automatic dependencies

Eric Botcazou ebotcazou@adacore.com
Sun Sep 29 17:55:00 GMT 2013


> I wanted to mention this explicitly, since last time around this series
> tripped across a GNU make bug.  If you see any problems, please report
> them and CC me.  I will look into them as soon as I am able.

Are there any additional prerequisites on the GNU make version?  On a machine 
with GNU make 3.80 installed, the bootstrap consistently fails with:

/red.a/gnatmail/gcc-x/build-red/x86_64-linux/gnat/obj/./prev-gcc/xg++ -
B/red.a/gnatmail/gcc-x/build-red/x86_64-linux/gnat/obj/./prev-gcc/ -
B/usr/gnat/x86_64-pc-linux-gnu/bin/ -nostdinc++ -B/red.a/gnatmail/gcc-x/build-
red/x86_64-linux/gnat/obj/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -
B/red.a/gnatmail/gcc-x/build-red/x86_64-linux/gnat/obj/prev-x86_64-pc-linux-
gnu/libstdc++-v3/libsupc++/.libs -I/red.a/gnatmail/gcc-x/build-red/x86_64-
linux/gnat/obj/prev-x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-
gnu -I/red.a/gnatmail/gcc-x/build-red/x86_64-linux/gnat/obj/prev-x86_64-pc-
linux-gnu/libstdc++-v3/include -I/red.a/gnatmail/gcc-x/build-red/x86_64-
linux/gnat/src/libstdc++-v3/libsupc++ -L/red.a/gnatmail/gcc-x/build-
red/x86_64-linux/gnat/obj/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -
L/red.a/gnatmail/gcc-x/build-red/x86_64-linux/gnat/obj/prev-x86_64-pc-linux-
gnu/libstdc++-v3/libsupc++/.libs   -O2 -g -gtoggle -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 -Werror -fno-common  -DHAVE_CONFIG_H -static-
libstdc++ -static-libgcc  -o cc1 c/c-lang.o c-family/stub-objc.o attribs.o 
c/c-errors.o c/c-decl.o c/c-typeck.o c/c-convert.o c/c-aux-info.o c/c-objc-
common.o c/c-parser.o c/c-array-notation.o c-family/c-common.o c-family/c-
cppbuiltin.o c-family/c-dump.o c-family/c-format.o c-family/c-gimplify.o c-
family/c-lex.o c-family/c-omp.o c-family/c-opts.o c-family/c-pch.o c-family/c-
ppoutput.o c-family/c-pragma.o c-family/c-pretty-print.o c-family/c-
semantics.o c-family/c-ada-spec.o tree-mudflap.o c-family/array-notation-
common.o c-family/c-ubsan.o i386-c.o glibc-c.o \
  cc1-checksum.o libbackend.a main.o tree-browser.o libcommon-target.a 
libcommon.a ../libcpp/libcpp.a ../libdecnumber/libdecnumber.a libcommon.a 
../libcpp/libcpp.a   ../libbacktrace/.libs/libbacktrace.a 
../libiberty/libiberty.a ../libdecnumber/libdecnumber.a   -
L/red.a/gnatmail/gcc-x/build-red/x86_64-linux/libmpfr/install/lib -
L/red.a/gnatmail/gcc-x/build-red/x86_64-linux/libmpfr/install/lib -
L/red.a/gnatmail/gcc-x/build-red/x86_64-linux/libmpfr/install/lib -lmpc -lmpfr 
-lgmp -rdynamic -ldl  -L../zlib -lz
/red.a/gnatmail/gcc-x/build-red/x86_64-linux/gnat/obj/prev-x86_64-pc-linux-
gnu/libstdc++-v3/src/.libs/libstdc++.a(eh_alloc.o): In function 
`__scoped_lock':
/red.a/gnatmail/gcc-x/build-red/x86_64-linux/gnat/obj/x86_64-pc-linux-
gnu/libstdc++-v3/include/ext/concurrence.h:153: undefined reference to 
`_Unwind_Resume'
/red.a/gnatmail/gcc-x/build-red/x86_64-linux/gnat/obj/prev-x86_64-pc-linux-
gnu/libstdc++-v3/src/.libs/libstdc++.a(eh_alloc.o): In function 
`__gnu_cxx::__mutex::unlock()':
/red.a/gnatmail/gcc-x/build-red/x86_64-linux/gnat/obj/x86_64-pc-linux-
gnu/libstdc++-v3/include/ext/concurrence.h:164: undefined reference to 
`_Unwind_Resume'
/red.a/gnatmail/gcc-x/build-red/x86_64-linux/gnat/obj/prev-x86_64-pc-linux-
gnu/libstdc++-v3/src/.libs/libstdc++.a(eh_alloc.o): In function 
`__scoped_lock':
/red.a/gnatmail/gcc-x/build-red/x86_64-linux/gnat/obj/x86_64-pc-linux-
gnu/libstdc++-v3/include/ext/concurrence.h:153: undefined reference to 
`_Unwind_Resume'

