]> code.ossystems Code Review - openembedded-core.git/commitdiff
gcc: fix missing dependencies for selftests
authorSteve Sakoman <steve@sakoman.com>
Tue, 5 Oct 2021 23:39:20 +0000 (13:39 -1000)
committerSteve Sakoman <steve@sakoman.com>
Tue, 19 Oct 2021 14:04:49 +0000 (04:04 -1000)
Building GCC with multiple make jobs appears to trigger a race condition.  The build fails with:

/bin/bash: TOPDIR/tmp/work/x86_64-linux/gcc-cross-i686/9.3.0-r0/gcc-9.3.0/build.x86_64-linux.i686-poky-linux/./gcc/xgcc: No such file or directory

Signed-off-by: Steve Sakoman <steve@sakoman.com>
meta/recipes-devtools/gcc/gcc-9.3.inc
meta/recipes-devtools/gcc/gcc-9.3/0040-fix-missing-dependencies-for-selftests.patch [new file with mode: 0644]

index 1c8e3df51d9116f95106783a298188a8ebfba62a..235576e627e357913e825cd9054c2cf3b7eb6615 100644 (file)
@@ -69,6 +69,7 @@ SRC_URI = "\
            file://0037-CVE-2019-14250-Check-zero-value-in-simple_object_elf.patch \
            file://0038-gentypes-genmodes-Do-not-use-__LINE__-for-maintainin.patch \
            file://0039-process_alt_operands-Don-t-match-user-defined-regs-o.patch \
+           file://0040-fix-missing-dependencies-for-selftests.patch \
            file://0001-aarch64-New-Straight-Line-Speculation-SLS-mitigation.patch \
            file://0002-aarch64-Introduce-SLS-mitigation-for-RET-and-BR-inst.patch \
            file://0003-aarch64-Mitigate-SLS-for-BLR-instruction.patch \
diff --git a/meta/recipes-devtools/gcc/gcc-9.3/0040-fix-missing-dependencies-for-selftests.patch b/meta/recipes-devtools/gcc/gcc-9.3/0040-fix-missing-dependencies-for-selftests.patch
new file mode 100644 (file)
index 0000000..c8960c6
--- /dev/null
@@ -0,0 +1,45 @@
+From b19d8aac15649f31a7588b2634411a1922906ea8 Mon Sep 17 00:00:00 2001
+From: Romain Naour <romain.naour@gmail.com>
+Date: Wed, 3 Jun 2020 12:30:57 -0600
+Subject: [PATCH] Fix missing dependencies for selftests which occasionally
+ causes failed builds.
+
+gcc/
+
+       * Makefile.in (SELFTEST_DEPS): Move before including language makefile
+       fragments.
+       
+Upstream-Status: Backport [https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=b19d8aac15649f31a7588b2634411a1922906ea8]
+Signed-off-by:Steve Sakoman <steve@sakoman.com>
+
+---
+ gcc/Makefile.in | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/gcc/Makefile.in b/gcc/Makefile.in
+index aab1dbba57b..be11311b60d 100644
+--- a/gcc/Makefile.in
++++ b/gcc/Makefile.in
+@@ -1735,6 +1735,10 @@ $(FULL_DRIVER_NAME): ./xgcc$(exeext)
+       $(LN_S) $< $@
+ #\f
++# SELFTEST_DEPS need to be set before including language makefile fragments.
++# Otherwise $(SELFTEST_DEPS) is empty when used from <LANG>/Make-lang.in.
++SELFTEST_DEPS = $(GCC_PASSES) stmp-int-hdrs $(srcdir)/testsuite/selftests
++
+ # Language makefile fragments.
+ # The following targets define the interface between us and the languages.
+@@ -2010,8 +2014,6 @@ DEVNULL=$(if $(findstring mingw,$(build)),nul,/dev/null)
+ SELFTEST_FLAGS = -nostdinc $(DEVNULL) -S -o $(DEVNULL) \
+       -fself-test=$(srcdir)/testsuite/selftests
+-SELFTEST_DEPS = $(GCC_PASSES) stmp-int-hdrs $(srcdir)/testsuite/selftests
+-
+ # Run the selftests during the build once we have a driver and the frontend,
+ # so that self-test failures are caught as early as possible.
+ # Use "s-selftest-FE" to ensure that we only run the selftests if the
+-- 
+2.27.0
+