about summary refs log tree commit diff
path: root/configure.in
diff options
context:
space:
mode:
authorRoland McGrath <roland@hack.frob.com>2012-05-14 15:42:52 -0700
committerRoland McGrath <roland@hack.frob.com>2012-05-16 16:20:59 -0700
commit61653dfb81b776bb72ce4304175b861d77c357a8 (patch)
tree588d62fd799fae6b3aef3958788ef72d7f71bd37 /configure.in
parent90c885c87bdb3380d430d3f72a4a5cabf2835167 (diff)
downloadglibc-61653dfb81b776bb72ce4304175b861d77c357a8.tar.gz
glibc-61653dfb81b776bb72ce4304175b861d77c357a8.tar.xz
glibc-61653dfb81b776bb72ce4304175b861d77c357a8.zip
BZ#10375: Configure magic to use -U_FORTIFY_SOURCE if needed.
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in16
1 files changed, 16 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index ce4b7ad02b..0916e9ec5c 100644
--- a/configure.in
+++ b/configure.in
@@ -2036,6 +2036,22 @@ AC_CHECK_SIZEOF(long double, 0)
 sizeof_long_double=$ac_cv_sizeof_long_double
 AC_SUBST(sizeof_long_double)
 
+CPPUNDEFS=
+dnl Check for silly hacked compilers predefining _FORTIFY_SOURCE.
+dnl Since we are building the implementations of the fortified functions here,
+dnl having the macro defined interacts very badly.
+AC_CACHE_CHECK([for _FORTIFY_SOURCE predefine], libc_cv_predef_fortify_source,
+[AC_TRY_COMPILE([], [
+#ifdef _FORTIFY_SOURCE
+# error bogon
+#endif],
+		[libc_cv_predef_fortify_source=no],
+		[libc_cv_predef_fortify_source=yes])])
+if test $libc_cv_predef_fortify_source = yes; then
+  CPPUNDEFS="${CPPUNDEFS:+$CPPUNDEFS }-U_FORTIFY_SOURCE"
+fi
+AC_SUBST(CPPUNDEFS)
+
 ### End of automated tests.
 ### Now run sysdeps configure fragments.