-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Pass the linker version to libfuzzer tests on darwin #87719
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pass the linker version to libfuzzer tests on darwin #87719
Conversation
@llvm/pr-subscribers-compiler-rt-sanitizer Author: Usama Hameed (usama54321) ChangesThe 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 Full diff: https://github.com/llvm/llvm-project/pull/87719.diff 1 Files Affected:
diff --git a/compiler-rt/test/fuzzer/lit.cfg.py b/compiler-rt/test/fuzzer/lit.cfg.py
index 4e203236b16708..9ecf162339f707 100644
--- a/compiler-rt/test/fuzzer/lit.cfg.py
+++ b/compiler-rt/test/fuzzer/lit.cfg.py
@@ -98,6 +98,9 @@ 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,
|
LGTM |
You can test this locally with the following command:darker --check --diff -r aa6ba23235b4418d528fe8df4d1cd6d2ad50ceb2...e9a6b273846ea4b6e63a8ccc791900990ac1f926 compiler-rt/test/fuzzer/lit.cfg.py View the diff from darker here.--- lit.cfg.py 2024-04-04 21:59:07.000000 +0000
+++ lit.cfg.py 2024-04-04 22:03:54.966410 +0000
@@ -96,11 +96,13 @@
# Avoids linker error:
# /failifmismatch: mismatch detected for 'annotate_string'
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):
+ 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,
|
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
e9a6b27
to
93c2485
Compare
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
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
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
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