scripts: Fix fortify checks if compiler does not support _FORTIFY_SOURCE=3
commita3090c2c98facbab3d47aa23a94f8d2caeb78d71
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 20 Jul 2023 14:35:54 +0000 (20 11:35 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 20 Jul 2023 20:58:26 +0000 (20 17:58 -0300)
tree73e79c30d449aff75fb3d7c72bdb1e29baf24533
parent6c85c5a1773d786ccdc375e34431488fbcdd88e0
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>
Makefile
Rules
configure
configure.ac
scripts/check-installed-headers.sh