Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[build] fix lld linker path #2898

Merged
merged 1 commit into from
Oct 10, 2024
Merged

[build] fix lld linker path #2898

merged 1 commit into from
Oct 10, 2024

Conversation

fhanau
Copy link
Collaborator

@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 mikea and anonrig October 10, 2024 19:25
@fhanau fhanau requested review from a team as code owners October 10, 2024 19:25
.bazelrc Outdated
@@ -320,7 +320,7 @@ build:release_macos --linkopt="-Wl,-no_function_starts"
# We could use Xcode 16's -Wl,-deduplicate option instead, but LLD's ICF appears to be superior.
# 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
Member

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
Collaborator 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
Collaborator 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 merged commit 91d97b9 into main Oct 10, 2024
13 checks passed
@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