diff options
author | Fabian Meumertzheim <fabian@meumertzhe.im> | 2021-08-16 18:27:23 +0200 |
---|---|---|
committer | Fabian Meumertzheim <fabian@meumertzhe.im> | 2021-08-16 20:04:28 +0200 |
commit | 5d23f7b6bbb188fb4976f7d8b641b0e3d7655970 (patch) | |
tree | de60f0a239599c25c5836790d306ed1c83e5fa1a | |
parent | 8e369a2df8f5fe0bbe694ffd3e619b0be4d64522 (diff) | |
download | jazzer-api-5d23f7b6bbb188fb4976f7d8b641b0e3d7655970.tar.gz |
Use lld only with clang on Linux
Restores compatibility with gcc on linux.
-rw-r--r-- | BUILD.bazel | 13 | ||||
-rw-r--r-- | driver/BUILD.bazel | 6 | ||||
-rw-r--r-- | examples/src/main/native/BUILD.bazel | 4 |
3 files changed, 18 insertions, 5 deletions
diff --git a/BUILD.bazel b/BUILD.bazel index 4ad9b371..c98d0d72 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -81,3 +81,16 @@ alias( name = "jazzer-api.publish", actual = "//agent/src/main/java/com/code_intelligence/jazzer/api:api_export.publish", ) + +config_setting( + name = "clang", + flag_values = {"@bazel_tools//tools/cpp:compiler": "clang"}, +) + +alias( + name = "clang_on_linux", + actual = select({ + ":clang": "@platforms//os:linux", + "//conditions:default": ":clang", + }), +) diff --git a/driver/BUILD.bazel b/driver/BUILD.bazel index d38acffc..905289e6 100644 --- a/driver/BUILD.bazel +++ b/driver/BUILD.bazel @@ -91,7 +91,7 @@ cc_binary( linkopts = [ "-rdynamic", ] + select({ - "@platforms//os:linux": ["-fuse-ld=lld"], + "//:clang_on_linux": ["-fuse-ld=lld"], "//conditions:default": [], }), visibility = ["//visibility:public"], @@ -118,7 +118,7 @@ cc_binary( "-static-libsan", "-rdynamic", ] + select({ - "@platforms//os:linux": ["-fuse-ld=lld"], + "//:clang_on_linux": ["-fuse-ld=lld"], "//conditions:default": [], }), visibility = ["//visibility:public"], @@ -142,7 +142,7 @@ cc_binary( "-fsanitize-link-c++-runtime", "-rdynamic", ] + select({ - "@platforms//os:linux": ["-fuse-ld=lld"], + "//:clang_on_linux": ["-fuse-ld=lld"], "//conditions:default": [], }), visibility = ["//visibility:public"], diff --git a/examples/src/main/native/BUILD.bazel b/examples/src/main/native/BUILD.bazel index 255e3509..91d6f8cd 100644 --- a/examples/src/main/native/BUILD.bazel +++ b/examples/src/main/native/BUILD.bazel @@ -10,7 +10,7 @@ cc_shared_library( "-fsanitize=fuzzer-no-link,address", ], linkopts = select({ - "@platforms//os:linux": ["-fuse-ld=lld"], + "//:clang_on_linux": ["-fuse-ld=lld"], "//conditions:default": [], }), visibility = ["//examples:__pkg__"], @@ -30,7 +30,7 @@ cc_shared_library( "-fno-sanitize-recover=all", ], linkopts = select({ - "@platforms//os:linux": ["-fuse-ld=lld"], + "//:clang_on_linux": ["-fuse-ld=lld"], "//conditions:default": [], }), visibility = ["//examples:__pkg__"], |