Minor improvements to -Zprofile#71283
Merged
bors merged 2 commits intorust-lang:masterfrom Apr 19, 2020
Merged
Conversation
Contributor
|
r? @davidtwco (rust_highfive has picked a reviewer for you, use r? to override) |
whitequark
approved these changes
Apr 18, 2020
Contributor
whitequark
left a comment
There was a problem hiding this comment.
LGTM, and good catch!
Member
Author
|
@bors r=davidtwco |
Collaborator
|
📌 Commit 9f23b2d has been approved by |
Dylan-DPC-zz
pushed a commit
to Dylan-DPC-zz/rust
that referenced
this pull request
Apr 18, 2020
Minor improvements to -Zprofile - `-Zprofile` is broken with codegen units because GCOV assumes that each source file corresponds to one object file. This PR makes `-Zprofile` automatically set codegen units to 1 and gives an error if `-Ccodegen-units=X` is specified on the command line (with `X != 1`). - The `profiler_builtins` crate is not suitable for `no_std` applications since it contains C code that depends on libc. In such cases a custom implementation of the LLVM gcov API (`llvm_gcov_init`, `llvm_gcda_*`) is needed. This PR adds `-Zno-profiler-runtime` flag which inhibits automatic injection of the `profiler_builtins` crate. cc @whitequark who implemented the original `-Zprofile` support
Dylan-DPC-zz
pushed a commit
to Dylan-DPC-zz/rust
that referenced
this pull request
Apr 18, 2020
Minor improvements to -Zprofile - `-Zprofile` is broken with codegen units because GCOV assumes that each source file corresponds to one object file. This PR makes `-Zprofile` automatically set codegen units to 1 and gives an error if `-Ccodegen-units=X` is specified on the command line (with `X != 1`). - The `profiler_builtins` crate is not suitable for `no_std` applications since it contains C code that depends on libc. In such cases a custom implementation of the LLVM gcov API (`llvm_gcov_init`, `llvm_gcda_*`) is needed. This PR adds `-Zno-profiler-runtime` flag which inhibits automatic injection of the `profiler_builtins` crate. cc @whitequark who implemented the original `-Zprofile` support
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Apr 18, 2020
Rollup of 5 pull requests Successful merges: - rust-lang#71271 (Move `MapInPlace` to rustc_data_structures) - rust-lang#71276 (miri-unleashed: test that we detect heap allocations) - rust-lang#71283 (Minor improvements to -Zprofile) - rust-lang#71287 (Explain why we shouldn't add inline attr to into_vec) - rust-lang#71303 (remove build warnings) Failed merges: r? @ghost
Member
Author
|
Just published |
Contributor
|
@Amanieu Excellent work! |
JohnTitor
added a commit
to JohnTitor/rust
that referenced
this pull request
Apr 23, 2020
… r=cramertj Ignore -Zprofile when building compiler_builtins rust-lang#70846 made the `compiler_builtins` crate ignore the default codegen-units setting and instead always split each function into a different codegen unit. This unfortunately breaks `-Zprofile` which requires a single codegen unit per crate (see rust-lang#71283). You can notice this when building with `cargo -Zbuild-std` and `RUSTFLAGS` containing `-Zprofile`. This PR works around this issue by just ignoring `-Zprofile` for the `compiler-builtins` crate.
Dylan-DPC-zz
pushed a commit
to Dylan-DPC-zz/rust
that referenced
this pull request
Apr 25, 2020
… r=cramertj Ignore -Zprofile when building compiler_builtins rust-lang#70846 made the `compiler_builtins` crate ignore the default codegen-units setting and instead always split each function into a different codegen unit. This unfortunately breaks `-Zprofile` which requires a single codegen unit per crate (see rust-lang#71283). You can notice this when building with `cargo -Zbuild-std` and `RUSTFLAGS` containing `-Zprofile`. This PR works around this issue by just ignoring `-Zprofile` for the `compiler-builtins` crate.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
-Zprofileis broken with codegen units because GCOV assumes that each source file corresponds to one object file. This PR makes-Zprofileautomatically set codegen units to 1 and gives an error if-Ccodegen-units=Xis specified on the command line (withX != 1).profiler_builtinscrate is not suitable forno_stdapplications since it contains C code that depends on libc. In such cases a custom implementation of the LLVM gcov API (llvm_gcov_init,llvm_gcda_*) is needed. This PR adds-Zno-profiler-runtimeflag which inhibits automatic injection of theprofiler_builtinscrate.cc @whitequark who implemented the original
-Zprofilesupport