Building 64 bit compiler on Solaris AMD64

Kai Ruottu kai.ruottu@wippies.com
Thu Dec 18 17:18:00 GMT 2008


Scott L. Burson wrote:
> On Wed, Dec 17, 2008 at 3:15 PM, Andrew Haley <aph@redhat.com> wrote:
>> Scott L. Burson wrote:
>>> On Wed, Dec 17, 2008 at 2:30 PM, Andrew Haley <aph@redhat.com> wrote:
>>>> Scott L. Burson wrote:
>>>>> No, I'll only get a 64-bit stage 1.
>>>> Which is all you need.
>>>>
>>>> --disable-bootstrap and there is no stage 2.
>>> Oh!  Didn't know about that.
>>>
>>> But what about the next problem I ran into -- that the compiler built
>>> in this way works only when -m64 is specified, because the libraries
>>> are all 64-bit?
>> It all depends on how the multilibs are configured.
> 
> No, I don't mean that the build process only attempts to build 64-bit
> libraries; I mean that even the libraries that the build process
> intends to build as 32-bit get built as 64-bit also.  So e.g.
> ${prefix}/lib/gcc/i386-pc-solaris2.11/4.3.2/crtbegin.o is a 64-bit
> object, but it's supposed to be 32-bit.

Please divide your "combined problem" into smaller "easy to handle"
problems via thinking :

- what is your $build system (should it be 32-bit or 64-bit?)
- what would be the $host system (should it be 64-bit?)
- what would be the default $target system (should it be 64-bit?)

and then use the suitable flags and system names in your configure.
Basically telling simple things like :

CC="gcc -m64" GCC_FOR_BUILD="gcc -m64"

would use a 64-bit target GCC for the binaries aimed for the $build
system and for the $host system. But at least in gcc-4.3.2 configuring
GCC for 'x86_64-solaris2.11' (64-bit as default) instead of 
'i686-solaris2.11' or something 32-bit, isn't supported :(  So one can
get only a 32-bit default GCC whose binaries were produced via 64-bit
'gen*' programs and are 64-bit binaries. Something like a crosscompiler
working on a 64-bit system and producing 32-bit (default) and 64-bit
(with '-m64') binaries there...

So your 'i386-pc-solaris2.11' (why the 'i386' ?) could be the only
possibility for $build', $host and '$target' when configuring like :

--build=$build --host=$host --target=$target

But for the tools used for these 3 target systems you can use all kind
of 'TOOL=', 'TOOL_FOR_BUILD=', 'TOOL_FOR_TARGET=' settings, where 'TOOL'
is 'AR', 'AS', 'CC', 'GCC', 'LD', 'NM', 'RANLIB' etc. These should be
passed to the Makefiles...

The base idea is "imagination"... "If a 'x86_64-linux' system runs 32-
bit binaries, it can imagine being a 32-bit system", and "if a 
'i686-solaris2.11' system can run 64-bit binaries, it can imagine being
a 64-bit system".  If dummy computers can have that much imagination,
why not the humans? :)

Aren't there any "Solaris 11/x86_64" alternatives like there are
separate Linuces for both 'x86' and 'x86_64' ?  Or why there isn't
any "64-bit default" GCC target for Solaris 11 ?

> 
> -- Scott
> 



More information about the Gcc-help mailing list