build: Prefer -static-pie to -shared for linking PIE executables

This commit is contained in:
mintsuki 2021-04-08 02:07:40 +02:00
parent 9caa555973
commit 621fc30a3b
2 changed files with 2 additions and 2 deletions

View File

@ -96,7 +96,7 @@ ifeq ($(TARGET), uefi)
-m64 \
-march=x86-64 \
-Wl,-melf_x86_64 \
-shared \
-static-pie \
-Wl,-Bsymbolic \
-Wl,--noinhibit-exec \
-pie \

View File

@ -3,7 +3,7 @@ CFLAGS = -O2
LD = cc
QEMU = qemu-system-x86_64
QEMUFLAGS = -m 1G -enable-kvm -cpu host
LDINTERNALFLAGS := -Tlinker.ld -nostdlib -shared -pie -fno-pic -fpie -z max-page-size=0x1000
LDINTERNALFLAGS := -Tlinker.ld -nostdlib -static-pie -fno-pic -fpie -z max-page-size=0x1000
INTERNALCFLAGS := -I../stivale -I. -ffreestanding -fno-stack-protector \
-fno-pic -fpie -fomit-frame-pointer -mno-red-zone -mno-80387 -mno-mmx -mno-3dnow -mno-sse \
-mno-sse2 -masm=intel