[PATCH] stdlib: tests: don't double-define _FORTIFY_SOURCE
Sam James
sam@gentoo.org
Wed Aug 10 15:06:13 GMT 2022
> On 10 Aug 2022, at 15:29, Siddhesh Poyarekar <siddhesh@gotplt.org> wrote:
>
> On 2022-08-08 18:30, Sam James wrote:
>> This is a fair point, although I now see we've actually got libc_cv_predef_fortify_source
>> which sets CPPUNDEFS for exactly this sort of problem anyway.
>> I don't see the warning with gcc-11 + -Werror + F_S=3 on a test program. I can build some
>> older GCCs as I should probably keep them around anyway though.
>
> Interesting, because you should have seen the warning about _FORTIFY_SOURCE=3 not being supported; I'm surprised that it doesn't fail due to that warning.
... and I see it now. I don't know what I did the other day. Oops.
>
>>> Alternatively, some magic here to determine the maximum fortification level wouldn't hurt, but I won't gate your patch on that :) I can work on that bit.
>> I started looking at that and I'm not sure there's a point. includes/features.h downgrades us appropriately. I think we can unconditionally
>> set F_S=3 if I'm right about GCC not caring, as all the logic is on the glibc side, right?
>
> It's the warning I'm thinking about avoiding.
>
>> We can always split this into two if you want:
>> 1. The original commit (I can convert it to use libc_cv_predef_fortify_source's result) & backport it to 2.36
>
> Sounds good to me.
>
>> 2. Another to crank to =3 and don't backport it in case I'm missing something.
>
Okay, sounds like a plan, cheers. I'll get on it.
> Thanks,
> Sid
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 358 bytes
Desc: Message signed with OpenPGP
URL: <https://sourceware.org/pipermail/libc-alpha/attachments/20220810/d318ce2b/attachment.sig>
More information about the Libc-alpha
mailing list