> Hi, > > (This message started out as a question, but I managed to figure it > out. Still, I think people might want to know.) > > I have figured out how to build a 64-bit GCC 4.3.2 on Solaris AMD64. > I wanted to build a 64 bit compiler (I mean, one where the compiler > executables are 64 bit) for performance. I went so far as to build every part of the tool chain that way also : $ /opt/build/dclarke/local/bin/m4 --version m4 (GNU M4) 1.4.12 Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by Rene' Seindal. $ /opt/build/dclarke/local/bin/make --version GNU Make 3.81 Copyright (C) 2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This program built for i386-pc-solaris2.10 $ /opt/build/dclarke/local/bin/indent --version GNU indent 2.2.9 $ file /opt/build/dclarke/local/bin/indent /opt/build/dclarke/local/bin/make /opt/build/dclarke/local/bin/m4 /opt/build/dclarke/local/bin/indent: ELF 64-bit LSB executable AMD64 Version 1 [SSE2 SSE FXSR CMOV FPU], dynamically linked, not stripped /opt/build/dclarke/local/bin/make: ELF 64-bit LSB executable AMD64 Version 1 [SSE2 SSE FXSR CMOV FPU], dynamically linked, not stripped /opt/build/dclarke/local/bin/m4: ELF 64-bit LSB executable AMD64 Version 1 [SSE2 SSE FXSR CMOV FPU], dynamically linked, not stripped etc > > I found this: > > http://gcc.gnu.org/ml/gcc-help/2008-12/msg00103.html > > which explained why supplying CC='gcc -m64' to configure didn't work. > So then I tried this: > > ../gcc-4.3.2/configure --prefix=/usr/local/gcc-4.3.2 --with-gnu-as > --with-as=/usr/local/gnu/bin/as --without-gnu-ld > --with-ld=/usr/ccs/bin/ld --enable-languages=c,c++ CFLAGS='-m64 -g > -O2' BOOT_CFLAGS='-m64 -g -O2' LDFLAGS='-L/usr/local/lib/64' > BOOT_LDFLAGS='-L/usr/local/lib/64' > > only to find that the BOOT_CFLAGS and BOOT_LDFLAGS don't actually get > edited into the top-level Makefile. Okay fine, I edited the Makefile > by hand and kicked off the build. But the '-m64' still doesn't > propagate to all the right places; gcc/build/genmodes.o comes out as > 32 bit, and the build dies because it can't link with the built > libiberty. > > Supplying CC='gcc -m64' in addition to CFLAGS fixed that problem, but > I found out I also needed to set CXXFLAGS. > > So here's the configure line that worked: > > ../gcc-4.3.2/configure --prefix=/usr/local/gcc-4.3.2 --with-gnu-as > --with-as=/usr/local/gnu/bin/as --without-gnu-ld > --with-ld=/usr/ccs/bin/ld --enable-languages=c,c++ CC='gcc -m64' > CFLAGS='-m64 -g -O2' CXXFLAGS='-m64 -g -O2' > LDFLAGS='-L/usr/local/lib/64' nice one ! I am using Sun Studio 12 here and I have a boatload of CFLAGS to start with : $ echo $CFLAGS -erroff=%all -fsimple=0 -g -m64 -xO1 -Qy -Xa -xbuiltin=%none -xdebugformat=dwarf -xmodel=medium -xnolibmil -xnolibmopt -xregs=no%frameptr -xs -xstrconst -xtarget=opteron -xtemp=/tmp/dclarke > > The steps are: > > () Run configure as above yep > () Hand-edit the top-level Makefile, setting BOOT_CFLAGS and > BOOT_LDFLAGS like CFLAGS and LDFLAGS yep > () Start the make in my case ... 64-bit make :-) > Seems like there's a general problem here of building a 64-bit > compiler in an environment where the default is 32 bits. I think it > should be easier. Maybe it deserves a specific configure option? I would love to see such a thing also . Dennis Clarke http://www.blastwave.org/ ps: if you want GCC 4.3.2 for Solaris 8 lowest level config ( i386 and sun4m sparc ) then you can find those at http://www.blastwave.org/testing/