mailing list of musl libc
 help / color / mirror / code / Atom feed
* Compile error with --target=i386
@ 2016-02-16  9:18 Petr Petrov
  2016-02-16 10:10 ` Alexander Monakov
  0 siblings, 1 reply; 7+ messages in thread
From: Petr Petrov @ 2016-02-16  9:18 UTC (permalink / raw)
  To: musl

Hello!

I'm trying to build the latest musl-libc 1.1.13 on i386 architecture.
I'm using the following line:

./configure --target=i386
make

and I got:
gcc -std=c99 -nostdinc -ffreestanding -ffloat-store -frounding-math 
-Wa,--noexecstack -D_XOPEN_SOURCE=700 -I./arch/i386 -I./arch/generic 
-Iobj/src/internal -I./src/internal -Iobj/include -I./include  -Os -pipe 
-fomit-frame-pointer -fno-unwind-tables -fno-asynchronous-unwind-tables 
-ffunction-sections -fdata-sections -mtune=generic 
-Werror=implicit-function-declaration -Werror=implicit-int 
-Werror=pointer-sign -Werror=pointer-arith -include vis.h  -c -o 
obj/src/fenv/i386/fenv.o src/fenv/i386/fenv.s
src/fenv/i386/fenv.s: Assembler messages:
src/fenv/i386/fenv.s:12: Error: suffix or operands invalid for `pop'
src/fenv/i386/fenv.s:19: Error: suffix or operands invalid for `push'
src/fenv/i386/fenv.s:21: Error: suffix or operands invalid for `pop'
src/fenv/i386/fenv.s:28: Error: suffix or operands invalid for `push'
src/fenv/i386/fenv.s:30: Error: suffix or operands invalid for `pop'
src/fenv/i386/fenv.s:67: Error: suffix or operands invalid for `push'
src/fenv/i386/fenv.s:76: Error: suffix or operands invalid for `pop'
src/fenv/i386/fenv.s:84: Error: suffix or operands invalid for `pop'
src/fenv/i386/fenv.s:90: Error: suffix or operands invalid for `push'
src/fenv/i386/fenv.s:92: Error: suffix or operands invalid for `pop'
src/fenv/i386/fenv.s:105: Error: suffix or operands invalid for `pop'
src/fenv/i386/fenv.s:108: Error: suffix or operands invalid for `push'
src/fenv/i386/fenv.s:110: Error: suffix or operands invalid for `pop'
src/fenv/i386/fenv.s:125: Error: suffix or operands invalid for `push'
src/fenv/i386/fenv.s:126: Error: suffix or operands invalid for `push'
src/fenv/i386/fenv.s:127: Error: suffix or operands invalid for `push'
src/fenv/i386/fenv.s:128: Error: suffix or operands invalid for `push'
src/fenv/i386/fenv.s:129: Error: suffix or operands invalid for `push'
src/fenv/i386/fenv.s:130: Error: suffix or operands invalid for `push'
src/fenv/i386/fenv.s:131: Error: suffix or operands invalid for `push'
src/fenv/i386/fenv.s:137: Error: suffix or operands invalid for `pop'
src/fenv/i386/fenv.s:157: Error: suffix or operands invalid for `pop'


Any ideas how to fix this or advises?

Thank you very much!

-- 
Cheers,
Petr Petrov,
GkmSoft software development company,
plug-ins development company for various CAD softwares,
http://gkmsoft.ru



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

* Re: Compile error with --target=i386
  2016-02-16  9:18 Compile error with --target=i386 Petr Petrov
@ 2016-02-16 10:10 ` Alexander Monakov
  2016-02-16 10:31   ` Petr Petrov
  0 siblings, 1 reply; 7+ messages in thread
From: Alexander Monakov @ 2016-02-16 10:10 UTC (permalink / raw)
  To: musl

On Tue, 16 Feb 2016, Petr Petrov wrote:
> I'm trying to build the latest musl-libc 1.1.13 on i386 architecture.
> I'm using the following line:
> 
> ./configure --target=i386
> make
> 
> and I got:
> gcc -std=c99 -nostdinc -ffreestanding -ffloat-store -frounding-math
> -Wa,--noexecstack -D_XOPEN_SOURCE=700 -I./arch/i386 -I./arch/generic
> -Iobj/src/internal -I./src/internal -Iobj/include -I./include  -Os -pipe
> -fomit-frame-pointer -fno-unwind-tables -fno-asynchronous-unwind-tables
> -ffunction-sections -fdata-sections -mtune=generic
> -Werror=implicit-function-declaration -Werror=implicit-int
> -Werror=pointer-sign -Werror=pointer-arith -include vis.h  -c -o
> obj/src/fenv/i386/fenv.o src/fenv/i386/fenv.s
> src/fenv/i386/fenv.s: Assembler messages:
> src/fenv/i386/fenv.s:12: Error: suffix or operands invalid for `pop'

