]> granicus.if.org Git - pdns/commitdiff
Check both for -pie and -Wl,pie
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Tue, 27 Jan 2015 18:59:21 +0000 (19:59 +0100)
committerRuben Kerkhof <ruben@rubenkerkhof.com>
Tue, 27 Jan 2015 19:04:59 +0000 (20:04 +0100)
Some versions of clang need the latter
Fixes #2125

m4/pdns_pie.m4

index df5e9c78335d1a71ed74c898961d8bac455482b4..9d64e48a795f58c5dd59b9dadf0e04ee7e3db1c9 100644 (file)
@@ -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])