diff options
author | Kacper Kasper <kacperkasper@gmail.com> | 2018-09-20 19:25:18 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-11-01 13:43:20 +0100 |
commit | aabf08487fb205f82ec0b5e642236b78134ce5d5 (patch) | |
tree | 7ed65934241fad0c7064360c0292f3aa49109b54 /configure.ac | |
parent | 26ccd00bc96c585b7065af0dcce246b5bfaae5e1 (diff) |
Tweak stack protector check
* There were concerns that current program could fail if -Werror
is enabled and incorrectly report stack protector availability.
* Remove "return 0;" since configure adds it automatically.
* Add -O0 to build options, otherwise the function is optimized
away and it doesn't trigger linker failure.
Change-Id: Ib540b583019d17fec1213ff3c364030b003a5f0f
Reviewed-on: https://gerrit.libreoffice.org/60836
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index e0ab079b011b..912f5f346e62 100644 --- a/configure.ac +++ b/configure.ac @@ -5928,8 +5928,8 @@ if test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then AC_MSG_CHECKING([whether $CC supports -fstack-protector-strong]) save_CFLAGS=$CFLAGS - CFLAGS="$CFLAGS -Werror -fstack-protector-strong" - AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ char a[8]; return 0; ]])],[ HAVE_GCC_STACK_PROTECTOR_STRONG=TRUE ],[]) + CFLAGS="$CFLAGS -O0 -Werror -fstack-protector-strong" + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ char a[8]; a[7] = 0; ]])],[ HAVE_GCC_STACK_PROTECTOR_STRONG=TRUE ],[]) CFLAGS=$save_CFLAGS if test "$HAVE_GCC_STACK_PROTECTOR_STRONG" = "TRUE"; then AC_MSG_RESULT([yes]) |