It seems you'd like to compile a 32-bit musl on an x86-64 glibc-based system
using the dual-abi (x86-64 + i386) capability of the host GCC.

If so, you need to pass -m32 on the gcc command line to generate 32-bit code:

./configure --target=i386 CC=gcc\ -m32

Alexander


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

* Re: Compile error with --target=i386
  2016-02-16 10:10 ` Alexander Monakov
@ 2016-02-16 10:31   ` Petr Petrov
  2016-02-16 10:39     ` Alexander Monakov
  0 siblings, 1 reply; 7+ messages in thread
From: Petr Petrov @ 2016-02-16 10:31 UTC (permalink / raw)
  To: musl

On 16.02.2016 13:10, Alexander Monakov wrote:
> On Tue, 16 Feb 2016, Petr Petrov wrote:
>> I'm trying to build the latest musl-libc 1.1.13 on i386 architecture.
>> I'm using the following line:
>>
>> ./configure --target=i386
>> make
>>
>> and I got:
>> gcc -std=c99 -nostdinc -ffreestanding -ffloat-store -frounding-math
>> -Wa,--noexecstack -D_XOPEN_SOURCE=700 -I./arch/i386 -I./arch/generic
>> -Iobj/src/internal -I./src/internal -Iobj/include -I./include  -Os -pipe
>> -fomit-frame-pointer -fno-unwind-tables -fno-asynchronous-unwind-tables
>> -ffunction-sections -fdata-sections -mtune=generic
>> -Werror=implicit-function-declaration -Werror=implicit-int
>> -Werror=pointer-sign -Werror=pointer-arith -include vis.h  -c -o
>> obj/src/fenv/i386/fenv.o src/fenv/i386/fenv.s
>> src/fenv/i386/fenv.s: Assembler messages:
>> src/fenv/i386/fenv.s:12: Error: suffix or operands invalid for `pop'
> It seems you'd like to compile a 32-bit musl on an x86-64 glibc-based system
> using the dual-abi (x86-64 + i386) capability of the host GCC.
>
> If so, you need to pass -m32 on the gcc command line to generate 32-bit code:
>
> ./configure --target=i386 CC=gcc\ -m32
>
> Alexander
>
>
Bingo! It works! Thank you very much!

Never-mind, I tried to use CFLAGS:

CFLAGS=-m32
./confgiure --target=i386
make

but it didn't work.

-- 
Cheers,
Petr Petrov,
GkmSoft software development company,
plug-ins development company for various CAD softwares,
http://gkmsoft.ru



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

* Re: Compile error with --target=i386
  2016-02-16 10:31   ` Petr Petrov
@ 2016-02-16 10:39     ` Alexander Monakov
  2016-02-16 16:54       ` Rich Felker
  0 siblings, 1 reply; 7+ messages in thread
From: Alexander Monakov @ 2016-02-16 10:39 UTC (permalink / raw)
  To: musl

On Tue, 16 Feb 2016, Petr Petrov wrote:
> Bingo! It works! Thank you very much!
> 
> Never-mind, I tried to use CFLAGS:
> 
> CFLAGS=-m32
> ./confgiure --target=i386
> make
> 
> but it didn't work.

As a general rule, ABI-altering options should go to $CC/$CXX, not $CFLAGS,
because the latter need not be applied when assembling and linking (so if -m32
is not present on gcc command line when doing the link step, it won't pass
-m elf_i386 to ld, and library search paths will be wrong too).

Alexander


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

* Re: Compile error with --target=i386
  2016-02-16 10:39     ` Alexander Monakov
