Skip to content
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

[DNM] set the linkage of some symbols to internal #1057

Closed
wants to merge 5 commits into from

Conversation

dwightguth
Copy link
Collaborator

@dwightguth dwightguth commented May 14, 2024

Each semantics exports a large number of semantics-specific global symbols. If we want to create applications which link in libraries for multiple semantics of the llvm backend, this is a problem, because symbols will collide with one another.

This PR is the first step of attempting to resolve this problem. Some symbols that are currently externally visible can simply be replaced with internal linkage in llvm, thus allowing them to be automatically renamed by the linker when they occur in multiple semantics.

Note that this does not fully resolve the problem. There are still two other classes of symbols that are an issue:

  1. symbols that are generated to interface the code generator with the runtime, which the runtime needs to be able to call, but which need to be made somehow local to the semantics.
  2. symbols which are intended to be part of the public API of the semantics, and thus need to be callable by applications which link against these libraries.

These will require a more complex solution that will come in a follow-up pull request.

Don't merge this yet. I am experimenting with another solution right now.

@rv-jenkins rv-jenkins changed the base branch from master to develop May 14, 2024 16:30
@dwightguth dwightguth marked this pull request as ready for review May 14, 2024 18:18
@dwightguth dwightguth changed the title set the linkage of some symbols to internal [DNM] set the linkage of some symbols to internal May 14, 2024
@Baltoli
Copy link
Contributor

Baltoli commented May 15, 2024

The changes here seem locally fine so I've approved in the event that your experimental alternative doesn't work out.

@dwightguth dwightguth closed this May 15, 2024
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