bazelbuild / bazel

a fast, scalable, multi-language and extensible build system
https://bazel.build
Apache License 2.0
22.94k stars 4.02k forks source link

Replace -fuse-ld=/path/to/ld with -fuse-ld={gold,lld,bfd} --ld-path=/path/to/ld for clang>=12.0.0 #13252

Open MaskRay opened 3 years ago

MaskRay commented 3 years ago

Description of the problem / feature request:

In Clang, -fuse-ld=/path/to/ld was abused to detect the linker flavor (by looking at known infixes like "lld" - which is brittle) and provide linker option suggestions (clang driver needs to know the linker flavor to provide different options in some cases). In GCC, only -fuse-ld={bfd,lld,gold} are supported (no -fuse-ld=/path/to/ld).

Clang 12 introduced --ld-path=/path/to/ld (and the relative form --ld-path=rel/path/to/ld) to specify the exact path. -fuse-ld=/path/to/ld is warned by -Wuse-ld-path (included in -Wextra).

github-actions[bot] commented 1 year ago

Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 2+ years. It will be closed in the next 14 days unless any other activity occurs or one of the following labels is added: "not stale", "awaiting-bazeler". Please reach out to the triage team (@bazelbuild/triage) if you think this issue is still relevant or you are interested in getting the issue resolved.

MaskRay commented 1 year ago

@bazelbuild/triage

This is still an issue. tools/cpp/unix_cc_configure.bzl has ["-fuse-ld=" + gold_or_lld_linker_path] if gold_or_lld_linker_path else [] that likely contains a path separator.

github-actions[bot] commented 1 month ago

Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 90 days unless any other activity occurs. If you think this issue is still relevant and should stay open, please post any comment here and the issue will no longer be marked as stale.