From 697c31abe442c3fe5e783994312ccfdbe5b4d265 Mon Sep 17 00:00:00 2001 From: Igor Svilenkov Bozic Date: Sat, 6 Sep 2025 19:40:35 +0200 Subject: [PATCH] zdtm: shstk: add SHSTK_ENABLE test build option * add SHSTK_ENABLE=1 toggle * passes -mshstk to compiler and -z shstk to linker Example: $ make -C test/zdtm/static clean $ make -C test/zdtm/static V=1 SHSTK_ENABLE=1 env00 $ readelf --notes test/zdtm/static/env00 | grep SHSTK Properties: x86 feature: SHSTK Signed-off-by: Igor Svilenkov Bozic Co-Authored-By: Andrei Vagin Signed-off-by: Alexander Mikhalitsyn --- test/zdtm/Makefile.inc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/zdtm/Makefile.inc b/test/zdtm/Makefile.inc index 3b349ed4d..465285f08 100644 --- a/test/zdtm/Makefile.inc +++ b/test/zdtm/Makefile.inc @@ -66,6 +66,11 @@ endif export PKG_CONFIG_PATH endif +ifeq ($(SHSTK_ENABLE),1) + CFLAGS += -mshstk + LDFLAGS += -Wl,-z,shstk +endif + define pkg-libs $(shell PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)" $(PKG_CONFIG) --libs $(1)) endef