Re: [PATCH] gcc: Disallow trampolines when -fhardened

2023-12-07 Thread Eric Botcazou
> I don't know either of these languages to write a test, and I don't see > anything that mentions the word trampoline in gfortran.dg/. Ada has > gnat.dg/trampoline3.adb but: > > $ gcc -c -Wtrampolines trampoline3.adb > trampoline3.adb:6:03: warning: variable "A" is read but never assigned >

Re: [PATCH] gcc: Disallow trampolines when -fhardened

2023-12-04 Thread Martin Uecker
Am Montag, dem 04.12.2023 um 11:46 -0500 schrieb Siddhesh Poyarekar: > On 2023-12-04 11:39, Andreas Schwab wrote: > > On Dez 04 2023, Siddhesh Poyarekar wrote: > > > > > For hardened code in C, I think we really should look to step away from > > > nested functions instead of adding ways to

Re: [PATCH] gcc: Disallow trampolines when -fhardened

2023-12-04 Thread Siddhesh Poyarekar
On 2023-12-04 11:39, Andreas Schwab wrote: On Dez 04 2023, Siddhesh Poyarekar wrote: For hardened code in C, I think we really should look to step away from nested functions instead of adding ways to continue supporting it. There's probably a larger conversation to be had about the utility of

Re: [PATCH] gcc: Disallow trampolines when -fhardened

2023-12-04 Thread Jakub Jelinek
On Mon, Dec 04, 2023 at 05:39:04PM +0100, Andreas Schwab wrote: > On Dez 04 2023, Siddhesh Poyarekar wrote: > > > For hardened code in C, I think we really should look to step away from > > nested functions instead of adding ways to continue supporting it. There's > > probably a larger

Re: [PATCH] gcc: Disallow trampolines when -fhardened

2023-12-04 Thread Andreas Schwab
On Dez 04 2023, Siddhesh Poyarekar wrote: > For hardened code in C, I think we really should look to step away from > nested functions instead of adding ways to continue supporting it. There's > probably a larger conversation to be had about the utility of nested > functions in general for C (and

Re: [PATCH] gcc: Disallow trampolines when -fhardened

2023-12-04 Thread Siddhesh Poyarekar
On 2023-12-02 04:42, Martin Uecker wrote: Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- It came up that a good hardening strategy is to disable trampolines which may require executable stack. Therefore the following patch adds -Werror=trampolines to -fhardened. This

Re: [PATCH] gcc: Disallow trampolines when -fhardened

2023-12-02 Thread Iain Sandoe
> On 2 Dec 2023, at 09:42, Martin Uecker wrote: > > >> Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? >> >> -- >8 -- >> It came up that a good hardening strategy is to disable trampolines >> which may require executable stack. Therefore the following patch >> adds

Re: [PATCH] gcc: Disallow trampolines when -fhardened

2023-12-02 Thread Martin Uecker
> Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? > > -- >8 -- > It came up that a good hardening strategy is to disable trampolines > which may require executable stack. Therefore the following patch > adds -Werror=trampolines to -fhardened. This would add a warning about

Re: [PATCH] gcc: Disallow trampolines when -fhardened

2023-12-01 Thread Jakub Jelinek
On Fri, Dec 01, 2023 at 03:53:14PM -0500, Marek Polacek wrote: > On Fri, Dec 01, 2023 at 11:44:28AM -0800, Andrew Pinski wrote: > > On Fri, Dec 1, 2023, 11:36 Marek Polacek wrote: > > > > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? > > > > > > -- >8 -- > > > It came up that a

Re: [PATCH] gcc: Disallow trampolines when -fhardened

2023-12-01 Thread Marek Polacek
On Fri, Dec 01, 2023 at 11:44:28AM -0800, Andrew Pinski wrote: > On Fri, Dec 1, 2023, 11:36 Marek Polacek wrote: > > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? > > > > -- >8 -- > > It came up that a good hardening strategy is to disable trampolines > > which may require

Re: [PATCH] gcc: Disallow trampolines when -fhardened

2023-12-01 Thread Andrew Pinski
On Fri, Dec 1, 2023, 11:36 Marek Polacek wrote: > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? > > -- >8 -- > It came up that a good hardening strategy is to disable trampolines > which may require executable stack. Therefore the following patch > adds -Werror=trampolines to

[PATCH] gcc: Disallow trampolines when -fhardened

2023-12-01 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- It came up that a good hardening strategy is to disable trampolines which may require executable stack. Therefore the following patch adds -Werror=trampolines to -fhardened. gcc/ChangeLog: * common.opt