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 62
62
# not built by default and the experimental Rust compilation targets that depend
63
63
# on them will not work unless the user opts in to building them. By default the
64
64
# `WebAssembly` target is enabled when compiling LLVM from scratch.
65
- #experimental-targets = "WebAssembly"
65
+ #experimental-targets = "WebAssembly;RISCV "
66
66
67
67
# Cap the number of parallel linker invocations when compiling LLVM.
68
68
# 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() {
100
100
optional_components. push ( "hexagon" ) ;
101
101
}
102
102
103
+ if major > 6 {
104
+ optional_components. push ( "riscv" ) ;
105
+ }
106
+
103
107
// FIXME: surely we don't need all these components, right? Stuff like mcjit
104
108
// or interpreter the compiler itself never uses.
105
109
let required_components = & [ "ipo" ,
Original file line number Diff line number Diff line change @@ -90,6 +90,12 @@ pub fn initialize_available_targets() {
90
90
LLVMInitializeMSP430Target ,
91
91
LLVMInitializeMSP430TargetMC ,
92
92
LLVMInitializeMSP430AsmPrinter ) ;
93
+ init_target ! ( llvm_component = "riscv" ,
94
+ LLVMInitializeRISCVTargetInfo ,
95
+ LLVMInitializeRISCVTarget ,
96
+ LLVMInitializeRISCVTargetMC ,
97
+ LLVMInitializeRISCVAsmPrinter ,
98
+ LLVMInitializeRISCVAsmParser ) ;
93
99
init_target ! ( llvm_component = "sparc" ,
94
100
LLVMInitializeSparcTargetInfo ,
95
101
LLVMInitializeSparcTarget ,
Original file line number Diff line number Diff line change @@ -171,6 +171,12 @@ bool LLVMRustPassManagerBuilderPopulateThinLTOPassManager(
171
171
#define SUBTARGET_MSP430
172
172
#endif
173
173
174
+ #ifdef LLVM_COMPONENT_RISCV
175
+ #define SUBTARGET_RISCV SUBTARGET (RISCV)
176
+ #else
177
+ #define SUBTARGET_RISCV
178
+ #endif
179
+
174
180
#ifdef LLVM_COMPONENT_SPARC
175
181
#define SUBTARGET_SPARC SUBTARGET (Sparc)
176
182
#else
@@ -192,7 +198,8 @@ bool LLVMRustPassManagerBuilderPopulateThinLTOPassManager(
192
198
SUBTARGET_SYSTEMZ \
193
199
SUBTARGET_MSP430 \
194
200
SUBTARGET_SPARC \
195
- SUBTARGET_HEXAGON
201
+ SUBTARGET_HEXAGON \
202
+ SUBTARGET_RISCV \
196
203
197
204
#define SUBTARGET (x ) \
198
205
namespace llvm { \
You can’t perform that action at this time.
0 commit comments