From 5079ae924ed473d10b581b12999f937f3219bb13 Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Tue, 27 Jan 2015 19:59:21 +0100 Subject: [PATCH] Check both for -pie and -Wl,pie Some versions of clang need the latter Fixes #2125 --- m4/pdns_pie.m4 | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/m4/pdns_pie.m4 b/m4/pdns_pie.m4 index df5e9c783..9d64e48a7 100644 --- a/m4/pdns_pie.m4 +++ b/m4/pdns_pie.m4 @@ -27,8 +27,16 @@ AC_DEFUN([AC_CC_PIE],[ *) gl_COMPILER_OPTION_IF([-fPIE -DPIE], [ PIE_CFLAGS="-fPIE -DPIE" - PIE_LDFLAGS="-pie" - ]) + gl_COMPILER_OPTION_IF([-pie], [ + PIE_LDFLAGS="-pie" + ], [ + dnl some versions of clang require -Wl,-pie instead of -pie + gl_COMPILER_OPTION_IF(["-Wl,-pie"], [ + PIE_LDFLAGS="-Wl,-pie" + ]) + ] + )] + ) esac AC_SUBST([PIE_CFLAGS]) AC_SUBST([PIE_LDFLAGS]) -- 2.40.0