Clean Up Debugging Statements

This commit is contained in:
W. Felix Handte 2022-01-05 15:21:48 -05:00
parent ef1f9e80ff
commit ff5d1daf33
2 changed files with 1 additions and 16 deletions

View File

@ -101,26 +101,13 @@ FLAGS = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)
ifndef ALREADY_APPENDED_NOEXECSTACK
export ALREADY_APPENDED_NOEXECSTACK := 1
ifeq ($(shell echo "int main(int argc, char* argv[]) { (void)argc; (void)argv; return 0; }" | $(CC) $(FLAGS) -z noexecstack -x c -Werror - -o $(VOID) 2>$(VOID) && echo 1 || echo 0),1)
$(info Supports noexecstack linker flag!)
$(info $(LDFLAGS))
LDFLAGS += -z noexecstack
$(info $(LDFLAGS))
else
$(info Doesn't support noexecstack linker flag!)
endif
ifeq ($(shell echo | $(CC) $(FLAGS) -Wa,--noexecstack -x assembler -Werror -c - -o $(VOID) 2>$(VOID) && echo 1 || echo 0),1)
$(info Supports noexecstack assembler flag!)
$(info $(CFLAGS))
CFLAGS += -Wa,--noexecstack
$(info $(CFLAGS))
else ifeq ($(shell echo | $(CC) $(FLAGS) -Qunused-arguments -Wa,--noexecstack -x assembler -Werror -c - -o $(VOID) 2>$(VOID) && echo 1 || echo 0),1)
# See e.g.: https://github.com/android/ndk/issues/171
$(info Supports noexecstack assembler flag with unused arg suppression!)
$(info $(CFLAGS))
CFLAGS += -Qunused-arguments -Wa,--noexecstack
$(info $(CFLAGS))
else
$(info Doesn't support noexecstack assembler flag!)
endif
endif

View File

@ -306,9 +306,7 @@ zstd -d -f tmp.zst --no-check
if [ "$isWindows" = false ]; then
if [ -n "$(which readelf)" ]; then
println "test: check if binary has executable stack"
file "$ZSTD_BIN"
readelf -lW "$ZSTD_BIN"
println "test: check if binary has executable stack (#2963)"
readelf -lW "$ZSTD_BIN" | grep 'GNU_STACK .* RW ' || die "zstd binary has executable stack!"
fi
fi