Permalink
Browse files

Include -fPIE when we check for $LD -pie

configure's linker flag check also compiles a C++ program.  g++ -pie informs
both the compiler and linker, but clang++ -Wl,-pie is only a linker flag, and
the linker will complain that the code hasn't been compiled as
position-independent.
  • Loading branch information...
1 parent 8c16ca8 commit 93325d3ef0dfb42dadebb978686a0c27a160cdf6 @kmcallister kmcallister committed with keithw Apr 9, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 configure.ac
View
@@ -91,10 +91,10 @@ AS_IF([test x"$hardening" != x"no"], [
[], [-fstack-protector-all])])
check_cc_cxx_flag([-fPIE],
- [check_link_flag([-pie],
+ [check_link_flag([-fPIE -pie],
[HARDEN_CFLAGS="$HARDEN_CFLAGS -fPIE"
HARDEN_LDFLAGS="$HARDEN_LDFLAGS -pie"],
- [check_link_flag([-Wl,-pie],
+ [check_link_flag([-fPIE -Wl,-pie],
[HARDEN_CFLAGS="$HARDEN_CFLAGS -fPIE"
HARDEN_LDFLAGS="$HARDEN_LDFLAGS -Wl,-pie"])])])

0 comments on commit 93325d3

Please sign in to comment.