Auto merge of #121203 - Nilstrieb:fp, r=Mark-Simulacrum
Add `rust.frame-pointers` config option This is very helpful for profiling. I've hacked this in many times, so let's add it properly.
This commit is contained in:
commit
eb1f279477
@ -612,6 +612,10 @@
|
|||||||
# Indicates whether symbols should be stripped using `-Cstrip=symbols`.
|
# Indicates whether symbols should be stripped using `-Cstrip=symbols`.
|
||||||
#strip = false
|
#strip = false
|
||||||
|
|
||||||
|
# Forces frame pointers to be used with `-Cforce-frame-pointers`.
|
||||||
|
# This can be helpful for profiling at a small performance cost.
|
||||||
|
# frame-pointers = false
|
||||||
|
|
||||||
# Indicates whether stack protectors should be used
|
# Indicates whether stack protectors should be used
|
||||||
# via the unstable option `-Zstack-protector`.
|
# via the unstable option `-Zstack-protector`.
|
||||||
#
|
#
|
||||||
|
@ -23,3 +23,6 @@ incremental = true
|
|||||||
backtrace-on-ice = true
|
backtrace-on-ice = true
|
||||||
# Make the compiler and standard library faster to build, at the expense of a ~20% runtime slowdown.
|
# Make the compiler and standard library faster to build, at the expense of a ~20% runtime slowdown.
|
||||||
lto = "off"
|
lto = "off"
|
||||||
|
# Forces frame pointers to be used with `-Cforce-frame-pointers`.
|
||||||
|
# This can be helpful for profiling at a small performance cost.
|
||||||
|
frame-pointers = true
|
||||||
|
@ -14,6 +14,9 @@ incremental = true
|
|||||||
backtrace-on-ice = true
|
backtrace-on-ice = true
|
||||||
# Make the compiler and standard library faster to build, at the expense of a ~20% runtime slowdown.
|
# Make the compiler and standard library faster to build, at the expense of a ~20% runtime slowdown.
|
||||||
lto = "off"
|
lto = "off"
|
||||||
|
# Forces frame pointers to be used with `-Cforce-frame-pointers`.
|
||||||
|
# This can be helpful for profiling at a small performance cost.
|
||||||
|
frame-pointers = true
|
||||||
|
|
||||||
[llvm]
|
[llvm]
|
||||||
# Will download LLVM from CI if available on your platform.
|
# Will download LLVM from CI if available on your platform.
|
||||||
|
@ -1870,6 +1870,10 @@ fn cargo(
|
|||||||
rustflags.arg("-Wrustc::internal");
|
rustflags.arg("-Wrustc::internal");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if self.config.rust_frame_pointers {
|
||||||
|
rustflags.arg("-Cforce-frame-pointers=true");
|
||||||
|
}
|
||||||
|
|
||||||
// If Control Flow Guard is enabled, pass the `control-flow-guard` flag to rustc
|
// If Control Flow Guard is enabled, pass the `control-flow-guard` flag to rustc
|
||||||
// when compiling the standard library, since this might be linked into the final outputs
|
// when compiling the standard library, since this might be linked into the final outputs
|
||||||
// produced by rustc. Since this mitigation is only available on Windows, only enable it
|
// produced by rustc. Since this mitigation is only available on Windows, only enable it
|
||||||
|
@ -256,6 +256,7 @@ pub struct Config {
|
|||||||
pub rust_split_debuginfo: SplitDebuginfo,
|
pub rust_split_debuginfo: SplitDebuginfo,
|
||||||
pub rust_rpath: bool,
|
pub rust_rpath: bool,
|
||||||
pub rust_strip: bool,
|
pub rust_strip: bool,
|
||||||
|
pub rust_frame_pointers: bool,
|
||||||
pub rust_stack_protector: Option<String>,
|
pub rust_stack_protector: Option<String>,
|
||||||
pub rustc_parallel: bool,
|
pub rustc_parallel: bool,
|
||||||
pub rustc_default_linker: Option<String>,
|
pub rustc_default_linker: Option<String>,
|
||||||
@ -1083,6 +1084,7 @@ struct Rust {
|
|||||||
musl_root: Option<String> = "musl-root",
|
musl_root: Option<String> = "musl-root",
|
||||||
rpath: Option<bool> = "rpath",
|
rpath: Option<bool> = "rpath",
|
||||||
strip: Option<bool> = "strip",
|
strip: Option<bool> = "strip",
|
||||||
|
frame_pointers: Option<bool> = "frame-pointers",
|
||||||
stack_protector: Option<String> = "stack-protector",
|
stack_protector: Option<String> = "stack-protector",
|
||||||
verbose_tests: Option<bool> = "verbose-tests",
|
verbose_tests: Option<bool> = "verbose-tests",
|
||||||
optimize_tests: Option<bool> = "optimize-tests",
|
optimize_tests: Option<bool> = "optimize-tests",
|
||||||
@ -1561,6 +1563,7 @@ fn get_table(option: &str) -> Result<TomlConfig, toml::de::Error> {
|
|||||||
download_rustc,
|
download_rustc,
|
||||||
lto,
|
lto,
|
||||||
validate_mir_opts,
|
validate_mir_opts,
|
||||||
|
frame_pointers,
|
||||||
stack_protector,
|
stack_protector,
|
||||||
strip,
|
strip,
|
||||||
lld_mode,
|
lld_mode,
|
||||||
@ -1609,6 +1612,7 @@ fn get_table(option: &str) -> Result<TomlConfig, toml::de::Error> {
|
|||||||
set(&mut config.codegen_tests, codegen_tests);
|
set(&mut config.codegen_tests, codegen_tests);
|
||||||
set(&mut config.rust_rpath, rpath);
|
set(&mut config.rust_rpath, rpath);
|
||||||
set(&mut config.rust_strip, strip);
|
set(&mut config.rust_strip, strip);
|
||||||
|
set(&mut config.rust_frame_pointers, frame_pointers);
|
||||||
config.rust_stack_protector = stack_protector;
|
config.rust_stack_protector = stack_protector;
|
||||||
set(&mut config.jemalloc, jemalloc);
|
set(&mut config.jemalloc, jemalloc);
|
||||||
set(&mut config.test_compare_mode, test_compare_mode);
|
set(&mut config.test_compare_mode, test_compare_mode);
|
||||||
|
@ -119,4 +119,9 @@ pub fn find_recent_config_change_ids(current_id: usize) -> Vec<ChangeInfo> {
|
|||||||
severity: ChangeSeverity::Info,
|
severity: ChangeSeverity::Info,
|
||||||
summary: "New option `target.<triple>.codegen-backends` added to config.toml.",
|
summary: "New option `target.<triple>.codegen-backends` added to config.toml.",
|
||||||
},
|
},
|
||||||
|
ChangeInfo {
|
||||||
|
change_id: 121203,
|
||||||
|
severity: ChangeSeverity::Info,
|
||||||
|
summary: "A new `rust.frame-pointers` option has been introduced and made the default in the compiler and codegen profiles.",
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
Loading…
Reference in New Issue
Block a user