Skip to content

[5.10][CMake] Add option to specify '-module-abi-name' #2288

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Oct 16, 2023

Cherry-pick #2282 into release/5.10

  • Explanation: Add SWIFT_MODULE_ABI_NAME_PREFIX CMake variable to swift-syntax libraries. Without this, (lib)sourcekitdInProc.{dylib|so|dll} was unusable if the binary links with swift-syntax via SwiftPM dependency, because sourcekitdInProc's swift-syntax symbols conflict with them. By differentiating the ABI name of the compiler's swift-syntax libraries, it can avoids name conflicts.
  • Risk: Low, no code change. -module-abi-name is a well-tested reliable option.
  • Testing: Passes current test-suite
  • Issues: rdar://116951101 , After building SwiftLint in Linux, a runtime error is generated when attempting to Lint a file. swift#68812
  • Reviewer: Alex Hoppen (@ahoppen), Ben Barham (@bnbarham)

Add 'SWIFT_MODULE_ABI_NAME_PREFIX' CMake variable. This can be used from
compiler's CMake so its swift-syntax libraries can have unique names.
That avoids symbol name conflicts when compiler libraries (e.g.
sourcekitdInProc) is used from binaries linking with swift-syntax (e.g.
via SwiftPM)

swiftlang/swift#68812
rdar://116951101
@rintaro rintaro requested a review from ahoppen as a code owner October 16, 2023 15:50
@rintaro
Copy link
Member Author

rintaro commented Oct 16, 2023

@swift-ci Please test

@rintaro rintaro merged commit 9822504 into swiftlang:release/5.10 Oct 16, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants