summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog9
-rwxr-xr-xgcc/configure26
-rw-r--r--gcc/configure.ac24
-rw-r--r--gcc/doc/install.texi3
4 files changed, 54 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 77528a50efc..ddf66c374d8 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,12 @@
+2017-10-31 Sandra Loosemore <sandra@codesourcery.com>
+
+ * 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-04-13 Denis Khalikov <d.khalikov@partner.samsung.com>
PR sanitizer/80414
diff --git a/gcc/configure b/gcc/configure
index 01971e8c8d0..ae5c37c2b0a 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -935,6 +935,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
@@ -1672,6 +1673,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
@@ -18461,7 +18463,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 18464 "configure"
+#line 18466 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -18567,7 +18569,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 18570 "configure"
+#line 18572 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -28586,6 +28588,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; }
@@ -28593,6 +28607,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
@@ -28640,8 +28659,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 dd11ac16f28..b5be82f4b3b 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -5539,10 +5539,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
@@ -5579,8 +5594,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 74bb6a8b5ea..cfcd173b037 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -1636,7 +1636,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.