@ 2016-02-16 16:54       ` Rich Felker
  2016-02-16 19:12         ` Alexander Monakov
  0 siblings, 1 reply; 7+ messages in thread
From: Rich Felker @ 2016-02-16 16:54 UTC (permalink / raw)
  To: musl

On Tue, Feb 16, 2016 at 01:39:16PM +0300, Alexander Monakov wrote:
> On Tue, 16 Feb 2016, Petr Petrov wrote:
> > Bingo! It works! Thank you very much!
> > 
> > Never-mind, I tried to use CFLAGS:
> > 
> > CFLAGS=-m32
> > ./confgiure --target=i386
> > make
> > 
> > but it didn't work.
> 
> As a general rule, ABI-altering options should go to $CC/$CXX, not $CFLAGS,
> because the latter need not be applied when assembling and linking (so if -m32
> is not present on gcc command line when doing the link step, it won't pass
> -m elf_i386 to ld, and library search paths will be wrong too).

In the case of musl, CFLAGS is always passed even at the linking
stage; I think the problem is just at configure time, where the
user-provided CFLAGS are not used in all the configure-time tests.
Maybe this is contrary to the normal UI for configure scripts and
should be changed?

Rich


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

* Re: Compile error with --target=i386
  2016-02-16 16:54       ` Rich Felker
@ 2016-02-16 19:12         ` Alexander Monakov
  2016-02-16 19:49           ` Rich Felker
  0 siblings, 1 reply; 7+ messages in thread
From: Alexander Monakov @ 2016-02-16 19:12 UTC (permalink / raw)
  To: musl

On Tue, 16 Feb 2016, Rich Felker wrote:
> In the case of musl, CFLAGS is always passed even at the linking
> stage; I think the problem is just at configure time, where the
> user-provided CFLAGS are not used in all the configure-time tests.
> Maybe this is contrary to the normal UI for configure scripts and
> should be changed?

I don't have a strong opinion whether it's contrary or not; my weak opinion is
that it is contrary, indeed; but nevertheless I stand by my original point
that -m32 is better when specified in $CC, generally speaking.

If you look at the opening post, you'll see that -m32 does not appear on the
quoted command line.  If Petr did it as he has shown, he forgot to 'export'
the variable; this would explain the failure (otherwise as you say it should
have worked).

Also please note that $CC should have -m32 (and any other ABI tweaks) for
musl-gcc to work as intended.

Alexander


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

* Re: Compile error with --target=i386
  2016-02-16 19:12         ` Alexander Monakov
@ 2016-02-16 19:49           ` Rich Felker
  0 siblings, 0 replies; 7+ messages in thread
From: Rich Felker @ 2016-02-16 19:49 UTC (permalink / raw)
  To: musl

On Tue, Feb 16, 2016 at 10:12:39PM +0300, Alexander Monakov wrote:
> On Tue, 16 Feb 2016, Rich Felker wrote:
> > In the case of musl, CFLAGS is always passed even at the linking
> > stage; I think the problem is just at configure time, where the
> > user-provided CFLAGS are not used in all the configure-time tests.
> > Maybe this is contrary to the normal UI for configure scripts and
> > should be changed?
> 
> I don't have a strong opinion whether it's contrary or not; my weak opinion is
> that it is contrary, indeed; but nevertheless I stand by my original point
> that -m32 is better when specified in $CC, generally speaking.
> 
> If you look at the opening post, you'll see that -m32 does not appear on the
> quoted command line.  If Petr did it as he has shown, he forgot to 'export'
> the variable; this would explain the failure (otherwise as you say it should
> have worked).
> 
> Also please note that $CC should have -m32 (and any other ABI tweaks) for
> musl-gcc to work as intended.

Yes, I agree with all this. I was just wondering if we should be
including that invoking user's CFLAGS when running tests in configure.
Right now I think it's inconsistent whether we do or not.

Rich


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

end of thread, other threads:[~2016-02-16 19:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-16  9:18 Compile error with --target=i386 Petr Petrov
2016-02-16 10:10 ` Alexander Monakov
2016-02-16 10:31   ` Petr Petrov
2016-02-16 10:39     ` Alexander Monakov
2016-02-16 16:54       ` Rich Felker
2016-02-16 19:12         ` Alexander Monakov
2016-02-16 19:49           ` Rich Felker

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