From: H.J. Lu Date: Tue, 11 Jan 2022 18:36:44 +0000 (-0800) Subject: x86: Append -z cet-report=error to LDFLAGS X-Git-Tag: v1.5.4^2~276^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d6fcdd123cbf05735c894c81599a0926c3427d4f;p=thirdparty%2Fzstd.git x86: Append -z cet-report=error to LDFLAGS Append -z cet-report=error to LDFLAGS if -fcf-protection is enabled by default in compiler to catch the missing Intel CET marker: compiling multi-threaded dynamic library 1.5.1 /usr/local/bin/ld: obj/conf_f408b4c825de923ffc88f7f21b6884b1/dynamic/huf_decompress_amd64.o: error: missing IBT and SHSTK properties collect2: error: ld returned 1 exit status ... LINK obj/conf_dbc0b41e36c44111bb0bb918e093d7c1/zstd /usr/local/bin/ld: obj/conf_dbc0b41e36c44111bb0bb918e093d7c1/huf_decompress_amd64.o: error: missing IBT and SHSTK properties collect2: error: ld returned 1 exit status --- diff --git a/lib/libzstd.mk b/lib/libzstd.mk index 6e9a64395..df298d789 100644 --- a/lib/libzstd.mk +++ b/lib/libzstd.mk @@ -114,6 +114,10 @@ CFLAGS += -Qunused-arguments -Wa,--noexecstack endif endif +ifeq ($(shell echo "int main(int argc, char* argv[]) { (void)argc; (void)argv; return 0; }" | $(CC) $(FLAGS) -z cet-report=error -x c -Werror - -o $(VOID) 2>$(VOID) && echo 1 || echo 0),1) +LDFLAGS += -z cet-report=error +endif + HAVE_COLORNEVER = $(shell echo a | grep --color=never a > /dev/null 2> /dev/null && echo 1 || echo 0) GREP_OPTIONS ?= ifeq ($HAVE_COLORNEVER, 1)