Add PNaCl target info to the makefile target cfgs and initialize the PNaCl target
machine if available.
This commit is contained in:
parent
f150c178ea
commit
0442be8e1c
4 changed files with 110 additions and 28 deletions
|
@ -2011,32 +2011,6 @@ extern {
|
|||
pub fn LLVMIsAAllocaInst(value_ref: ValueRef) -> ValueRef;
|
||||
pub fn LLVMIsAConstantInt(value_ref: ValueRef) -> ValueRef;
|
||||
|
||||
pub fn LLVMInitializeX86TargetInfo();
|
||||
pub fn LLVMInitializeX86Target();
|
||||
pub fn LLVMInitializeX86TargetMC();
|
||||
pub fn LLVMInitializeX86AsmPrinter();
|
||||
pub fn LLVMInitializeX86AsmParser();
|
||||
pub fn LLVMInitializeARMTargetInfo();
|
||||
pub fn LLVMInitializeARMTarget();
|
||||
pub fn LLVMInitializeARMTargetMC();
|
||||
pub fn LLVMInitializeARMAsmPrinter();
|
||||
pub fn LLVMInitializeARMAsmParser();
|
||||
pub fn LLVMInitializeAArch64TargetInfo();
|
||||
pub fn LLVMInitializeAArch64Target();
|
||||
pub fn LLVMInitializeAArch64TargetMC();
|
||||
pub fn LLVMInitializeAArch64AsmPrinter();
|
||||
pub fn LLVMInitializeAArch64AsmParser();
|
||||
pub fn LLVMInitializeMipsTargetInfo();
|
||||
pub fn LLVMInitializeMipsTarget();
|
||||
pub fn LLVMInitializeMipsTargetMC();
|
||||
pub fn LLVMInitializeMipsAsmPrinter();
|
||||
pub fn LLVMInitializeMipsAsmParser();
|
||||
pub fn LLVMInitializePowerPCTargetInfo();
|
||||
pub fn LLVMInitializePowerPCTarget();
|
||||
pub fn LLVMInitializePowerPCTargetMC();
|
||||
pub fn LLVMInitializePowerPCAsmPrinter();
|
||||
pub fn LLVMInitializePowerPCAsmParser();
|
||||
|
||||
pub fn LLVMRustAddPass(PM: PassManagerRef, Pass: *const c_char) -> bool;
|
||||
pub fn LLVMRustCreateTargetMachine(Triple: *const c_char,
|
||||
CPU: *const c_char,
|
||||
|
@ -2144,6 +2118,53 @@ extern {
|
|||
pub fn LLVMRustGetModuleDataLayout(M: ModuleRef) -> TargetDataRef;
|
||||
}
|
||||
|
||||
#[cfg(have_component_x86)]
|
||||
extern {
|
||||
pub fn LLVMInitializeX86TargetInfo();
|
||||
pub fn LLVMInitializeX86Target();
|
||||
pub fn LLVMInitializeX86TargetMC();
|
||||
pub fn LLVMInitializeX86AsmPrinter();
|
||||
pub fn LLVMInitializeX86AsmParser();
|
||||
}
|
||||
#[cfg(have_component_arm)]
|
||||
extern {
|
||||
pub fn LLVMInitializeARMTargetInfo();
|
||||
pub fn LLVMInitializeARMTarget();
|
||||
pub fn LLVMInitializeARMTargetMC();
|
||||
pub fn LLVMInitializeARMAsmPrinter();
|
||||
pub fn LLVMInitializeARMAsmParser();
|
||||
}
|
||||
#[cfg(have_component_aarch64)]
|
||||
extern {
|
||||
pub fn LLVMInitializeAArch64TargetInfo();
|
||||
pub fn LLVMInitializeAArch64Target();
|
||||
pub fn LLVMInitializeAArch64TargetMC();
|
||||
pub fn LLVMInitializeAArch64AsmPrinter();
|
||||
pub fn LLVMInitializeAArch64AsmParser();
|
||||
}
|
||||
#[cfg(have_component_mips)]
|
||||
extern {
|
||||
pub fn LLVMInitializeMipsTargetInfo();
|
||||
pub fn LLVMInitializeMipsTarget();
|
||||
pub fn LLVMInitializeMipsTargetMC();
|
||||
pub fn LLVMInitializeMipsAsmPrinter();
|
||||
pub fn LLVMInitializeMipsAsmParser();
|
||||
}
|
||||
#[cfg(have_component_powerpc)]
|
||||
extern {
|
||||
pub fn LLVMInitializePowerPCTargetInfo();
|
||||
pub fn LLVMInitializePowerPCTarget();
|
||||
pub fn LLVMInitializePowerPCTargetMC();
|
||||
pub fn LLVMInitializePowerPCAsmPrinter();
|
||||
pub fn LLVMInitializePowerPCAsmParser();
|
||||
}
|
||||
#[cfg(have_component_pnacl)]
|
||||
extern {
|
||||
pub fn LLVMInitializePNaClTargetInfo();
|
||||
pub fn LLVMInitializePNaClTarget();
|
||||
pub fn LLVMInitializePNaClTargetMC();
|
||||
}
|
||||
|
||||
// LLVM requires symbols from this library, but apparently they're not printed
|
||||
// during llvm-config?
|
||||
#[cfg(windows)]
|
||||
|
@ -2357,6 +2378,20 @@ pub fn initialize_available_targets() {
|
|||
init_target!(have_component_aarch64 AArch64);
|
||||
init_target!(have_component_arm ARM);
|
||||
init_target!(have_component_x86 X86);
|
||||
|
||||
// PNaCl doesn't provide some of the optional target components, so we
|
||||
// manually initialize it here.
|
||||
#[cfg(have_component_pnacl)]
|
||||
fn init_pnacl() {
|
||||
unsafe {
|
||||
LLVMInitializePNaClTargetInfo();
|
||||
LLVMInitializePNaClTarget();
|
||||
LLVMInitializePNaClTargetMC();
|
||||
}
|
||||
}
|
||||
#[cfg(not(have_component_pnacl))]
|
||||
fn init_pnacl() { }
|
||||
init_pnacl();
|
||||
}
|
||||
|
||||
// The module containing the native LLVM dependencies, generated by the build system
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue