Skip to content

Commit 77d2cd2

Browse files
authored
Auto merge of #36080 - japaric:systemz, r=alexcrichton
build llvm with systemz backend enabled, and link to related libraries when building rust against system llvm closes #36077 r? @alexcrichton
2 parents 86dde9b + 15d8dfb commit 77d2cd2

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

configure

+1-1
Original file line numberDiff line numberDiff line change
@@ -1747,7 +1747,7 @@ do
17471747
CMAKE_ARGS="$CMAKE_ARGS -DLLVM_ENABLE_ASSERTIONS=ON"
17481748
fi
17491749

1750-
CMAKE_ARGS="$CMAKE_ARGS -DLLVM_TARGETS_TO_BUILD='X86;ARM;AArch64;Mips;PowerPC'"
1750+
CMAKE_ARGS="$CMAKE_ARGS -DLLVM_TARGETS_TO_BUILD='X86;ARM;AArch64;Mips;PowerPC;SystemZ'"
17511751
CMAKE_ARGS="$CMAKE_ARGS -G '$CFG_CMAKE_GENERATOR'"
17521752
CMAKE_ARGS="$CMAKE_ARGS $CFG_LLVM_SRC_DIR"
17531753

mk/main.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ endif
300300
# LLVM macros
301301
######################################################################
302302

303-
LLVM_OPTIONAL_COMPONENTS=x86 arm aarch64 mips powerpc pnacl
303+
LLVM_OPTIONAL_COMPONENTS=x86 arm aarch64 mips powerpc pnacl systemz
304304
LLVM_REQUIRED_COMPONENTS=ipo bitreader bitwriter linker asmparser mcjit \
305305
interpreter instrumentation
306306

src/rustllvm/PassWrapper.cpp

+8-1
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,19 @@ LLVMRustAddPass(LLVMPassManagerRef PM, LLVMPassRef rust_pass) {
131131
#define SUBTARGET_PPC
132132
#endif
133133

134+
#ifdef LLVM_COMPONENT_SYSTEMZ
135+
#define SUBTARGET_SYSTEMZ SUBTARGET(SystemZ)
136+
#else
137+
#define SUBTARGET_SYSTEMZ
138+
#endif
139+
134140
#define GEN_SUBTARGETS \
135141
SUBTARGET_X86 \
136142
SUBTARGET_ARM \
137143
SUBTARGET_AARCH64 \
138144
SUBTARGET_MIPS \
139-
SUBTARGET_PPC
145+
SUBTARGET_PPC \
146+
SUBTARGET_SYSTEMZ
140147

141148
#define SUBTARGET(x) namespace llvm { \
142149
extern const SubtargetFeatureKV x##FeatureKV[]; \

0 commit comments

Comments
 (0)