Debian Codegraph @

vmtest/patches/5.18-Revert-Makefile-link-with-z-noexecstack-no-warn-rwx-.patch

raw
1 From 656f46da75e198bec61e4f2cc425d9fc9b2679cc Mon Sep 17 00:00:00 2001
2 Message-ID: <656f46da75e198bec61e4f2cc425d9fc9b2679cc.1741383572.git.osandov@osandov.com>
3 From: Omar Sandoval <[email protected]>
4 Date: Fri, 7 Mar 2025 13:38:13 -0800
5 Subject: [PATCH] Revert "Makefile: link with -z noexecstack
6 --no-warn-rwx-segments"
7
8 This reverts commit d81aa6bfff835ceea33c192d394f03e4a59cd12c.
9
10 This results in a missing build ID on arm64 on v5.18-stable starting
11 with v5.18.18 if CONFIG_MODVERSIONS=y. In mainline and LTS kernels, this
12 was fixed properly by commit 99cb0d917ffa ("arch: fix broken BuildID for
13 arm64 and riscv") (in v6.2), but that had a bunch of followup fixes.
14 Commit 7b4537199a4a ("kbuild: link symbol CRCs at final link, removing
15 CONFIG_MODULE_REL_CRCS") (in v5.19) also somehow works around it. Older
16 stable branches didn't get this noexecstack change, so that leaves us
17 with just v5.18 that needs this revert.
18
19 Signed-off-by: Omar Sandoval <[email protected]>
20 ---
21 Makefile | 5 -----
22 1 file changed, 5 deletions(-)
23
24 diff --git a/Makefile b/Makefile
25 index fc7efcdab0a2..31e952dc676d 100644
26 --- a/Makefile
27 +++ b/Makefile
28 @@ -1031,11 +1031,6 @@ KBUILD_CFLAGS += $(KCFLAGS)
29 KBUILD_LDFLAGS_MODULE += --build-id=sha1
30 LDFLAGS_vmlinux += --build-id=sha1
31
32 -KBUILD_LDFLAGS += -z noexecstack
33 -ifeq ($(CONFIG_LD_IS_BFD),y)
34 -KBUILD_LDFLAGS += $(call ld-option,--no-warn-rwx-segments)
35 -endif
36 -
37 ifeq ($(CONFIG_STRIP_ASM_SYMS),y)
38 LDFLAGS_vmlinux += $(call ld-option, -X,)
39 endif
40 --
41 2.48.1
42