Fix ifunc test in configure.ac to make unknown attribute warnings fatal.
authorPeter Griess <pgriess@fb.com>
Tue, 10 Sep 2013 20:33:09 +0000 (15:33 -0500)
committerPeter Griess <pgriess@fb.com>
Tue, 15 Oct 2013 01:46:13 +0000 (18:46 -0700)
Summary:
- By default, GCC only warns on unknown attributes. As a result our
FOLLY_HAVE_IFUNC test doesn't actually catch instances where we don't
support this.

Test Plan:
- fbconfig -r folly && fbmake runtests
- ./configure && make check on Ubuntu/FC/Mac

Reviewed By: oyamauchi@fb.com

FB internal diff: D998506

folly/configure.ac

index cd0489afe43a1cae6443b4a2682b763e2ba2a6e2..664c83d5ffd4cc7a3488d59f1a3f5f8c825b5288 100644 (file)
@@ -58,8 +58,11 @@ AC_CHECK_TYPE([__int128],
   [AC_DEFINE([HAVE_INT128_T], [0], [Define if __int128 does not exist])])
 AC_CHECK_TYPES([ptrdiff_t])
 AC_COMPILE_IFELSE(
-  [AC_LANG_SOURCE[extern "C" void (*test_ifunc(void))() { return 0; }
-                  void func() __attribute__((ifunc("test_ifunc")));]],
+  [AC_LANG_SOURCE[
+    #pragma GCC diagnostic error "-Wattributes"
+    extern "C" void (*test_ifunc(void))() { return 0; }
+    void func() __attribute__((ifunc("test_ifunc")));]
+  ],
   [AC_DEFINE([HAVE_IFUNC], [1], [Define to 1 if the compiler supports ifunc])],
   [AC_DEFINE([HAVE_IFUNC], [0], [Define to 0 if the compiler doesn't support ifunc])]
 )