From b1b0264a4e7a2db261639fba421957265a6aed24 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sun, 28 Dec 2014 03:36:40 +0100 Subject: [PATCH] configure: build with -fstack-protector-strong if supported. --- NEWS | 3 +++ configure | 14 +++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/NEWS b/NEWS index 545e0dda..418f7cf5 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,8 @@ xbps-0.43 (???): + * configure: build with -fstack-protector-strong if supported by the compiler, + and fallback to -fstack-protector-all otherwise. + * xbps-pkgdb(8): the `packaged-with` string obj is removed from pkgdb. Since 0.42 that object is unnecessary and is being obsoleted. diff --git a/configure b/configure index 688daedb..3a07f524 100755 --- a/configure +++ b/configure @@ -269,15 +269,15 @@ done check_compiler_flag PIC f CFLAGS check_compiler_flag "inline-functions" f CFLAGS -check_compiler_flag stack-protector-all f CFLAGS -if [ $? -eq 0 ]; then - if [ "$CC" = "gcc" ]; then - check_compiler_flag "param ssp-buffer-size=1" - CFLAGS +check_compiler_flag stack-protector-strong f CFLAGS +if [ $? -ne 0 ]; then + check_compiler_flag stack-protector-all f CFLAGS + if [ $? -eq 0 ]; then + if [ "$CC" = "gcc" ]; then + check_compiler_flag "param ssp-buffer-size=1" - CFLAGS + fi fi fi -if [ $? -eq 0 ]; then - echo "CPPFLAGS += -D_FORTIFY_SOURCE=2" >>$CONFIG_MK -fi check_compiler_flag "visibility=default" f SHAREDLIB_CFLAGS if [ $? -eq 0 ]; then HAVE_VISIBILITY=yes