about summary refs log tree commit diff
path: root/Rules
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2023-07-20 11:35:54 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2023-07-20 17:58:26 -0300
commita3090c2c98facbab3d47aa23a94f8d2caeb78d71 (patch)
tree73e79c30d449aff75fb3d7c72bdb1e29baf24533 /Rules
parent6c85c5a1773d786ccdc375e34431488fbcdd88e0 (diff)
downloadglibc-a3090c2c98facbab3d47aa23a94f8d2caeb78d71.tar.gz
glibc-a3090c2c98facbab3d47aa23a94f8d2caeb78d71.tar.xz
glibc-a3090c2c98facbab3d47aa23a94f8d2caeb78d71.zip
scripts: Fix fortify checks if compiler does not support _FORTIFY_SOURCE=3
The 30379efad1 added _FORTIFY_SOURCE checks without check if compiler
does support all used fortify levels.  This patch fixes it by first
checking at configure time the maximum support fortify level and using
it instead of a pre-defined one.

Checked on x86_64 with gcc 11, 12, and 13.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
Tested-by: Florian Weimer <fweimer@redhat.com>
Diffstat (limited to 'Rules')
-rw-r--r--Rules4
1 files changed, 2 insertions, 2 deletions
diff --git a/Rules b/Rules
index 5e945d7347..279ae490ac 100644
--- a/Rules
+++ b/Rules
@@ -85,7 +85,7 @@ tests-special += $(objpfx)check-installed-headers-c.out
 libof-check-installed-headers-c := testsuite
 $(objpfx)check-installed-headers-c.out: \
     $(..)scripts/check-installed-headers.sh $(headers)
-	$(SHELL) $(..)scripts/check-installed-headers.sh c \
+	$(SHELL) $(..)scripts/check-installed-headers.sh c $(supported-fortify) \
 	  "$(CC) $(filter-out -std=%,$(CFLAGS)) -D_ISOMAC $(+includes)" \
 	  $(headers) > $@; \
 	$(evaluate-test)
@@ -97,7 +97,7 @@ tests-special += $(objpfx)check-installed-headers-cxx.out
 libof-check-installed-headers-cxx := testsuite
 $(objpfx)check-installed-headers-cxx.out: \
     $(..)scripts/check-installed-headers.sh $(headers)
-	$(SHELL) $(..)scripts/check-installed-headers.sh c++ \
+	$(SHELL) $(..)scripts/check-installed-headers.sh c++ $(supported-fortify) \
 	  "$(CXX) $(filter-out -std=%,$(CXXFLAGS)) -D_ISOMAC $(+includes)" \
 	  $(headers) > $@; \
 	$(evaluate-test)