commit:     f05ec3bd6ad1e7830fec94c1aa1770a9a411bd5c
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Aug  1 08:17:41 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Aug  1 08:17:41 2025 +0000
URL:        
https://gitweb.gentoo.org/proj/toolchain/binutils-patches.git/commit/?id=f05ec3bd

9999: add fix for race condition in gprof tests

Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...st-gmon-gprof-l.sh-after-tst-gmon-gprof.s.patch | 57 ++++++++++++++++++++++
 1 file changed, 57 insertions(+)

diff --git 
a/9999/0006-gprof-Run-tst-gmon-gprof-l.sh-after-tst-gmon-gprof.s.patch 
b/9999/0006-gprof-Run-tst-gmon-gprof-l.sh-after-tst-gmon-gprof.s.patch
new file mode 100644
index 0000000..1076168
--- /dev/null
+++ b/9999/0006-gprof-Run-tst-gmon-gprof-l.sh-after-tst-gmon-gprof.s.patch
@@ -0,0 +1,57 @@
+https://inbox.sourceware.org/binutils/[email protected]/
+
+From d752cad608e8d508e85e949a1ac0cca3b3cb3557 Mon Sep 17 00:00:00 2001
+Message-ID: 
<d752cad608e8d508e85e949a1ac0cca3b3cb3557.1754036184.git....@gentoo.org>
+From: "H.J. Lu" <[email protected]>
+Date: Thu, 31 Jul 2025 06:34:39 -0700
+Subject: [PATCH] gprof: Run tst-gmon-gprof-l.sh after tst-gmon-gprof.sh
+
+Both tst-gmon-gprof.sh and tst-gmon-gprof-l.sh generate gmon.out and
+process it.  Run tst-gmon-gprof-l.sh after tst-gmon-gprof.sh to avoid
+the race condition.
+
+       * testsuite/Makefile.am (tst-gmon-gprof-l.out): Depend on
+       tst-gmon-gprof.out.
+       * testsuite/Makefile.in: Regenerated.
+
+Signed-off-by: H.J. Lu <[email protected]>
+---
+ gprof/testsuite/Makefile.am | 4 +++-
+ gprof/testsuite/Makefile.in | 4 +++-
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/gprof/testsuite/Makefile.am b/gprof/testsuite/Makefile.am
+index 0c80b12e6e4..7ab1c2ea6b7 100644
+--- a/gprof/testsuite/Makefile.am
++++ b/gprof/testsuite/Makefile.am
+@@ -37,7 +37,9 @@ tst-gmon-gprof.out: tst-gmon$(EXEEXT) $(GPROF)
+ 
+ check_SCRIPTS += tst-gmon-gprof-l.sh
+ check_DATA += tst-gmon-gprof-l.out
+-tst-gmon-gprof-l.out: tst-gmon$(EXEEXT) $(GPROF)
++# Run tst-gmon-gprof-l.sh after tst-gmon-gprof.sh to avoid the race
++# condition since they both generate gmon.out.
++tst-gmon-gprof-l.out: tst-gmon$(EXEEXT) $(GPROF) tst-gmon-gprof.out
+       $(srcdir)/tst-gmon-gprof-l.sh $(GPROF) tst-gmon$(EXEEXT)
+ 
+ endif NATIVE
+diff --git a/gprof/testsuite/Makefile.in b/gprof/testsuite/Makefile.in
+index 2ac5f241012..ab8a2cbb16e 100644
+--- a/gprof/testsuite/Makefile.in
++++ b/gprof/testsuite/Makefile.in
+@@ -884,7 +884,9 @@ uninstall-am:
+ @NATIVE_TRUE@ $(LINK) tst-gmon.$(OBJEXT)
+ @[email protected]: tst-gmon$(EXEEXT) $(GPROF)
+ @NATIVE_TRUE@ $(srcdir)/tst-gmon-gprof.sh $(GPROF) tst-gmon$(EXEEXT)
+-@[email protected]: tst-gmon$(EXEEXT) $(GPROF)
++# Run tst-gmon-gprof-l.sh after tst-gmon-gprof.sh to avoid the race
++# condition since they both generate gmon.out.
++@[email protected]: tst-gmon$(EXEEXT) $(GPROF) 
tst-gmon-gprof.out
+ @NATIVE_TRUE@ $(srcdir)/tst-gmon-gprof-l.sh $(GPROF) tst-gmon$(EXEEXT)
+ 
+ # Tell versions [3.59,3.63) of GNU make to not export all variables.
+
+base-commit: 711667472193c31b67eb3c190d7c91f660ac4bb0
+-- 
+2.50.1
+

Reply via email to