Skip to content

Fix duplicate symbols static-linking failure by renaming symbols #500

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

kateinoigakukun
Copy link
Member

@kateinoigakukun kateinoigakukun commented Jun 18, 2022

_swift_stdlib_XX symbols defined in _CUnicode module are also defined in runtime library as hidden visibility.
It works in linking as a shared library, but it doesn't when statically linking with lld, which resolves lib_StringProcessing.a's _swift_stdlib_getScript and loads UnicodeScalarProps.c.o, then loads libswiftCore.a's UnicodeScalarProps.cpp.o for other _swift_stdlib_XX symbols that are not defined in UnicodeScalarProps.c.o.

This patch tries to fix the failure by renaming those symbols in _CUnicode module.

XFAILing test has been added by swiftlang/swift#59556, and will be un-XFAILed by swiftlang/swift#59562

_swift_stdlib_XX symbols defined in _CUnicode module are also defined in
runtime library as hidden visibility. It works in linking as a shared
library, but it doesn't when statically linking with lld, which resolves
lib_StringProcessing.a's _swift_stdlib_getScript and loads
UnicodeScalarProps.c.o, then loads libswiftCore.a's
UnicodeScalarProps.cpp.o for other _swift_stdlib_XX symbols that are not
defined in UnicodeScalarProps.c.o.
@milseman
Copy link
Member

@Azoy can you look at this?

Copy link
Contributor

@Azoy Azoy left a comment

Choose a reason for hiding this comment

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

This looks good as a workaround until #255 is landed. Thanks!

@Azoy
Copy link
Contributor

Azoy commented Jun 18, 2022

@swift-ci please test

@Azoy Azoy merged commit 14eb23f into swiftlang:swift/main Jun 18, 2022
@kateinoigakukun
Copy link
Member Author

Thanks!

@kateinoigakukun kateinoigakukun deleted the katei/fix-unicode-duplicate-syms branch June 21, 2022 04:25
kateinoigakukun added a commit to swiftwasm/swift that referenced this pull request Nov 3, 2022
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