I decided to re-build binutils and try the Target "x86_64-pc-solaris2.11" that is suggested to be available to us in this post: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39150#c1
The attempt with Sun's Linker did not work so I tried with Binutils. # isainfo -k amd64 # uname -a SunOS opensolaris 5.11 snv_106 i86pc i386 i86pc # gcc/xgcc -v Using built-in specs. Target: x86_64-pc-solaris2.11 Configured with: ../gcc_trunk/configure --build=i386-pc-solaris2.11 --target=x86_64-pc-solaris2.11 --enable-languages=ada,c,c++,fortran,java,objc,obj-c++ --enable-shared --disable-static --enable-multilib --enable-decimal-float --with-long-double-128 --with-included-gettext --enable-stage1-checking --enable-checking=release --with-tune=k8 --with-cpu=k8 --with-arch=k8 --with-gnu-as --with-as=/usr/local/bin/as --with-gnu-ld --with-ld=/usr/local/bin/ld --with-gmp=/usr/local --with-mpfr=/usr/local --without-ppl Thread model: posix gcc version 4.4.0 20090213 (experimental) [trunk revision 144162] (GCC) # as --version GNU assembler (GNU Binutils) 2.19.1 # ld --version GNU ld (GNU Binutils) 2.19.1 The Build breaks here: # gmake ... cp gcj gcj-cross gmake[2]: Leaving directory `/usr/share/src/gcc_build/gcc' Configuring in ./gnattools configure: creating cache ./config.cache checking for a BSD-compatible install... /usr/bin/ginstall -c checking build system type... i386-pc-solaris2.11 checking host system type... i386-pc-solaris2.11 checking target system type... x86_64-pc-solaris2.11 checking whether ln -s works... yes checking for i386-pc-solaris2.11-gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed updating cache ./config.cache configure: creating ./config.status config.status: creating Makefile Checking multilib configuration for libgcc... Configuring in x86_64-pc-solaris2.11/libgcc configure: creating cache ./config.cache checking for --enable-version-specific-runtime-libs... no checking for a BSD-compatible install... /usr/bin/ginstall -c checking for gawk... gawk checking build system type... i386-pc-solaris2.11 checking host system type... x86_64-pc-solaris2.11 checking for x86_64-pc-solaris2.11-ar... /usr/local/x86_64-pc-solaris2.11/bin/ar checking for x86_64-pc-solaris2.11-lipo... x86_64-pc-solaris2.11-lipo checking for x86_64-pc-solaris2.11-nm... /usr/share/src/gcc_build/./gcc/nm checking for x86_64-pc-solaris2.11-ranlib... /usr/local/x86_64-pc-solaris2.11/bin/ranlib checking for x86_64-pc-solaris2.11-strip... /usr/local/x86_64-pc-solaris2.11/bin/strip checking whether ln -s works... yes checking for x86_64-pc-solaris2.11-gcc... /usr/share/src/gcc_build/./gcc/xgcc -B/usr/share/src/gcc_build/./gcc/ -B/usr/local/x86_64-pc-solaris2.11/bin/ -B/usr/local/x86_64-pc-solaris2.11/lib/ -isystem /usr/local/x86_64-pc-solaris2.11/include -isystem /usr/local/x86_64-pc-solaris2.11/sys-include checking for suffix of object files... configure: error: in `/usr/share/src/gcc_build/x86_64-pc-solaris2.11/libgcc': configure: error: cannot compute suffix of object files: cannot compile See `config.log' for more details. gmake[1]: *** [configure-target-libgcc] Error 1 gmake[1]: Leaving directory `/usr/share/src/gcc_build' gmake: *** [all] Error 2 ... The ../gcc_build/x86_64-pc-solaris2.11/libgcc/config.log file says: ... xgcc: '-V' must come at the start of the command line configure:2396: $? = 1 configure:2415: /usr/share/src/gcc_build/./gcc/xgcc -B/usr/share/src/gcc_build/./gcc/ -B/usr/local/x86_64-pc-solaris2.11/bin/ -B/usr/local/x86_64-pc-solaris2.11/lib/ -isystem /usr/local/x86_64-pc-solaris2.11/include -isystem /usr/local/x86_64-pc-solaris2.11/sys-include -o conftest -g -O2 conftest.c >&5 /var/tmp//ccMDaqTx.s: Assembler messages: /var/tmp//ccMDaqTx.s:35: Error: cannot represent relocation type BFD_RELOC_64 /var/tmp//ccMDaqTx.s:36: Error: cannot represent relocation type BFD_RELOC_64 /var/tmp//ccMDaqTx.s:44: Error: cannot represent relocation type BFD_RELOC_64 /var/tmp//ccMDaqTx.s:45: Error: cannot represent relocation type BFD_RELOC_64 /var/tmp//ccMDaqTx.s:123: Error: cannot represent relocation type BFD_RELOC_64 configure:2418: $? = 1 configure:2590: checking for suffix of object files ... The command being used is: /usr/share/src/gcc_build/./gcc/xgcc -B/usr/share/src/gcc_build/./gcc/ -B/usr/local/x86_64-pc-solaris2.11/bin/ -B/usr/local/x86_64-pc-solaris2.11/lib/ -isystem /usr/local/x86_64-pc-solaris2.11/include -isystem /usr/local/x86_64-pc-solaris2.11/sys-include -o conftest -g -O2 conftest.c ---------- If I change that by adding "-v --save-temps" and using it on a 'hello world'.c I get: # /usr/share/src/gcc_build/./gcc/xgcc -B/usr/share/src/gcc_build/./gcc/ -B/usr/local/x86_64-pc-solaris2.11/bin/ -B/usr/local/x86_64-pc-solaris2.11/lib/ -isystem /usr/local/x86_64-pc-solaris2.11/include -isystem /usr/local/x86_64-pc-solaris2.11/sys-include -o /usr/share/src/gcc_build/test_gcc -g -O2 -v --save-temps /usr/share/src/gcc_build/test_gcc.c Reading specs from /usr/share/src/gcc_build/./gcc/specs Target: x86_64-pc-solaris2.11 ... ignoring nonexistent directory "/usr/local/x86_64-pc-solaris2.11/sys-include" ignoring nonexistent directory "/usr/share/src/gcc_build/gcc/../lib/gcc/x86_64-pc-solaris2.11/4.4.0/include" ignoring nonexistent directory "/usr/share/src/gcc_build/gcc/../lib/gcc/x86_64-pc-solaris2.11/4.4.0/include-fixed" ignoring nonexistent directory "/usr/share/src/gcc_build/gcc/../lib/gcc/x86_64-pc-solaris2.11/4.4.0/../../../../x86_64-pc-solaris2.11/sys-include" ignoring nonexistent directory "/usr/share/src/gcc_build/gcc/../lib/gcc/x86_64-pc-solaris2.11/4.4.0/../../../../x86_64-pc-solaris2.11/include" ignoring nonexistent directory "/usr/share/src/gcc_build/gcc/../lib/gcc/../../lib/gcc/x86_64-pc-solaris2.11/4.4.0/include" ignoring nonexistent directory "/usr/share/src/gcc_build/gcc/../lib/gcc/../../lib/gcc/x86_64-pc-solaris2.11/4.4.0/include-fixed" ignoring nonexistent directory "/usr/share/src/gcc_build/gcc/../lib/gcc/../../lib/gcc/x86_64-pc-solaris2.11/4.4.0/../../../../x86_64-pc-solaris2.11/sys-include" ignoring nonexistent directory "/usr/share/src/gcc_build/gcc/../lib/gcc/../../lib/gcc/x86_64-pc-solaris2.11/4.4.0/../../../../x86_64-pc-solaris2.11/include" #include "..." search starts here: #include <...> search starts here: /usr/share/src/gcc_build/./gcc/include /usr/share/src/gcc_build/./gcc/include-fixed /usr/local/x86_64-pc-solaris2.11/include End of search list. COLLECT_GCC_OPTIONS='-B/usr/share/src/gcc_build/./gcc/' '-B/usr/local/x86_64-pc-solaris2.11/bin/' '-B/usr/local/x86_64-pc-solaris2.11/lib/' '-isystem' '/usr/local/x86_64-pc-solaris2.11/include' '-isystem' '/usr/local/x86_64-pc-solaris2.11/sys-include' '-o' '/usr/share/src/gcc_build/test_gcc' '-g' '-O2' '-v' '-save-temps' '-mtune=k8' '-march=k8' /usr/share/src/gcc_build/./gcc/cc1 -fpreprocessed test_gcc.i -quiet -dumpbase test_gcc.c -mtune=k8 -march=k8 -auxbase test_gcc -g -O2 -version -o test_gcc.s GNU C (GCC) version 4.4.0 20090213 (experimental) [trunk revision 144162] (x86_64-pc-solaris2.11) compiled by GNU C version 4.4.0 20090213 (experimental) [trunk revision 144149], GMP version 4.2.4, MPFR version 2.4.0. GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Compiler executable checksum: a992498eab7f18012e2fb257873e25d1 COLLECT_GCC_OPTIONS='-B/usr/share/src/gcc_build/./gcc/' '-B/usr/local/x86_64-pc-solaris2.11/bin/' '-B/usr/local/x86_64-pc-solaris2.11/lib/' '-isystem' '/usr/local/x86_64-pc-solaris2.11/include' '-isystem' '/usr/local/x86_64-pc-solaris2.11/sys-include' '-o' '/usr/share/src/gcc_build/test_gcc' '-g' '-O2' '-v' '-save-temps' '-mtune=k8' '-march=k8' /usr/local/bin/as -v -V -Qy -s -o test_gcc.o test_gcc.s GNU assembler version 2.19.1 (i386-pc-solaris2.11) using BFD version (GNU Binutils) 2.19.1 test_gcc.s: Assembler messages: test_gcc.s:34: Error: cannot represent relocation type BFD_RELOC_64 test_gcc.s:35: Error: cannot represent relocation type BFD_RELOC_64 test_gcc.s:43: Error: cannot represent relocation type BFD_RELOC_64 test_gcc.s:44: Error: cannot represent relocation type BFD_RELOC_64 test_gcc.s:120: Error: cannot represent relocation type BFD_RELOC_64 ---------- Note the "ignoring nonexistent directory" messages. Some of those directory are malformed and if edited a bit they could be good choices. EG: /usr/share/src/gcc_build/gcc/../lib/gcc/../../lib/gcc/x86_64-pc-solaris2.11/ = /usr/share/src/gcc_build///lib/gcc/x86_64-pc-solaris2.11/ This would be a better choice: /usr/share/src/gcc_build//gcc/x86_64-pc-solaris2.11/ ----- In _this_ Bug Report the problem is caused by the command: /usr/local/bin/as -v -V -Qy -s -o test_gcc.o test_gcc.s If I change that by adding "--64" it works correctly: /usr/local/bin/as --64 -v -V -Qy -s -o test_gcc.o test_gcc.s So I will add "-m64" to the gcc command: # /usr/share/src/gcc_build/./gcc/xgcc -B/usr/share/src/gcc_build/./gcc/ -B/usr/local/x86_64-pc-solaris2.11/bin/ -B/usr/local/x86_64-pc-solaris2.11/lib/ -isystem /usr/local/x86_64-pc-solaris2.11/include -isystem /usr/local/x86_64-pc-solaris2.11/sys-include -o /usr/share/src/gcc_build/test_gcc -g -O2 -v --save-temps -m64 /usr/share/src/gcc_build/test_gcc.c Reading specs from /usr/share/src/gcc_build/./gcc/specs Target: x86_64-pc-solaris2.11 ... GNU assembler version 2.19.1 (i386-pc-solaris2.11) using BFD version (GNU Binutils) 2.19.1 COMPILER_PATH=/usr/share/src/gcc_build/./gcc/:/usr/local/x86_64-pc-solaris2.11/bin/:/usr/local/x86_64-pc-solaris2.11/lib/ LIBRARY_PATH=/usr/local/x86_64-pc-solaris2.11/lib/amd64/:/usr/share/src/gcc_build/./gcc/:/usr/local/x86_64-pc-solaris2.11/bin/:/usr/local/x86_64-pc-solaris2.11/lib/ COLLECT_GCC_OPTIONS='-B/usr/share/src/gcc_build/./gcc/' '-B/usr/local/x86_64-pc-solaris2.11/bin/' '-B/usr/local/x86_64-pc-solaris2.11/lib/' '-isystem' '/usr/local/x86_64-pc-solaris2.11/include' '-isystem' '/usr/local/x86_64-pc-solaris2.11/sys-include' '-o' '/usr/share/src/gcc_build/test_gcc' '-g' '-O2' '-v' '-save-temps' '-m64' '-mtune=k8' '-march=k8' /usr/share/src/gcc_build/./gcc/collect2 -V -m elf_x86_64 -Y P,/lib/64:/usr/lib/64 -Qy -o /usr/share/src/gcc_build/test_gcc crt1.o crti.o values-Xa.o crtbegin.o -L/usr/local/x86_64-pc-solaris2.11/lib/amd64 -L/usr/share/src/gcc_build/./gcc -L/usr/local/x86_64-pc-solaris2.11/bin -L/usr/local/x86_64-pc-solaris2.11/lib test_gcc.o -lgcc -lgcc_eh -lc -lgcc -lgcc_eh crtend.o crtn.o GNU ld (GNU Binutils) 2.19.1 Supported emulations: elf_i386_ldso elf_i386 elf_x86_64 /usr/local/bin/ld: crt1.o: No such file: No such file or directory # locate crt1.o /opt/csw/gcc4/lib/gcc/i386-pc-solaris2.8/4.0.2/crt1.o /opt/csw/gcc4/lib/gcc/i386-pc-solaris2.8/4.0.2/gcrt1.o /usr/lib/amd64/crt1.o /usr/lib/amd64/gcrt1.o /usr/lib/crt1.o /usr/lib/gcrt1.o If gcc wants 'crt1.o' it should build it or look in: /usr/lib/amd64/crt1.o Rob -- Summary: Configury incorrect for 64-bit Targets on Solaris Product: gcc Version: 4.4.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: bootstrap AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: rob1weld at aol dot com GCC build triplet: i386-pc-solaris2.11 GCC host triplet: i386-pc-solaris2.11 GCC target triplet: i386-pc-solaris2.11 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39186