From 78fd4c51f4d05692b35ec9be7162d2827f5e6ba5 Mon Sep 17 00:00:00 2001 From: Sandra Loosemore Date: Tue, 31 Oct 2017 22:14:19 -0400 Subject: [PATCH] configure.ac (--enable-libssp): New. 2017-10-31 Sandra Loosemore gcc/ * configure.ac (--enable-libssp): New. (gcc_cv_libc_provides_ssp): Check for explicit setting before trying to determine target-specific default. Adjust indentation. * configure: Regenerated. * doc/install.texi (Configuration): Expand --disable-libssp documentation. From-SVN: r254288 --- gcc/ChangeLog | 9 +++++++++ gcc/configure | 26 +++++++++++++++++++++++--- gcc/configure.ac | 24 ++++++++++++++++++++---- gcc/doc/install.texi | 3 ++- 4 files changed, 54 insertions(+), 8 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 62f81b70b9b..4c653194a4c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2017-10-31 Sandra Loosemore + + * configure.ac (--enable-libssp): New. + (gcc_cv_libc_provides_ssp): Check for explicit setting before + trying to determine target-specific default. Adjust indentation. + * configure: Regenerated. + * doc/install.texi (Configuration): Expand --disable-libssp + documentation. + 2017-10-31 Daniel Santos config/i386/i386.c (ix86_expand_epilogue): Correct stack diff --git a/gcc/configure b/gcc/configure index c6297acf53c..c4313cce39f 100755 --- a/gcc/configure +++ b/gcc/configure @@ -942,6 +942,7 @@ enable_fix_cortex_a53_843419 with_glibc_version enable_gnu_unique_object enable_linker_build_id +enable_libssp enable_default_ssp with_long_double_128 with_gc @@ -1682,6 +1683,7 @@ Optional Features: extension on glibc systems --enable-linker-build-id compiler will always pass --build-id to linker + --enable-libssp enable linking against libssp --enable-default-ssp enable Stack Smashing Protection as default --enable-maintainer-mode enable make rules and dependencies not useful (and @@ -18440,7 +18442,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 18443 "configure" +#line 18445 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -18546,7 +18548,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 18549 "configure" +#line 18551 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -29040,6 +29042,18 @@ $as_echo "#define HAVE_SOLARIS_CRTS 1" >>confdefs.h fi +# Check whether --enable-libssp was given. +if test "${enable_libssp+set}" = set; then : + enableval=$enable_libssp; case "${enableval}" in + yes|no) + ;; + *) + as_fn_error "unknown libssp setting $enableval" "$LINENO" 5 + ;; +esac +fi + + # Test for stack protector support in target C library. { $as_echo "$as_me:${as_lineno-$LINENO}: checking __stack_chk_fail in target C library" >&5 $as_echo_n "checking __stack_chk_fail in target C library... " >&6; } @@ -29047,6 +29061,11 @@ if test "${gcc_cv_libc_provides_ssp+set}" = set; then : $as_echo_n "(cached) " >&6 else gcc_cv_libc_provides_ssp=no + if test "x$enable_libssp" = "xno"; then + gcc_cv_libc_provides_ssp=yes + elif test "x$enable_libssp" = "xyes"; then + gcc_cv_libc_provides_ssp=no + else case "$target" in *-*-musl*) # All versions of musl provide stack protector @@ -29094,8 +29113,9 @@ else fi ;; - *) gcc_cv_libc_provides_ssp=no ;; + *) gcc_cv_libc_provides_ssp=no ;; esac + fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_libc_provides_ssp" >&5 $as_echo "$gcc_cv_libc_provides_ssp" >&6; } diff --git a/gcc/configure.ac b/gcc/configure.ac index 0ff9dfe24a0..08685b846a0 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -5756,10 +5756,25 @@ if test x$gcc_cv_solaris_crts = xyes; then [Define if the system-provided CRTs are present on Solaris.]) fi +AC_ARG_ENABLE(libssp, +[AS_HELP_STRING([--enable-libssp], [enable linking against libssp])], +[case "${enableval}" in + yes|no) + ;; + *) + AC_MSG_ERROR([unknown libssp setting $enableval]) + ;; +esac], []) + # Test for stack protector support in target C library. AC_CACHE_CHECK(__stack_chk_fail in target C library, - gcc_cv_libc_provides_ssp, - [gcc_cv_libc_provides_ssp=no + gcc_cv_libc_provides_ssp, + [gcc_cv_libc_provides_ssp=no + if test "x$enable_libssp" = "xno"; then + gcc_cv_libc_provides_ssp=yes + elif test "x$enable_libssp" = "xyes"; then + gcc_cv_libc_provides_ssp=no + else case "$target" in *-*-musl*) # All versions of musl provide stack protector @@ -5796,8 +5811,9 @@ AC_CACHE_CHECK(__stack_chk_fail in target C library, AC_CHECK_FUNC(__stack_chk_fail,[gcc_cv_libc_provides_ssp=yes], [echo "no __stack_chk_fail on this target"]) ;; - *) gcc_cv_libc_provides_ssp=no ;; - esac]) + *) gcc_cv_libc_provides_ssp=no ;; + esac + fi]) if test x$gcc_cv_libc_provides_ssp = xyes; then AC_DEFINE(TARGET_LIBC_PROVIDES_SSP, 1, diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi index 7bab1634af5..b10c94af5ca 100644 --- a/gcc/doc/install.texi +++ b/gcc/doc/install.texi @@ -1640,7 +1640,8 @@ not be built. @item --disable-libssp Specify that the run-time libraries for stack smashing protection -should not be built. +should not be built or linked against. On many targets library support +is provided by the C library instead. @item --disable-libquadmath Specify that the GCC quad-precision math library should not be built. -- 2.30.2