Skip to content

[5.0] Split link flags and link libraries lists to make gold happy. #20871

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

Conversation

drodriguez
Copy link
Contributor

gold is more strict than lld about the order of the arguments, that's
why CMake offers two different properties for the linker: LINK_FLAGS and
LINK_LIBRARIES. The former _add_variant_link_flags was adding the
libraries to LINK_FLAGS, when the correct thing is to add them to
LINK_LIBRARIES.

The change adds a new output variable for _add_variant_link_flags which
will containt the linked libraries, and CMake will be able to generate
the correct command line invocation for when gold is used.

This should fix the Android CI build.

Cherry-picked from #20813

gold is more strict than lld about the order of the arguments, that's
why CMake offers two different properties for the linker: LINK_FLAGS and
LINK_LIBRARIES. The former _add_variant_link_flags was adding the
libraries to LINK_FLAGS, when the correct thing is to add them to
LINK_LIBRARIES.

The change adds a new output variable for _add_variant_link_flags which
will containt the linked libraries, and CMake will be able to generate
the correct command line invocation for when gold is used.

This should fix the Android CI build.
@drodriguez drodriguez requested a review from a team as a code owner November 29, 2018 19:02
@compnerd compnerd changed the title Split link flags and link libraries lists to make gold happy. [5.0] Split link flags and link libraries lists to make gold happy. Nov 30, 2018
@bob-wilson
Copy link
Contributor

@swift-ci please test

@bob-wilson bob-wilson merged commit fd1ef3d into swiftlang:swift-5.0-branch Dec 5, 2018
@drodriguez drodriguez deleted the fix-android-gold-link-flags-order branch January 7, 2019 19:35
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.

2 participants