Re: [PATCH] Allow overriding EXPECT

2023-12-21 Thread Mike Stump
On Dec 21, 2023, at 8:49 AM, Christophe Lyon  wrote:
> 
> While investigating possible race conditions in the GCC testsuites
> caused by bufferization issues, I wanted to investigate workarounds
> similar to GDB's READ1 [1], and I noticed it was not always possible
> to override EXPECT when running 'make check'.
> 
> This patch adds the missing support in various Makefiles.

Ok.




[PATCH] Allow overriding EXPECT

2023-12-21 Thread Christophe Lyon
While investigating possible race conditions in the GCC testsuites
caused by bufferization issues, I wanted to investigate workarounds
similar to GDB's READ1 [1], and I noticed it was not always possible
to override EXPECT when running 'make check'.

This patch adds the missing support in various Makefiles.

I was not able to test the patch for all the libraries updated here,
but I confirmed it works as intended/needed for libstdc++.

libatomic, libitm, libgomp already work as intended because their
Makefiles do not have:
MAKEOVERRIDES=

Tested on (native) aarch64-linux-gnu, confirmed the patch introduces
the behaviour I want in gcc, g++, gfortran and libstdc++.

I updated (but could not test) libgm2, libphobos, libquadmath and
libssp for consistency since their Makefiles have MAKEOVERRIDES=

libffi, libgo, libsanitizer seem to need a similar update, but they
are imported from their respective upstream repo, so should not be
patched here.

[1] https://github.com/bminor/binutils-gdb/blob/master/gdb/testsuite/README#L269

2023-12-21  Christophe Lyon  

gcc/
* Makefile.in: Allow overriding EXEPCT.

libgm2/
* Makefile.am: Allow overriding EXEPCT.
* Makefile.in: Regenerate.

libphobos/
* Makefile.am: Allow overriding EXEPCT.
* Makefile.in: Regenerate.

libquadmath/
* Makefile.am: Allow overriding EXEPCT.
* Makefile.in: Regenerate.

libssp/
* Makefile.am: Allow overriding EXEPCT.
* Makefile.in: Regenerate.

libstdc++-v3/
* Makefile.am: Allow overriding EXEPCT.
* Makefile.in: Regenerate.
---
 gcc/Makefile.in  | 3 +++
 libgm2/Makefile.am   | 1 +
 libgm2/Makefile.in   | 1 +
 libphobos/Makefile.am| 1 +
 libphobos/Makefile.in| 1 +
 libquadmath/Makefile.am  | 1 +
 libquadmath/Makefile.in  | 1 +
 libssp/Makefile.am   | 1 +
 libssp/Makefile.in   | 1 +
 libstdc++-v3/Makefile.am | 1 +
 libstdc++-v3/Makefile.in | 1 +
 11 files changed, 13 insertions(+)

diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index f284c1387e2..bc35a1bd237 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -4303,6 +4303,7 @@ $(lang_checks_parallel): site.exp
vardots=`echo "$$variant" | sed 's,/,.,g'`; \
$(MAKE) TESTSUITEDIR="testsuite.$$vardots" \
  RUNTESTFLAGS="--target_board=$$variant $(RUNTESTFLAGS)" \
+ EXPECT=$(EXPECT) \
  "$$target"
 
 TESTSUITEDIR = testsuite
@@ -4368,6 +4369,7 @@ $(lang_checks_parallelized): check-% : site.exp
  
GCC_RUNTEST_PARALLELIZE_DIR=`${PWD_COMMAND}`/$(TESTSUITEDIR)/$(check_p_tool)-parallel
 ; \
  export GCC_RUNTEST_PARALLELIZE_DIR ; \
  $(MAKE) TESTSUITEDIR="$(TESTSUITEDIR)" RUNTESTFLAGS="$(RUNTESTFLAGS)" 
\
+   EXPECT=$(EXPECT) \
check-parallel-$* \
$(patsubst %,check-parallel-$*_%, $(check_p_subdirs)); \
  sums= ; logs= ; \
@@ -4386,6 +4388,7 @@ $(lang_checks_parallelized): check-% : site.exp
  rm -rf $(TESTSUITEDIR)/$*-parallel || true; \
else \
  $(MAKE) TESTSUITEDIR="$(TESTSUITEDIR)" RUNTESTFLAGS="$(RUNTESTFLAGS)" 
\
+   EXPECT=$(EXPECT) \
check_$*_parallelize= check-parallel-$*; \
fi
 
diff --git a/libgm2/Makefile.am b/libgm2/Makefile.am
index d2eadfc51aa..72391d01291 100644
--- a/libgm2/Makefile.am
+++ b/libgm2/Makefile.am
@@ -69,6 +69,7 @@ AM_MAKEFLAGS = \
"CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
"CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
 "CFLAGS_LONGDOUBLE=$(CFLAGS_LONGDOUBLE)" \
+   "EXPECT=$(EXPECT)" \
"INSTALL=$(INSTALL)" \
"INSTALL_DATA=$(INSTALL_DATA)" \
"INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
diff --git a/libgm2/Makefile.in b/libgm2/Makefile.in
index 5a96f98edc9..4c30d2b034f 100644
--- a/libgm2/Makefile.in
+++ b/libgm2/Makefile.in
@@ -371,6 +371,7 @@ AM_MAKEFLAGS = \
"CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
"CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
 "CFLAGS_LONGDOUBLE=$(CFLAGS_LONGDOUBLE)" \
+   "EXPECT=$(EXPECT)" \
"INSTALL=$(INSTALL)" \
"INSTALL_DATA=$(INSTALL_DATA)" \
"INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
diff --git a/libphobos/Makefile.am b/libphobos/Makefile.am
index d46cfef533e..307c57c8b22 100644
--- a/libphobos/Makefile.am
+++ b/libphobos/Makefile.am
@@ -38,6 +38,7 @@ AM_MAKEFLAGS = \
"CXXFLAGS=$(CXXFLAGS)" \
"CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
"CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
+   "EXPECT=$(EXPECT)" \
"GDC_FOR_TARGET=$(GDC_FOR_TARGET)" \
"GDC=$(GDC)" \
"GDCFLAGS=$(GDCFLAGS)" \
diff --git a/libphobos/Makefile.in b/libphobos/Makefile.in
index 8d62c31dab0..eef750bc46e 100644
--- a/libphobos/Makefile.in
+++ b/libphobos/Makefile.in
@@ -365,6 +365,7 @@ AM_MAKEFLAGS = \
"CXXFLAGS=$(CXXFLAGS)" \
"CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
"CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
+