Skip to content

Fix CMake build to explicitly pick up ar and ranlib from toolchain. #6721

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 18, 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

@swift-ci Please test

@MaxDesiatov
Copy link
Contributor

@swift-ci smoke test

@tomerd
Copy link
Contributor

tomerd commented Jul 18, 2023

@al45tair please create 5.9 cherry pick once this lands on main

Copy link
Contributor

@etcwilde etcwilde left a comment

Choose a reason for hiding this comment

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

Seems reasonable to me.

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.

4 participants