From 93325d3ef0dfb42dadebb978686a0c27a160cdf6 Mon Sep 17 00:00:00 2001 From: Keegan McAllister Date: Mon, 9 Apr 2012 00:22:59 -0400 Subject: [PATCH] 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. --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 2351d87..68f4522 100644 --- a/configure.ac +++ b/configure.ac @@ -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"])])])