https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87836

--- Comment #23 from Gary Mills <gary_mills at fastmail dot fm> ---
It's not Solaris, first of all.  Solaris is a closed system once again.  It's
illumos, which is derived from Opensolaris.  These are the two assemblers:

This is on SPARC hardware:
<mills@t2000:725>$ as -V
as: Sun Compiler Common 12 SunOS_sparc snv_121 08/03/2009
<mills@t2000:726>$ uname -a
SunOS t2000 5.11 master-0-g5093b3b sun4v sparc SUNW,Sun-Fire-T200

This is on x86 hardware:
<mills@tyan:545>$ as -V      
as: Sun Compiler Common 12 SunOS_i386 snv_121 08/03/2009
Usage: as [-V] [-Q{y,n}] [-s]
          [-S[aAbBcClL]] [-K {pic,PIC}] [-o objfile] [-L] [-T]
          [-P [[-Ipath] [-Dname] [-Dname=def] [-Uname]]...]
          [-m [-Ym,path]] [-n] [-xF] [-F] [-b] [-i] file.s ...
<mills@tyan:546>$ uname -a
SunOS tyan 5.11 illumos-8dfe5547fb i86pc i386 i86pc

They seem to be the same.  illumos does not have source for the assembler, only
the binaries.  They can't be changed.  illumos does have source for the
linkers.

Yes, /usr/gcc/4.9/bin/gcc and /usr/gcc/4.9/bin/g++ are the 32-bit-default
compilers.  They will produce 64-bit binaries with the -m64 option.  They are
actually 4.9.4.  I built the compilers myself, using gcc-4.4.4.

I just tried a build of gcc-7 (gcc-7.3.0) with a minimal configuration.  This
is what appears in the oldest config.log:

  $
/export/home/mills/Downloads/code/oi-userland/components/developer/gcc-7/gcc-7.3.0/configure
CC=/usr/gcc/4.9/bin/gcc CXX=/usr/gcc/4.9/bin/g++ F77=/usr/gcc/4.9/bin/gfortran
FC=/usr/gcc/4.9/bin/gfortran CFLAGS= -O3 -mno-app-regs CXXFLAGS=  FFLAGS= 
FCFLAGS= LDFLAGS=-m32 PKG_CONFIG_PATH=/usr/lib/pkgconfig --prefix=/usr/gcc/7
--mandir=/usr/gcc/7/share/man --bindir=/usr/gcc/7/bin --libdir=/usr/gcc/7/lib
--sbindir=/usr/gcc/7/sbin --sbindir=/usr/gcc/7/bin --libdir=/usr/gcc/7/lib
--libexecdir=/usr/gcc/7/lib --host sparc-sun-solaris2.11 --build
sparc-sun-solaris2.11 --target sparc-sun-solaris2.11 --without-gnu-ld
--with-ld=/usr/bin/ld --without-gnu-as --with-as=/usr/bin/as
LDFLAGS=-R/usr/gcc/7/lib

I also removed all of the patches except for one that modifies
libgcc/config.host to create crtbeginS.o and crtendS.o.  The build stopped
quite early with this error:

/usr/gcc/4.9/bin/g++ -std=gnu++98   -g -DIN_GCC     -fno-exceptions -fno-rtti
-fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wno-format -Wmissing-format-attribute -Woverloaded-virtual
-pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings
-fno-common  -DHAVE_CONFIG_H -DGENERATOR_FILE -fno-PIE -static-libstdc++
-static-libgcc -R/usr/gcc/7/lib  -o build/genmddeps \
    build/genmddeps.o build/read-md.o build/errors.o
../build-sparc-sun-solaris2.11/libiberty/libiberty.a
build/genmddeps
/export/home/mills/Downloads/code/oi-userland/components/developer/gcc-7/gcc-7.3.0/gcc/common.md
/export/home/mills/Downloads/code/oi-userland/components/developer/gcc-7/gcc-7.3.0/gcc/config/sparc/sparc.md
> tmp-mddeps
/bin/bash: line 1: 28485 Bus Error               (core dumped) build/genmddeps
/export/home/mills/Downloads/code/oi-userland/components/developer/gcc-7/gcc-7.3.0/gcc/common.md
/export/home/mills/Downloads/code/oi-userland/components/developer/gcc-7/gcc-7.3.0/gcc/config/sparc/sparc.md
> tmp-mddeps
Makefile:2240: recipe for target 's-mddeps' failed
make[4]: *** [s-mddeps] Error 138
make[4]: Leaving directory
'/dpool/export/home/mills/Downloads/code/oi-userland-apr/components/developer/gcc-7/build/sparcv7/gcc'

This is what gdb said about the core file:

(gdb) bt
#0  0x0001f7bc in __gnu_cxx::__mutex::__mutex (
    this=0x5007c <(anonymous namespace)::emergency_mutex>)
    at
/export/home/mills/Downloads/code/oi-userland/components/developer/gcc49/build/sparcv7/sparc-sun-solaris2.11/libstdc++-v3/include/ext/concurrence.h:132
#1  __static_initialization_and_destruction_0 (__priority=65535, 
    __initialize_p=1)
    at
/export/home/mills/Downloads/code/oi-userland/components/developer/gcc49/gcc-4.9.4/libstdc++-v3/libsupc++/eh_alloc.cc:96
#2  _GLOBAL__sub_I_eh_alloc.cc(void) ()
    at
/export/home/mills/Downloads/code/oi-userland/components/developer/gcc49/gcc-4.9.4/libstdc++-v3/libsupc++/eh_alloc.cc:211
#3  0x0002f19c in __do_global_ctors_aux ()
#4  0x0002f1d4 in _init ()
#5  0x000165f0 in _start ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) quit

The build didn't dump core at this point before.  Something in the
configuration must have changed its behavior.

Reply via email to