Skip to content
Merged
Show file tree
Hide file tree
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
24 changes: 17 additions & 7 deletions compiler/rustc_codegen_llvm/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -584,13 +584,23 @@ pub(crate) unsafe fn create_module<'ll>(
);
}

if llvm_version >= (24, 0, 0) && sess.target.singlethread(&sess.internal_target_features) {
llvm::add_module_flag_str(
llmod,
llvm::ModuleFlagMergeBehavior::Error,
"thread-model",
"single",
);
if llvm_version >= (24, 0, 0) {
if sess.target.singlethread(&sess.internal_target_features) {
llvm::add_module_flag_str(
llmod,
llvm::ModuleFlagMergeBehavior::Error,
"thread-model",
"single",
);
}
if wants_wasm_eh(&sess.target) {
llvm::add_module_flag_str(
llmod,
llvm::ModuleFlagMergeBehavior::Error,
"exception-model",
"wasm",
);
}
}

// Add module flags specified via -Z llvm_module_flag
Expand Down
9 changes: 5 additions & 4 deletions compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -458,10 +458,11 @@ extern "C" void LLVMRustAddLibraryInfo(LLVMTargetMachineRef T,
TLII.disableAllFunctions();
unwrap(PMR)->add(new TargetLibraryInfoWrapperPass(TLII));
#if LLVM_VERSION_GE(24, 0)
// LLVM 24 removed TargetOptions::EABIVersion; the EABI version is now
// derived from the target triple instead.
unwrap(PMR)->add(new RuntimeLibraryInfoWrapper(
Options->ExceptionModel, Options->MCOptions.ABIName, Options->VecLib));
// LLVM 24 removed TargetOptions::EABIVersion and ExceptionModel; the EABI
// version and exception model are now derived from the target triple and
// module flags respectively instead.
unwrap(PMR)->add(new RuntimeLibraryInfoWrapper(Options->MCOptions.ABIName,
Options->VecLib));
#elif LLVM_VERSION_GE(22, 0)
unwrap(PMR)->add(new RuntimeLibraryInfoWrapper(
TargetTriple, Options->ExceptionModel, Options->FloatABIType,
Expand Down
Loading