I occasionally get a build failure in libgcc when doing a scratch build (onx86_64-unknown-linux-gnu) , and if I simply do another make, it works fine. I am always building with make -j16, so its never been easy to spot.

This morning, it happened to fail in such a way that I can sort of see whats going on for a change. well I thought so anyway

The problem is building libgcc.

(small log snippet at the bottom)
compilation of libgcc/libgcov-interface.c is spawned, in particular (1) the _gcov_reset.o portion. meanwhile, a bit later, but presumably in parallel, (2) gthr-default.h is linked to a source file.
but too late!!!! (3), _gcov_reset has already failed looking for it.

Now if I type make, everything builds to completion because the file is there.


However, as I look into it deeper, It doesn't seem to be quite that simple.. Looking at the detailed dates of files in the 32 bit directory (where I think it worked), (sorted using --time-style=full-iso)
<...>
-rw-rw-r--. 1 amacleod amacleod 8129 2015-07-15 08:57:23.745914123 -0400 _gcov_execvp.dep -rw-rw-r--. 1 amacleod amacleod 8128 2015-07-15 08:57:23.745914123 -0400 _gcov_execv.dep -rw-rw-r--. 1 amacleod amacleod 8129 2015-07-15 08:57:23.755914124 -0400 _gcov_execve.dep -rw-rw-r--. 1 amacleod amacleod 8129 2015-07-15 08:57:23.779914126 -0400 _gcov_execle.dep -rw-rw-r--. 1 amacleod amacleod 12520 2015-07-15 08:57:23.781914126 -0400 _gcov_execvp.o -rw-rw-r--. 1 amacleod amacleod 12516 2015-07-15 08:57:23.787914127 -0400 _gcov_execv.o -rw-rw-r--. 1 amacleod amacleod 12552 2015-07-15 08:57:23.823914130 -0400 _gcov_execve.o lrwxrwxrwx. 1 amacleod amacleod 39 2015-07-15 08:57:23.841914132 -0400 gthr-default.h -> /gcc/2015-07-14/gcc/libgcc/gthr-posix.h -rw-rw-r--. 1 amacleod amacleod 8129 2015-07-15 08:57:23.854914133 -0400 _gcov_execlp.dep -rw-rw-r--. 1 amacleod amacleod 13268 2015-07-15 08:57:23.860914134 -0400 _gcov_execle.o -rw-rw-r--. 1 amacleod amacleod 13216 2015-07-15 08:57:23.885914136 -0400 _gcov_execlp.o -rw-rw-r--. 1 amacleod amacleod 8128 2015-07-15 08:57:23.895914137 -0400 _gcov_reset.dep -rw-rw-r--. 1 amacleod amacleod 14184 2015-07-15 08:57:23.954914142 -0400 _gcov_reset.o
<...>

It looks like configure is running WHILE compilation is happening, and _gcov_reset.o just happens to be spawned *late* enough in my case above that the file isnt quite there yet... Although that doesnt make sense either.. although why are some .o's older than the header file.. OR gthr-default.h is being created a second time when configuring for the non-32 bit (or vice versa). But that doesnt make sense either since when I look at the other directory I see something similar.
<...>
-rw-rw-r--. 1 amacleod amacleod 18008 2015-07-15 08:57:22.678914029 -0400 _gcov_execvp.o -rw-rw-r--. 1 amacleod amacleod 19192 2015-07-15 08:57:22.706914031 -0400 _gcov_execl.o -rw-rw-r--. 1 amacleod amacleod 26464 2015-07-15 08:57:22.712914032 -0400 _gcov_indirect_call_topn_profiler.o -rw-rw-r--. 1 amacleod amacleod 8087 2015-07-15 08:57:22.720914032 -0400 _gcov_execve.dep -rw-rw-r--. 1 amacleod amacleod 8086 2015-07-15 08:57:22.720914032 -0400 _gcov_execv.dep lrwxrwxrwx. 1 amacleod amacleod 39 2015-07-15 08:57:22.723914032 -0400 gthr-default.h -> /gcc/2015-07-14/gcc/libgcc/gthr-posix.h -rw-rw-r--. 1 amacleod amacleod 19296 2015-07-15 08:57:22.729914033 -0400 _gcov_execle.o -rw-rw-r--. 1 amacleod amacleod 18688 2015-07-15 08:57:22.730914033 -0400 _gcov_fork.o -rw-rw-r--. 1 amacleod amacleod 18008 2015-07-15 08:57:22.754914035 -0400 _gcov_execv.o -rw-rw-r--. 1 amacleod amacleod 18184 2015-07-15 08:57:22.760914036 -0400 _gcov_execve.o
<...>

