Skip to content

Conversation

@sin-ack
Copy link

@sin-ack sin-ack commented Jan 21, 2026

Clang allows a full path to be passed to -fuse-ld=. However, GCC (and others?) don't allow this. If gold or lld is selected, the linker is not on a standard path (e.g. Gentoo, which allows multiple versions of LLVM to be installed in /usr/lib/llvm/<major>/) and --incompatible_strict_action_env is enabled, GCC won't know where the linker is located and fail to find the linker.

Now we always return the full linker path, and pass -fuse-ld= based on the compiler identity.

Fixes bazelbuild/bazel#26527.

Clang allows a full path to be passed to -fuse-ld=. However, GCC (and
others?) don't allow this. If gold or lld is selected, the linker is not
on a standard path (e.g. Gentoo, which allows multiple versions of LLVM
to be installed in /usr/lib/llvm/<major>/) and
--incompatible_strict_action_env is enabled, GCC won't know where the
linker is located and fail to find the linker.

Now we always return the full linker path, and pass -fuse-ld= based on
the compiler identity.

Fixes bazelbuild/bazel#26527.
@sin-ack
Copy link
Author

sin-ack commented Jan 21, 2026

Build failures appear to be docs related.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Linker path not passed in with -B when linker is auto-selected by Bazel

1 participant