1
Fork 0

Move versioned LLVM target creation to rustc_codegen_ssa

The OS version depends on the deployment target environment variables,
the access of which we want to move to later in the compilation pipeline
that has access to more information, for example `env_depinfo`.
This commit is contained in:
Mads Marquart 2024-11-01 17:07:18 +01:00
parent 20c909ff9c
commit e1233153ac
12 changed files with 208 additions and 144 deletions

View file

@ -9,6 +9,7 @@ use llvm::{
LLVMRustLLVMHasZlibCompressionForDebugSymbols, LLVMRustLLVMHasZstdCompressionForDebugSymbols,
};
use rustc_codegen_ssa::back::link::ensure_removed;
use rustc_codegen_ssa::back::versioned_llvm_target;
use rustc_codegen_ssa::back::write::{
BitcodeSection, CodegenContext, EmitObj, ModuleConfig, TargetMachineFactoryConfig,
TargetMachineFactoryFn,
@ -211,7 +212,7 @@ pub(crate) fn target_machine_factory(
singlethread = false;
}
let triple = SmallCStr::new(&sess.target.llvm_target);
let triple = SmallCStr::new(&versioned_llvm_target(sess));
let cpu = SmallCStr::new(llvm_util::target_cpu(sess));
let features = CString::new(target_features.join(",")).unwrap();
let abi = SmallCStr::new(&sess.target.llvm_abiname);