Discussion:
Unable to build gcc-4.8.2 on sparcv9 Solaris 10.
Don Krause
2013-12-05 18:20:10 UTC
Permalink
Hi all,

I've been trying to build gcc-4.8.2 on Solaris 10 on Sparc.

The bootstrap process gives me an "internal compiler error"

Using:

SunOS sunv210 5.10 Generic_127127-11 sun4u sparc SUNW,Sun-Fire-V210
gcc 3.4.6
make 3.81
bunutils 2.24

As for the source code stack, it:

gcc 4.8.2 +

gmp 4.3.2
mpc 0.8.1
mpfr 2.4.2

Procedure,

expand gcc 4.8.2 into clean directory.
expand gmp, mpc, mpfr into gcc 4.8.2 tree, rename directories as appropriate.

./configure --prefix=/home/tools/solaris2013

make.

That churns for a couple hours. (yes, old and crappy equipment. No options here..)

Then:

make[4]: Leaving directory `/home/towelie/dkrause/src/solaris2013/gcc-4.8.2/BUILD/sparc-sun-solaris2.10/libgcc'
/home/towelie/dkrause/src/solaris2013/gcc-4.8.2/BUILD/./gcc/xgcc -B/home/towelie/dkrause/src/solaris2013/gcc-4.8.2/BUILD/./gcc/ -B/home/tools/solaris2013/sparc-sun-solaris2.10/bin/ -B/home/tools/solaris2013/sparc-sun-solaris2.10/lib/ -isystem /home/tools/solaris2013/sparc-sun-solaris2.10/include -isystem /home/tools/solaris2013/sparc-sun-solaris2.10/sys-include -g -O2 -O2 -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fPIC -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -fPIC -I. -I. -I../.././gcc -I../../../libgcc -I../../../libgcc/. -I../../../libgcc/../gcc -I../../../libgcc/../include -DHAVE_CC_TLS -o _muldi3.o -MT _muldi3.o -MD -MP -MF _muldi3.dep -DL_muldi3 -c ../../../libgcc/libgcc2.c -fvisibility=hidden -DHIDE_EXPORTS
../../../libgcc/libgcc2.c: In function '__muldi3':
../../../libgcc/libgcc2.c:549:17: internal compiler error: Segmentation Fault
const DWunion uu = {.ll = u};
^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
make[3]: *** [_muldi3.o] Error 1
make[3]: Leaving directory `/home/towelie/dkrause/src/solaris2013/gcc-4.8.2/BUILD/sparc-sun-solaris2.10/libgcc'
make[2]: *** [all-stage1-target-libgcc] Error 2
make[2]: Leaving directory `/home/towelie/dkrause/src/solaris2013/gcc-4.8.2/BUILD'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/home/towelie/dkrause/src/solaris2013/gcc-4.8.2/BUILD'
make: *** [all] Error 2


Suggestions?

Thanks!

--
Don Krause
Ian Lance Taylor
2013-12-05 21:11:51 UTC
Permalink
Post by Don Krause
I've been trying to build gcc-4.8.2 on Solaris 10 on Sparc.
The bootstrap process gives me an "internal compiler error"
SunOS sunv210 5.10 Generic_127127-11 sun4u sparc SUNW,Sun-Fire-V210
gcc 3.4.6
make 3.81
bunutils 2.24
gcc 4.8.2 +
gmp 4.3.2
mpc 0.8.1
mpfr 2.4.2
Procedure,
expand gcc 4.8.2 into clean directory.
expand gmp, mpc, mpfr into gcc 4.8.2 tree, rename directories as appropriate.
./configure --prefix=/home/tools/solaris2013
make.
That churns for a couple hours. (yes, old and crappy equipment. No options here..)
make[4]: Leaving directory `/home/towelie/dkrause/src/solaris2013/gcc-4.8.2/BUILD/sparc-sun-solaris2.10/libgcc'
/home/towelie/dkrause/src/solaris2013/gcc-4.8.2/BUILD/./gcc/xgcc -B/home/towelie/dkrause/src/solaris2013/gcc-4.8.2/BUILD/./gcc/ -B/home/tools/solaris2013/sparc-sun-solaris2.10/bin/ -B/home/tools/solaris2013/sparc-sun-solaris2.10/lib/ -isystem /home/tools/solaris2013/sparc-sun-solaris2.10/include -isystem /home/tools/solaris2013/sparc-sun-solaris2.10/sys-include -g -O2 -O2 -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fPIC -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -fPIC -I. -I. -I../.././gcc -I../../../libgcc -I../../../libgcc/. -I../../../libgcc/../gcc -I../../../libgcc/../include -DHAVE_CC_TLS -o _muldi3.o -MT _muldi3.o -MD -MP -MF _muldi3.dep -DL_muldi3 -c ../../../libgcc/libgcc2.c -fvisibility=hidden -DHIDE_EXPORTS
../../../libgcc/libgcc2.c:549:17: internal compiler error: Segmentation Fault
const DWunion uu = {.ll = u};
^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
make[3]: *** [_muldi3.o] Error 1
make[3]: Leaving directory `/home/towelie/dkrause/src/solaris2013/gcc-4.8.2/BUILD/sparc-sun-solaris2.10/libgcc'
make[2]: *** [all-stage1-target-libgcc] Error 2
make[2]: Leaving directory `/home/towelie/dkrause/src/solaris2013/gcc-4.8.2/BUILD'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/home/towelie/dkrause/src/solaris2013/gcc-4.8.2/BUILD'
make: *** [all] Error 2
Suggestions?
Since GCC 4.8.2 is known to build on SPARC Solaris 10, the first thing
I would consider is which compiler you are using to build GCC.
Perhaps there is a bug in that compiler. Since you mentioned "old and
crappy equipment" the second thing I would consider is the possibility
of a hardware failure.

