From 626409108d0147eef4e03173cee0b2780144b528 Mon Sep 17 00:00:00 2001 From: Rot127 Date: Thu, 22 Aug 2024 06:20:33 -0500 Subject: [PATCH] Check for test_corpus build --- bindings/python/setup.py | 9 ++++++--- suite/fuzz/Makefile | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/bindings/python/setup.py b/bindings/python/setup.py index 6af9c2fa8a..52c86b0306 100755 --- a/bindings/python/setup.py +++ b/bindings/python/setup.py @@ -136,13 +136,16 @@ def build_libraries(): # Windows build: this process requires few things: # - MSVC installed # - Run this command in an environment setup for MSVC - if not os.path.exists("build"): - os.mkdir("build") - os.chdir("build") + if not os.path.exists("build_py"): + os.mkdir("build_py") + os.chdir("build_py") print("Build Directory: {}\n".format(os.getcwd())) # Only build capstone.dll / libcapstone.dylib if SYSTEM == "win32": os.system('cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DCAPSTONE_BUILD_LEGACY_TESTS=OFF -DCAPSTONE_BUILD_CSTOOL=OFF -G "NMake Makefiles" ..') + elif 'AFL_NOOPT' in os.environ: + # build for test_corpus + os.system('cmake -DBUILD_SHARED_LIBS=ON -DCAPSTONE_BUILD_LEGACY_TESTS=OFF -DCAPSTONE_BUILD_CSTOOL=OFF ..') else: os.system('cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DCAPSTONE_BUILD_LEGACY_TESTS=OFF -DCAPSTONE_BUILD_CSTOOL=OFF -G "Unix Makefiles" ..') os.system("cmake --build .") diff --git a/suite/fuzz/Makefile b/suite/fuzz/Makefile index 99f9106321..4c84681497 100644 --- a/suite/fuzz/Makefile +++ b/suite/fuzz/Makefile @@ -81,7 +81,7 @@ else $(link-static) endif -$(FUZZERBIN): FUZZLDFLAGS="-fsanitize=fuzzer" +$(FUZZERBIN): FUZZLDFLAGS="-fsanitize=fuzzer -fno-sanitize-coverage=stack-depth" $(FUZZERBIN): fuzz_disasm.o platform.o @mkdir -p $(@D)