From 6ebf4030f8e3116bb2f5eb35fe2fc1e620eda9c4 Mon Sep 17 00:00:00 2001 From: Jack Wink Date: Sun, 28 Dec 2014 12:27:35 -0500 Subject: [PATCH 1/4] change '-pie' to '-Wl,-pie' to squash clang errors --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 53f40cf9..1be45244 100644 --- a/configure.ac +++ b/configure.ac @@ -162,7 +162,7 @@ AS_IF([test "$enable_pie" != "no"],[ AX_CHECK_LINK_FLAG([-fPIE], [AX_CHECK_LINK_FLAG([-pie], [CFLAGS="$CFLAGS -fPIE" - LDFLAGS="$LDFLAGS -pie"]) + LDFLAGS="$LDFLAGS -Wl,-pie"]) ]) ]) ]) From 9c9d1edf74d72837488fd820e8d596d3e5e0d9a8 Mon Sep 17 00:00:00 2001 From: Jack Wink Date: Sun, 28 Dec 2014 12:59:53 -0500 Subject: [PATCH 2/4] check to see if '-Wl,-pie' is supported before using it --- configure.ac | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 1be45244..d4a436bc 100644 --- a/configure.ac +++ b/configure.ac @@ -159,10 +159,13 @@ AS_CASE([$host_os], [cygwin*|mingw*|msys|pw32*|cegcc*], [ ], [ AS_IF([test "$enable_pie" != "no"],[ AX_CHECK_COMPILE_FLAG([-fPIE], [ - AX_CHECK_LINK_FLAG([-fPIE], - [AX_CHECK_LINK_FLAG([-pie], - [CFLAGS="$CFLAGS -fPIE" - LDFLAGS="$LDFLAGS -Wl,-pie"]) + AX_CHECK_LINK_FLAG([-fPIE], [ + CFLAGS="$CFLAGS -fPIE" + AX_CHECK_COMPILE_FLAG(["-Wl,-pie"], [ + LDFLAGS="$LDFLAGS -Wl,-pie" + ], [ + LDFLAGS="$LDFLAGS -pie" + ]) ]) ]) ]) From 1ce56adbef6c3fc5345c90f126c0b7a26a1d19b9 Mon Sep 17 00:00:00 2001 From: Jack Wink Date: Sun, 28 Dec 2014 13:17:09 -0500 Subject: [PATCH 3/4] a second stab at detecting valid linker flags --- configure.ac | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index d4a436bc..9eb77c54 100644 --- a/configure.ac +++ b/configure.ac @@ -160,12 +160,16 @@ AS_CASE([$host_os], [cygwin*|mingw*|msys|pw32*|cegcc*], [ ], [ AS_IF([test "$enable_pie" != "no"],[ AX_CHECK_COMPILE_FLAG([-fPIE], [ AX_CHECK_LINK_FLAG([-fPIE], [ - CFLAGS="$CFLAGS -fPIE" - AX_CHECK_COMPILE_FLAG(["-Wl,-pie"], [ + AX_CHECK_LINK_FLAG([-Wl,-pie], [ + CFLAGS="$CFLAGS -fPIE" LDFLAGS="$LDFLAGS -Wl,-pie" ], [ - LDFLAGS="$LDFLAGS -pie" + AX_CHECK_LINK_FLAG([-pie], [ + CFLAGS="$CFLAGS -fPIE" + LDFLAGS="$LDFLAGS -pie" + ]) ]) + AX_CHECK_LINK_FLAG([-pie], []) ]) ]) ]) From f87ef76ee85e0acaadab45247ef65058c143e0a4 Mon Sep 17 00:00:00 2001 From: Jack Wink Date: Sun, 28 Dec 2014 13:19:07 -0500 Subject: [PATCH 4/4] remove extra pie check --- configure.ac | 1 - 1 file changed, 1 deletion(-) diff --git a/configure.ac b/configure.ac index 9eb77c54..8d7caaef 100644 --- a/configure.ac +++ b/configure.ac @@ -169,7 +169,6 @@ AS_IF([test "$enable_pie" != "no"],[ LDFLAGS="$LDFLAGS -pie" ]) ]) - AX_CHECK_LINK_FLAG([-pie], []) ]) ]) ])