Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/mono/mono/mini/mini-llvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -3435,11 +3435,16 @@ emit_gc_safepoint_poll (MonoLLVMModule *module, LLVMModuleRef lmodule, MonoCompi
mono_llvm_add_func_attr (func, LLVM_ATTR_NO_UNWIND);
if (is_aot) {
#if TARGET_WIN32
if (module->static_link)
if (module->static_link) {
LLVMSetLinkage (func, LLVMInternalLinkage);
else
#endif
/* Prevent it from being optimized away, leading to asserts inside 'opt' */
mark_as_used (module, func);
} else {
LLVMSetLinkage (func, LLVMWeakODRLinkage);
}
#else
LLVMSetLinkage (func, LLVMWeakODRLinkage);
#endif
} else {
mono_llvm_add_func_attr (func, LLVM_ATTR_OPTIMIZE_NONE); // no need to waste time here, the function is already optimized and will be inlined.
mono_llvm_add_func_attr (func, LLVM_ATTR_NO_INLINE); // optnone attribute requires noinline (but it will be inlined anyway)
Expand Down