Skip to content

Commit e41ff5c

Browse files
committed
Pass the linker version to libfuzzer tests on darwin (llvm#87719)
The HOST_LINK_VERSION is a hardcoded string in Darwin clang that detects the linker version at configure time. The driver uses this information to build the correct set of arguments for the linker. This patch detects the linker version again during compiler-rt configuration and passes it to the libfuzzer tests. This allows a clang built on a machine with a new linker to run compiler-rt tests on a machine with an old linker. rdar://125932376
1 parent f4d8849 commit e41ff5c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,12 @@ 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+
if "darwin" in config.available_features and getattr(
94+
config, "darwin_linker_version", None
95+
):
96+
extra_cmd = extra_cmd + " -mlinker-version=" + config.darwin_linker_version
97+
9298
return " ".join(
9399
[
94100
compiler_cmd,

0 commit comments

Comments
 (0)