summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlias Apalodimas <[email protected]>2025-06-11 23:24:28 +0300
committerTom Rini <[email protected]>2025-06-11 16:21:36 -0600
commit7e81e690d7276283d4a4d988fa47e0965c62c433 (patch)
treedca743bb6967b12ee761f184a3464cb5a967e4e7
parentae297ca722ffdb0ae7d76e3fde637f91d4d79e81 (diff)
kbuild: add -fno-PIE flag unconditionally
Backport from kernel commit 42a92bccd213 ("kbuild: add -fno-PIE flag unconditionally") Signed-off-by: Ilias Apalodimas <[email protected]>
-rw-r--r--Makefile9
1 files changed, 3 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index e1ac2d9cec3..6c01ccfcb97 100644
--- a/Makefile
+++ b/Makefile
@@ -435,9 +435,10 @@ KBUILD_CPPFLAGS := -D__KERNEL__ -D__UBOOT__
KBUILD_CFLAGS := -Wall -Werror=strict-prototypes -Wno-trigraphs \
-Wno-format-security \
- -fno-builtin -ffreestanding $(CSTD_FLAG)
+ -fno-builtin -ffreestanding $(CSTD_FLAG) \
+ -fno-PIE
KBUILD_CFLAGS += -fshort-wchar -fno-strict-aliasing
-KBUILD_AFLAGS := -D__ASSEMBLY__
+KBUILD_AFLAGS := -D__ASSEMBLY__ -fno-PIE
KBUILD_LDFLAGS :=
ifeq ($(cc-name),clang)
@@ -457,10 +458,6 @@ KBUILD_CFLAGS += $(call cc-option, -no-integrated-as)
KBUILD_AFLAGS += $(call cc-option, -no-integrated-as)
endif
-# Don't generate position independent code
-KBUILD_CFLAGS += $(call cc-option,-fno-PIE)
-KBUILD_AFLAGS += $(call cc-option,-fno-PIE)
-
# Read UBOOTRELEASE from include/config/uboot.release (if it exists)
UBOOTRELEASE = $(shell cat include/config/uboot.release 2> /dev/null)
UBOOTVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION)