The coremark binary includes a copy of the compiler flags in the output
which breaks the reproducible build tenet of Yocto.  This patch simply
replaces COMPILER_FLAGS with "".

Signed-off-by: Ryan Eatmon <[email protected]>
---
 ..._main-Remove-printing-compiler-flags.patch | 41 +++++++++++++++++++
 .../coremark/coremark_git.bb                  |  5 ++-
 2 files changed, 45 insertions(+), 1 deletion(-)
 create mode 100644 
meta-arago-test/recipes-benchmark/coremark/coremark/0001-core_main-Remove-printing-compiler-flags.patch

diff --git 
a/meta-arago-test/recipes-benchmark/coremark/coremark/0001-core_main-Remove-printing-compiler-flags.patch
 
b/meta-arago-test/recipes-benchmark/coremark/coremark/0001-core_main-Remove-printing-compiler-flags.patch
new file mode 100644
index 00000000..ef7c78b2
--- /dev/null
+++ 
b/meta-arago-test/recipes-benchmark/coremark/coremark/0001-core_main-Remove-printing-compiler-flags.patch
@@ -0,0 +1,41 @@
+From 0af4e2298ccacc8afc0294b7a731f0e866155427 Mon Sep 17 00:00:00 2001
+From: Ryan Eatmon <[email protected]>
+Date: Mon, 1 Dec 2025 12:21:23 -0600
+Subject: [PATCH] core_main: Remove printing compiler flags
+
+Reproducible builds do not like including anything that references the
+build environment on the host machine.  This would include printing out
+the COMPILER_FLAGS macro.  Substitute it with "".
+
+Upstream-Status: Inappropriate [OE-Specific]
+
+Signed-off-by: Ryan Eatmon <[email protected]>
+---
+ core_main.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/core_main.c b/core_main.c
+index a4beeb6..f0ab87f 100644
+--- a/core_main.c
++++ b/core_main.c
+@@ -380,7 +380,7 @@ for (i = 0; i < MULTITHREAD; i++)
+     ee_printf("Iterations       : %lu\n",
+               (long unsigned)default_num_contexts * results[0].iterations);
+     ee_printf("Compiler version : %s\n", COMPILER_VERSION);
+-    ee_printf("Compiler flags   : %s\n", COMPILER_FLAGS);
++    ee_printf("Compiler flags   : %s\n", ""); //Reproducible build fix: 
COMPILER_FLAGS);
+ #if (MULTITHREAD > 1)
+     ee_printf("Parallel %s : %d\n", PARALLEL_METHOD, default_num_contexts);
+ #endif
+@@ -410,7 +410,7 @@ for (i = 0; i < MULTITHREAD; i++)
+                       default_num_contexts * results[0].iterations
+                           / time_in_secs(total_time),
+                       COMPILER_VERSION,
+-                      COMPILER_FLAGS);
++                      ""); //Reproducible build fix: COMPILER_FLAGS);
+ #if defined(MEM_LOCATION) && !defined(MEM_LOCATION_UNSPEC)
+             ee_printf(" / %s", MEM_LOCATION);
+ #else
+-- 
+2.43.0
+
diff --git a/meta-arago-test/recipes-benchmark/coremark/coremark_git.bb 
b/meta-arago-test/recipes-benchmark/coremark/coremark_git.bb
index 1e002c06..9d770c44 100644
--- a/meta-arago-test/recipes-benchmark/coremark/coremark_git.bb
+++ b/meta-arago-test/recipes-benchmark/coremark/coremark_git.bb
@@ -3,7 +3,10 @@ SUMMARY = "The benchmark utility to measure the performance of 
CPU"
 LICENSE = "Coremark"
 LIC_FILES_CHKSUM = "file://LICENSE.md;md5=0a18b17ae63deaa8a595035f668aebe1"
 
-SRC_URI = "git://github.com/eembc/coremark.git;branch=main;protocol=https"
+SRC_URI = " \
+    git://github.com/eembc/coremark.git;branch=main;protocol=https \
+    file://0001-core_main-Remove-printing-compiler-flags.patch \
+"
 PV = "1.01+git"
 SRCREV = "1f483d5b8316753a742cbf5590caf5bd0a4e4777"
 
-- 
2.43.0



-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#16843): 
https://lists.yoctoproject.org/g/meta-arago/message/16843
Mute This Topic: https://lists.yoctoproject.org/mt/116562369/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-arago/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to