Skip to content

Commit

Permalink
Auto merge of rust-lang#118178 - compiler-errors:rollup-0i11w85, r=co…
Browse files Browse the repository at this point in the history
…mpiler-errors

Rollup of 6 pull requests

Successful merges:

 - rust-lang#118012 (Add support for global allocation in smir)
 - rust-lang#118013 (Enable Rust to use the EHCont security feature of Windows)
 - rust-lang#118100 (Enable profiler in dist-powerpc64-linux)
 - rust-lang#118142 (Tighten up link attributes for llvm-wrapper bindings)
 - rust-lang#118147 (Fix some unnecessary casts)
 - rust-lang#118161 (Allow defining opaques in `check_coroutine_obligations`)

r? `@ghost`
`@rustbot` modify labels: rollup
  • Loading branch information
bors committed Nov 22, 2023
2 parents 6d2b84b + 4ec548a commit 06d1afe
Show file tree
Hide file tree
Showing 37 changed files with 666 additions and 243 deletions.
10 changes: 10 additions & 0 deletions compiler/rustc_codegen_llvm/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,16 @@ pub unsafe fn create_module<'ll>(
);
}

// Set module flag to enable Windows EHCont Guard (/guard:ehcont).
if sess.opts.unstable_opts.ehcont_guard {
llvm::LLVMRustAddModuleFlag(
llmod,
llvm::LLVMModFlagBehavior::Warning,
"ehcontguard\0".as_ptr() as *const _,
1,
)
}

// Insert `llvm.ident` metadata.
//
// On the wasm targets it will get hooked up to the "producer" sections
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_codegen_llvm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ struct TimeTraceProfiler {
impl TimeTraceProfiler {
fn new(enabled: bool) -> Self {
if enabled {
unsafe { llvm::LLVMTimeTraceProfilerInitialize() }
unsafe { llvm::LLVMRustTimeTraceProfilerInitialize() }
}
TimeTraceProfiler { enabled }
}
Expand All @@ -113,7 +113,7 @@ impl TimeTraceProfiler {
impl Drop for TimeTraceProfiler {
fn drop(&mut self) {
if self.enabled {
unsafe { llvm::LLVMTimeTraceProfilerFinishThread() }
unsafe { llvm::LLVMRustTimeTraceProfilerFinishThread() }
}
}
}
Expand Down

0 comments on commit 06d1afe

Please sign in to comment.