scripts: Don't use FORTIFY_SOURCE when optimizations are disabled

Both arguments were incompatible and warnings were being displayed for
this combination

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
This commit is contained in:
Otavio Pontes
2020-03-16 15:50:44 -07:00
parent 6afe772d7e
commit db08520ed9
3 changed files with 7 additions and 2 deletions
+5 -1
View File
@@ -2,7 +2,7 @@ SUFFIXES= .rst
EXTRA_DIST = COPYING scripts/findstatic.pl swupd.bash swupd.zsh config
AM_CFLAGS = -fPIE -fPIC -g -D_FORTIFY_SOURCE=2 -fno-common -std=gnu99 \
AM_CFLAGS = -fPIE -fPIC -g -fno-common -std=gnu99 \
-O$(OPTIMIZE) \
-Wall \
-Wextra \
@@ -22,6 +22,10 @@ AM_CFLAGS = -fPIE -fPIC -g -D_FORTIFY_SOURCE=2 -fno-common -std=gnu99 \
-fno-delete-null-pointer-checks \
-fwrapv
if ENABLE_FORTIFY
AM_CFLAGS += -D_FORTIFY_SOURCE=2
endif
AM_LDFLAGS = -z noexecstack -z relro -z now \
-pie
+1
View File
@@ -41,6 +41,7 @@ AS_IF(
[AC_SUBST(OPTIMIZE, [0])],
[AC_SUBST(OPTIMIZE, [2])]
)
AM_CONDITIONAL([ENABLE_FORTIFY], [test "$enable_optimizations" != "no"])
AC_ARG_ENABLE(
[bzip2],
+1 -1
View File
@@ -30,7 +30,7 @@ run_checks() {
}
# Run tests without any security optimization and with address sanitizer
CFLAGS="-fsanitize=address -fno-omit-frame-pointer" run_build --disable-optimizations "$CONFIGURE_ARGS"
CFLAGS="-fsanitize=address -fno-omit-frame-pointer -Werror" run_build --disable-optimizations "$CONFIGURE_ARGS"
run_checks
# Run build with basic configurations