-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
[WIP] parameterize -C prefer-dynamic
#88101
[WIP] parameterize -C prefer-dynamic
#88101
Commits on Aug 17, 2021
-
extra details about library mismatches.
Added reverse map that tells us for a given dependency and its preferred format, what were the parent crates that requested that dependency+format combination.
Configuration menu - View commit details
-
Copy full SHA for a8ed3a4 - Browse repository at this point
Copy the full SHA a8ed3a4View commit details -
improve debugging experience slightly.
(type annotations are to help rust-analyzer as much as humans.)
Configuration menu - View commit details
-
Copy full SHA for dbe4d27 - Browse repository at this point
Copy the full SHA dbe4d27View commit details -
Generalize
-C prefer-dyanmic
to carry an optional subset of the cra……tes to prefer dynamic linkage on. Note: carrying an empty set here is *not* the same as `-C prefer-dyanmic=no` (and the latter is the default behavior for `rustc`). As discussed in detail in the comments for `enum PreferDynamicSet` (and also in the comments of `rustc_metadata::dependency_format`), `-C prefer-dynamic=no` asks the compiler to guess what linkage to use, and it currently guesses all static first, and if that fails, then it prefers dynamic linkage for all crates that provide both dynamic and static libraries. Using an empty set for `-C prefer-dynamic`, on the other hand, means the compiler should never prefer dynamic linkage over static linkage, even if that means it won't be able to successfully link the build product.
Configuration menu - View commit details
-
Copy full SHA for bf817f6 - Browse repository at this point
Copy the full SHA bf817f6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5d77479 - Browse repository at this point
Copy the full SHA 5d77479View commit details -
Add some simple tests of how
-C prefer-dynamic
interacts with depen……dency tracking.
Configuration menu - View commit details
-
Copy full SHA for 0099f6b - Browse repository at this point
Copy the full SHA 0099f6bView commit details -
Some tests of the current behavior, including the elaborated output w…
…hen we fail due to repeated static library.
Configuration menu - View commit details
-
Copy full SHA for 8d63ba2 - Browse repository at this point
Copy the full SHA 8d63ba2View commit details
Commits on Aug 18, 2021
-
A collection of test cases showing how the new `-C prefer-dynamic=cra…
…te,...` flag can be used to resolve issue 82151. These differ from the diamonds-*.rs in a couple of ways: * The most foundational library is being compiled to multiple crate output types, and * The most foundational library is being compiled to a `cdylib`, not a `dylib`. These two details seemed to be critical for reproducing the exact set of unfortunate link-time behaviors that we observed on issue 82151, as illustrated by the family of tests named `issue-82151-serverctl-*.rs`. ---- issue-82151-serverctl-prefdyn.rs works around ld-binary specific details by adding extra normalization to test, including normalizing stage number in output.
Configuration menu - View commit details
-
Copy full SHA for 172ba70 - Browse repository at this point
Copy the full SHA 172ba70View commit details -
Variations on the dylibs/diamonds tests inspired by issue 82151.
These tests specifically show the effects of having both rlib and dylib library variants present, as well as what happens when you mix in various settings for `-C prefer-dynamic=...`.
Configuration menu - View commit details
-
Copy full SHA for a2231a4 - Browse repository at this point
Copy the full SHA a2231a4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5509ab2 - Browse repository at this point
Copy the full SHA 5509ab2View commit details
Commits on Aug 19, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 21778cb - Browse repository at this point
Copy the full SHA 21778cbView commit details