From 0c109b44863fe53908998dd56d2f8076bb6bd6d2 Mon Sep 17 00:00:00 2001 From: cancel Date: Fri, 30 Nov 2018 20:43:03 +0900 Subject: [PATCH] Fix up PIE flags --- tool | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/tool b/tool index 07e1dea..6e76010 100755 --- a/tool +++ b/tool @@ -167,15 +167,9 @@ build_target() { add cc_flags -D_FORTIFY_SOURCE=2 -fstack-protector-strong fi if [[ $pie_enabled = 1 ]]; then - add cc_flags -fpie - if [[ $lld_detected = 1 ]]; then - # LLD seems to need this or it fails at linking. If we also pass -Wl,-pie - # then the built binary will crash before reaching main(). - add cc_flags -Wl,-z,notext - else - # This is the one that works everywhere else.. hmm - add cc_flags -Wl,-pie - fi + add cc_flags -pie -fpie -Wl,-pie + else + add cc_flags -no-pie -fno-pie fi case "$1" in debug)