Skip to content

[cmake/AddSwift] When support is passed for LLVM_LINK_COMPONENTS also implicitly include demangle #38913

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

Conversation

akyrtzi
Copy link
Contributor

@akyrtzi akyrtzi commented Aug 17, 2021

Using support llvm component ends up adding -Xlinker /path/to/lib/libLLVMDemangle.a
to LINK_FLAGS but libLLVMDemangle.a is not added as an input to the linking ninja statement.
As a workaround, in order to setup precise inputs for the ninja link statement, include demangle component
whenever support is mentioned.

…so implicitly include `demangle`

Using `support` llvm component ends up adding `-Xlinker /path/to/lib/libLLVMDemangle.a`
to `LINK_FLAGS` but `libLLVMDemangle.a` is not added as an input to the linking ninja statement.
As a workaround, in order to setup precise inputs for the ninja link statement, include `demangle` component
whenever `support` is mentioned.
@akyrtzi akyrtzi requested a review from gottesmm August 17, 2021 21:55
@akyrtzi
Copy link
Contributor Author

akyrtzi commented Aug 17, 2021

@swift-ci smoke test

# to `LINK_FLAGS` but `libLLVMDemangle.a` is not added as an input to the linking ninja statement.
# As a workaround, include `demangle` component whenever `support` is mentioned.
if("support" IN_LIST ASHL_LLVM_LINK_COMPONENTS)
list(APPEND ASHL_LLVM_LINK_COMPONENTS "demangle")
Copy link
Contributor

Choose a reason for hiding this comment

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

I dislike this solution since it is a bit of a hack. But I think it is fine for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for reviewing!

@akyrtzi akyrtzi merged commit 8224df3 into swiftlang:main Aug 27, 2021
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