diff options
-rw-r--r-- | driver/BUILD.bazel | 15 | ||||
-rw-r--r-- | examples/src/main/native/BUILD.bazel | 8 |
2 files changed, 20 insertions, 3 deletions
diff --git a/driver/BUILD.bazel b/driver/BUILD.bazel index 8a0762ea..8e095559 100644 --- a/driver/BUILD.bazel +++ b/driver/BUILD.bazel @@ -79,7 +79,10 @@ cc_binary( ], linkopts = [ "-rdynamic", - ], + ] + select({ + "@platforms//os:linux": ["-fuse-ld=lld"], + "//conditions:default": [], + }), visibility = ["//visibility:public"], deps = [":driver_lib"], ) @@ -103,7 +106,10 @@ cc_binary( "-fsanitize=address", "-static-libsan", "-rdynamic", - ], + ] + select({ + "@platforms//os:linux": ["-fuse-ld=lld"], + "//conditions:default": [], + }), visibility = ["//visibility:public"], deps = [":driver_lib"] + select({ # There is no static ASan runtime on macOS, so link to the dynamic @@ -123,7 +129,10 @@ cc_binary( # Link UBSan statically, even on macOS. "-static-libsan", "-rdynamic", - ], + ] + select({ + "@platforms//os:linux": ["-fuse-ld=lld"], + "//conditions:default": [], + }), visibility = ["//visibility:public"], deps = [":driver_lib"], ) diff --git a/examples/src/main/native/BUILD.bazel b/examples/src/main/native/BUILD.bazel index f2587cbe..12bbc120 100644 --- a/examples/src/main/native/BUILD.bazel +++ b/examples/src/main/native/BUILD.bazel @@ -9,6 +9,10 @@ cc_shared_library( copts = [ "-fsanitize=fuzzer-no-link,address", ], + linkopts = select({ + "@platforms//os:linux": ["-fuse-ld=lld"], + "//conditions:default": [], + }), visibility = ["//examples:__pkg__"], deps = [ "@bazel_tools//tools/jdk:jni", @@ -27,6 +31,10 @@ cc_shared_library( # Workaround for https://github.com/bazelbuild/bazel/issues/11122. "-fno-sanitize=vptr,function", ], + linkopts = select({ + "@platforms//os:linux": ["-fuse-ld=lld"], + "//conditions:default": [], + }), visibility = ["//examples:__pkg__"], deps = [ "@bazel_tools//tools/jdk:jni", |