Created attachment 48860 [details] build.log.bz2 Building GCC with multiple make jobs appears to trigger a race condition. The build often fails with: > /var/tmp/portage/sys-devel/gcc-10.1.0-r1/work/build/./gcc/xgcc -B/var/tmp/portage/sys-devel/gcc-10.1.0-r1/work/build/./gcc/ -xc++ -nostdinc /dev/null -S -o /dev/null -fself-test=/var/tmp/portage/sys-devel/gcc-10.1.0-r1/work/gcc-10.1.0/gcc/testsuite/selftests > /bin/bash: /var/tmp/portage/sys-devel/gcc-10.1.0-r1/work/build/./gcc/xgcc: No such file or directory > make[3]: *** [/var/tmp/portage/sys-devel/gcc-10.1.0-r1/work/gcc-10.1.0/gcc/cp/Make-lang.in:178: s-selftest-c++] Error 127 This has been noticeable at least since GCC-9.x. Reported downstream at https://bugs.gentoo.org/728304. Likely related to https://github.com/cirosantilli/linux-kernel-module-cheat/issues/108 uname: Linux Laptop-PC 5.7.8-gentoo #1 SMP Fri Jul 10 04:05:05 EDT 2020 x86_64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz GenuineIntel GNU/Linux
Created attachment 48861 [details] gcc-10.1.0-xgcc-selftest-makeopts.patch This patch appears to resolve the issue on my end
Makefile.in: GCC_PASSES=xgcc$(exeext) specs SELFTEST_DEPS = $(GCC_PASSES) stmp-int-hdrs $(srcdir)/testsuite/selftests c/Make-lang.in C_SELFTEST_DEPS = cc1$(exeext) $(SELFTEST_DEPS) ... s-selftest-c: $(C_SELFTEST_DEPS) cp/Make-lang.in: CPP_SELFTEST_DEPS = cc1plus$(exeext) $(SELFTEST_DEPS) ... selftest-c++: s-selftest-c++ ... s-selftest-c++: $(CPP_SELFTEST_DEPS) ---- CUT --- This looks correct to me. xgcc is there already in the depends of s-selftest-c++. Which make version are you using?
> Which make version are you using? GNU Make 4.3
The offending command is > /var/tmp/portage/sys-devel/gcc-10.1.0-r1/work/build/./gcc/xgcc -B/var/tmp/portage/sys-devel/gcc-10.1.0-r1/work/build/./gcc/ -xc++ -nostdinc /dev/null -S -o /dev/null -fself-test=/var/tmp/portage/sys-devel/gcc-10.1.0-r1/work/gcc-10.1.0/gcc/testsuite/selftests I would presume that there's no reason why gcc would emit "-o /dev/null" though I have seen it whaile using ccache. Looking further at https://github.com/buildroot/buildroot/commit/58ecbbc3ef18c43ae1c02a5c4bf30aa7ef2d8092, with regard to s-selftest-c: > The problem only occurs when ccache is used with gcc 9 and 10, > probably due to a race condition. > > While debuging with "make -p" we can notice that s-selftest-c target > contain only "cc1" as dependency instead of cc1 and SELFTEST_DEPS [4]. > > s-selftest-c: cc1 > > While the build is failing, the s-selftest-c dependencies recipe is > still running and reported as a bug by make. > > "Dependencies recipe running (THIS IS A BUG)." > > A change [5] in gcc 9 seems to introduce the problem since we can't > reproduce this problem with gcc 8. So this is likely a ccache bug.
Has been fixed since June of last year with r11-881.
*** Bug 95840 has been marked as a duplicate of this bug. ***