summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorZheng Junjie <z572@z572.online>2025-06-24 00:22:42 +0800
committerAndreas Enge <andreas@enge.fr>2025-07-18 20:17:36 +0200
commitf51070cb702ce950ff40be9c5e86b2d365b1a86d (patch)
tree941c8db22395ae85ce64618611a48f728dca2e2d /gnu
parent7d3fd78e8429a99e1f1666adec406e967ef5086e (diff)
gnu: dtc: Fix tests.
* gnu/packages/patches/dtc-fix-test.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. * gnu/packages/bootloaders.scm (dtc)[source]: Use it. Change-Id: I70d593ff55c677df9aae46ba289a0888bab73f12
Diffstat (limited to 'gnu')
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/bootloaders.scm3
-rw-r--r--gnu/packages/patches/dtc-fix-test.patch38
3 files changed, 41 insertions, 1 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index 231eb291ed1..150cb1474d9 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1218,6 +1218,7 @@ dist_patch_DATA = \
1218 %D%/packages/patches/dovecot-trees-support-dovecot-2.3.patch \ 1218 %D%/packages/patches/dovecot-trees-support-dovecot-2.3.patch \
1219 %D%/packages/patches/dstat-fix-crash-when-specifying-delay.patch \ 1219 %D%/packages/patches/dstat-fix-crash-when-specifying-delay.patch \
1220 %D%/packages/patches/dstat-skip-devices-without-io.patch \ 1220 %D%/packages/patches/dstat-skip-devices-without-io.patch \
1221 %D%/packages/patches/dtc-fix-test.patch \
1221 %D%/packages/patches/duc-fix-test-sh.patch \ 1222 %D%/packages/patches/duc-fix-test-sh.patch \
1222 %D%/packages/patches/dune-common-skip-failing-tests.patch \ 1223 %D%/packages/patches/dune-common-skip-failing-tests.patch \
1223 %D%/packages/patches/durden-shadow-arcan.patch \ 1224 %D%/packages/patches/durden-shadow-arcan.patch \
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index e5b582efb87..c4b721c9f56 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -754,7 +754,8 @@ The SUBDIR argument defaults to \"efi/Guix\", as it is also the case for
754 "dtc-" version ".tar.gz")) 754 "dtc-" version ".tar.gz"))
755 (sha256 755 (sha256
756 (base32 756 (base32
757 "1x609axqpkw5d47pz3ag34ycy3w7y1d0i8q4715hvlmgszmya07j")))) 757 "1x609axqpkw5d47pz3ag34ycy3w7y1d0i8q4715hvlmgszmya07j"))
758 (patches (search-patches "dtc-fix-test.patch"))))
758 (build-system meson-build-system) 759 (build-system meson-build-system)
759 (arguments 760 (arguments
760 (list 761 (list
diff --git a/gnu/packages/patches/dtc-fix-test.patch b/gnu/packages/patches/dtc-fix-test.patch
new file mode 100644
index 00000000000..c905309e245
--- /dev/null
+++ b/gnu/packages/patches/dtc-fix-test.patch
@@ -0,0 +1,38 @@
1from https://git.kernel.org/pub/scm/utils/dtc/dtc.git/patch/?id=ce1d8588880aecd7af264e422a16a8b33617cef7
2
3From ce1d8588880aecd7af264e422a16a8b33617cef7 Mon Sep 17 00:00:00 2001
4From: David Gibson <david@gibson.dropbear.id.au>
5Date: Wed, 5 Feb 2025 13:39:43 +1100
6Subject: [PATCH] tests: When building .so from -O asm output mark as
7 non-executable stack
8
9For certain tests, we take the output from dtc -O asm and build it into
10a .so shared library which we then dlopen() for further tests. Because we
11don't mark it otherwise, it's treated as requiring an executable stack,
12which dlopen() refuses to open as of glibc-2.41.
13
14Of course, the library is pure data, no code, so it certainly doesn't need
15an executable stack. Add the -znoexecstack linker option to avoid the
16error.
17
18Fixes: https://github.com/dgibson/dtc/issues/163
19
20Reported-by: Xi Ruoyao <xry111@xry111.site>
21Signed-off-by: David Gibson <david@gibson.dropbear.id.a>
22---
23 tests/run_tests.sh | 2 +-
24 1 file changed, 1 insertion(+), 1 deletion(-)
25
26diff --git a/tests/run_tests.sh b/tests/run_tests.sh
27index 937b1288..f0b51c04 100755
28--- a/tests/run_tests.sh
29+++ b/tests/run_tests.sh
30@@ -201,7 +201,7 @@ run_dtc_test () {
31 }
32
33 asm_to_so () {
34- $CC -shared -o $1.test.so "$SRCDIR/data.S" $1.test.s
35+ $CC -shared -Wl,-znoexecstack -o $1.test.so "$SRCDIR/data.S" $1.test.s
36 }
37
38 asm_to_so_test () {