diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac index f508a3722b..12d1f50b14 100644 --- a/configure.ac +++ b/configure.ac @@ -1578,17 +1578,17 @@ dnl support it no_fortify_source="-Wp,-U_FORTIFY_SOURCE" fortify_source="${no_fortify_source}" -AC_CACHE_CHECK([for __builtin_dynamic_object_size], [libc_cv___builtin_dynamic_object_size], [ +AC_CACHE_CHECK([for maximum supported _FORTIFY_SOURCE level], + [libc_cv_supported_fortify_source], [ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [__builtin_dynamic_object_size("", 0)])], - [libc_cv___builtin_dynamic_object_size=yes - AS_IF([test "$enable_fortify_source" = yes], [enable_fortify_source=3])], - [libc_cv___builtin_dynamic_object_size=no - AS_IF([test "$enable_fortify_source" = yes], [enable_fortify_source=2])]) + [libc_cv_supported_fortify_source=3], + [libc_cv_supported_fortify_source=2]) ]) AS_CASE([$enable_fortify_source], + [yes], [libc_cv_fortify_source=yes enable_fortify_source=$libc_cv_supported_fortify_source], [1|2], [libc_cv_fortify_source=yes], - [3], [AS_IF([test "$libc_cv___builtin_dynamic_object_size" = yes], + [3], [AS_IF([test $libc_cv_supported_fortify_source = 3], [libc_cv_fortify_source=yes], [AC_MSG_ERROR([Compiler doesn't provide necessary support for _FORTIFY_SOURCE=3])])], [libc_cv_fortify_source=no]) @@ -1601,6 +1601,7 @@ AC_SUBST(enable_fortify_source) AC_SUBST(libc_cv_fortify_source) AC_SUBST(no_fortify_source) AC_SUBST(fortify_source) +LIBC_CONFIG_VAR([supported-fortify], [$libc_cv_supported_fortify_source]) dnl Starting with binutils 2.35, GAS can attach multiple symbol versions dnl to one symbol (PR 23840). |