diff options
author | Ben Hutchings <ben@decadent.org.uk> | 2022-08-02 22:47:14 +0200 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2022-08-04 00:45:26 +0200 |
commit | 2acbe15d7a8093cfa295aadc56707892e87a7eaf (patch) | |
tree | 9809f8ccc127e01fbebc22fe4603744a8d5e7e08 | |
parent | 2f31533dd248f24c8f90a0551cf86b09f144b77c (diff) | |
download | klibc-2acbe15d7a8093cfa295aadc56707892e87a7eaf.tar.gz |
[klibc] Kbuild: Properly disable executable stacks in static builds
I typo'd the variable name KLIBCSTACKFLAGS in the value of
KLIBCCFLAGS, leaving the stack executable in statically linked
executables. Fix that.
Executables using a shared library did not have this problem, unless
they included assembly language sources. C compilers generate the
no-executable-stack header by default, and the interpreter definition
that's statically linked into such executables was built with a
correctly spelt KLIBCSTACKFLAGS as an extra option.
Fixes: c562319cdba0 ("[klibc] Kbuild: Add a per-architecture option to ...")
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r-- | scripts/Kbuild.klibc | 2 | ||||
-rw-r--r-- | usr/klibc/Kbuild | 1 |
2 files changed, 1 insertions, 2 deletions
diff --git a/scripts/Kbuild.klibc b/scripts/Kbuild.klibc index e88bc003d73e55..64da31ac420f93 100644 --- a/scripts/Kbuild.klibc +++ b/scripts/Kbuild.klibc @@ -133,7 +133,7 @@ KLIBCDEFS += -D__KLIBC__=$(KLIBCMAJOR) \ -D_BITSIZE=$(KLIBCBITSIZE) KLIBCCPPFLAGS += $(KLIBCDEFS) KLIBCCFLAGS += $(KLIBCCPPFLAGS) $(KLIBCREQFLAGS) $(KLIBCARCHREQFLAGS) \ - $(KLIBCOPTFLAGS) $(KLIBCSTACKFLGS) $(KLIBCWARNFLAGS) + $(KLIBCOPTFLAGS) $(KLIBCSTACKFLAGS) $(KLIBCWARNFLAGS) KLIBCAFLAGS += -D__ASSEMBLY__ $(KLIBCCFLAGS) KLIBCSTRIPFLAGS += --strip-all -R .comment -R .note diff --git a/usr/klibc/Kbuild b/usr/klibc/Kbuild index 9ea55a23e081c5..5933f89a1a7b14 100644 --- a/usr/klibc/Kbuild +++ b/usr/klibc/Kbuild @@ -186,7 +186,6 @@ quiet_cmd_interp = BUILD $@ cmd_interp = $(KLIBCCC) $(klibccflags) -D__ASSEMBLY__ \ -DLIBDIR=\"$(SHLIBDIR)\" \ -DSOHASH=\"$(SOLIBHASH)\" \ - $(KLIBCSTACKFLAGS) \ -c -o $@ $< $(INTERP_O): $(obj)/interp.S $(SOLIB).hash |