The problem is that the C++ driver doesn't put -lgcc_eh on the link line, 
which means that ENABLE_SHARED_LIBGCC isn't defined.  Here's the line:

g++ -c  -DSTANDARD_STARTFILE_PREFIX=\"../../../\" -
DSTANDARD_EXEC_PREFIX=\"/usr/gnat/lib/gcc/\" -
DSTANDARD_LIBEXEC_PREFIX=\"/usr/gnat/libexec/gcc/\" -
DDEFAULT_TARGET_VERSION=\"4.9.0\" -DDEFAULT_TARGET_MACHINE=\"x86_64-pc-linux-
gnu\" -DSTANDARD_BINDIR_PREFIX=\"/usr/gnat/bin/\" -
DTOOLDIR_BASE_PREFIX=\"../../../../\"   -DCONFIGURE_SPECS="\"\"" -
DIN_GCC_FRONTEND -O2 -g -O0 -g -DIN_GCC   -fno-exceptions -fno-rtti -
fasynchronous-unwind-tables -W -Wall -Wwrite-strings -Wcast-qual -Wmissing-
format-attribute -fno-common  -DHAVE_CONFIG_H -I. -Icp -I../../src/gcc -
I../../src/gcc/cp -I../../src/gcc/../include -I../../src/gcc/../libcpp/include 
-I/red.a/gnatmail/gcc-x/build-red/x86_64-linux/libmpfr/install/include -
I/red.a/gnatmail/gcc-x/build-red/x86_64-linux/libmpfr/install/include -
I/red.a/gnatmail/gcc-x/build-red/x86_64-linux/libmpfr/install/include  -
I../../src/gcc/../libdecnumber -I../../src/gcc/../libdecnumber/bid -
I../libdecnumber -I../../src/gcc/../libbacktrace    -o cp/g++spec.o -MT 
cp/g++spec.o -MMD -MP -MF cp/.deps/g++spec.TPo ../../src/gcc/cp/g++spec.c
../../src/gcc/cp/g++spec.c: In function 'void 
lang_specific_driver(cl_decoded_option**, unsigned int*, int*)':
../../src/gcc/cp/g++spec.c:329: warning: NULL used in arithmetic

The Makefile contains:

DRIVER_DEFINES = \
  -DSTANDARD_STARTFILE_PREFIX=\"$(unlibsubdir)/\" \
  -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc/\" \
  -DSTANDARD_LIBEXEC_PREFIX=\"$(libexecdir)/gcc/\" \
  -DDEFAULT_TARGET_VERSION=\"$(version)\" \
  -DDEFAULT_TARGET_MACHINE=\"$(target_noncanonical)\" \
  -DSTANDARD_BINDIR_PREFIX=\"$(bindir)/\" \
  -DTOOLDIR_BASE_PREFIX=\"$(libsubdir_to_prefix)$(prefix_to_exec_prefix)\" \
   \
  $(VALGRIND_DRIVER_DEFINES) \
  $(and $(SHLIB),$(filter yes,yes),-DENABLE_SHARED_LIBGCC) \
  -DCONFIGURE_SPECS="\"\""

which looks correct.

-- 
Eric Botcazou



More information about the Gcc mailing list