* musl-gcc -m32 is broken
@ 2015-08-26 22:16 Andy Lutomirski
2015-08-27 1:44 ` Rich Felker
0 siblings, 1 reply; 5+ messages in thread
From: Andy Lutomirski @ 2015-08-26 22:16 UTC (permalink / raw)
To: musl
Adding %{m16|m32:-m elf_i386} to the *link spec in musl-gcc.specs
fixes at least the obvious failure for me.
--Andy
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: musl-gcc -m32 is broken
2015-08-26 22:16 musl-gcc -m32 is broken Andy Lutomirski
@ 2015-08-27 1:44 ` Rich Felker
2015-08-27 19:58 ` Andy Lutomirski
0 siblings, 1 reply; 5+ messages in thread
From: Rich Felker @ 2015-08-27 1:44 UTC (permalink / raw)
To: musl
On Wed, Aug 26, 2015 at 03:16:22PM -0700, Andy Lutomirski wrote:
> Adding %{m16|m32:-m elf_i386} to the *link spec in musl-gcc.specs
> fixes at least the obvious failure for me.
Can you clarify? musl-gcc's target is coupled to the target arch that
the corresponding musl libc was built for. Switching targets with -m32
and similar options is not going to get you correspondingly switched
libraries. Or am I misunderstanding what you're trying to do?
Rich
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: musl-gcc -m32 is broken
2015-08-27 1:44 ` Rich Felker
@ 2015-08-27 19:58 ` Andy Lutomirski
2015-08-27 20:09 ` Rich Felker
0 siblings, 1 reply; 5+ messages in thread
From: Andy Lutomirski @ 2015-08-27 19:58 UTC (permalink / raw)
To: musl
On 08/26/2015 06:44 PM, Rich Felker wrote:
> On Wed, Aug 26, 2015 at 03:16:22PM -0700, Andy Lutomirski wrote:
>> Adding %{m16|m32:-m elf_i386} to the *link spec in musl-gcc.specs
>> fixes at least the obvious failure for me.
>
> Can you clarify? musl-gcc's target is coupled to the target arch that
> the corresponding musl libc was built for. Switching targets with -m32
> and similar options is not going to get you correspondingly switched
> libraries. Or am I misunderstanding what you're trying to do?
I build for an i386 target on an x86_64 Fedora system using CFLAGS=-m32.
It built successfully and even seems to work, but musl-gcc ends up
omitting -m32 in the link stage, so it tries to pick up the wrong
libraries and fails to link.
ISTM either musl-gcc should accept and honor -m32 (and work!) or
musl-gcc should hardcode the target architecture (i.e. musl-gcc should
target i386 even without -m32).
--Andy
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Re: musl-gcc -m32 is broken
2015-08-27 19:58 ` Andy Lutomirski
@ 2015-08-27 20:09 ` Rich Felker
2015-08-28 0:49 ` Andy Lutomirski
0 siblings, 1 reply; 5+ messages in thread
From: Rich Felker @ 2015-08-27 20:09 UTC (permalink / raw)
To: musl
On Thu, Aug 27, 2015 at 12:58:21PM -0700, Andy Lutomirski wrote:
> On 08/26/2015 06:44 PM, Rich Felker wrote:
> >On Wed, Aug 26, 2015 at 03:16:22PM -0700, Andy Lutomirski wrote:
> >>Adding %{m16|m32:-m elf_i386} to the *link spec in musl-gcc.specs
> >>fixes at least the obvious failure for me.
> >
> >Can you clarify? musl-gcc's target is coupled to the target arch that
> >the corresponding musl libc was built for. Switching targets with -m32
> >and similar options is not going to get you correspondingly switched
> >libraries. Or am I misunderstanding what you're trying to do?
>
> I build for an i386 target on an x86_64 Fedora system using
> CFLAGS=-m32. It built successfully and even seems to work, but
> musl-gcc ends up omitting -m32 in the link stage, so it tries to
> pick up the wrong libraries and fails to link.
I think -m32 should be part of $CC, not $CFLAGS. Then it should get
incorporated into the musl-gcc script.
Rich
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: musl-gcc -m32 is broken
2015-08-27 20:09 ` Rich Felker
@ 2015-08-28 0:49 ` Andy Lutomirski
0 siblings, 0 replies; 5+ messages in thread
From: Andy Lutomirski @ 2015-08-28 0:49 UTC (permalink / raw)
To: musl
On 08/27/2015 01:09 PM, Rich Felker wrote:
> On Thu, Aug 27, 2015 at 12:58:21PM -0700, Andy Lutomirski wrote:
>> On 08/26/2015 06:44 PM, Rich Felker wrote:
>>> On Wed, Aug 26, 2015 at 03:16:22PM -0700, Andy Lutomirski wrote:
>>>> Adding %{m16|m32:-m elf_i386} to the *link spec in musl-gcc.specs
>>>> fixes at least the obvious failure for me.
>>>
>>> Can you clarify? musl-gcc's target is coupled to the target arch that
>>> the corresponding musl libc was built for. Switching targets with -m32
>>> and similar options is not going to get you correspondingly switched
>>> libraries. Or am I misunderstanding what you're trying to do?
>>
>> I build for an i386 target on an x86_64 Fedora system using
>> CFLAGS=-m32. It built successfully and even seems to work, but
>> musl-gcc ends up omitting -m32 in the link stage, so it tries to
>> pick up the wrong libraries and fails to link.
>
> I think -m32 should be part of $CC, not $CFLAGS. Then it should get
> incorporated into the musl-gcc script.
>
I don't suppose the configure script could be taught to do this
automatically if I type --target=i386? (Or at least to document this
somehow.)
I searched for how to handle -m32 musl builds, and I got very
conflicting advice.
--Andy
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-08-28 0:49 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-26 22:16 musl-gcc -m32 is broken Andy Lutomirski
2015-08-27 1:44 ` Rich Felker
2015-08-27 19:58 ` Andy Lutomirski
2015-08-27 20:09 ` Rich Felker
2015-08-28 0:49 ` Andy Lutomirski
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).