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 <svilenkov@gmail.com>
Co-Authored-By: Andrei Vagin <avagin@gmail.com>
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
This commit is contained in:
Igor Svilenkov Bozic 2025-09-06 19:40:35 +02:00 committed by Andrei Vagin
parent 6fd71b9ee9
commit 697c31abe4

View file

@ -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