http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60620

            Bug ID: 60620
           Summary: missing gnattools dependency causes highly parallel
                    build failure with --disable-bootstrap
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gnugcc at marino dot st

GCC 4.9.0 has been brought into FreeBSD ports (lang/gcc-aux) which supports 4
platforms: i386-FreeBSD, i386-DragonFly, x86_64-FreeBSD, and x86-64-DragonFly. 
On machines with low -j inputs (say -j4) it would build fine, but on powerful
machines with like -j8 or greater, we'd seen a clean jail (no base compiler lib
in path) build break on gnattools such as this:

checking for scalbnl... ../../xg++ -B../../
-B../../../x86_64-aux-freebsd10.0/libstdc++-v3/src/.libs
-B../../../x86_64-aux-freebsd10.0/libstdc++-v3/libsupc++/.libs
-L../../../x86_64-aux-freebsd10.0/libstdc++-v3/src/.libs
-L../../../x86_64-aux-freebsd10.0/libstdc++-v3/libsupc++/.libs
-static-libstdc++ -static-libgcc -I- -I../rts -I.
-I/work/a/ports/lang/gcc-aux/work/gcc-4.9-20140316/gcc/ada -static-libstdc++
-static-libgcc  -DIN_GCC  -g -O2 -W -Wall -o ../../gnatlink b_gnatl.o
gnatlink.o a-except.o ali.o alloc.o butil.o casing.o csets.o debug.o fmap.o
fname.o gnatvsn.o hostparm.o indepsw.o interfac.o i-c.o i-cstrin.o namet.o
opt.o osint.o output.o rident.o s-exctab.o s-secsta.o s-stalib.o s-stoele.o
sdefault.o snames.o stylesw.o switch.o system.o table.o targparm.o tree_io.o
types.o validsw.o widechar.o ../link.o ../targext.o ../../ggc-none.o
../../libcommon-target.a ../../libcommon.a ../../../libcpp/libcpp.a
../rts/libgnat.a ../../../intl/libintl.a 
../../../libbacktrace/.libs/libbacktrace.a ../../../libiberty/libiberty.a  
yes
checking for sinf... /usr/bin/ld: cannot find -lstdc++
collect2: error: ld returned 1 exit status
gmake[5]: *** [../../gnatlink] Error 1
gmake[5]: *** Waiting for unfinished jobs....


It seems this doesn't happen with a full bootstrap.  For reference, this is a
typical configuration:

/work/a/ports/lang/gcc-aux/work/gcc-4.9-20140316/configure
--enable-languages=c\ c++\ ada\ fortran\ objc --build=x86_64-aux-freebsd10.0
--prefix=/usr/local/gcc-aux --with-system-zlib --with-gmp=/usr/local
--with-mpfr=/usr/local --with-mpc=/usr/local  --enable-shared
--enable-threads=posix --disable-libmudflap --disable-libgomp --disable-libssp
--enable-libquadmath --enable-nls --disable-bootstrap

It appears the linking using g++ is intentional as -static-libstdc++ is passed,
so that means that libstdc++ is required to build gnattools but that dependency
is not documented.  The following patches solved the parallel build problems
with --disable-bootstrap that we were seeing:

--- Makefile.def.orig    2013-10-29 13:37:47.000000000 -0500
+++ Makefile.def
@@ -336,6 +336,7 @@ dependencies = { module=all-libcpp; on=a
 dependencies = { module=all-fixincludes; on=all-libiberty; };

 dependencies = { module=all-gnattools; on=all-target-libada; };
+dependencies = { module=all-gnattools; on=all-target-libstdc++-v3; };

 dependencies = { module=all-lto-plugin; on=all-libiberty; };


--- Makefile.in.orig    2014-03-07 07:58:27.000000000 -0500
+++ Makefile.in
@@ -46730,6 +46730,7 @@ all-stageprofile-libcpp: maybe-all-stage
 all-stagefeedback-libcpp: maybe-all-stagefeedback-intl
 all-fixincludes: maybe-all-libiberty
 all-gnattools: maybe-all-target-libada
+all-gnattools: maybe-all-target-libstdc++-v3
 all-lto-plugin: maybe-all-libiberty

 all-stage1-lto-plugin: maybe-all-stage1-libiberty


It should be a simple matter to confirm that libstdc++ is indeed required for
gnattools and that it's not listed as a dependency.  It is also possible that
gcc 4.8.x is affected by this, but I cannot say as I have never tried to build
that version, nor do I know if libstdc++ is required for gnattools there.

Reply via email to