summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/recipes-extended/stress-ng/stress-ng/0001-test-float-Make-variables-global.patch34
-rw-r--r--meta/recipes-extended/stress-ng/stress-ng_0.15.02.bb1
2 files changed, 35 insertions, 0 deletions
diff --git a/meta/recipes-extended/stress-ng/stress-ng/0001-test-float-Make-variables-global.patch b/meta/recipes-extended/stress-ng/stress-ng/0001-test-float-Make-variables-global.patch
new file mode 100644
index 0000000000..2e598ca4f4
--- /dev/null
+++ b/meta/recipes-extended/stress-ng/stress-ng/0001-test-float-Make-variables-global.patch
@@ -0,0 +1,34 @@
1From 958a86069c8d0149969b5c32212a28009c4a9ded Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 21 Jan 2023 23:18:18 -0800
4Subject: [PATCH] test-float: Make variables global
5
6Latest clang ( clang 16+ ) is able to optimize everything out when -O2 is used and as
7a result build succeeds and test output comes out to be wrong. Therefore
8make the variables global, so clang does not optimize away the functions
9
10Upstream-Status: Backport [https://github.com/ColinIanKing/stress-ng/commit/e299eb60a3a029e975304cc43045aea6ab1fad70]
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12---
13 test/test-float.c | 3 +--
14 1 file changed, 1 insertion(+), 2 deletions(-)
15
16diff --git a/test/test-float.c b/test/test-float.c
17index d2800cd3..ad5503c3 100644
18--- a/test/test-float.c
19+++ b/test/test-float.c
20@@ -61,10 +61,9 @@
21 /* Avoid implicit int in the definition of test even if FLOAT is not known. */
22 typedef FLOAT float_type;
23
24+FLOAT a = 0.0, b = 0.0, c = 0.0, d = 0.0;
25 static float_type HOT OPTIMIZE3 test(void)
26 {
27- FLOAT a = 0.0, b = 0.0, c = 0.0, d = 0.0;
28-
29 float_ops(FLOAT, a, b, c, d, sin, cos);
30 float_ops(FLOAT, a, b, c, d, sinl, cosl);
31
32--
332.39.1
34
diff --git a/meta/recipes-extended/stress-ng/stress-ng_0.15.02.bb b/meta/recipes-extended/stress-ng/stress-ng_0.15.02.bb
index c554bb403e..75400f589e 100644
--- a/meta/recipes-extended/stress-ng/stress-ng_0.15.02.bb
+++ b/meta/recipes-extended/stress-ng/stress-ng_0.15.02.bb
@@ -6,6 +6,7 @@ LICENSE = "GPL-2.0-only"
6LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" 6LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
7 7
8SRC_URI = "git://github.com/ColinIanKing/stress-ng.git;protocol=https;branch=master \ 8SRC_URI = "git://github.com/ColinIanKing/stress-ng.git;protocol=https;branch=master \
9 file://0001-test-float-Make-variables-global.patch \
9 file://0001-Pass-LD_GOLD-1-via-makefile-to-enable-gold-linker.patch" 10 file://0001-Pass-LD_GOLD-1-via-makefile-to-enable-gold-linker.patch"
10SRCREV = "4164f6842c712c2d9a13619c3c70fd35d8d02cdb" 11SRCREV = "4164f6842c712c2d9a13619c3c70fd35d8d02cdb"
11S = "${WORKDIR}/git" 12S = "${WORKDIR}/git"