Skip to content

Commit

Permalink
Support using unversioned lld as linker too (#8189)
Browse files Browse the repository at this point in the history
* Support using unversioend lld as linker too

On Fedora and RHEL the `lld` executable is the plain unversioned `lld`.
That's also usable as a linker if it's recent enough.

See dotnet/runtime#58959 (comment)
for more details and discussion.

* Query clang's -fuse-ld to decide whether lld is okay to use

Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>

Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
  • Loading branch information
omajid and am11 authored Nov 22, 2021
1 parent d8d35c7 commit 9a3b642
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion eng/common/native/init-compiler.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ if [[ -z "$CC" ]]; then
fi

if [[ "$compiler" == "clang" ]]; then
if command -v "lld$desired_version" > /dev/null; then
if "$CC" -fuse-ld=lld -Wl,--version 2>&1; then
# Only lld version >= 9 can be considered stable
if [[ "$majorVersion" -ge 9 ]]; then
LDFLAGS="-fuse-ld=lld"
Expand Down

0 comments on commit 9a3b642

Please sign in to comment.