pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Can't build gcc7 on Solaris 10



Just a quick follow up... I tried to update my Solaris system (host and zones) to the last patchset I could get ( 2017.12.14 ). i still get the same errors whatever the gcc i'm using. Which is by the way : 

/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    -O2  -g -O2 -std=gnu99 -O3 -D_FORTIFY_SOURCE=2 -I/usr/include -DIN_GCC    -W -Wall -Wwrite-strings -Wcast-qual -Wno-format -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -fPIC -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector  -shared -nodefaultlibs -Wl,-h,libgcc_s.so.1 -Wl,-z,text -Wl,-z,defs -Wl,-M,libgcc.map -o sparcv8plus/libgcc_s.so.1.tmp -g -O2 -std=gnu99 -O3 -D_FORTIFY_SOURCE=2 -I/usr/include -m32 -B./ _muldi3_s.o _negdi2_s.o _lshrdi3_s.o _ashldi3_s.o _ashrdi3_s.o _cmpdi2_s.o _ucmpdi2_s.o _clear_cache_s.o _trampoline_s.o __main_s.o _absvsi2_s.o _absvdi2_s.o _addvsi3_s.o _addvdi3_s.o _subvsi3_s.o _subvdi3_s.o _mulvsi3_s.o _mulvdi3_s.o _negvsi2_s.o _negvdi2_s.o _ctors_s.o _ffssi2_s.o _ffsdi2_s.o _clz_s.o _clzsi2_s.o _clzdi2_s.o _ctzsi2_s.o _ctzdi2_s.o _popcount_tab_s.o _popcountsi2_s.o _popcountdi2_s.o _paritysi2_s.o _paritydi2_s.o _powisf2_s.o _powidf2_s.o _powixf2_s.o _powitf2_s.o _mulhc3_s.o _mulsc3_s.o _muldc3_s.o _mulxc3_s.o _multc3_s.o _divhc3_s.o _divsc3_s.o _divdc3_s.o _divxc3_s.o _divtc3_s.o _bswapsi2_s.o _bswapdi2_s.o _clrsbsi2_s.o _clrsbdi2_s.o _fixunssfsi_s.o _fixunsdfsi_s.o _fixunsxfsi_s.o _fixsfdi_s.o _fixdfdi_s.o _fixxfdi_s.o _fixtfdi_s.o _fixunssfdi_s.o _fixunsdfdi_s.o _fixunsxfdi_s.o _fixunstfdi_s.o _floatdisf_s.o _floatdidf_s.o _floatdixf_s.o _floatditf_s.o _floatundisf_s.o _floatundidf_s.o _floatundixf_s.o _floatunditf_s.o _divdi3_s.o _moddi3_s.o _divmoddi4_s.o _udivdi3_s.o _umoddi3_s.o _udivmoddi4_s.o _udiv_w_sdiv_s.o enable-execute-stack_s.o unwind-dw2_s.o unwind-dw2-fde-dip_s.o unwind-sjlj_s.o unwind-c_s.o emutls_s.o libgcc.a -lc && rm -f sparcv8plus/libgcc_s.so && if [ -f sparcv8plus/libgcc_s.so.1 ]; then mv -f sparcv8plus/libgcc_s.so.1 sparcv8plus/libgcc_s.so.1.backup; else true; fi && mv sparcv8plus/libgcc_s.so.1.tmp sparcv8plus/libgcc_s.so.1 && ln -s libgcc_s.so.1 sparcv8plus/libgcc_s.so
ld: fatal: relocation error: R_SPARC_32: file _negdi2_s.o: symbol .text (section): offset 0xc62da is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _lshrdi3_s.o: symbol .text (section): offset 0xc64db is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _ashldi3_s.o: symbol .text (section): offset 0xc66e9 is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _ashrdi3_s.o: symbol .text (section): offset 0xc68f7 is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _cmpdi2_s.o: symbol .text (section): offset 0xc6b05 is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _clear_cache_s.o: symbol .text (section): offset 0xc6f0b is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _absvsi2_s.o: symbol .text (section): offset 0xc74dd is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _absvdi2_s.o: symbol .text (section): offset 0xc76e2 is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _addvsi3_s.o: symbol .text (section): offset 0xc78ea is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _addvdi3_s.o: symbol .text (section): offset 0xc7aed is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _subvsi3_s.o: symbol .text (section): offset 0xc7cf2 is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _subvdi3_s.o: symbol .text (section): offset 0xc7ef5 is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _mulvsi3_s.o: symbol .text (section): offset 0xc80fa is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _mulvdi3_s.o: symbol .text (section): offset 0xc82fd is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _negvsi2_s.o: symbol .text (section): offset 0xc8543 is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _negvdi2_s.o: symbol .text (section): offset 0xc8746 is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _ffssi2_s.o: symbol .text (section): offset 0xc8b3a is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _ffsdi2_s.o: symbol .text (section): offset 0xc8d3f is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _clzsi2_s.o: symbol .text (section): offset 0xc913e is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _clzdi2_s.o: symbol .text (section): offset 0xc9346 is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _ctzsi2_s.o: symbol .text (section): offset 0xc9556 is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _popcountsi2_s.o: symbol .text (section): offset 0xc9b5f is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _popcountdi2_s.o: symbol .text (section): offset 0xc9d66 is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _paritysi2_s.o: symbol .text (section): offset 0xc9f75 is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _paritydi2_s.o: symbol .text (section): offset 0xca179 is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _powidf2_s.o: symbol .text (section): offset 0xca58e is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _powitf2_s.o: symbol .text (section): offset 0xca97e is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _mulsc3_s.o: symbol .text (section): offset 0xcad7b is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _muldc3_s.o: symbol .text (section): offset 0xcafc5 is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _multc3_s.o: symbol .text (section): offset 0xcb3fb is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _divsc3_s.o: symbol .text (section): offset 0xcb873 is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _divdc3_s.o: symbol .text (section): offset 0xcbaae is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _divtc3_s.o: symbol .text (section): offset 0xcbeca is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _bswapsi2_s.o: symbol .text (section): offset 0xcc12d is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _clrsbsi2_s.o: symbol .text (section): offset 0xcc545 is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _clrsbdi2_s.o: symbol .text (section): offset 0xcc74e is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _fixunssfsi_s.o: symbol .text (section): offset 0xcc95d is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _fixunsdfsi_s.o: symbol .text (section): offset 0xccb61 is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _fixsfdi_s.o: symbol .text (section): offset 0xccf47 is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _fixdfdi_s.o: symbol .text (section): offset 0xcd14b is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _fixtfdi_s.o: symbol .text (section): offset 0xcd533 is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _fixunssfdi_s.o: symbol .text (section): offset 0xcd737 is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _fixunsdfdi_s.o: symbol .text (section): offset 0xcd943 is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _fixunstfdi_s.o: symbol .text (section): offset 0xcdd2a is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _floatdidf_s.o: symbol .text (section): offset 0xce15a is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _floatditf_s.o: symbol .text (section): offset 0xce549 is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _floatundisf_s.o: symbol .text (section): offset 0xce751 is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _floatunditf_s.o: symbol .text (section): offset 0xced53 is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _divdi3_s.o: symbol .text (section): offset 0xcef5b is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _moddi3_s.o: symbol .text (section): offset 0xcf1a6 is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _udivdi3_s.o: symbol .text (section): offset 0xcf66f is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _umoddi3_s.o: symbol .text (section): offset 0xcf8ba is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _udivmoddi4_s.o: symbol .text (section): offset 0xcfb0b is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _udiv_w_sdiv_s.o: symbol .text (section): offset 0xcfd63 is non-aligned
ld: fatal: relocation error: R_SPARC_32: file enable-execute-stack_s.o: symbol .text.startup (section): offset 0xcfe5a is non-aligned
ld: fatal: relocation error: R_SPARC_32: file unwind-dw2_s.o: symbol .text (section): offset 0xd01b1 is non-aligned
ld: fatal: relocation error: R_SPARC_32: file unwind-dw2-fde-dip_s.o: symbol .text (section): offset 0xd113e is non-aligned
ld: fatal: relocation error: R_SPARC_32: file unwind-c_s.o: symbol .text (section): offset 0xd1f5e is non-aligned
collect2: error: ld returned 1 exit status
Makefile:977: recipe for target 'libgcc_s.so' failed
gmake[5]: *** [libgcc_s.so] Error 1
gmake[5]: Leaving directory '/usr/pkgsrc/lang/gcc7/work/build/sparc64-sun-solaris2.10/sparcv8plus/libgcc'
Makefile:1198: recipe for target 'multi-do' failed
gmake[4]: *** [multi-do] Error 1
gmake[4]: Leaving directory '/usr/pkgsrc/lang/gcc7/work/build/sparc64-sun-solaris2.10/libgcc'
Makefile:123: recipe for target 'all-multi' failed
gmake[3]: *** [all-multi] Error 2
gmake[3]: Leaving directory '/usr/pkgsrc/lang/gcc7/work/build/sparc64-sun-solaris2.10/libgcc'
Makefile:20904: recipe for target 'all-stage1-target-libgcc' failed
gmake[2]: *** [all-stage1-target-libgcc] Error 2
gmake[2]: Leaving directory '/usr/pkgsrc/lang/gcc7/work/build'
Makefile:26034: recipe for target 'stage1-bubble' failed
gmake[1]: *** [stage1-bubble] Error 2
gmake[1]: Leaving directory '/usr/pkgsrc/lang/gcc7/work/build'
Makefile:937: recipe for target 'all' failed
gmake: *** [all] Error 2
*** Error code 2

I runned a "make clean clean-depends" before building.
GCC version used were :


Quick question here : Is it there anybody who has successfully used/tested pkgsrc ( 2017Q3 ) on a Solaris 10 system ( global zone or local zone ) ?


On Sun, Dec 3, 2017 at 12:25 PM, Julien Savard <juliensavard17%gmail.com@localhost> wrote:
Hi,
So gcc7 failed compiling from gcc4.9 (OpenSWC) as well as gcc 5.2 (OpenCSW) with the same error (than with SFW gcc 3 ) :

ld: fatal: relocation error: R_SPARC_32: file _muldi3_s.o: symbol .text (section): offset 0x7ea6a6db is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _negdi2_s.o: symbol .text (section): offset 0x7ea6a8e2 is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _lshrdi3_s.o: symbol .text (section): offset 0x7ea6aae3 is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _ashldi3_s.o: symbol .text (section): offset 0x7ea6acff is non-aligned
ld: fatal: relocation error: R_SPARC_32: file _ashrdi3_s.o: symbol .text (section): offset 0x7ea6af1b is non-aligned

I tried to compile gcc6 instead with SFW gcc3 and here again, same result...

ld: fatal: relocation error: R_SPARC_32: file unwind-dw2_s.o: symbol .text (section): offset 0x7ea7421f is non-aligned
ld: fatal: relocation error: R_SPARC_32: file unwind-dw2-fde-dip_s.o: symbol .text (section): offset 0x7ea74fc5 is non-aligned
ld: fatal: relocation error: R_SPARC_32: file emutls_s.o: symbol .text (section): offset 0x7ea75b83 is non-aligned
collect2: error: ld returned 1 exit status
gmake[5]: *** [libgcc_s.so] Error 1
gmake[5]: Leaving directory `/usr/pkgsrc/lang/gcc6/work/build/sparc64-sun-solaris2.10/sparcv8plus/libgcc'
gmake[4]: *** [multi-do] Error 1
gmake[4]: Leaving directory `/usr/pkgsrc/lang/gcc6/work/build/sparc64-sun-solaris2.10/libgcc'
gmake[3]: *** [all-multi] Error 2
gmake[3]: Leaving directory `/usr/pkgsrc/lang/gcc6/work/build/sparc64-sun-solaris2.10/libgcc'
gmake[2]: *** [all-stage1-target-libgcc] Error 2
gmake[2]: Leaving directory `/usr/pkgsrc/lang/gcc6/work/build'
gmake[1]: *** [stage1-bubble] Error 2
gmake[1]: Leaving directory `/usr/pkgsrc/lang/gcc6/work/build'
gmake: *** [all] Error 2
*** Error code 2

Stop.
bmake[1]: stopped in /usr/pkgsrc/lang/gcc6
*** Error code 1

Stop.
bmake: stopped in /usr/pkgsrc/lang/gcc6

I will try to compile gcc6 with OpenCSW gcc4 ( and/or OpenCSW gcc5) and in the mean time, as suggested by Michel Jansens, I will try to compile gcc5 from SFW gcc3. I'll try to keep you updated...

By the way, I tried to google about that "ld: fatal: relocation error:" but I didn't find anything really usefull. Does anybody have an idea about if it can be fixed and how ?

On Sun, Dec 3, 2017 at 4:16 AM, Michel Jansens <michel.jansens%ulb.ac.be@localhost> wrote:
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 SPARC

config.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/g
as --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
n

Hope it can be of any help. 


Michel


On 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 :

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; \
fi
echo timestamp > gcc.pod
perl ../../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

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...

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 1
gmake[5]: Leaving directory `/usr/pkgsrc/lang/gcc7/work/build/sparc64-sun-solaris2.10/sparcv8plus/libgcc'
gmake[4]: *** [multi-do] Error 1
gmake[4]: Leaving directory `/usr/pkgsrc/lang/gcc7/work/build/sparc64-sun-solaris2.10/libgcc'
gmake[3]: *** [all-multi] Error 2
gmake[3]: Leaving directory `/usr/pkgsrc/lang/gcc7/work/build/sparc64-sun-solaris2.10/libgcc'
gmake[2]: *** [all-stage1-target-libgcc] Error 2
gmake[2]: Leaving directory `/usr/pkgsrc/lang/gcc7/work/build'
gmake[1]: *** [stage1-bubble] Error 2
gmake[1]: Leaving directory `/usr/pkgsrc/lang/gcc7/work/build'
gmake: *** [all] Error 2
*** Error code 2

