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:
committed by
Keith Winstein
parent
8c16ca8123
commit
93325d3ef0
+2
-2
@@ -91,10 +91,10 @@ AS_IF([test x"$hardening" != x"no"], [
|
|||||||
[], [-fstack-protector-all])])
|
[], [-fstack-protector-all])])
|
||||||
|
|
||||||
check_cc_cxx_flag([-fPIE],
|
check_cc_cxx_flag([-fPIE],
|
||||||
[check_link_flag([-pie],
|
[check_link_flag([-fPIE -pie],
|
||||||
[HARDEN_CFLAGS="$HARDEN_CFLAGS -fPIE"
|
[HARDEN_CFLAGS="$HARDEN_CFLAGS -fPIE"
|
||||||
HARDEN_LDFLAGS="$HARDEN_LDFLAGS -pie"],
|
HARDEN_LDFLAGS="$HARDEN_LDFLAGS -pie"],
|
||||||
[check_link_flag([-Wl,-pie],
|
[check_link_flag([-fPIE -Wl,-pie],
|
||||||
[HARDEN_CFLAGS="$HARDEN_CFLAGS -fPIE"
|
[HARDEN_CFLAGS="$HARDEN_CFLAGS -fPIE"
|
||||||
HARDEN_LDFLAGS="$HARDEN_LDFLAGS -Wl,-pie"])])])
|
HARDEN_LDFLAGS="$HARDEN_LDFLAGS -Wl,-pie"])])])
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user