Skip to content

stdlib: install the image registrar in the static runtime #19829

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 1 commit into from
Oct 12, 2018

Conversation

compnerd
Copy link
Member

We were previously only installing the image registration helper in the shared
runtime location. When building with a static runtime, we would look in the
wrong location. Ensure that we install to both locations to repair the static
builds.

Replace this paragraph with a description of your changes and rationale. Provide links to external references/discussions if appropriate.

Resolves SR-NNNN.

@compnerd
Copy link
Member Author

CC: @kevints @gottesmm @Rostepher

@compnerd
Copy link
Member Author

@swift-ci please test

@compnerd
Copy link
Member Author

@swift-ci please build toolchain

@jckarter
Copy link
Contributor

To be clear, this only impacts the statically-linked-into-a-dynamically-linked-executable case, not the -static-executable build, right?

@compnerd
Copy link
Member Author

@jckarter, no, I believe that this only impacts the -static-executable case. The problem is that when you use the swift driver to build with -static-stdlib, you will look for the runtime components in swift_static and not swift. However, we previously did not populate the runtime registrar into the swift_static location. We now do, so we are now in a better state than before.

We were previously only installing the image registration helper in the shared
runtime location.  When building with a static runtime, we would look in the
wrong location.  Ensure that we install to both locations to repair the static
builds.
@compnerd
Copy link
Member Author

@swift-ci please test

@compnerd
Copy link
Member Author

@swift-ci please build toolchain

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 73c5460f44a80d4f77e211d11a17b3714b99d726

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 73c5460f44a80d4f77e211d11a17b3714b99d726

@jckarter
Copy link
Contributor

-static-stdlib is the "statically link the Swift runtime, but dynamically link everything else" setting (IIRC). It makes sense to include the runtime registrar in that stdlib.

The -static-executable build (which produces a completely static binary, no dynamic loader present at all) was at one point set up such that the registration code statically resolved the right sections of the binary, since there's no need to dynamically register code in that case. I'm not sure if that broke for other reasons already.

@compnerd
Copy link
Member Author

@swift-ci please test Linux platform

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - f7f1f02

@compnerd
Copy link
Member Author

Oh, interesting, seems that the libdispatch failure that I thought was due to another change is happening anyways? I put up swiftlang/swift-corelibs-libdispatch#399 to deal with that.

@compnerd
Copy link
Member Author

Please test with the following PRs:
swiftlang/swift-corelibs-libdispatch#399

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - f7f1f02

@compnerd
Copy link
Member Author

@swift-ci please test Linux platform

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - f7f1f02

@compnerd
Copy link
Member Author

The failure seems unrelated (and has been occurring for a while).

@compnerd
Copy link
Member Author

@swift-ci please build toolchain

@swift-ci
Copy link
Contributor

Linux Toolchain (Ubuntu 16.04)
Download Toolchain
Git Sha - f7f1f02

Install command
tar zxf swift-PR-19829-67-ubuntu16.04.tar.gz
More info

@swift-ci
Copy link
Contributor

macOS Toolchain
Download Toolchain
Git Sha - f7f1f02

Install command
tar -zxf swift-PR-19829-79-osx.tar.gz --directory ~/

@compnerd
Copy link
Member Author

@swift-ci please test Linux platform

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - f7f1f02

@compnerd
Copy link
Member Author

@swift-ci please test Linux platform

@compnerd compnerd merged commit 791e369 into swiftlang:master Oct 12, 2018
@compnerd compnerd deleted the static-registrar branch October 12, 2018 23:15
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