The only other thing I can think of is maybe the configure bits are being run in parallel somehow with the build? , or maybe re-run more than once and my file got unlucky enough to be looking for this one at eactly the wrong moment? To be fair, the config output isnt obvious whether its creating gthr-default in the 64 or 32 bit directory.. making it difficult to figure whats going on, but it does seem interleaved and the timestamps are fishy looking to me.

Im not very good with configure and Makefiles and how we parallelize this... Anyone with any bright ideas?


Andrew



config.status: linking /gcc/2015-07-14/gcc/libgcc/unwind-generic.h to unwind.h /gcc/2015-07-14/build/./gcc/xgcc -B/gcc/2015-07-14/build/./gcc/ -B/gcc/2015-07-14/install/x86_64-unknown-linux-gnu/bin/ -B/gcc/2015-07-14/install/x86_64-unknown-linux-gnu/lib/ -isystem /gcc/2015-07-14/install/x86_64-unknown-linux-gnu/include -isystem /gcc/2015-07-14/install/x86_64-unknown-linux-gnu/sys-include -g -O2 -O2 -g -O2 -DIN_GCC -fPIC -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fpic -mlong-double-80 -DUSE_ELF_SYMVER -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -fpic -mlong-double-80 -DUSE_ELF_SYMVER -I. -I. -I../.././gcc -I/gcc/2015-07-14/gcc/libgcc -I/gcc/2015-07-14/gcc/libgcc/. -I/gcc/2015-07-14/gcc/libgcc/../gcc -I/gcc/2015-07-14/gcc/libgcc/../include -I/gcc/2015-07-14/gcc/libgcc/config/libbid -DENABLE_DECIMAL_BID_FORMAT -DHAVE_CC_TLS -DUSE_TLS -o _gcov_execve.o -MT _gcov_execve.o -MD -MP -MF _gcov_execve.dep -DL_gcov_execve -c /gcc/2015-07-14/gcc/libgcc/libgcov-interface.c

(1)

/gcc/2015-07-14/build/./gcc/xgcc -B/gcc/2015-07-14/build/./gcc/ -B/gcc/2015-07-14/install/x86_64-unknown-linux-gnu/bin/ -B/gcc/2015-07-14/install/x86_64-unknown-linux-gnu/lib/ -isystem /gcc/2015-07-14/install/x86_64-unknown-linux-gnu/include -isystem /gcc/2015-07-14/install/x86_64-unknown-linux-gnu/sys-include -g -O2 -O2 -g -O2 -DIN_GCC -fPIC -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fpic -mlong-double-80 -DUSE_ELF_SYMVER -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -fpic -mlong-double-80 -DUSE_ELF_SYMVER -I. -I. -I../.././gcc -I/gcc/2015-07-14/gcc/libgcc -I/gcc/2015-07-14/gcc/libgcc/. -I/gcc/2015-07-14/gcc/libgcc/../gcc -I/gcc/2015-07-14/gcc/libgcc/../include -I/gcc/2015-07-14/gcc/libgcc/config/libbid -DENABLE_DECIMAL_BID_FORMAT -DHAVE_CC_TLS -DUSE_TLS -o _gcov_reset.o -MT _gcov_reset.o -MD -MP -MF _gcov_reset.dep -DL_gcov_reset -c /gcc/2015-07-14/gcc/libgcc/libgcov-interface.c /gcc/2015-07-14/build/./gcc/xgcc -B/gcc/2015-07-14/build/./gcc/ -B/gcc/2015-07-14/install/x86_64-unknown-linux-gnu/bin/ -B/gcc/2015-07-14/install/x86_64-unknown-linux-gnu/lib/ -isystem /gcc/2015-07-14/install/x86_64-unknown-linux-gnu/include -isystem /gcc/2015-07-14/install/x86_64-unknown-linux-gnu/sys-include -g -O2 -O2 -g -O2 -DIN_GCC -fPIC -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fpic -mlong-double-80 -DUSE_ELF_SYMVER -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -fpic -mlong-double-80 -DUSE_ELF_SYMVER -I. -I. -I../.././gcc -I/gcc/2015-07-14/gcc/libgcc -I/gcc/2015-07-14/gcc/libgcc/. -I/gcc/2015-07-14/gcc/libgcc/../gcc -I/gcc/2015-07-14/gcc/libgcc/../include -I/gcc/2015-07-14/gcc/libgcc/config/libbid -DENABLE_DECIMAL_BID_FORMAT -DHAVE_CC_TLS -DUSE_TLS -o _gcov.o -MT _gcov.o -MD -MP -MF _gcov.dep -DL_gcov -c /gcc/2015-07-14/gcc/libgcc/libgcov-driver.c config.status: linking /gcc/2015-07-14/gcc/libgcc/config/i386/linux-unwind.h to md-unwind-support.h /gcc/2015-07-14/build/./gcc/xgcc -B/gcc/2015-07-14/build/./gcc/ -B/gcc/2015-07-14/install/x86_64-unknown-linux-gnu/bin/ -B/gcc/2015-07-14/install/x86_64-unknown-linux-gnu/lib/ -isystem /gcc/2015-07-14/install/x86_64-unknown-linux-gnu/include -isystem /gcc/2015-07-14/install/x86_64-unknown-linux-gnu/sys-include -g -O2 -O2 -g -O2 -DIN_GCC -fPIC -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fpic -mlong-double-80 -DUSE_ELF_SYMVER -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -fpic -mlong-double-80 -DUSE_ELF_SYMVER -I. -I. -I../.././gcc -I/gcc/2015-07-14/gcc/libgcc -I/gcc/2015-07-14/gcc/libgcc/. -I/gcc/2015-07-14/gcc/libgcc/../gcc -I/gcc/2015-07-14/gcc/libgcc/../include -I/gcc/2015-07-14/gcc/libgcc/config/libbid -DENABLE_DECIMAL_BID_FORMAT -DHAVE_CC_TLS -DUSE_TLS -o unwind-dw2.o -MT unwind-dw2.o -MD -MP -MF unwind-dw2.dep -fexceptions -c /gcc/2015-07-14/gcc/libgcc/unwind-dw2.c -fvisibility=hidden -DHIDE_EXPORTS
if [ -z "32" ]; then \
  true; \
