diff mbox

[LEDE-DEV] toolchain: add musl libc.so to external toolchain

Message ID 20170314122809.8668-1-hauke.mehrtens@intel.com
State Superseded
Headers show

Commit Message

Hauke Mehrtens March 14, 2017, 12:28 p.m. UTC
From: Hauke Mehrtens <hauke.mehrtens@intel.com>

musl provides a /lib/libc.so file which should be integrated into the libc
package when the external toolchain with musl is used.

Signed-off-by: Hauke Mehrtens <hauke.mehrtens@intel.com>
---
 package/libs/toolchain/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Florian Fainelli March 14, 2017, 5:20 p.m. UTC | #1
On 03/14/2017 05:28 AM, hauke.mehrtens@intel.com wrote:
> From: Hauke Mehrtens <hauke.mehrtens@intel.com>
> 
> musl provides a /lib/libc.so file which should be integrated into the libc
> package when the external toolchain with musl is used.
> 
> Signed-off-by: Hauke Mehrtens <hauke.mehrtens@intel.com>
> ---
>  package/libs/toolchain/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/package/libs/toolchain/Makefile b/package/libs/toolchain/Makefile
> index 8a90b5e..09c576d 100644
> --- a/package/libs/toolchain/Makefile
> +++ b/package/libs/toolchain/Makefile
> @@ -164,7 +164,7 @@ define Package/libc/config
>  		string
>  		prompt "libc shared library files (use wildcards)"
>  		depends on EXTERNAL_TOOLCHAIN && PACKAGE_libc
> -		default "./lib/ld{*.so*,-linux*.so.*} ./lib/lib{anl,c,cidn,crypt,dl,m,nsl,nss_dns,nss_files,resolv,util}{-*.so,.so.*}"
> +		default "./lib/ld{*.so*,-linux*.so.*} ./lib/lib{anl,c,cidn,crypt,dl,m,nsl,nss_dns,nss_files,resolv,util}{-*.so,.so.*} ./lib/libc.so"

Why not change just the last part of the wildcard from: {-*.so,.so.*}
into {-*.so,.so.*,.so*} or even {*.so,.so.*}?
Hauke Mehrtens March 14, 2017, 5:28 p.m. UTC | #2
On 2017-03-14 18:20, Florian Fainelli wrote:
> On 03/14/2017 05:28 AM, hauke.mehrtens@intel.com wrote:
>> From: Hauke Mehrtens <hauke.mehrtens@intel.com>
>> 
>> musl provides a /lib/libc.so file which should be integrated into the 
>> libc
>> package when the external toolchain with musl is used.
>> 
>> Signed-off-by: Hauke Mehrtens <hauke.mehrtens@intel.com>
>> ---
>>  package/libs/toolchain/Makefile | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/package/libs/toolchain/Makefile 
>> b/package/libs/toolchain/Makefile
>> index 8a90b5e..09c576d 100644
>> --- a/package/libs/toolchain/Makefile
>> +++ b/package/libs/toolchain/Makefile
>> @@ -164,7 +164,7 @@ define Package/libc/config
>>  		string
>>  		prompt "libc shared library files (use wildcards)"
>>  		depends on EXTERNAL_TOOLCHAIN && PACKAGE_libc
>> -		default "./lib/ld{*.so*,-linux*.so.*} 
>> ./lib/lib{anl,c,cidn,crypt,dl,m,nsl,nss_dns,nss_files,resolv,util}{-*.so,.so.*}"
>> +		default "./lib/ld{*.so*,-linux*.so.*} 
>> ./lib/lib{anl,c,cidn,crypt,dl,m,nsl,nss_dns,nss_files,resolv,util}{-*.so,.so.*} 
>> ./lib/libc.so"
> 
> Why not change just the last part of the wildcard from: {-*.so,.so.*}
> into {-*.so,.so.*,.so*} or even {*.so,.so.*}?

{-*.so,.so.*,.so*} should also work, I will change to that.

{*.so,.so.*} will add more files:
$ ls -al lib/libc{*.so,.so.*}
lib/libc.so
lib/libcc1.so -> libcc1.so.0.0.0

