Makefile: explicitly disable PIE
authorKarsten Merker <merker@debian.org>
Fri, 26 Apr 2019 10:04:06 +0000 (12:04 +0200)
committerAnup Patel <anup@brainfault.org>
Tue, 30 Apr 2019 03:51:47 +0000 (09:21 +0530)
The various available RISC-V toolchains differ in their default
configuration regarding PIE, e.g. the buildroot RISC-V toolchain
has PIE disabled by default while the Debian toolchain has it
enabled by default.

OpenSBI currently doesn't support being built with PIE enabled,
therefore disable it explicitly by passing "-fno-pie -no-pie" in
CFLAGS.

Signed-off-by: Karsten Merker <merker@debian.org>
Acked-by: Anup Patel <anup.patel@wdc.com>
Makefile

index abad95c..a62eb0e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -164,6 +164,7 @@ CFLAGS              +=      -mcmodel=$(PLATFORM_RISCV_CODE_MODEL)
 CFLAGS         +=      $(GENFLAGS)
 CFLAGS         +=      $(platform-cflags-y)
 CFLAGS         +=      $(firmware-cflags-y)
+CFLAGS         +=      -fno-pie -no-pie
 
 CPPFLAGS       +=      $(GENFLAGS)
 CPPFLAGS       +=      $(platform-cppflags-y)