Stop.
bmake[1]: stopped in /usr/pkgsrc/lang/gcc7
*** Error code 1

Stop.
bmake: stopped in /usr/pkgsrc/lang/gcc7

My mkconf file as nothing really special :

.ifdef BSD_PKG_MK       # begin pkgsrc settings

ABI=                    64
PKGSRC_COMPILER=        gcc
GCCBASE=                /usr/sfw

PKG_DBDIR=              /usr/pkg/pkgdb
LOCALBASE=              /usr/pkg
VARBASE=                /var
PKG_TOOLS_BIN=          /usr/pkg/sbin
PKGINFODIR=             info
PKGMANDIR=              man

TOOLS_PLATFORM.install?=        /usr/pkg/bin/bsdinstall
TOOLS_PLATFORM.awk?=            /usr/pkg/bin/nawk
TOOLS_PLATFORM.sed?=            /usr/pkg/bin/nbsed
TOOLS_PLATFORM.sh?=             /usr/bin/bash
CFLAGS+=-std=c99
CFLAGS+=-O2
CPPFLAGS+=-O2
CXXFLAGS+=-O2
DBG=                    # prevent DBG from adding default optimizer flags
FETCH_USING=            fetch
.endif                  # end pkgsrc settings

Replace GCCBASE for /opt/csw/bin when using OpenCSW. Any idea anybody ?







Home | Main Index | Thread Index | Old Index