File tree Expand file tree Collapse file tree 4 files changed +19
-2
lines changed Expand file tree Collapse file tree 4 files changed +19
-2
lines changed Original file line number Diff line number Diff line change 6262# not built by default and the experimental Rust compilation targets that depend
6363# on them will not work unless the user opts in to building them. By default the
6464# `WebAssembly` target is enabled when compiling LLVM from scratch.
65- # experimental-targets = "WebAssembly"
65+ # experimental-targets = "WebAssembly;RISCV "
6666
6767# Cap the number of parallel linker invocations when compiling LLVM.
6868# This can be useful when building LLVM with debug info, which significantly
Original file line number Diff line number Diff line change @@ -100,6 +100,10 @@ fn main() {
100100 optional_components. push ( "hexagon" ) ;
101101 }
102102
103+ if major > 6 {
104+ optional_components. push ( "riscv" ) ;
105+ }
106+
103107 // FIXME: surely we don't need all these components, right? Stuff like mcjit
104108 // or interpreter the compiler itself never uses.
105109 let required_components = & [ "ipo" ,
Original file line number Diff line number Diff line change @@ -90,6 +90,12 @@ pub fn initialize_available_targets() {
9090 LLVMInitializeMSP430Target ,
9191 LLVMInitializeMSP430TargetMC ,
9292 LLVMInitializeMSP430AsmPrinter ) ;
93+ init_target ! ( llvm_component = "riscv" ,
94+ LLVMInitializeRISCVTargetInfo ,
95+ LLVMInitializeRISCVTarget ,
96+ LLVMInitializeRISCVTargetMC ,
97+ LLVMInitializeRISCVAsmPrinter ,
98+ LLVMInitializeRISCVAsmParser ) ;
9399 init_target ! ( llvm_component = "sparc" ,
94100 LLVMInitializeSparcTargetInfo ,
95101 LLVMInitializeSparcTarget ,
Original file line number Diff line number Diff line change @@ -171,6 +171,12 @@ bool LLVMRustPassManagerBuilderPopulateThinLTOPassManager(
171171#define SUBTARGET_MSP430
172172#endif
173173
174+ #ifdef LLVM_COMPONENT_RISCV
175+ #define SUBTARGET_RISCV SUBTARGET (RISCV)
176+ #else
177+ #define SUBTARGET_RISCV
178+ #endif
179+
174180#ifdef LLVM_COMPONENT_SPARC
175181#define SUBTARGET_SPARC SUBTARGET (Sparc)
176182#else
@@ -192,7 +198,8 @@ bool LLVMRustPassManagerBuilderPopulateThinLTOPassManager(
192198 SUBTARGET_SYSTEMZ \
193199 SUBTARGET_MSP430 \
194200 SUBTARGET_SPARC \
195- SUBTARGET_HEXAGON
201+ SUBTARGET_HEXAGON \
202+ SUBTARGET_RISCV \
196203
197204#define SUBTARGET (x ) \
198205 namespace llvm { \
You can’t perform that action at this time.
0 commit comments