From: Ruben Kerkhof Date: Tue, 27 Jan 2015 18:59:21 +0000 (+0100) Subject: Check both for -pie and -Wl,pie X-Git-Tag: rec-3.7.0-rc2~19^2~8 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5079ae924ed473d10b581b12999f937f3219bb13;p=pdns Check both for -pie and -Wl,pie Some versions of clang need the latter Fixes #2125 --- 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])