diff --git a/run-tests.sh b/run-tests.sh index 23014d0..808a6bf 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -52,14 +52,14 @@ cat< is-ucrt.c #endif EOF ANY_ARCH=$(echo $ARCHS | awk '{print $1}') -if ! $ANY_ARCH-w64-mingw32-gcc -E is-ucrt.c > /dev/null 2>&1; then +if ! $ANY_ARCH-w64-mingw32-gcc$TOOLEXT -E is-ucrt.c > /dev/null 2>&1; then # If the default CRT isn't UCRT, we can't build for mingw32uwp. unset HAVE_UWP fi rm -f is-ucrt.c -if (echo "int main(){}" | $ANY_ARCH-w64-mingw32-clang -x c++ - -o has-cfguard-test.exe -mguard=cf); then - if llvm-readobj --coff-load-config has-cfguard-test.exe | grep -q 'CF_INSTRUMENTED (0x100)'; then +if (echo "int main(){}" | $ANY_ARCH-w64-mingw32-clang$TOOLEXT -x c++ - -o has-cfguard-test.exe -mguard=cf); then + if llvm-readobj$TOOLEXT --coff-load-config has-cfguard-test.exe | grep -q 'CF_INSTRUMENTED (0x100)'; then HAVE_CFGUARD=1 elif [ -n "$HAVE_CFGUARD" ]; then echo "error: Toolchain doesn't seem to include Control Flow Guard support." 1>&2 diff --git a/test/Makefile b/test/Makefile index 9a0d6ad..ebfa30a 100644 --- a/test/Makefile +++ b/test/Makefile @@ -252,8 +252,12 @@ ifeq ($(CMD),) FAILURE_TEST_TARGETS = $(addprefix .failtested., $(FAILURE_TESTS)) CUSTOM1_FAILURE_TEST_TARGETS = .customtest1.bufferoverflow-fortify$(EXEEXT) ifneq ($(HAVE_CFGUARD),) + ifeq ($(WSL),) + # These tests do special calling of cmd.exe, which don't quite + # work when running with Linux make in WSL. CUSTOM2_FAILURE_TEST_TARGETS = .customtest2.cfguard-test$(EXEEXT) endif + endif endif endif