Can gcc always build 64-bit on Solaris?

David Kirkby
Wed Jun 16 02:04: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.



More information about the Gcc-help mailing list