Skip to content

Commit

Permalink
Add an option to inhibit automatic injection of profiler_builtins
Browse files Browse the repository at this point in the history
  • Loading branch information
Amanieu committed Apr 18, 2020
1 parent 7fe4127 commit 9f23b2d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/librustc_metadata/creader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
2 changes: 2 additions & 0 deletions src/librustc_session/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down

0 comments on commit 9f23b2d

Please sign in to comment.