[PATCH 07/12] Disable _FORTIFY_SOURCE when building with -O0
Andrei Otcheretianski
andrei.otcheretianski at intel.com
Mon Dec 25 02:21:04 PST 2023
_FORTIFY_SOURCE requires at least -O2 optimization level.
This may result in compilation warnings. Fix it.
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski at intel.com>
---
hostapd/Makefile | 2 +-
tests/build/build-hostapd-internal.config | 2 +-
tests/build/build-wpa_supplicant-internal.config | 2 +-
wpa_supplicant/Makefile | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/hostapd/Makefile b/hostapd/Makefile
index 51702439c6..500098c8ba 100644
--- a/hostapd/Makefile
+++ b/hostapd/Makefile
@@ -167,7 +167,7 @@ OBJS += ../src/eapol_auth/eapol_auth_sm.o
ifdef CONFIG_CODE_COVERAGE
-CFLAGS += -O0 -fprofile-arcs -ftest-coverage
+CFLAGS += -O0 -fprofile-arcs -ftest-coverage -U_FORTIFY_SOURCE
LIBS += -lgcov
LIBS_c += -lgcov
LIBS_h += -lgcov
diff --git a/tests/build/build-hostapd-internal.config b/tests/build/build-hostapd-internal.config
index 421977eed4..5b5d8037ed 100644
--- a/tests/build/build-hostapd-internal.config
+++ b/tests/build/build-hostapd-internal.config
@@ -77,7 +77,7 @@ CONFIG_SUITEB=y
CONFIG_MBO=y
CONFIG_CODE_COVERAGE=y
-CFLAGS += -O0 -Wsign-compare
+CFLAGS += -O0 -Wsign-compare -U_FORTIFY_SOURCE
CONFIG_TAXONOMY=y
#CONFIG_FILS=y
diff --git a/tests/build/build-wpa_supplicant-internal.config b/tests/build/build-wpa_supplicant-internal.config
index 574fb4b182..fb6a7b9dc3 100644
--- a/tests/build/build-wpa_supplicant-internal.config
+++ b/tests/build/build-wpa_supplicant-internal.config
@@ -117,7 +117,7 @@ CONFIG_SUITEB=y
CONFIG_MBO=y
#CONFIG_CODE_COVERAGE=y
-CFLAGS += -O0 -Wsign-compare
+CFLAGS += -O0 -Wsign-compare -U_FORTIFY_SOURCE
#CONFIG_FILS=y
#CONFIG_FILS_SK_PFS=y
CONFIG_PMKSA_CACHE_EXTERNAL=y
diff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile
index 46e20f44a6..9b0c3c7c8c 100644
--- a/wpa_supplicant/Makefile
+++ b/wpa_supplicant/Makefile
@@ -188,7 +188,7 @@ CFLAGS += -Werror -DEAPOL_TEST
endif
ifdef CONFIG_CODE_COVERAGE
-CFLAGS += -O0 -fprofile-arcs -ftest-coverage
+CFLAGS += -O0 -fprofile-arcs -ftest-coverage -U_FORTIFY_SOURCE
LIBS += -lgcov
LIBS_c += -lgcov
LIBS_p += -lgcov
--
2.43.0
More information about the Hostap
mailing list