config-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PATCH: Add x32 support to config.guess


From: Jan Engelhardt
Subject: Re: PATCH: Add x32 support to config.guess
Date: Wed, 31 Oct 2012 04:55:01 +0100 (CET)
User-agent: Alpine 2.01 (LNX 1266 2009-07-14)

On Sunday 2012-08-19 19:56, H.J. Lu wrote:
>>
>>I don't think it's reasonable for config.guess to depend on a C
>>compiler.  You would not believe how many problem reports I get due to
>>this.
>
>For x32, there is no x32 kernel.  We have an x86-64 kernel which
>supports x32.  You can run both x86-64 and x32 binaries under the
>same x86-64 kernel.  The same x86-64 compiler can generate either
>x86-64 or x32 binary.  The only way for config.guess to tell which
>target one is building for is to run the C compiler to check the target
>format.  What do you recommend to detect x32 vs x86-64 in
>config.guess?

I would say that you cannot detect this, since the output format is
ultimately a _user_ choice. SPARC environments are basically in the
same boat - and there seems to be no problem for them. In case you do
not already know, I will elaborate.



config.guess defaults to sparc64-linux-gnu because that is all it can
get (`uname -m` yields sparc64). If you now want to produce ELF32
binaries for a particular program, you would use

        ./configure CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32

and similarly with -m64 for ELF64. Explicit specification of desired
output type is exactly what automated distro build processes do.

AFAICS, autotools itself does not do anything with (implicitly or
explicitly specified) canonical host/build/target triplets; instead,
it is only your very own code in configure.ac. So, in packages that
_do_ interpret the canonical triples in some way
(perl for example creates a directory by the triplet's name -
/usr/lib/perl5/5.12.1/sparcv9-linux-thread-multi), you want to use

        ./configure --host=sparcv9-linux-gnu CFLAGS=-m32...
and     ./configure --host=sparc64-linux-gnu CFLAGS=-m64...

to avoid file clashes when having both a sparcv9ish perl and a
sparc64ish perl library in your system.



And so, this comes back to x86 with three recipes:

Build e_ident[5]=0x02(64-bit), e_machine=x86_64:
        ./configure --host=x86_64-linux-gnu CFLAGS=-m64...

Build e_ident[5]=0x01(32-bit), e_machine=x86_64:
        ./configure --host=x32-linux-gnu CFLAGS=-mx32...

Build e_ident[5]=0x01(32-bit), e_machine=i386:
        ./configure --host=i386-linux-gnu CFLAGS=-m32...

And "x32" (x32-linux-gnu, x32-unknown-linux-gnu, x32-suse-linux-gnu,
whichever detail level you like) is thus also my current
recommendation for a triplet for use with --host=/--build=/--target=.
This does not require any changes to config.guess -- just start using
it, it will work out. config.guess has no "sparcv9" magic either.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]