All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: gcc cross-compiler hangs with musl libc
       [not found] <8760uq4yok.fsf@babayev.com>
@ 2016-05-07  8:40 ` Richard Purdie
  2016-05-07 15:41   ` Khem Raj
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Purdie @ 2016-05-07  8:40 UTC (permalink / raw)
  To: Ruslan Babayev; +Cc: poky

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
> 
> 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.
> 
> 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




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: gcc cross-compiler hangs with musl libc
  2016-05-07  8:40 ` gcc cross-compiler hangs with musl libc Richard Purdie
@ 2016-05-07 15:41   ` Khem Raj
  0 siblings, 0 replies; 2+ messages in thread
From: Khem Raj @ 2016-05-07 15:41 UTC (permalink / raw)
  To: Richard Purdie; +Cc: Ruslan Babayev, poky

On Sat, May 7, 2016 at 1:40 AM, Richard Purdie
<richard.purdie@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
>
>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-05-07 15:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <8760uq4yok.fsf@babayev.com>
2016-05-07  8:40 ` gcc cross-compiler hangs with musl libc Richard Purdie
2016-05-07 15:41   ` Khem Raj

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.