else \
  rootpre=`${PWDCMD-pwd}`/; export rootpre; \
srcrootpre=`cd /gcc/2015-07-14/gcc/libgcc; ${PWDCMD-pwd}`/; export srcrootpre; \
  lib=`echo "${rootpre}" | sed -e 's,^.*/\([^/][^/]*\)/$,\1,'`; \
compiler="/gcc/2015-07-14/build/./gcc/xgcc -B/gcc/2015-07-14/build/./gcc/ -B/gcc/2015-07-14/install/x86_64-unknown-linux-gnu/bin/ -B/gcc/2015-07-14/install/x86_64-unknown-linux-gnu/lib/ -isystem /gcc/2015-07-14/install/x86_64-unknown-linux-gnu/include -isystem /gcc/2015-07-14/install/x86_64-unknown-linux-gnu/sys-include "; \
  for i in `${compiler} --print-multi-lib 2>/dev/null`; do \
    dir=`echo $i | sed -e 's/;.*$//'`; \
    if [ "${dir}" = "." ]; then \
      true; \
    else \
      if [ -d ../${dir}/${lib} ]; then \
    flags=`echo $i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; \
if (cd ../${dir}/${lib}; make "AR=ar" "AR_FLAGS=rc" "CC=/gcc/2015-07-14/build/./gcc/xgcc -B/gcc/2015-07-14/build/./gcc/ -B/gcc/2015-07-14/install/x86_64-unknown-linux-gnu/bin/ -B/gcc/2015-07-14/install/x86_64-unknown-linux-gnu/lib/ -isystem /gcc/2015-07-14/install/x86_64-unknown-linux-gnu/include -isystem /gcc/2015-07-14/install/x86_64-unknown-linux-gnu/sys-include " "CFLAGS=-g -O2" "DESTDIR=" "EXTRA_OFILES=" "HDEFINES=" "INSTALL=/usr/bin/install -c" "INSTALL_DATA=/usr/bin/install -c -m 644" "INSTALL_PROGRAM=/usr/bin/install -c" "LDFLAGS=" "LOADLIBES=" "RANLIB=ranlib" "SHELL=/bin/sh" "prefix=/gcc/2015-07-14/install" "exec_prefix=/gcc/2015-07-14/install" "libdir=/gcc/2015-07-14/install/lib" "libsubdir=/gcc/2015-07-14/install/lib/gcc/x86_64-unknown-linux-gnu/6.0.0" "tooldir=/gcc/2015-07-14/install/x86_64-unknown-linux-gnu" \
            CFLAGS="-g -O2 ${flags}" \
            CCASFLAGS=" ${flags}" \
            FCFLAGS=" ${flags}" \
            FFLAGS=" ${flags}" \
            ADAFLAGS=" ${flags}" \
            prefix="/gcc/2015-07-14/install" \
            exec_prefix="/gcc/2015-07-14/install" \
            GCJFLAGS=" ${flags}" \
            GOCFLAGS="-O2 -g ${flags}" \
            CXXFLAGS="-g -O2 -D_GNU_SOURCE ${flags}" \
            LIBCFLAGS="-g -O2 ${flags}" \
LIBCXXFLAGS="-g -O2 -D_GNU_SOURCE -fno-implicit-templates ${flags}" \
            LDFLAGS=" ${flags}" \
            MULTIFLAGS="${flags}" \
            DESTDIR="" \
            INSTALL="/usr/bin/install -c" \
            INSTALL_DATA="/usr/bin/install -c -m 644" \
            INSTALL_PROGRAM="/usr/bin/install -c" \
            INSTALL_SCRIPT="/usr/bin/install -c" \
            all); then \
      true; \
    else \
      exit 1; \
    fi; \
      else true; \
      fi; \
    fi; \
  done; \
fi
/gcc/2015-07-14/build/./gcc/xgcc -B/gcc/2015-07-14/build/./gcc/ -B/gcc/2015-07-14/install/x86_64-unknown-linux-gnu/bin/ -B/gcc/2015-07-14/install/x86_64-unknown-linux-gnu/lib/ -isystem /gcc/2015-07-14/install/x86_64-unknown-linux-gnu/include -isystem /gcc/2015-07-14/install/x86_64-unknown-linux-gnu/sys-include -g -O2 -O2 -g -O2 -DIN_GCC -fPIC -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fpic -mlong-double-80 -DUSE_ELF_SYMVER -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -fpic -mlong-double-80 -DUSE_ELF_SYMVER -I. -I. -I../.././gcc -I/gcc/2015-07-14/gcc/libgcc -I/gcc/2015-07-14/gcc/libgcc/. -I/gcc/2015-07-14/gcc/libgcc/../gcc -I/gcc/2015-07-14/gcc/libgcc/../include -I/gcc/2015-07-14/gcc/libgcc/config/libbid -DENABLE_DECIMAL_BID_FORMAT -DHAVE_CC_TLS -DUSE_TLS -o unwind-dw2-fde-dip.o -MT unwind-dw2-fde-dip.o -MD -MP -MF unwind-dw2-fde-dip.dep -fexceptions -c /gcc/2015-07-14/gcc/libgcc/unwind-dw2-fde-dip.c -fvisibility=hidden -DHIDE_EXPORTS /gcc/2015-07-14/build/./gcc/xgcc -B/gcc/2015-07-14/build/./gcc/ -B/gcc/2015-07-14/install/x86_64-unknown-linux-gnu/bin/ -B/gcc/2015-07-14/install/x86_64-unknown-linux-gnu/lib/ -isystem /gcc/2015-07-14/install/x86_64-unknown-linux-gnu/include -isystem /gcc/2015-07-14/install/x86_64-unknown-linux-gnu/sys-include -g -O2 -O2 -g -O2 -DIN_GCC -fPIC -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fpic -mlong-double-80 -DUSE_ELF_SYMVER -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -fpic -mlong-double-80 -DUSE_ELF_SYMVER -I. -I. -I../.././gcc -I/gcc/2015-07-14/gcc/libgcc -I/gcc/2015-07-14/gcc/libgcc/. -I/gcc/2015-07-14/gcc/libgcc/../gcc -I/gcc/2015-07-14/gcc/libgcc/../include -I/gcc/2015-07-14/gcc/libgcc/config/libbid -DENABLE_DECIMAL_BID_FORMAT -DHAVE_CC_TLS -DUSE_TLS -o unwind-sjlj.o -MT unwind-sjlj.o -MD -MP -MF unwind-sjlj.dep -fexceptions -c /gcc/2015-07-14/gcc/libgcc/unwind-sjlj.c -fvisibility=hidden -DHIDE_EXPORTS config.status: linking /gcc/2015-07-14/gcc/libgcc/config/i386/sfp-machine.h to sfp-machine.h /gcc/2015-07-14/build/./gcc/xgcc -B/gcc/2015-07-14/build/./gcc/ -B/gcc/2015-07-14/install/x86_64-unknown-linux-gnu/bin/ -B/gcc/2015-07-14/install/x86_64-unknown-linux-gnu/lib/ -isystem /gcc/2015-07-14/install/x86_64-unknown-linux-gnu/include -isystem /gcc/2015-07-14/install/x86_64-unknown-linux-gnu/sys-include -g -O2 -O2 -g -O2 -DIN_GCC -fPIC -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fpic -mlong-double-80 -DUSE_ELF_SYMVER -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -fpic -mlong-double-80 -DUSE_ELF_SYMVER -I. -I. -I../.././gcc -I/gcc/2015-07-14/gcc/libgcc -I/gcc/2015-07-14/gcc/libgcc/. -I/gcc/2015-07-14/gcc/libgcc/../gcc -I/gcc/2015-07-14/gcc/libgcc/../include -I/gcc/2015-07-14/gcc/libgcc/config/libbid -DENABLE_DECIMAL_BID_FORMAT -DHAVE_CC_TLS -DUSE_TLS -o emutls.o -MT emutls.o -MD -MP -MF emutls.dep -fexceptions -c /gcc/2015-07-14/gcc/libgcc/emutls.c -fvisibility=hidden -DHIDE_EXPORTS /gcc/2015-07-14/build/./gcc/xgcc -B/gcc/2015-07-14/build/./gcc/ -B/gcc/2015-07-14/install/x86_64-unknown-linux-gnu/bin/ -B/gcc/2015-07-14/install/x86_64-unknown-linux-gnu/lib/ -isystem /gcc/2015-07-14/install/x86_64-unknown-linux-gnu/include -isystem /gcc/2015-07-14/install/x86_64-unknown-linux-gnu/sys-include -g -O2 -O2 -g -O2 -DIN_GCC -fPIC -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fpic -mlong-double-80 -DUSE_ELF_SYMVER -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -fpic -mlong-double-80 -DUSE_ELF_SYMVER -I. -I. -I../.././gcc -I/gcc/2015-07-14/gcc/libgcc -I/gcc/2015-07-14/gcc/libgcc/. -I/gcc/2015-07-14/gcc/libgcc/../gcc -I/gcc/2015-07-14/gcc/libgcc/../include -I/gcc/2015-07-14/gcc/libgcc/config/libbid -DENABLE_DECIMAL_BID_FORMAT -DHAVE_CC_TLS -DUSE_TLS -o _muldi3_s.o -MT _muldi3_s.o -MD -MP -MF _muldi3_s.dep -DSHARED -DL_muldi3 -c /gcc/2015-07-14/gcc/libgcc/libgcc2.c

(2)

config.status: linking /gcc/2015-07-14/gcc/libgcc/gthr-posix.h to gthr-default.h /gcc/2015-07-14/build/./gcc/xgcc -B/gcc/2015-07-14/build/./gcc/ -B/gcc/2015-07-14/install/x86_64-unknown-linux-gnu/bin/ -B/gcc/2015-07-14/install/x86_64-unknown-linux-gnu/lib/ -isystem /gcc/2015-07-14/install/x86_64-unknown-linux-gnu/include -isystem /gcc/2015-07-14/install/x86_64-unknown-linux-gnu/sys-include -g -O2 -O2 -g -O2 -DIN_GCC -fPIC -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fpic -mlong-double-80 -DUSE_ELF_SYMVER -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -fpic -mlong-double-80 -DUSE_ELF_SYMVER -I. -I. -I../.././gcc -I/gcc/2015-07-14/gcc/libgcc -I/gcc/2015-07-14/gcc/libgcc/. -I/gcc/2015-07-14/gcc/libgcc/../gcc -I/gcc/2015-07-14/gcc/libgcc/../include -I/gcc/2015-07-14/gcc/libgcc/config/libbid -DENABLE_DECIMAL_BID_FORMAT -DHAVE_CC_TLS -DUSE_TLS -o _negdi2_s.o -MT _negdi2_s.o -MD -MP -MF _negdi2_s.dep -DSHARED -DL_negdi2 -c /gcc/2015-07-14/gcc/libgcc/libgcc2.c

(3)

In file included from /gcc/2015-07-14/gcc/libgcc/libgcov-interface.c:27:0:
/gcc/2015-07-14/gcc/libgcc/gthr.h:148:26: fatal error: gthr-default.h: No such file or directory
compilation terminated.
Makefile:883: recipe for target '_gcov_reset.o' failed
make[3]: *** [_gcov_reset.o] Error 1
make[3]: *** Waiting for unfinished jobs....
config.status: executing default commands

Reply via email to