ld: fatal: relocation error: R_SPARC_32: file _muldi3_s.o: symbol .text (section): offset 0x7ea6a6db is non-alignedld: fatal: relocation error: R_SPARC_32: file _negdi2_s.o: symbol .text (section): offset 0x7ea6a8e2 is non-alignedld: fatal: relocation error: R_SPARC_32: file _lshrdi3_s.o: symbol .text (section): offset 0x7ea6aae3 is non-alignedld: fatal: relocation error: R_SPARC_32: file _ashldi3_s.o: symbol .text (section): offset 0x7ea6acff is non-alignedld: fatal: relocation error: R_SPARC_32: file _ashrdi3_s.o: symbol .text (section): offset 0x7ea6af1b is non-aligned
ld: fatal: relocation error: R_SPARC_32: file unwind-dw2_s.o: symbol .text (section): offset 0x7ea7421f is non-alignedld: fatal: relocation error: R_SPARC_32: file unwind-dw2-fde-dip_s.o: symbol .text (section): offset 0x7ea74fc5 is non-alignedld: fatal: relocation error: R_SPARC_32: file emutls_s.o: symbol .text (section): offset 0x7ea75b83 is non-alignedcollect2: error: ld returned 1 exit statusgmake[5]: *** [libgcc_s.so] Error 1gmake[5]: Leaving directory `/usr/pkgsrc/lang/gcc6/work/build/sparc64-sun-solaris2.10/sparcv8plus/libgcc'gmake[4]: *** [multi-do] Error 1gmake[4]: Leaving directory `/usr/pkgsrc/lang/gcc6/work/build/sparc64-sun-solaris2.10/libgcc'gmake[3]: *** [all-multi] Error 2gmake[3]: Leaving directory `/usr/pkgsrc/lang/gcc6/work/build/sparc64-sun-solaris2.10/libgcc'gmake[2]: *** [all-stage1-target-libgcc] Error 2gmake[2]: Leaving directory `/usr/pkgsrc/lang/gcc6/work/build'gmake[1]: *** [stage1-bubble] Error 2gmake[1]: Leaving directory `/usr/pkgsrc/lang/gcc6/work/build'gmake: *** [all] Error 2*** Error code 2Stop.bmake[1]: stopped in /usr/pkgsrc/lang/gcc6*** Error code 1Stop.bmake: stopped in /usr/pkgsrc/lang/gcc6
Hi Julien,I managed to build it a few month ago with pkgsrc 2017Q2. I started with opensfw gcc3.4.3 as well, but I did build gcc5 first, then built gcc7 with gcc5.my Solaris 10 release is Oracle Solaris 10 1/13 s10s_u11wos_24a SPARCconfig.log in /opt/pkgsrc-2017Q2/lang/gcc7/work/build shows this: ../gcc-7.1.0/configure --disable-libstdcxx-pch --disable-nls --enable-__cxa_atexit --with-gxx-include-dir=/opt/pkg-2017Q2/gcc7/include/c++/ --enable-libssp --enable-languages=c obj-c++ objc fortran c++ --enable-shared --enable-long-long--with-local-prefix=/opt/pkg-2017Q2/gcc7 --enable-threads=posix --with-boot-ldf lags=-static-libstdc++ -static-libgcc -Wl,-R/opt/pkg-2017Q2/gcc5/lib/gcc/sparc-s un-solaris2.10/5.4.0 -Wl,-R/opt/pkg-2017Q2/gcc5/lib -Wl,-R/opt/pkg-2017Q2/lib --without-gnu-ld --with-ld=/usr/ccs/bin/ld --with-gnu-as --with-as=/usr/sfw/bin/gas --prefix=/opt/pkg-2017Q2/gcc7 --build=sparc-sun-solaris2.10 --host=sparc-sun-solaris2.10 --infodir=/opt/pkg-2017Q2/gcc7/info --mandir=/opt/pkg-2017Q2/gcc7/ ma nHope it can be of any help.MichelOn 30 Nov 2017, at 04:49, Julien Savard <juliensavard17%gmail.com@localhost> wrote:Hi,I'm trying to build gcc7 on Solaris 10. I tried with gcc 3.4.3 which is provided with Solaris as SunFreeWare (SFW) but it always get stuck there on build :CPU is completly used by cc1. I thought it might be simply slow but I let it compile for 2-3 days and it didn't get any further. It's simply stuck there...if [ xinfo = xinfo ]; then \/usr/pkgsrc/lang/gcc7/work/.tools/bin/makeinfo --split-size=5000000 --split-size=5000000 --split-size=5000000 --no-split -I . -I ../../gcc-7.2.0/gcc/doc \ -I ../../gcc-7.2.0/gcc/doc/include -o doc/cppinternals.info ../../gcc-7.2.0/gcc/doc/ cppinternals.texi; \ fiecho timestamp > gcc.podperl ../../gcc-7.2.0/gcc/../contrib/texi2pod.pl ../../gcc-7.2.0/gcc/doc/ invoke.texi > gcc.pod echo timestamp > doc/gcc.1(pod2man --center="GNU" --release="gcc-7.2.0" --date=2017-08-14 --section=1 gcc.pod > doc/gcc.1.T$$ && \mv -f doc/gcc.1.T$$ doc/gcc.1) || \(rm -f doc/gcc.1.T$$ && exit 1)cp doc/gcc.1 doc/g++.1/usr/pkgsrc/lang/gcc7/work/build/./gcc/xgcc -B/usr/pkgsrc/lang/gcc7/work/ build/./gcc/ -nostdinc -x c /dev/null -S -o /dev/null -fself-test=../../gcc-7.2.0/ gcc/testsuite/selftests I also tried with gcc4.9 and gcc5.2 provided by OpenCSW. This time it fails with this error :/usr/pkgsrc/lang/gcc7/work/build/./gcc/xgcc -B/usr/pkgsrc/lang/gcc7/work/ build/./gcc/ -B/usr/pkg/gcc7/sparc64-sun- solaris2.10/bin/ -B/usr/pkg/gcc7/sparc64-sun- solaris2.10/lib/ -isystem /usr/pkg/gcc7/sparc64-sun- solaris2.10/include -isystem /usr/pkg/gcc7/sparc64-sun- solaris2.10/sys-include -g -std=c99 -O2 -D_FORTIFY_SOURCE=2 -I/usr/include -m32 -O2 -g -std=c99 -O2 -D_FORTIFY_SOURCE=2 -I/usr/include -DIN_GCC -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -I. -I. -I../../.././gcc -I../../../../gcc-7.1.0/libgcc -I../../../../gcc-7.1.0/ libgcc/. -I../../../../gcc-7.1.0/ libgcc/../gcc -I../../../../gcc-7.1.0/ libgcc/../include -g0 -finhibit-size-directive -fno-inline -fno-exceptions -fno-zero-initialized-in-bss -fno-toplevel-reorder -fno-tree-vectorize -fbuilding-libgcc -fno-stack-protector -I. -I. -I../../.././gcc -I../../../../gcc-7.1.0/libgcc -I../../../../gcc-7.1.0/ libgcc/. -I../../../../gcc-7.1.0/ libgcc/../gcc -I../../../../gcc-7.1.0/ libgcc/../include -o gmon.o -MT gmon.o -MD -MP -MF gmon.dep -fPIC -fPIC -c ../../../../gcc-7.1.0/libgcc/ config/sol2/gmon.c ../../../../gcc-7.1.0/libgcc/config/sol2/gmon.c:299:5: error: expected declaration specifiers or '...' before string constant asm(".global _mcount\n"^~~~~~~~~~~~~~~~~~~~gmake[5]: *** [gmon.o] Error 1gmake[5]: Leaving directory `/usr/pkgsrc/lang/gcc7/work/build/sparc64-sun-solaris2.10/ sparcv8plus/libgcc' gmake[4]: *** [multi-do] Error 1gmake[4]: Leaving directory `/usr/pkgsrc/lang/gcc7/work/build/sparc64-sun-solaris2.10/ libgcc' gmake[3]: *** [all-multi] Error 2gmake[3]: Leaving directory `/usr/pkgsrc/lang/gcc7/work/build/sparc64-sun-solaris2.10/ libgcc' gmake[2]: *** [all-stage1-target-libgcc] Error 2gmake[2]: Leaving directory `/usr/pkgsrc/lang/gcc7/work/build' gmake[1]: *** [stage1-bubble] Error 2gmake[1]: Leaving directory `/usr/pkgsrc/lang/gcc7/work/build' gmake: *** [all] Error 2*** Error code 2Stop.bmake[1]: stopped in /usr/pkgsrc/lang/gcc7*** Error code 1Stop.bmake: stopped in /usr/pkgsrc/lang/gcc7My mkconf file as nothing really special :Replace GCCBASE for /opt/csw/bin when using OpenCSW. Any idea anybody ?.ifdef BSD_PKG_MK # begin pkgsrc settingsABI= 64PKGSRC_COMPILER= gccGCCBASE= /usr/sfwPKG_DBDIR= /usr/pkg/pkgdbLOCALBASE= /usr/pkgVARBASE= /varPKG_TOOLS_BIN= /usr/pkg/sbinPKGINFODIR= infoPKGMANDIR= manTOOLS_PLATFORM.install?= /usr/pkg/bin/bsdinstallTOOLS_PLATFORM.awk?= /usr/pkg/bin/nawkTOOLS_PLATFORM.sed?= /usr/pkg/bin/nbsedTOOLS_PLATFORM.sh?= /usr/bin/bashCFLAGS+=-std=c99CFLAGS+=-O2CPPFLAGS+=-O2CXXFLAGS+=-O2DBG= # prevent DBG from adding default optimizer flagsFETCH_USING= fetch.endif # end pkgsrc settings