Skip to content

Commit 5cda6a2

Browse files
committed
more hardening flags from OpenSSF recommendation 11/2023
1 parent de3939c commit 5cda6a2

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

Makefile.in

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,13 @@ ifeq "$(GCCMAJORGTEQ4)" "1"
153153
# solves "Undefined symbol lua_settop" error when lua
154154
# script tries to request external library
155155
LDFLAGS += -Wl,--export-dynamic
156+
# more flags from OpenSSF recommendation 11/2023
157+
# https://best.openssf.org/Compiler-Hardening-Guides/Compiler-Options-Hardening-Guide-for-C-and-C++
158+
STDCCFLAGS += -D_GLIBCXX_ASSERTIONS -fstack-clash-protection -fstack-protector-strong -Wtrampolines -fno-delete-null-pointer-checks -fno-strict-overflow -fno-strict-aliasing
159+
LDFLAGS += -Wl,-z,nodlopen -Wl,-z,noexecstack
160+
ifeq ($(MACHTYPE),x86_64)
161+
STDCCFLAGS += -fcf-protection=full
162+
endif
156163
endif # gcc >= 4.x.x
157164
endif # linux
158165

0 commit comments

Comments
 (0)