Skip to contentSkip to conversation

apr: remove -std=gnu23 from apr_rules.mk to fix reproducibility

PATCH In review [email protected] 2 participants 2 messages Apr 12 – Apr 14

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 apr: remove -std=gnu23 from apr_rules.mk to fix reproducibility

From: Martin Jansa <[email protected]>

With the updated ax_prog_cc_for_build.m4 from
apr: fix build with autoconf-2.73
it now correctly detects -std=gnu23 usability on host gcc and doesn't try to use it e.g. with gcc-13 which doesn't support it, but that causes build reproducibility issue between builds on such hosts as CC_FOR_BUILD is included in installed /usr/share/build-1/apr_rules.mk
https://valkyrie.yocto.io/pub/repro-fail/oe-reproducible-20260412-a5w4mcrk/packages/diff-html/

---
 meta/recipes-support/apr/apr_1.7.6.bb | 2 ++
 1 file changed, 2 insertions(+)
meta/recipes-support/apr/apr_1.7.6.bb +2 -0
index 86fac1e4c8..9a7a8ddd74 100644
@@ -87,6 +87,8 @@ do_configure:append() {
 do_install:append() {
 	oe_multilib_header apr.h
 	install -d ${D}${datadir}/apr
+	# 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}${datadir}/build-1/apr_rules.mk
 }
 
 do_install:append:class-target() {
#1 lore raw
Quoted 10 lines · Martin Jansa via lists.openembedded.org

From: Martin Jansa <[email protected]>

With the updated ax_prog_cc_for_build.m4 from
apr: fix build with autoconf-2.73
it now correctly detects -std=gnu23 usability on host gcc and doesn't try to use it e.g. with gcc-13 which doesn't support it, but that causes build reproducibility issue between builds on such hosts as CC_FOR_BUILD is included in installed /usr/share/build-1/apr_rules.mk
https://valkyrie.yocto.io/pub/repro-fail/oe-reproducible-20260412-a5w4mcrk/packages/diff-html/

Quoted 2 lines

---

This fix got merged, but it looks like this is not enough: we sometimes have a whitespace diff, like on this build:

https://valkyrie.yocto.io/pub/repro-fail/oe-reproducible-20260414-82oogy25/packages/diff-html/

Signature · 3 lines
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com