From: "Thomas Weißschuh" <thomas@t-8ch.de>
To: Willy Tarreau <w@1wt.eu>
Cc: "Paul E. McKenney" <paulmck@kernel.org>,
Shuah Khan <shuah@kernel.org>,
Paul Walmsley <paul.walmsley@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Tom Rix <trix@redhat.com>,
linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-riscv@lists.infradead.org, llvm@lists.linux.dev
Subject: Re: [PATCH 7/7] tools/nolibc: simplify stackprotector compiler flags
Date: Sun, 21 May 2023 12:36:01 +0200 [thread overview]
Message-ID: <ccd8a189-0ca1-4462-8478-87b6c6ccb066@t-8ch.de> (raw)
In-Reply-To: <20230521-nolibc-automatic-stack-protector-v1-7-dad6c80c51c1@weissschuh.net>
On 2023-05-21 11:36:35+0200, Thomas Weißschuh wrote:
> Now that nolibc enable stackprotector support automatically when the
> compiler enables it we only have to get the -fstack-protector flags
> correct.
>
> The cc-options are structured so that -fstack-protector-all is only
> enabled if -mstack-protector=guard works, as that is the only mode
> supported by nolibc.
>
> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
> ---
> tools/testing/selftests/nolibc/Makefile | 13 ++-----------
> 1 file changed, 2 insertions(+), 11 deletions(-)
>
> diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile
> index bd41102ea299..445c352b1b33 100644
> --- a/tools/testing/selftests/nolibc/Makefile
> +++ b/tools/testing/selftests/nolibc/Makefile
> @@ -76,20 +76,11 @@ else
> Q=@
> endif
>
> -CFLAGS_STACKPROTECTOR = -DNOLIBC_STACKPROTECTOR \
> - $(call cc-option,-mstack-protector-guard=global) \
> - $(call cc-option,-fstack-protector-all)
> -CFLAGS_STKP_i386 = $(CFLAGS_STACKPROTECTOR)
> -CFLAGS_STKP_x86_64 = $(CFLAGS_STACKPROTECTOR)
> -CFLAGS_STKP_x86 = $(CFLAGS_STACKPROTECTOR)
> -CFLAGS_STKP_arm64 = $(CFLAGS_STACKPROTECTOR)
> -CFLAGS_STKP_arm = $(CFLAGS_STACKPROTECTOR)
> -CFLAGS_STKP_mips = $(CFLAGS_STACKPROTECTOR)
> -CFLAGS_STKP_riscv = $(CFLAGS_STACKPROTECTOR)
> -CFLAGS_STKP_loongarch = $(CFLAGS_STACKPROTECTOR)
> +CFLAGS_STACKPROTECTOR = $(call cc-option,-mstack-protector-guard=global -fstack-protector-all)
> CFLAGS_s390 = -m64
> CFLAGS ?= -Os -fno-ident -fno-asynchronous-unwind-tables -std=c89 \
> $(call cc-option,-fno-stack-protector) \
> + $(call cc-option,-mstack-protector-guard=global $(call cc-option,-fstack-protector-all)) \
> $(CFLAGS_STKP_$(ARCH)) $(CFLAGS_$(ARCH))
> LDFLAGS := -s
I noticed, of course after having sent the series, that the cleanup here
was not done properly.
CFLAGS_STACKPROTECTOR and CFLAGS_STKP should be deleted completely.
This will be fixed in v2, or feel free to fix it up when applying the
series.
next prev parent reply other threads:[~2023-05-21 11:48 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-21 9:36 [PATCH 0/7] tools/nolibc: autodetect stackprotector availability from compiler Thomas Weißschuh
2023-05-21 9:36 ` [PATCH 1/7] tools/nolibc: fix typo pint -> point Thomas Weißschuh
2023-05-21 9:36 ` [PATCH 2/7] tools/nolibc: x86_64: disable stack protector for _start Thomas Weißschuh
2023-05-21 9:36 ` [PATCH 3/7] tools/nolibc: ensure stack protector guard is never zero Thomas Weißschuh
2023-05-21 9:36 ` [PATCH 4/7] tools/nolibc: add test for __stack_chk_guard initialization Thomas Weißschuh
2023-05-21 9:36 ` [PATCH 5/7] tools/nolibc: reformat list of headers to be installed Thomas Weißschuh
2023-05-21 9:36 ` [PATCH 6/7] tools/nolibc: add autodetection for stackprotector support Thomas Weißschuh
2023-05-21 9:36 ` [PATCH 7/7] tools/nolibc: simplify stackprotector compiler flags Thomas Weißschuh
2023-05-21 10:36 ` Thomas Weißschuh [this message]
2023-05-23 20:12 ` Willy Tarreau
2023-05-23 20:38 ` Thomas Weißschuh
2023-05-23 20:50 ` Willy Tarreau
2023-05-21 10:08 ` [PATCH 0/7] tools/nolibc: autodetect stackprotector availability from compiler Willy Tarreau
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ccd8a189-0ca1-4462-8478-87b6c6ccb066@t-8ch.de \
--to=thomas@t-8ch.de \
--cc=aou@eecs.berkeley.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=llvm@lists.linux.dev \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=paulmck@kernel.org \
--cc=shuah@kernel.org \
--cc=trix@redhat.com \
--cc=w@1wt.eu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®