-
Notifications
You must be signed in to change notification settings - Fork 10.5k
runtime: ingest LLVMSupport into the runtime #31665
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
Conversation
I'll be updating the commit message to include this, but LLVMSupport was forked at 22492eead218ec91d349c8c50439880fbeacf2b7. The allocation updates are corresponding to upstream changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yaay
Do we need all of llvmSupport? Can we bring over only the bits we use? |
@jckarter I believe that we dont need all of LLVMSupport. My intention is to bring it in its entirety to compile. Im going to more or less immediately follow this up with 2 changes:
I want to introduce the library in its complete form because its much easier to track the provenance that way. It makes it simpler to split the operation into copy, delete rather than do it as one. However, Im happy to just stack that into this change and merge the entire thing at once, as long as the steps remain to help make it easier to follow what happened. |
@swift-ci please test |
Build failed |
Build failed |
Please test with following PRs: @swift-ci please test |
Build failed |
Build failed |
Please test with following PRs: @swift-ci please test |
Build failed |
Please test with following PRs: @swift-ci please test macOS platform |
Please test with following PRs: @swift-ci please test windows platform |
Build failed |
Build failed |
Please test with following PRs: @swift-ci please test |
Build failed |
Build failed |
51afc8b
to
70d4f34
Compare
Please test with following PRs: @swift-ci please test |
Build failed |
Build failed |
@swift-ci please test |
Build failed |
Build failed |
@swift-ci please test |
Build failed |
Build failed |
@swift-ci please test windows platform |
@swift-ci please test Linux platform |
@swift-ci please test |
Build failed |
@swift-ci please test Windows platform |
This symbol is actually leaked on all the platforms, and can be cleaned up subsequently |
@swift-ci please test macOS platform |
Linux is also in sync with macOS here |
Build failed |
This adds a new copy of LLVMSupport into the runtime. This is the final step before changing the inline namespace for the runtime support. This will allow us to avoid the ODR violations from the header definitions of LLVMSupport. LLVMSupport forked at: 22492eead218ec91d349c8c50439880fbeacf2b7 Changes made to LLVMSupport from that revision: process.inc forward declares `_beginthreadex` due to compilation issues due to custom flag handling API changes required that we alter the `Deallocate` routine to account for the alignment. This is a temporary state, meant to simplify the process. We do not use the entire LLVMSupport library and there is no value in keeping the entire library. Subsequent commits will prune the library to the needs for the runtime.
This adds the `__swift::__runtime` inline namespace to the LLVMSupport interfaces. This avoids an ODR violation when LLVM and Swift are in the same address space. It also will aid in the process of pruning the LLVMSupport library by ensuring that accidental leakage of the llvm namespace does not allow us to remove symbols which we rely on.
Reduce LLVMSupport to the subset required for the runtime. This reduces the TCB and the overheads of the runtime. The inline namespace's preservation ensures that ODR violations do not occur.
@swift-ci please test |
@swift-ci please test Windows platform |
Spoke with JoeG and MikeA about this offline. We all agree that this is bringing us into a better state for stability moving forward, addresses the ODR violation issue. This allows for a transitioning state where we could start vending the ADTs as part of the runtime and work towards removing the some of the C++-ness of the ABI definitions to allow for easier sharing between the runtime and the compiler. It would also allow for easier use of the ABI type definitions in the Swift code. |
This adds a new copy of LLVMSupport into the runtime. This is the final
step before changing the inline namespace for the runtime support. This
will allow us to avoid the ODR violations from the header definitions of
LLVMSupport.
Replace this paragraph with a description of your changes and rationale. Provide links to external references/discussions if appropriate.
Resolves SR-NNNN.