[PATCH] scripts: Fix fortify checks if compiler does not support _FORTIFY_SOURCE=3

Florian Weimer fweimer@redhat.com
Thu Jul 20 16:26:53 GMT 2023


* Siddhesh Poyarekar:

> On 2023-07-20 10:40, Adhemerval Zanella via Libc-alpha wrote:
>> 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.
>> ---
>
> LGTM, pending approval from RM.  At the moment there's no real reason
> to verify headers for different fortification levels (just 1 or 2
> would do) but I reckon it's a future-proof change, in case we ever end
> up diverging further on those levels.
>
> Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>

Agreed, and (with GCC 11):

Tested-by: Florian Weimer <fweimer@redhat.com>

Thanks,
Florian



More information about the Libc-alpha mailing list