Skip to content

Commit

Permalink
tools/nolibc: tests: fold in no-stack-protector cflags
Browse files Browse the repository at this point in the history
For the cflags to enable stack protectors to work properly they need to
be specified after -fno-stack-protector.

To do this fold all cflags into a single variable and move
-fno-stack-protector before the arch-specific cflags and another
one specific to stack protectors since we don't want to enable them
on all archs.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
  • Loading branch information
Thomas Weißschuh authored and Paul E. McKenney committed Mar 27, 2023
1 parent 7188d46 commit 255ffee
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tools/testing/selftests/nolibc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,9 @@ Q=@
endif

CFLAGS_s390 = -m64
CFLAGS ?= -Os -fno-ident -fno-asynchronous-unwind-tables $(CFLAGS_$(ARCH))
CFLAGS += $(call cc-option,-fno-stack-protector)
CFLAGS ?= -Os -fno-ident -fno-asynchronous-unwind-tables \
$(call cc-option,-fno-stack-protector) \
$(CFLAGS_STKP_$(ARCH)) $(CFLAGS_$(ARCH))
LDFLAGS := -s

help:
Expand Down

0 comments on commit 255ffee

Please sign in to comment.