]> granicus.if.org Git - pdns/commitdiff
Fix PIE detection for older gcc's
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Sat, 24 Jan 2015 17:47:23 +0000 (18:47 +0100)
committerRuben Kerkhof <ruben@rubenkerkhof.com>
Sat, 24 Jan 2015 17:50:29 +0000 (18:50 +0100)
At least on FreeBSD, gcc42 can't create
position-independent executables when threads are involved.

Expand our configure check to use some pthread code so it fails
instead of succeeds.

Fixes #2037 and probably #2055

pdns/configure-recursor

index 1716186449d79271e2ba7249467aeba04381f0f0..f82a8b8c0e712c851d92cea2060d2a7f1efeb726 100755 (executable)
@@ -20,7 +20,7 @@ CF_STACK=""
 test_flags() {
   # test for relocation
 
-  if [ `uname -s` = 'SunOS' -o `uname -s` = 'FreeBSD' ]; then
+  if [ `uname -s` = 'SunOS' ]; then
     return
   fi
 
@@ -34,9 +34,13 @@ test_flags() {
 
   src=conftest.cc
   cat >$src <<EOF
+#include <pthread.h>
+
+__thread unsigned int t_id;
 int
 main ()
 {
+  t_id = 1;
   return 0;
 }
 EOF