[compiler-rt] 65e5391 - Pass the linker version to libfuzzer tests on darwin (#87719)

via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 5 14:48:19 PDT 2024


Author: Usama Hameed
Date: 2024-04-05T14:48:16-07:00
New Revision: 65e5391657147d1bda3a4d9b26c9b3db0ca54fd7

URL: https://github.com/llvm/llvm-project/commit/65e5391657147d1bda3a4d9b26c9b3db0ca54fd7
DIFF: https://github.com/llvm/llvm-project/commit/65e5391657147d1bda3a4d9b26c9b3db0ca54fd7.diff

LOG: Pass the linker version to libfuzzer tests on darwin (#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

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/compiler-rt/test/fuzzer/lit.cfg.py b/compiler-rt/test/fuzzer/lit.cfg.py
index 4e203236b16708..9084254b3b15cd 100644
--- a/compiler-rt/test/fuzzer/lit.cfg.py
+++ b/compiler-rt/test/fuzzer/lit.cfg.py
@@ -98,6 +98,11 @@ def generate_compiler_cmd(is_cpp=True, fuzzer_enabled=True, msan_enabled=False):
     if "windows" in config.available_features:
         extra_cmd = extra_cmd + " -D_DISABLE_VECTOR_ANNOTATION -D_DISABLE_STRING_ANNOTATION"
 
+    if "darwin" in config.available_features and getattr(
+        config, "darwin_linker_version", None
+    ):
+        extra_cmd = extra_cmd + " -mlinker-version=" + config.darwin_linker_version
+
     return " ".join(
         [
             compiler_cmd,


        


More information about the llvm-commits mailing list