Skip to contentSkip to conversation

strace: Remove -std=gnu23 from ptests makefile to fix reproducibility

PATCH In review Khem Raj 2 participants 2 messages Apr 14

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 strace: Remove -std=gnu23 from ptests makefile to fix reproducibility

with updated ax_prog_cc_for_build.m4 macros, -std=gnu23 can be added to CC_FOR_BUILD based upon what autoconf-2.73 detects gcc on host to support which could vary depending upon build host. This gets into Makefile which is shipped with ptests on tatget. Since we are on gcc-15 this option is not really needed on target as gcc15 defaults to c23

---
 meta/recipes-devtools/strace/strace_6.19.bb | 2 ++
 1 file changed, 2 insertions(+)
meta/recipes-devtools/strace/strace_6.19.bb +2 -0
index 9dcf9d14d5..e7c96262ce 100644
@@ -52,6 +52,8 @@ do_install_ptest() {
 	sed -e 's/^srcdir = .*/srcdir = ..\/..\/ptest\/tests/' \
 	    -e "/^TEST_LOG_DRIVER =/s|(top_srcdir)|(top_builddir)|" \
 	    -i ${D}/${PTEST_PATH}/${TESTDIR}/Makefile
+	# avoid reproducibility issue, -std=gnu23 is used only on hosts with gcc-14 and newer
+	sed -i '/^CC_FOR_BUILD=/s/-std=gnu23//g' ${D}/${PTEST_PATH}/${TESTDIR}/Makefile
 }
 
 RDEPENDS:${PN}-ptest += "make coreutils grep gawk sed locale-base-en-us"
#1 lore raw
Quoted 19 lines · Khem Raj via lists.openembedded.org

with updated ax_prog_cc_for_build.m4 macros, -std=gnu23 can be added to CC_FOR_BUILD based upon what autoconf-2.73 detects gcc on host to support which could vary depending upon build host. This gets into Makefile which is shipped with ptests on tatget. Since we are on gcc-15 this option is not really needed on target as gcc15 defaults to c23

---
 meta/recipes-devtools/strace/strace_6.19.bb | 2 ++

 1 file changed, 2 insertions(+)
meta/recipes-devtools/strace/strace_6.19.bb +0 -0
index 9dcf9d14d5..e7c96262ce 100644
@@ -52,6 +52,8 @@ do_install_ptest() {
  	sed -e 's/^srcdir = .*/srcdir = ..\/..\/ptest\/tests/' \
  	    -e "/^TEST_LOG_DRIVER =/s|(top_srcdir)|(top_builddir)|" \

      -i ${D}/${PTEST_PATH}/${TESTDIR}/Makefile

meta/recipes-devtools/strace/strace_6.19.bb do_install_ptest() { · line 56

Quoted 2 lines
meta/recipes-devtools/strace/strace_6.19.bb +2 -0
+	# avoid reproducibility issue, -std=gnu23 is used only on hosts with gcc-14 and newer
+	sed -i '/^CC_FOR_BUILD=/s/-std=gnu23//g' ${D}/${PTEST_PATH}/${TESTDIR}/Makefile

Sadly this doesn't quite work since " -std=gnu23" gets added to the line and hence there would still a whitespace difference :(.

I've send another version of this which handles the whitespace (and combines with the previous sed).

Cheers,

Richard