Skip to content
This repository was archived by the owner on Jan 20, 2024. It is now read-only.

Commit 0f62e7e

Browse files
committed
[compiler-rt] Fix fuzzer tests on Windows
This fixes a link-time mismatch between the clang_rt.fuzzer-x86_64.lib and the fuzzer tests, which happen to build with -fsanitize=address. See: https://learn.microsoft.com/en-us/cpp/sanitizers/error-container-overflow?view=msvc-170
1 parent 2ce430a commit 0f62e7e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

compiler-rt/test/fuzzer/lit.cfg.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,16 @@ def generate_compiler_cmd(is_cpp=True, fuzzer_enabled=True, msan_enabled=False):
8989
if fuzzer_enabled:
9090
sanitizers.append("fuzzer")
9191
sanitizers_cmd = "-fsanitize=%s" % ",".join(sanitizers)
92+
93+
# Since clang_rt.fuzzer-x86_64.lib is built without -fsanitize=address and
94+
# we're building with that flag here, the MSVC STL needs all libs to be
95+
# compiled with the same -fsanitize flags, see:
96+
# https://learn.microsoft.com/en-us/cpp/sanitizers/error-container-overflow?view=msvc-170
97+
# Avoids linker error:
98+
# /failifmismatch: mismatch detected for 'annotate_string'
99+
if "windows" in config.available_features:
100+
extra_cmd = extra_cmd + " -D_DISABLE_VECTOR_ANNOTATION -D_DISABLE_STRING_ANNOTATION"
101+
92102
return " ".join(
93103
[
94104
compiler_cmd,

0 commit comments

Comments
 (0)