Can gcc always build 64-bit on Solaris?

Dennis Clarke
Wed Jun 16 09:24:00 GMT 2010

> On Solaris and OpenSolaris, the default is to build 32-bit
> executables, despite the fact that the operating system is 64-bit.
> I'm trying to build some code, which I did not write, but which gets
> confused what library it needs to link. The code is 64-bit, but it
> tries to link to a 32-bit GCC library, with the obvious failure.
> It fails as it tries to link /usr/local/gcc-4.4.4/lib/
> which is a 32-bit library - the 64-bit version would be in
> /usr/local/gcc-4.4.4/lib/amd64/ (x84 processor) of
> /usr/local/gcc-4.4.4/lib/sparcv9/ (SPARC processor)
> Would it be possible to create a version of gcc, which defaults to
> 64-bit code and is incapable of producing 32-bit code?
> If I overwrote all the libraries in $PREFIX/lib with 64-bit versions i.e.
> $ cp $PREFIX/lib/amd64 $PREFIX/lib
> would that mess up gcc?
> I'm trying to build Sage,
> which consists of 300 MB of compressed source code. Sorting out all
> the 32-bit/64-bit issues is proving difficult, so I'm wondering if I
> can force the compiler to just build 64-bit.
> Dave

I seem to recall that we were going to try to work on this together. At
the very least get some help from those of us that do porting to Solaris
night and day. To answer your first question, I hate to say this, if GCC
is built correctly on Solaris then it will neatly do both 32-bit and
64-bit compiles perfetly and never with a library mismatch. I do this
*all* the time.

Perhaps we need to sync some efforts here.

Dennis Clarke  <- Email related to the open source Solaris   <- Email related to open source for Solaris

More information about the Gcc-help mailing list