mirror of https://github.com/rust-lang/rust.git
Enable loongarch64 LLVM target
This commit is contained in:
parent
10f7ba562a
commit
ccf5417799
|
@ -10,6 +10,7 @@ const OPTIONAL_COMPONENTS: &[&str] = &[
|
|||
"aarch64",
|
||||
"amdgpu",
|
||||
"avr",
|
||||
"loongarch",
|
||||
"m68k",
|
||||
"mips",
|
||||
"powerpc",
|
||||
|
|
|
@ -146,6 +146,12 @@ extern "C" void LLVMTimeTraceProfilerFinish(const char* FileName) {
|
|||
#define SUBTARGET_HEXAGON
|
||||
#endif
|
||||
|
||||
#ifdef LLVM_COMPONENT_LOONGARCH
|
||||
#define SUBTARGET_LOONGARCH SUBTARGET(LoongArch)
|
||||
#else
|
||||
#define SUBTARGET_LOONGARCH
|
||||
#endif
|
||||
|
||||
#define GEN_SUBTARGETS \
|
||||
SUBTARGET_X86 \
|
||||
SUBTARGET_ARM \
|
||||
|
@ -159,6 +165,7 @@ extern "C" void LLVMTimeTraceProfilerFinish(const char* FileName) {
|
|||
SUBTARGET_SPARC \
|
||||
SUBTARGET_HEXAGON \
|
||||
SUBTARGET_RISCV \
|
||||
SUBTARGET_LOONGARCH \
|
||||
|
||||
#define SUBTARGET(x) \
|
||||
namespace llvm { \
|
||||
|
|
|
@ -102,6 +102,14 @@ pub fn initialize_available_targets() {
|
|||
LLVMInitializeM68kAsmPrinter,
|
||||
LLVMInitializeM68kAsmParser
|
||||
);
|
||||
init_target!(
|
||||
llvm_component = "loongarch",
|
||||
LLVMInitializeLoongArchTargetInfo,
|
||||
LLVMInitializeLoongArchTarget,
|
||||
LLVMInitializeLoongArchTargetMC,
|
||||
LLVMInitializeLoongArchAsmPrinter,
|
||||
LLVMInitializeLoongArchAsmParser
|
||||
);
|
||||
init_target!(
|
||||
llvm_component = "mips",
|
||||
LLVMInitializeMipsTargetInfo,
|
||||
|
|
|
@ -88,7 +88,7 @@ changelog-seen = 2
|
|||
# the resulting rustc being unable to compile for the disabled architectures.
|
||||
#
|
||||
# To add support for new targets, see https://rustc-dev-guide.rust-lang.org/building/new-target.html.
|
||||
#targets = "AArch64;ARM;BPF;Hexagon;MSP430;Mips;NVPTX;PowerPC;RISCV;Sparc;SystemZ;WebAssembly;X86"
|
||||
#targets = "AArch64;ARM;BPF;Hexagon;LoongArch;MSP430;Mips;NVPTX;PowerPC;RISCV;Sparc;SystemZ;WebAssembly;X86"
|
||||
|
||||
# LLVM experimental targets to build support for. These targets are specified in
|
||||
# the same format as above, but since these targets are experimental, they are
|
||||
|
|
|
@ -291,7 +291,7 @@ impl Step for Llvm {
|
|||
let llvm_targets = match &builder.config.llvm_targets {
|
||||
Some(s) => s,
|
||||
None => {
|
||||
"AArch64;ARM;BPF;Hexagon;MSP430;Mips;NVPTX;PowerPC;RISCV;\
|
||||
"AArch64;ARM;BPF;Hexagon;LoongArch;MSP430;Mips;NVPTX;PowerPC;RISCV;\
|
||||
Sparc;SystemZ;WebAssembly;X86"
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue