Commit c6e51ca2 authored by Peter Griess's avatar Peter Griess

Fix ifunc test in configure.ac to make unknown attribute warnings fatal.

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
parent 1a732b02
......@@ -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])]
)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment