Skip to content

[llvm] Mangle all llvm symbols to avoid collisions #7

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 4 commits into from
Feb 6, 2019

Conversation

benlangmuir
Copy link
Contributor

Rename all of the llvm symbols so that they will not collide if another copy of llvm is linked into the same image. The use of llvm within IndexStore is purely an implementation detail. Using a source-level rename is a workaround for the lack of symbol visibility controls in swiftpm. Ideally we could do this with a combination of -fvisibility=hidden and ld -r.

This allows us to link into sourcekit-lsp statically without colliding with symbols in llbuild.

We ended up deciding to fix the linking issues around llvm in a
different way, so this was unnecessary. If someone needs it we can
easily bring it back.
Adds an #include of a prefix header to every imported llvm file so that
we can use this to customize certain behaviours specifically for
indexstore-db. Clang has support for including prefix headers, but
swiftpm doesn't have a way to access it, so we use this instead.
Rename all of the llvm symbols so that they will not collide if another
copy of llvm is linked into the same image. The use of llvm within
IndexStore is purely an implementation detail. Using a source-level
rename is a workaround for the lack of symbol visibility controls in
swiftpm. Ideally we could do this with a combination of
`-fvisibility=hidden` and `ld -r`.

This allows us to link into sourcekit-lsp statically without colliding
with symbols in llbuild.
@benlangmuir benlangmuir requested a review from akyrtzi as a code owner February 6, 2019 21:34
@benlangmuir benlangmuir merged commit bbe9a1c into swiftlang:master Feb 6, 2019
@benlangmuir benlangmuir deleted the import branch February 6, 2019 21:37
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