[klibc] [PATCH klibc 2/2] Disable PIE

Ben Hutchings ben at decadent.org.uk
Sun Jan 6 11:30:28 PST 2019


We link all executables as non-relocatable, so it makes no sense to
generate PIE code.  In addition, PIE code on i386 requires a working
GOT which we don't generate.

Signed-off-by: Ben Hutchings <ben at decadent.org.uk>
---
 scripts/Kbuild.klibc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/Kbuild.klibc b/scripts/Kbuild.klibc
index f147a37309e3..35c375edd909 100644
--- a/scripts/Kbuild.klibc
+++ b/scripts/Kbuild.klibc
@@ -67,7 +67,8 @@ include $(srctree)/scripts/Kbuild.include
 # ---------------------------------------------------------------------------
 
 KLIBCREQFLAGS     := $(call cc-option, -fno-stack-protector, ) \
-                     $(call cc-option, -fwrapv, )
+                     $(call cc-option, -fwrapv, ) \
+                     $(call cc-option, -fno-PIE, )
 KLIBCARCHREQFLAGS :=
 KLIBCOPTFLAGS     :=
 KLIBCWARNFLAGS    := -W -Wall -Wno-sign-compare -Wno-unused-parameter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://www.zytor.com/pipermail/klibc/attachments/20190106/35c7319e/attachment.sig>


More information about the klibc mailing list