So: first try to repeat the build in a clean directory. If it fails
in the same way, consider the build compiler. Can you perhaps stage
the build by building an earlier version of GCC and using that to
build GCC 4.8.2?

Hope this helps.

Ian
Don Krause
2013-12-07 00:38:18 UTC
Permalink
Post by Ian Lance Taylor
Post by Don Krause
I've been trying to build gcc-4.8.2 on Solaris 10 on Sparc.
The bootstrap process gives me an "internal compiler error"
SunOS sunv210 5.10 Generic_127127-11 sun4u sparc SUNW,Sun-Fire-V210
gcc 3.4.6
make 3.81
bunutils 2.24
gcc 4.8.2 +
gmp 4.3.2
mpc 0.8.1
mpfr 2.4.2
Procedure,
expand gcc 4.8.2 into clean directory.
expand gmp, mpc, mpfr into gcc 4.8.2 tree, rename directories as appropriate.
./configure --prefix=/home/tools/solaris2013
make.
That churns for a couple hours. (yes, old and crappy equipment. No options here..)
make[4]: Leaving directory `/home/towelie/dkrause/src/solaris2013/gcc-4.8.2/BUILD/sparc-sun-solaris2.10/libgcc'
/home/towelie/dkrause/src/solaris2013/gcc-4.8.2/BUILD/./gcc/xgcc -B/home/towelie/dkrause/src/solaris2013/gcc-4.8.2/BUILD/./gcc/ -B/home/tools/solaris2013/sparc-sun-solaris2.10/bin/ -B/home/tools/solaris2013/sparc-sun-solaris2.10/lib/ -isystem /home/tools/solaris2013/sparc-sun-solaris2.10/include -isystem /home/tools/solaris2013/sparc-sun-solaris2.10/sys-include -g -O2 -O2 -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fPIC -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -fPIC -I. -I. -I../.././gcc -I../../../libgcc -I../../../libgcc/. -I../../../libgcc/../gcc -I../../../libgcc/../include -DHAVE_CC_TLS -o _muldi3.o -MT _muldi3.o -MD -MP -MF _muldi3.dep -DL_muldi3 -c ../../../libgcc/libgcc2.c -fvisibility=hidden -DHIDE_EXPORTS
../../../libgcc/libgcc2.c:549:17: internal compiler error: Segmentation Fault
const DWunion uu = {.ll = u};
^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
make[3]: *** [_muldi3.o] Error 1
make[3]: Leaving directory `/home/towelie/dkrause/src/solaris2013/gcc-4.8.2/BUILD/sparc-sun-solaris2.10/libgcc'
make[2]: *** [all-stage1-target-libgcc] Error 2
make[2]: Leaving directory `/home/towelie/dkrause/src/solaris2013/gcc-4.8.2/BUILD'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/home/towelie/dkrause/src/solaris2013/gcc-4.8.2/BUILD'
make: *** [all] Error 2
Suggestions?
Since GCC 4.8.2 is known to build on SPARC Solaris 10, the first thing
I would consider is which compiler you are using to build GCC.
Perhaps there is a bug in that compiler. Since you mentioned "old and
crappy equipment" the second thing I would consider is the possibility
of a hardware failure.
So: first try to repeat the build in a clean directory. If it fails
in the same way, consider the build compiler. Can you perhaps stage
the build by building an earlier version of GCC and using that to
build GCC 4.8.2?
Hope this helps.
Ian
Still have the same problem, and this is after switching machines, with a fresh
install of Sparc Solaris10, a new user, no environment stuff set.

Building gcc-4.8.2 using gcc-3.4.6 from sunfreeware gets along far enough to create
what I believe is a stage one xgcc, then that binary crashes with an internal compiler error as above.

The build starts with Make 3.81 gcc 3.4.6 and bunutils 2.17.

I guess my only option now is to try to build an intermediate, maybe 4.2.* gcc and try it again.

Thanks!
--
Don Krause
Kai Ruottu
2013-12-07 08:19:11 UTC
Permalink
Post by Don Krause
Post by Ian Lance Taylor
Post by Don Krause
I've been trying to build gcc-4.8.2 on Solaris 10 on Sparc.
The bootstrap process gives me an "internal compiler error"
./configure --prefix=/home/tools/solaris2013
make.
That churns for a couple hours. (yes, old and crappy equipment. No options here..)
../../../libgcc/libgcc2.c:549:17: internal compiler error: Segmentation Fault
const DWunion uu = {.ll = u};
^
Suggestions?
Since GCC 4.8.2 is known to build on SPARC Solaris 10, the first thing
I would consider is which compiler you are using to build GCC.
Can you perhaps stage the build by building an earlier version of GCC and using that to
build GCC 4.8.2?
Still have the same problem, and this is after switching machines, with a fresh
install of Sparc Solaris10, a new user, no environment stuff set.
Building gcc-4.8.2 using gcc-3.4.6 from sunfreeware gets along far enough to create
what I believe is a stage one xgcc, then that binary crashes with an internal compiler error as above.
The build starts with Make 3.81 gcc 3.4.6 and bunutils 2.17.
I guess my only option now is to try to build an intermediate, maybe 4.2.* gcc and try it again.
Maybe only using the '--disable-build-with-cxx' could succeed... Using
an intermediate GCC 4.x could however
be the only working way. But whether gcc-4.2 is enough I'm not sure :(

Using the g++-4.1.2 (like in CentOS5) has caused some build crashes when
using the current '--enable-build-with-cxx'
default in the GCC build. So I myself have used g++-4.6 or g++-4.7 as
the minimum with g++ as the build compiler.
Don Krause
2013-12-10 01:31:48 UTC
Permalink
Post by Don Krause
Post by Ian Lance Taylor
Post by Don Krause
I've been trying to build gcc-4.8.2 on Solaris 10 on Sparc.
The bootstrap process gives me an "internal compiler error"
./configure --prefix=/home/tools/solaris2013
make.
That churns for a couple hours. (yes, old and crappy equipment. No options here..)
../../../libgcc/libgcc2.c:549:17: internal compiler error: Segmentation Fault
const DWunion uu = {.ll = u};
^
Suggestions?
Since GCC 4.8.2 is known to build on SPARC Solaris 10, the first thing
I would consider is which compiler you are using to build GCC.
Can you perhaps stage the build by building an earlier version of GCC and using that to
build GCC 4.8.2?
Still have the same problem, and this is after switching machines, with a fresh
install of Sparc Solaris10, a new user, no environment stuff set.
Building gcc-4.8.2 using gcc-3.4.6 from sunfreeware gets along far enough to create
what I believe is a stage one xgcc, then that binary crashes with an internal compiler error as above.
The build starts with Make 3.81 gcc 3.4.6 and bunutils 2.17.
I guess my only option now is to try to build an intermediate, maybe 4.2.* gcc and try it again.
Maybe only using the '--disable-build-with-cxx' could succeed... Using an intermediate GCC 4.x could however
be the only working way. But whether gcc-4.2 is enough I'm not sure :(
Using the g++-4.1.2 (like in CentOS5) has caused some build crashes when using the current '--enable-build-with-cxx'
default in the GCC build. So I myself have used g++-4.6 or g++-4.7 as the minimum with g++ as the build compiler.
Well, I was successful at building 4.7.3 on my old Ultra 10, which is likely more than good enough for what I needed.

But, because the host isn't doing anything else, I'm now trying to build 4.8.2 again with 4.7.3. We'll see.

Thanks everyone!
--
Don Krause
Kai Ruottu
2013-12-10 16:03:13 UTC
Permalink
Post by Don Krause
Post by Don Krause
I've been trying to build gcc-4.8.2 on Solaris 10 on Sparc.
The bootstrap process gives me an "internal compiler error"
./configure --prefix=/home/tools/solaris2013
make.
That churns for a couple hours. (yes, old and crappy equipment. No options here..)
../../../libgcc/libgcc2.c:549:17: internal compiler error: Segmentation Fault
const DWunion uu = {.ll = u};
Well, I was successful at building 4.7.3 on my old Ultra 10, which is likely more than good enough for what I needed.
But, because the host isn't doing anything else, I'm now trying to build 4.8.2 again with 4.7.3. We'll see.
When the native build "churns for a couple hours" one possibility for
making tools for Sparc/Solaris 10
could be via crosscompiling on some much quicker host. But unfortunately
gcc-4.8.2 seems to be broken
because the Canadian Cross process on an older CentOS 5.10 Linux/x86
system ended with :

g++ -c -Os -DIN_GCC -fno-exceptions -fno-rtti
-fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long
-Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H
-DGENERATOR_FILE -I. -Ibuild -I../../gcc -I../../gcc/build
-I../../gcc/../include -I../../gcc/../libcpp/include
-I/home/src/gcc-4.8.2/build/./gmp -I/home/src/gcc-4.8.2/gmp
-I/home/src/gcc-4.8.2/build/./mpfr -I/home/src/gcc-4.8.2/mpfr
-I/home/src/gcc-4.8.2/mpc/src -I../../gcc/../libdecnumber
-I../../gcc/../libdecnumber/dpd -I../libdecnumber
-I../../gcc/../libbacktrace \
-o build/genconstants.o ../../gcc/genconstants.c
cc1plus: error: unrecognized command line option "-Wno-narrowing"
cc1plus: error: unrecognized command line option "-Wno-overlength-strings"
make[2]: *** [build/genconstants.o] Virhe 1
make[2]: Poistutaan hakemistosta "/home/src/gcc-4.8.2/build/gcc"
make[1]: *** [all-gcc] Virhe 2

The build G++ was the native g++-4.1.2 :

[***@localhost build]# g++ -v
Reading specs from /usr/lib/gcc/i386-redhat-linux/4.1.2/specs
Target: i386-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-libgcj-multifile
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada
--enable-java-awt=gtk --disable-dssi --disable-plugin
--with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre
--with-cpu=generic --host=i386-redhat-linux
Thread model: posix
gcc version 4.1.2 20080704 (Red Hat 4.1.2-54)

which seemingly didn't grok the "-Wno-narrowing" and
"-Wno-overlength-strings" options.
On a newer Linux/x86_64 system the build then ended later with :

make[2]: Siirrytään hakemistoon "/home/src/gcc-4.8.2/build/gcc"
sparc-solaris2.10-g++-4.8 -c -DGENERATOR_FILE -Os -DIN_GCC
-fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall
-Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute
-pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings
-DHAVE_CONFIG_H -I. -I. -I../../gcc -I../../gcc/. -I../../gcc/../include
-I../../gcc/../libcpp/include -I/home/src/gcc-4.8.2/build/./gmp
-I/home/src/gcc-4.8.2/gmp -I/home/src/gcc-4.8.2/build/./mpfr
-I/home/src/gcc-4.8.2/mpfr -I/home/src/gcc-4.8.2/mpc/src
-I../../gcc/../libdecnumber -I../../gcc/../libdecnumber/dpd
-I../libdecnumber -I../../gcc/../libbacktrace ../../gcc/gengtype.c -o
gengtype.o
In file included from ../../gcc/gengtype.c:25:0:
../../gcc/gengtype.c: In function 'void error_at_line(const fileloc*,
const char*, ...)':
../../gcc/system.h:93:53: error: 'fputc_unlocked' was not declared in
this scope
# define fputc(C, Stream) fputc_unlocked (C, Stream)
^
../../gcc/gengtype.c:117:3: note: in expansion of macro 'fputc'
fputc ('\n', stderr);
^
Googling with the error message gave an explanation and some patch:

http://git.yoctoproject.org/cgit.cgi/poky/plain/meta/recipes-devtools/gcc/gcc-4.8/0044-gengtypes.patch

Sad that this bug wasn't yet fixed in gcc-4.8.2 :(
Don Krause
2013-12-11 01:22:45 UTC
Permalink
Post by Don Krause
Post by Don Krause
I've been trying to build gcc-4.8.2 on Solaris 10 on Sparc.
The bootstrap process gives me an "internal compiler error"
./configure --prefix=/home/tools/solaris2013
make.
That churns for a couple hours. (yes, old and crappy equipment. No options here..)
../../../libgcc/libgcc2.c:549:17: internal compiler error: Segmentation Fault
const DWunion uu = {.ll = u};
Well, I was successful at building 4.7.3 on my old Ultra 10, which is likely more than good enough for what I needed.
But, because the host isn't doing anything else, I'm now trying to build 4.8.2 again with 4.7.3. We'll see.
When the native build "churns for a couple hours" one possibility for making tools for Sparc/Solaris 10
could be via crosscompiling on some much quicker host. But unfortunately gcc-4.8.2 seems to be broken
g++ -c -Os -DIN_GCC -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -Ibuild -I../../gcc -I../../gcc/build -I../../gcc/../include -I../../gcc/../libcpp/include -I/home/src/gcc-4.8.2/build/./gmp -I/home/src/gcc-4.8.2/gmp -I/home/src/gcc-4.8.2/build/./mpfr -I/home/src/gcc-4.8.2/mpfr -I/home/src/gcc-4.8.2/mpc/src -I../../gcc/../libdecnumber -I../../gcc/../libdecnumber/dpd -I../libdecnumber -I../../gcc/../libbacktrace \
-o build/genconstants.o ../../gcc/genconstants.c
cc1plus: error: unrecognized command line option "-Wno-narrowing"
cc1plus: error: unrecognized command line option "-Wno-overlength-strings"
make[2]: *** [build/genconstants.o] Virhe 1
make[2]: Poistutaan hakemistosta "/home/src/gcc-4.8.2/build/gcc"
make[1]: *** [all-gcc] Virhe 2
Reading specs from /usr/lib/gcc/i386-redhat-linux/4.1.2/specs
Target: i386-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --disable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=i386-redhat-linux
Thread model: posix
gcc version 4.1.2 20080704 (Red Hat 4.1.2-54)
which seemingly didn't grok the "-Wno-narrowing" and "-Wno-overlength-strings" options.
make[2]: SiirrytÀÀn hakemistoon "/home/src/gcc-4.8.2/build/gcc"
sparc-solaris2.10-g++-4.8 -c -DGENERATOR_FILE -Os -DIN_GCC -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -I. -I. -I../../gcc -I../../gcc/. -I../../gcc/../include -I../../gcc/../libcpp/include -I/home/src/gcc-4.8.2/build/./gmp -I/home/src/gcc-4.8.2/gmp -I/home/src/gcc-4.8.2/build/./mpfr -I/home/src/gcc-4.8.2/mpfr -I/home/src/gcc-4.8.2/mpc/src -I../../gcc/../libdecnumber -I../../gcc/../libdecnumber/dpd -I../libdecnumber -I../../gcc/../libbacktrace ../../gcc/gengtype.c -o gengtype.o
../../gcc/system.h:93:53: error: 'fputc_unlocked' was not declared in this scope
# define fputc(C, Stream) fputc_unlocked (C, Stream)
^
../../gcc/gengtype.c:117:3: note: in expansion of macro 'fputc'
fputc ('\n', stderr);
^
http://git.yoctoproject.org/cgit.cgi/poky/plain/meta/recipes-devtools/gcc/gcc-4.8/0044-gengtypes.patch
Sad that this bug wasn't yet fixed in gcc-4.8.2 :(
I considered cross compiling it, but given my timeline, it wasn't too bad to start compiling 4.7.3 on this host, then leaving for the night.

4.7.3 was finished when I came in the next morning. (less that about 16 hours.)

On the other hand, building 4.8.2 with 4.7.3 on this old Ultra 10 has been grinding away now for more than 27 hours.. (But hey, at least it's compiling.
That's a huge improvement over building it with 3.4.6..)

--
Don Krause

Jonathan Wakely
2013-12-05 23:46:16 UTC
Permalink
Post by Don Krause
make.
That churns for a couple hours. (yes, old and crappy equipment. No options here..)
I have nothing helpful to add that unless your crappy equipment is
more than eight years old then "make -j 2" will probably speed things
up, and if it can handle more than two threads at once then "make -j
4" will probably speed it up further.
Loading...