Skip to content

[4.2 EARLY] Just autolink everything #16391

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

jrose-apple
Copy link
Contributor

  • Explanation: If module A uses some inlinable code from module B (including function default arguments), and that code uses a symbol in module C, but module A doesn't itself import module C, we'll get a link error. This change conservatively autolinks any modules that are transitively imported, even if they aren't re-exported by their intervening modules.
  • Scope: As described in the explanation. We've seen this on at least one Apple-internal project.
  • Issue: rdar://problem/39338239
  • Risk: Medium-low. There's basically no way that this could result in fewer things being linked, so the main risk is whether more things will get linked than before, or if this drastically slows down compilation or linking. That seems unlikely (and hasn't been observed).
  • Testing: Added compiler regression tests.
  • Reviewed by: @graydon and @DougGregor

And disable them on non-ObjC platforms again, because those overlays
depend on a stdlib that contains _ObjectiveCBridgeable.

(cherry picked from commit 0e5100d)
This is unfortunate in that it makes the linker do extra work, but in
practice it probably doesn't matter much, and meanwhile it handles all
our problems with @inlinable.

Alternate solution to rdar://problem/39338239

(cherry picked from commit 098b170)
@jrose-apple
Copy link
Contributor Author

@swift-ci Please test

@jrose-apple
Copy link
Contributor Author

Some more tests are being run on the regular 4.2 branch at #16390. The original PR, with further description of the problem, is #16349.

@jrose-apple jrose-apple merged commit 45edab5 into swiftlang:swift-4.2-branch-04-30-2018 May 5, 2018
@jrose-apple jrose-apple deleted the 4.2-EARLY-just-autolink-everything branch May 5, 2018 01:54
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.

1 participant