I desire to replace my OS's gcc toolchain with a newer version since the one supplied by the manufacturer is a little old (and missing some languages).
I am compiling gcc-4.2.1 (release from ftp://mirrors.kernel.org/gnu/). Sun's gcc (not used during build): # gcc -v Reading specs from /user/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/specs Configured with: /builds/sfwnv-86/usr/src/cmd/gcc/gcc-3.4.3/configure --prefix=/usr/sfw --with-as=/usr/sfw/bin/gas --with-gnu-as --with-ld=/usr/ccs/bin/ld --without-gnu-ld --enable-languages=c,c++,f77,objc --enable shared Thread model: posix gcc version 3.4.3 (csl-sol210-3_4-20050802) Linker used during build: # /usr/ccs/bin/ld -V ld: Software Generation Utilities - Solaris Link Editors: 5.11-1.622 GCC used to build (From BlastWave): # gcc -v Reading specs from /opt/csw/gcc4/lib/gcc/i386-pc-solaris2.8/4.0.2/specs Target: i386-pc-solaris2.8 Configured with: ../sources/gcc-4.0.2/configure --prefix=/opt/csw/gcc4 --with-local-prefix=/opt/csw --with-gnu-as --with-as=/opt/csw/bin/gas --without-gnu-ld --with-ld=/usr/ccs/bin/ld --enable-threads=posix --enable-shared --enable-multilib --enable-nls --with-included-gettext --with-libiconv-prefix=/opt/csw --with-x --enable-java-awt=xlib --with-system-zlib --enable-languages=c,c++,f95,java,objc,ada Thread model: posix gcc version 4.0.2 Failing configure command: /opt/gcc-4.2.1/configure --build=i386-pc-solaris2.11 --prefix=/usr/sfw --with-as=/usr/sfw/bin/gas --with-gnu-as --with-ld=/usr/ccs/bin/ld --without-gnu-ld --enable-shared --enable-threads=posix --enable-libada --enable-libssp --enable-libmudflap --enable-libgomp --enable-decimal-float --with-x --x-includes=/usr/include/X11 --x-libraries=/usr/X11/lib --enable-java-awt=gtk,xlib --enable-gtk-cairo --enable-qt-peer --enable-gconf-peer --with-stabs --enable-stage1-checking=release --enable-multilib --enable-nls --enable-languages=c,ada,c++,fortran,java,objc,obj-c++ --enable-xmlj The reason I am using the "--without-gnu-ld --with-ld=/usr/ccs/bin/ld" option is because the Solaris OS supplied gcc (configured by SUN) (and other gcc's such as BlastWave's) all seem to use it. It seems reasonable to follow the manufacturers advice if you are going to replace the OS's system compiler. It may well be true (or not) that _after_ I successfully build a newer gcc that I should compile a newer binutils and use that -- but building the newer gcc with the 'recommended' linker is what I desire to do (for now). If I configure without "--enable-xmlj" the build (or if you prefer Sun's ld) works. If I configure using "--enable-xmlj" I get a relocation error in gnu-xml concerning debug_info (so it seems we could fix one small section and get everything to work). Here is a portion of my build log: # grep -B 10 -A 2 LASF7986 /opt/gcc-4.2.1-build-1/made_1j_log.txt mkdir .libs/libgcj.lax/libffi_convenience.a (cd .libs/libgcj.lax/libffi_convenience.a && /usr/sfw/i386-pc-solaris2.11/bin/ar x /opt/gcc-4.2.1-build/i386-pc-solaris2.11/libjava/../libffi/.libs/libffi_convenience.a) rm -fr .libs/libgcj.lax/libzgcj_convenience.a mkdir .libs/libgcj.lax/libzgcj_convenience.a (cd .libs/libgcj.lax/libzgcj_convenience.a && /usr/sfw/i386-pc-solaris2.11/bin/ar x /opt/gcc-4.2.1-build/i386-pc-solaris2.11/libjava/../zlib/.libs/libzgcj_convenience.a) rm -fr .libs/libgcj.lax/libgcjgc_convenience.a mkdir .libs/libgcj.lax/libgcjgc_convenience.a (cd .libs/libgcj.lax/libgcjgc_convenience.a && /usr/sfw/i386-pc-solaris2.11/bin/ar x /opt/gcc-4.2.1-build/i386-pc-solaris2.11/libjava/../boehm-gc/.libs/libgcjgc_convenience.a) /opt/gcc-4.2.1-build/./gcc/xgcc -shared-libgcc (HUGE command deleted) /i386-pc-solaris2.11/../../../i386-pc-solaris2.11/lib -L/usr/sfw/lib/gcc/i386-pc-solaris2.11/../.. -lgcc_s -lgcc_s -lc /opt/gcc-4.2.1-build/./gcc/crtend.o /usr/lib/crtn.o -Wl,-h -Wl,libgcj.so.8 -o .libs/libgcj.so.8.0.0 ld: warning: relocation error: R_386_32: file .libs/gnu-xml.o: symbol .LASF7985: external symbolic relocation against non-allocatable section .debug_info; cannot be processed at runtime: relocation ignored ld: warning: relocation error: R_386_32: file .libs/gnu-xml.o: symbol .LASF7986: external symbolic relocation against non-allocatable section .debug_info; cannot be processed at runtime: relocation ignored ld: warning: relocation error: R_386_32: file .libs/gnu-xml.o: symbol .LASF7987: external symbolic relocation against non-allocatable section .debug_info; cannot be processed at runtime: relocation ignored ld: warning: relocation error: R_386_32: file .libs/gnu-xml.o: symbol .LASF40: external symbolic relocation against non-allocatable section .debug_info; cannot be processed at runtime: relocation ignored (The errors continue for over 20000 lines, finally ending with this:) /i386-pc-solaris2.11/../../../i386-pc-solaris2.11/lib -L/usr/sfw/lib/gcc/i386-pc-solaris2.11/../.. -lgcc_s -lgcc_s -lc /opt/gcc-4.2.1-build/./gcc/crtend.o /usr/lib/crtn.o -Wl,-h -Wl,libgcj.so.8 -o .libs/libgcj.so.8.0.0 ld: warning: relocation error: R_386_32: file .libs/gnu-xml.o: symbol .LASF7985: external symbolic relocation against non-allocatable section .debug_info; cannot be processed at runtime: relocation ignored ld: warning: relocation error: R_386_32: file .libs/gnu-xml.o: symbol .LASF7986: external symbolic relocation against non-allocatable section .debug_info; cannot be processed at runtime: relocation ignored ld: warning: relocation error: R_386_32: file .libs/gnu-xml.o: symbol .LASF7987: external symbolic relocation against non-allocatable section .debug_info; cannot be processed at runtime: relocation ignored ld: warning: relocation error: R_386_32: file .libs/gnu-xml.o: symbol .LASF40: external symbolic relocation against non-allocatable section .debug_info; cannot be processed at runtime: relocation ignored If there is no desire to fix gnu-xml so it would not fault Sun's linker then can we check the linker version in the root configure script and disallow --enable-xmlj so that the build of gcc does not work perfectly for several hours and then fail when the build is just about to complete :(! . -- Summary: Build gcc-4.2.1 release fails when configured with -- with-xmlj using Sun's ld Product: gcc Version: 4.2.1 Status: UNCONFIRMED Severity: blocker Priority: P3 Component: libgcj 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=36640