-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
bootstrap: build crates under libtest with -Z emit-stack-sizes #59401
Conversation
Seems reasonable to me! I wonder though if we should just go ahead and do this for all of the binaries? (libstd/libtest, not rustc). The size costs here are minimal enough that we can just eat them, and this may be useful information for non-LTO situations as well perhaps? |
Sounds good to me. Any suggestion for passing the flag to all the crates below libtest? I thought about using |
I think what you'll want to do is set an env var read by the wrapper in the |
@alexcrichton I have updated the PR to build all crates under libtest with -Zemit-stack-sizes |
@bors: r+ |
📌 Commit 7d365cf has been approved by |
…es, r=alexcrichton bootstrap: build crates under libtest with -Z emit-stack-sizes Please see the comment in the diff for the rationale. This change adds a `.stack_sizes` linker section to `libcompiler_builtins.rlib` but this section is discarded by the linker by default so it won't affect the binary size of most programs. It will, however, negatively affect the binary size of programs that link to a recent release of the `cortex-m-rt` crate because of the linker script that crate provides, but I have proposed a PR (rust-embedded/cortex-m-rt#186) to solve the problem (which I originally introduced :-)). This change does increase the size of the `libcompiler_builtins.rlib` artifact we distribute but the increase is in the order of (a few) KBs. r? @alexcrichton
Rollup of 11 pull requests Successful merges: - #58019 (Combine all builtin late lints and make lint checking parallel) - #59358 (Use `track_errors` instead of hand rolling) - #59394 (warn -> deny duplicate match bindings) - #59401 (bootstrap: build crates under libtest with -Z emit-stack-sizes) - #59423 (Visit path in `walk_mac`) - #59468 (musl: build toolchain libs with -fPIC) - #59476 (Use `SmallVec` in `TokenStreamBuilder`.) - #59496 (Remove unnecessary with_globals calls) - #59498 (Use 'write_all' instead of 'write' in example code) - #59503 (Stablize {f32,f64}::copysign().) - #59511 (Fix missed fn rename in #59284) Failed merges: r? @ghost
Rollup of 11 pull requests Successful merges: - #58019 (Combine all builtin late lints and make lint checking parallel) - #59358 (Use `track_errors` instead of hand rolling) - #59394 (warn -> deny duplicate match bindings) - #59401 (bootstrap: build crates under libtest with -Z emit-stack-sizes) - #59423 (Visit path in `walk_mac`) - #59468 (musl: build toolchain libs with -fPIC) - #59476 (Use `SmallVec` in `TokenStreamBuilder`.) - #59496 (Remove unnecessary with_globals calls) - #59498 (Use 'write_all' instead of 'write' in example code) - #59503 (Stablize {f32,f64}::copysign().) - #59511 (Fix missed fn rename in #59284) Failed merges: r? @ghost
…t-stack-sizes-gc-sections-ld-gold-bug, r=alexcrichton Revert "compile crates under test w/ -Zemit-stack-sizes" Revert PR rust-lang#59401 to fix issue rust-lang#59652 (a stable-to-beta regression). This is result of squashing two revert commits: Revert "compile all crates under test w/ -Zemit-stack-sizes" This reverts commit 7d365cf. Revert "bootstrap: build compiler-builtins with -Z emit-stack-sizes" This reverts commit 8b8488c. ---- (My intention is that someone can re-add this code again later, either after the `ld.gold` issue itself is fixed, or with safe-guards to check whether `ld.gold` is in use and then issuing warnings about the problems here when they arise.)
…t-stack-sizes-gc-sections-ld-gold-bug, r=alexcrichton Revert "compile crates under test w/ -Zemit-stack-sizes" Revert PR rust-lang#59401 to fix issue rust-lang#59652 (a stable-to-beta regression). This is result of squashing two revert commits: Revert "compile all crates under test w/ -Zemit-stack-sizes" This reverts commit 7d365cf. Revert "bootstrap: build compiler-builtins with -Z emit-stack-sizes" This reverts commit 8b8488c. ---- (My intention is that someone can re-add this code again later, either after the `ld.gold` issue itself is fixed, or with safe-guards to check whether `ld.gold` is in use and then issuing warnings about the problems here when they arise.)
…t-stack-sizes-gc-sections-ld-gold-bug, r=alexcrichton Revert "compile crates under test w/ -Zemit-stack-sizes" Revert PR rust-lang#59401 to fix issue rust-lang#59652 (a stable-to-beta regression). This is result of squashing two revert commits: Revert "compile all crates under test w/ -Zemit-stack-sizes" This reverts commit 7d365cf. Revert "bootstrap: build compiler-builtins with -Z emit-stack-sizes" This reverts commit 8b8488c. ---- (My intention is that someone can re-add this code again later, either after the `ld.gold` issue itself is fixed, or with safe-guards to check whether `ld.gold` is in use and then issuing warnings about the problems here when they arise.)
Please see the comment in the diff for the rationale.
This change adds a
.stack_sizes
linker section tolibcompiler_builtins.rlib
but this section is discarded by the linker by default so it won't affect the
binary size of most programs. It will, however, negatively affect the binary
size of programs that link to a recent release of the
cortex-m-rt
cratebecause of the linker script that crate provides, but I have proposed a PR
(rust-embedded/cortex-m-rt#186) to solve the problem (which I originally
introduced :-)).
This change does increase the size of the
libcompiler_builtins.rlib
artifact wedistribute but the increase is in the order of (a few) KBs.
r? @alexcrichton