[PATCH v3 0/5] fcntl fortification
Zack Weinberg
zack@owlfolio.org
Tue Jun 20 13:47:40 GMT 2023
On Tue, Jun 20, 2023, at 9:40 AM, Adhemerval Zanella Netto via Libc-alpha wrote:
> On 20/06/23 09:53, Sergey Bugaev wrote:
>> On Tue, Jun 20, 2023 at 3:38 PM Maxim Kuvyrkov
>> <maxim.kuvyrkov@linaro.org> wrote:
>>> We don't set _FORTIFY_SOURCE in our CI's glibc build, but, I think, it comes from Ubuntu's GCC, where it may be enabled by default. Or are you using Ubuntu and not seeing this with default Ubuntu toolchain?
>>
>> I'm not using Ubuntu.
>>
>> Do they just set _FORTIFY_SOURCE by default -- i.e. not only when
>> building OS packages, but for all compilations? That's... unusual :|
>
> It does for any optimized build:
>
> $ gcc -v 2>&1 | grep 'gcc version'
> gcc version 11.3.0 (Ubuntu 11.3.0-1ubuntu1~22.04.1)
> $ gcc -dM -E - < /dev/null | grep -w _FORTIFY_SOURCE
> $ gcc -O2 -dM -E - < /dev/null | grep -w _FORTIFY_SOURCE
> #define _FORTIFY_SOURCE 2
>
> And I think this is a common configuration for recent distros.
Argh, I should have thought to try turning on optimization :-/
zw
More information about the Libc-alpha
mailing list