Re: Hot to test for _FORTIFY_SOURCE with Autoconf

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Mar 17, 2020 at 6:49 PM Martin Sebor via Gcc-help
<gcc-help@xxxxxxxxxxx> wrote:
> > On Tue, Mar 17, 2020 at 8:11 PM Jonathan Wakely <jwakely.gcc@xxxxxxxxx> wrote:
> > I think it is related to object size checking.
>
> In GCC 10 you can test __has_builtin (__builtin_object_size).  In GCC
> versions that don't support __has_builtin using __builtin_object_size
> will either compile or not, depending on whether it's supported.  It
> doesn't depend on any macros.

That is a good way to test if the compiler has object size checking
support, but it is no guarantee that the C library has FORTIFY_SOURCE
support.  If it is fortify source support that you need, then you need
to explicitly check for that.  If it is just the object size checking
support you need, then you can do the check this way.

Jim



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux