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.
This commit is contained in:
Keegan McAllister
2012-04-09 00:22:59 -04:00
committed by Keith Winstein
parent 8c16ca8123
commit 93325d3ef0
+2 -2
View File
@@ -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"])])])