Add an option to inhibit automatic injection of profiler_builtins

This commit is contained in:
Amanieu d'Antras 2020-04-17 21:21:49 +01:00
parent 7fe41279c5
commit 9f23b2d36b
2 changed files with 5 additions and 1 deletions

View File

@ -686,7 +686,9 @@ impl<'a> CrateLoader<'a> {
}
fn inject_profiler_runtime(&mut self) {
if self.sess.opts.debugging_opts.profile || self.sess.opts.cg.profile_generate.enabled() {
if (self.sess.opts.debugging_opts.profile || self.sess.opts.cg.profile_generate.enabled())
&& !self.sess.opts.debugging_opts.no_profiler_runtime
{
info!("loading profiler");
let name = Symbol::intern("profiler_builtins");

View File

@ -890,6 +890,8 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
"extra arguments to prepend to the linker invocation (space separated)"),
profile: bool = (false, parse_bool, [TRACKED],
"insert profiling code"),
no_profiler_runtime: bool = (false, parse_bool, [TRACKED],
"don't automatically inject the profiler_builtins crate"),
relro_level: Option<RelroLevel> = (None, parse_relro_level, [TRACKED],
"choose which RELRO level to use"),
nll_facts: bool = (false, parse_bool, [UNTRACKED],