A little bit offtopic.
With LEDE 17.01 branch this is sufficient to use a external musl 
toolchain, on the master branch the Linux kernel will not build because 
it has some problems with the includes, it looks like it gets more 
includes than the kernel wants. When I modify the wrapper file manually 
and remove all the extra gcc options the kernel and all the other stuff 
compiles fine.

Hauke
Florian Fainelli March 14, 2017, 5:34 p.m. UTC | #3
On 03/14/2017 10:28 AM, Hauke Mehrtens wrote:
> On 2017-03-14 18:20, Florian Fainelli wrote:
>> On 03/14/2017 05:28 AM, hauke.mehrtens@intel.com wrote:
>>> From: Hauke Mehrtens <hauke.mehrtens@intel.com>
>>>
>>> musl provides a /lib/libc.so file which should be integrated into the
>>> libc
>>> package when the external toolchain with musl is used.
>>>
>>> Signed-off-by: Hauke Mehrtens <hauke.mehrtens@intel.com>
>>> ---
>>>  package/libs/toolchain/Makefile | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/package/libs/toolchain/Makefile
>>> b/package/libs/toolchain/Makefile
>>> index 8a90b5e..09c576d 100644
>>> --- a/package/libs/toolchain/Makefile
>>> +++ b/package/libs/toolchain/Makefile
>>> @@ -164,7 +164,7 @@ define Package/libc/config
>>>          string
>>>          prompt "libc shared library files (use wildcards)"
>>>          depends on EXTERNAL_TOOLCHAIN && PACKAGE_libc
>>> -        default "./lib/ld{*.so*,-linux*.so.*}
>>> ./lib/lib{anl,c,cidn,crypt,dl,m,nsl,nss_dns,nss_files,resolv,util}{-*.so,.so.*}"
>>>
>>> +        default "./lib/ld{*.so*,-linux*.so.*}
>>> ./lib/lib{anl,c,cidn,crypt,dl,m,nsl,nss_dns,nss_files,resolv,util}{-*.so,.so.*}
>>> ./lib/libc.so"
>>
>> Why not change just the last part of the wildcard from: {-*.so,.so.*}
>> into {-*.so,.so.*,.so*} or even {*.so,.so.*}?
> 
> {-*.so,.so.*,.so*} should also work, I will change to that.
> 
> {*.so,.so.*} will add more files:
> $ ls -al lib/libc{*.so,.so.*}
> lib/libc.so
> lib/libcc1.so -> libcc1.so.0.0.0
> 
> A little bit offtopic.
> With LEDE 17.01 branch this is sufficient to use a external musl
> toolchain, on the master branch the Linux kernel will not build because
> it has some problems with the includes, it looks like it gets more
> includes than the kernel wants. When I modify the wrapper file manually
> and remove all the extra gcc options the kernel and all the other stuff
> compiles fine.

Well, there are a ton of issues with upstream kernels that do not have
patched kernel headers, especially in the area of networking
definitions, I saw you submitted fixes for that a short while ago, but I
also met some issues with building netifd's system-linux.c (related).

What extra GCC option is causing problems for you here? Is your
precompiled musl library available somewhere? The one I use is
stbgcc-4.8 (old) which can be found here:

https://github.com/Broadcom/stbgcc-4.8/releases/download/stbgcc-4.8-1.6/stbgcc-4.8-1.6.tar.bz2
Hauke Mehrtens March 14, 2017, 6:17 p.m. UTC | #4
On 2017-03-14 18:34, Florian Fainelli wrote:
> On 03/14/2017 10:28 AM, Hauke Mehrtens wrote:
>> On 2017-03-14 18:20, Florian Fainelli wrote:
>>> On 03/14/2017 05:28 AM, hauke.mehrtens@intel.com wrote:
>>>> From: Hauke Mehrtens <hauke.mehrtens@intel.com>
>>>> 
>>>> musl provides a /lib/libc.so file which should be integrated into 
>>>> the
>>>> libc
>>>> package when the external toolchain with musl is used.
>>>> 
>>>> Signed-off-by: Hauke Mehrtens <hauke.mehrtens@intel.com>
>>>> ---
>>>>  package/libs/toolchain/Makefile | 2 +-
>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>> 
>>>> diff --git a/package/libs/toolchain/Makefile
>>>> b/package/libs/toolchain/Makefile
>>>> index 8a90b5e..09c576d 100644
>>>> --- a/package/libs/toolchain/Makefile
>>>> +++ b/package/libs/toolchain/Makefile
>>>> @@ -164,7 +164,7 @@ define Package/libc/config
>>>>          string
>>>>          prompt "libc shared library files (use wildcards)"
>>>>          depends on EXTERNAL_TOOLCHAIN && PACKAGE_libc
>>>> -        default "./lib/ld{*.so*,-linux*.so.*}
>>>> ./lib/lib{anl,c,cidn,crypt,dl,m,nsl,nss_dns,nss_files,resolv,util}{-*.so,.so.*}"
>>>> 
>>>> +        default "./lib/ld{*.so*,-linux*.so.*}
>>>> ./lib/lib{anl,c,cidn,crypt,dl,m,nsl,nss_dns,nss_files,resolv,util}{-*.so,.so.*}
>>>> ./lib/libc.so"
>>> 
>>> Why not change just the last part of the wildcard from: {-*.so,.so.*}
>>> into {-*.so,.so.*,.so*} or even {*.so,.so.*}?
>> 
>> {-*.so,.so.*,.so*} should also work, I will change to that.
>> 
>> {*.so,.so.*} will add more files:
>> $ ls -al lib/libc{*.so,.so.*}
>> lib/libc.so
>> lib/libcc1.so -> libcc1.so.0.0.0
>> 
>> A little bit offtopic.
>> With LEDE 17.01 branch this is sufficient to use a external musl
>> toolchain, on the master branch the Linux kernel will not build 
>> because
>> it has some problems with the includes, it looks like it gets more
>> includes than the kernel wants. When I modify the wrapper file 
>> manually
>> and remove all the extra gcc options the kernel and all the other 
>> stuff
>> compiles fine.
> 
> Well, there are a ton of issues with upstream kernels that do not have
> patched kernel headers, especially in the area of networking
> definitions, I saw you submitted fixes for that a short while ago, but 
> I
> also met some issues with building netifd's system-linux.c (related).
The problems related to netifd should get fixed upstream with these 
patches:
https://lkml.org/lkml/2017/3/12/235 (I hope I sent it to the right 
people)
In LEDE these are the patches 27{1,2,3}

> What extra GCC option is causing problems for you here? Is your
> precompiled musl library available somewhere? The one I use is
> stbgcc-4.8 (old) which can be found here:
> 
> https://github.com/Broadcom/stbgcc-4.8/releases/download/stbgcc-4.8-1.6/stbgcc-4.8-1.6.tar.bz2

I used a toolchain generated with LEDE 17.1 in LEDE master. Now I tried 
it again and can not reproduce the problem again.
The changes in this patch are needed anyway, but I will send a v2.

Hauke
diff mbox

Patch

diff --git a/package/libs/toolchain/Makefile b/package/libs/toolchain/Makefile
index 8a90b5e..09c576d 100644
--- a/package/libs/toolchain/Makefile
+++ b/package/libs/toolchain/Makefile
@@ -164,7 +164,7 @@  define Package/libc/config
 		string
 		prompt "libc shared library files (use wildcards)"
 		depends on EXTERNAL_TOOLCHAIN && PACKAGE_libc
-		default "./lib/ld{*.so*,-linux*.so.*} ./lib/lib{anl,c,cidn,crypt,dl,m,nsl,nss_dns,nss_files,resolv,util}{-*.so,.so.*}"
+		default "./lib/ld{*.so*,-linux*.so.*} ./lib/lib{anl,c,cidn,crypt,dl,m,nsl,nss_dns,nss_files,resolv,util}{-*.so,.so.*} ./lib/libc.so"
 
 	endmenu
 endef