Browse Source

Fix bad LLD codegen from PIE flags in build tool

master
cancel 6 years ago
parent
commit
004e537d30
  1. 10
      tool

10
tool

@ -161,7 +161,15 @@ build_target() {
add cc_flags -fuse-ld=lld add cc_flags -fuse-ld=lld
fi fi
if [[ $protections_enabled = 1 ]]; then if [[ $protections_enabled = 1 ]]; then
add cc_flags -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fpie -Wl,-pie add cc_flags -D_FORTIFY_SOURCE=2 -fstack-protector-strong -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
fi fi
case "$1" in case "$1" in
debug) debug)

Loading…
Cancel
Save