Skip to content

[5.9] Fix CMake build to explicitly pick up ar and ranlib from toolchain. #6729

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

Merged
merged 1 commit into from
Jul 19, 2023

Conversation

al45tair
Copy link
Contributor

CMake under various conditions will attempt to use llvm-ar and llvm-ranlib when it spots that we're building using clang, and while that works fine on Linux, it doesn't work so well on Darwin, leaving us with a link failure with a perplexing error message.

The rest of the Swift build is resilient to this problem already, but the bootstrap script here doesn't pass the relevant options to CMake, so it's possible to end up with the build failing when trying to link lib/libCYaml.a after the build has mangled the static library with llvm-ranlib.

rdar://112478653

CMake under various conditions will attempt to use `llvm-ar` and
`llvm-ranlib` when it spots that we're building using `clang`, and
while that works fine on Linux, it doesn't work so well on Darwin,
leaving us with a link failure with a perplexing error message.

The rest of the Swift build is resilient to this problem already,
but the `bootstrap` script here doesn't pass the relevant options
to CMake, so it's possible to end up with the build failing when
trying to link `lib/libCYaml.a` after the build has mangled the
static library with `llvm-ranlib`.

rdar://112478653
@al45tair
Copy link
Contributor Author

This is a cherry pick of #6721.

@al45tair al45tair requested review from MaxDesiatov and etcwilde July 19, 2023 09:49
@al45tair al45tair added the swift 5.9 This PR targets the 5.9 branch label Jul 19, 2023
Copy link
Contributor

@MaxDesiatov MaxDesiatov left a comment

Choose a reason for hiding this comment

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

Thanks!

@MaxDesiatov
Copy link
Contributor

@swift-ci clean test windows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
swift 5.9 This PR targets the 5.9 branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants