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



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