Re: [PATCH v5] gcc: Introduce -fhardened

2023-11-27 Thread Marek Polacek
On Sun, Nov 26, 2023 at 11:59:04AM +0100, FX Coudert wrote: > Hi Marek, > > The new test at gcc.target/i386/cf_check-6.c fails on darwin with: > Excess errors: > cc1: warning: '-fhardened' not supported for this target > > Other tests are only run on Linux, so I added this to >

Re: [PATCH v5] gcc: Introduce -fhardened

2023-11-26 Thread FX Coudert
Hi Marek, The new test at gcc.target/i386/cf_check-6.c fails on darwin with: Excess errors: cc1: warning: '-fhardened' not supported for this target Other tests are only run on Linux, so I added this to gcc.target/i386/cf_check-6.c as well. Pushed as

Re: [PATCH v5] gcc: Introduce -fhardened

2023-11-23 Thread Marek Polacek
On Tue, Nov 21, 2023 at 10:41:10AM -0500, Marek Polacek wrote: > On Mon, Nov 20, 2023 at 05:32:47PM +0100, Jakub Jelinek wrote: > > LGTM. > > Thanks a lot. Since Richi seems to be fine with the patch as well, > I'll push it tomorrow AM if no comments. Pushed. I'll update changes.html now.

Re: [PATCH v5] gcc: Introduce -fhardened

2023-11-21 Thread Marek Polacek
On Mon, Nov 20, 2023 at 05:32:47PM +0100, Jakub Jelinek wrote: > LGTM. Thanks a lot. Since Richi seems to be fine with the patch as well, I'll push it tomorrow AM if no comments. Marek

Re: [PATCH v5] gcc: Introduce -fhardened

2023-11-21 Thread Jakub Jelinek
On Thu, Nov 16, 2023 at 03:51:22PM -0500, Marek Polacek wrote: > Thanks, that's a good point. In this version I've added a target hook. > > On my system, -D_FORTIFY_SOURCE=3 will be used, and if I remove > linux_fortify_source_default_level it's =2 as expected. > > The only problem was that it

[PATCH v5] gcc: Introduce -fhardened

2023-11-16 Thread Marek Polacek
On Wed, Nov 15, 2023 at 01:25:27PM +0100, Jakub Jelinek wrote: > On Fri, Nov 03, 2023 at 06:51:16PM -0400, Marek Polacek wrote: > > + if (flag_hardened) > > + { > > + if (!fortify_seen_p && optimize > 0) > > + { > > + if (TARGET_GLIBC_MAJOR == 2 && TARGET_GLIBC_MINOR >=