Re: [PATCH][RFC] add -[DU]_FORTIFY_SOURCE[=n] to DW_AT_producer

2025-03-13 Thread Richard Biener
On Thu, 13 Mar 2025, Jakub Jelinek wrote: > On Thu, Mar 13, 2025 at 03:44:21PM +0100, Richard Biener wrote: > > + case OPT_D: > > + case OPT_U: > > + if (strncmp (options[i].arg, "_FORTIFY_SOURCE", > > +strlen ("_FORTIFY_SOURCE")) == 0) > > I'd say you want to verify t

Re: [PATCH][RFC] add -[DU]_FORTIFY_SOURCE[=n] to DW_AT_producer

2025-03-13 Thread Jakub Jelinek
On Thu, Mar 13, 2025 at 03:51:15PM +0100, Richard Biener wrote: > On Thu, 13 Mar 2025, Jakub Jelinek wrote: > > > On Thu, Mar 13, 2025 at 03:44:21PM +0100, Richard Biener wrote: > > > + case OPT_D: > > > + case OPT_U: > > > + if (strncmp (options[i].arg, "_FORTIFY_SOURCE", > > > +

Re: [PATCH][RFC] add -[DU]_FORTIFY_SOURCE[=n] to DW_AT_producer

2025-03-13 Thread Jakub Jelinek
On Thu, Mar 13, 2025 at 04:11:51PM +0100, Andreas Schwab wrote: > On Mär 13 2025, Richard Biener wrote: > > > The following makes sure to record -D_FORTIFY_SOURCE=n and > > -U_FORTIFY_SOURCE in the DW_AT_producer debuginfo attribute when > > present on the compiler command line. > > Should this a

Re: [PATCH][RFC] add -[DU]_FORTIFY_SOURCE[=n] to DW_AT_producer

2025-03-13 Thread Andreas Schwab
On Mär 13 2025, Richard Biener wrote: > The following makes sure to record -D_FORTIFY_SOURCE=n and > -U_FORTIFY_SOURCE in the DW_AT_producer debuginfo attribute when > present on the compiler command line. Should this also handle defines passed via -Wp? -- Andreas Schwab, SUSE Labs, sch...@suse

Re: [PATCH][RFC] add -[DU]_FORTIFY_SOURCE[=n] to DW_AT_producer

2025-03-13 Thread Jakub Jelinek
On Thu, Mar 13, 2025 at 03:44:21PM +0100, Richard Biener wrote: > + case OPT_D: > + case OPT_U: > + if (strncmp (options[i].arg, "_FORTIFY_SOURCE", > + strlen ("_FORTIFY_SOURCE")) == 0) I'd say you want to verify that after that substring there is either '\0' or "=".

[PATCH][RFC] add -[DU]_FORTIFY_SOURCE[=n] to DW_AT_producer

2025-03-13 Thread Richard Biener
The following makes sure to record -D_FORTIFY_SOURCE=n and -U_FORTIFY_SOURCE in the DW_AT_producer debuginfo attribute when present on the compiler command line. We seem to want this internally now, not sure whether others also need this (I'm happily carrying this downstream). Bootstrapped on x86