[poky] gcc cross-compiler hangs with musl libc
Khem Raj
raj.khem at gmail.com
Sat May 7 08:41:23 PDT 2016
On Sat, May 7, 2016 at 1:40 AM, Richard Purdie
<richard.purdie at linuxfoundation.org> wrote:
> On Fri, 2016-05-06 at 15:19 -0700, Ruslan Babayev wrote:
>> Hi Richard,
>>
>> I recently noticed GCC in meta-toolchain misteriously hangs when
>> trying to build
>> anything. This is my config (with meta-intel layers added):
>>
>> MACHINE = "crystalforest"
>> TCLIBC = "musl"
>>
>> I narrowed it down to gcc not liking '-m64' flag followed by '
>> -mmusl'.
>>
>> $ x86_64-poky-linux-musl-gcc --sysroot=/opt/poky/2.1/sysroots/corei7
>> -64-poky-linux-musl hello.c -o hello -m64 #works
>> $ x86_64-poky-linux-musl-gcc --sysroot=/opt/poky/2.1/sysroots/corei7
>> -64-poky-linux-musl hello.c -o hello -mmusl #works
>>
>> $ x86_64-poky-linux-musl-gcc --sysroot=/opt/poky/2.1/sysroots/corei7
>> -64-poky-linux-musl hello.c -o hello -mmusl -m64 #works
>> $ x86_64-poky-linux-musl-gcc --sysroot=/opt/poky/2.1/sysroots/corei7
>> -64-poky-linux-musl hello.c -o hello -m64 -mmusl #hangs
>> ^C
Can you pass -v option and see where it hangs ?, secondly whats your SDK_HOST
>>
>> So it seems passing -mmusl is not required. Just to try this out I
>> commented out TARGET_CC_ARCH_append_libc-musl line in
>> meta/classes/toolchain-scripts.bbclass and rebuilt my meta-toolchain
>> to
>> make GCC happy.
OK thats a good datapoint, I can try to reproduce it.
>>
>> I have seen this with musl and x86_64 with -m64 but I am guessing the
>> issue might also affect other architechtures and tunes as well x86(
>> -m64,
>> -m32, -mx32), powerpc (-m64, -m32) etc.
>>
>> While this looks like a bug in GCC, is there a reason we need to pass
>> -mmusl flag?
>
> I'd imagine its telling gcc to link against the musl libc rather than
> the glibc one. Certainly, the order of the options shouldn't hang gcc,
> in fact gcc shouldn't ever hang due to the options passed so this
> sounds like a gcc bug.
>
> I've cc'd Khem who knows more about the musl patches.
>
> Cheers,
>
> Richard
>
>
More information about the poky
mailing list