Skip to content

[build] fix lld linker path#2898

Merged
fhanau merged 1 commit into
mainfrom
felix/101024-macOS-ci
Oct 10, 2024
Merged

[build] fix lld linker path#2898
fhanau merged 1 commit into
mainfrom
felix/101024-macOS-ci

Conversation

@fhanau
Copy link
Copy Markdown
Contributor

@fhanau fhanau commented Oct 10, 2024

This appears to be needed for the clang driver to find LLD when using older clang versions.

=============

This (hopefully) fixes macOS CI release builds.

@fhanau fhanau requested review from anonrig and mikea October 10, 2024 19:25
@fhanau fhanau requested review from a team as code owners October 10, 2024 19:25
Comment thread .bazelrc Outdated
# We also want to enable ICF for Linux, but there it causes warnings when dynamically linking with
# libc++.
build:macos_lld --linkopt="-fuse-ld=/opt/homebrew/bin/ld64.lld"
build:macos_lld --linkopt=-fuse-ld=lld --linkopt=--ld-path=/opt/homebrew/bin/ld64.lld
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q: Is there an assertion in anywhere in the build pipeline so that homebrew is installed and these expectations (such as /homebrew/bin/ld64.lld are available?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With #2884, macos_lld is a build configuration we opt in to in the release job, and we run brew install lld before that. Homebrew itself is always installed in the image.
Now that I think about it the /opt/homebrew/bin/ld64.lld requirement is precisely why this is actually failing – the homebrew binary paths are different on x86 and Apple Silicon, and since the release job is on x86 we'll need different paths here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Figured out a way to not use an absolute path – glad there's a platform-independent option!

This appears to be needed for the clang driver to find LLD when using older
clang versions.
@fhanau fhanau force-pushed the felix/101024-macOS-ci branch from 2fd4ec1 to 4f2fe3e Compare October 10, 2024 19:54
@fhanau fhanau merged commit 91d97b9 into main Oct 10, 2024
@fhanau fhanau deleted the felix/101024-macOS-ci branch October 10, 2024 19:58
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.

3 participants