about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-08-29 12:48:21 -0700
committerGitHub <noreply@github.com>2016-08-29 12:48:21 -0700
commit77d2cd28fd715d2b9751de82b14d28ce6e376728 (patch)
tree063e89474e2403ee3dfb6c589ea1838806973936
parent86dde9bbda92c02c61282b5df5d38338a798ef3b (diff)
parent15d8dfb6a0c7241845e4636cfc7d8cbf86108a08 (diff)
downloadrust-77d2cd28fd715d2b9751de82b14d28ce6e376728.tar.gz
rust-77d2cd28fd715d2b9751de82b14d28ce6e376728.zip
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
-rwxr-xr-xconfigure2
-rw-r--r--mk/main.mk2
-rw-r--r--src/rustllvm/PassWrapper.cpp9
3 files changed, 10 insertions, 3 deletions
diff --git a/configure b/configure
index a48ff6a7610..44fb3d368d2 100755
--- a/configure
+++ b/configure
@@ -1747,7 +1747,7 @@ do
         CMAKE_ARGS="$CMAKE_ARGS -DLLVM_ENABLE_ASSERTIONS=ON"
     fi
 
-    CMAKE_ARGS="$CMAKE_ARGS -DLLVM_TARGETS_TO_BUILD='X86;ARM;AArch64;Mips;PowerPC'"
+    CMAKE_ARGS="$CMAKE_ARGS -DLLVM_TARGETS_TO_BUILD='X86;ARM;AArch64;Mips;PowerPC;SystemZ'"
     CMAKE_ARGS="$CMAKE_ARGS -G '$CFG_CMAKE_GENERATOR'"
     CMAKE_ARGS="$CMAKE_ARGS $CFG_LLVM_SRC_DIR"
 
diff --git a/mk/main.mk b/mk/main.mk
index 428d9d16182..5a849af9856 100644
--- a/mk/main.mk
+++ b/mk/main.mk
@@ -300,7 +300,7 @@ endif
 # LLVM macros
 ######################################################################
 
-LLVM_OPTIONAL_COMPONENTS=x86 arm aarch64 mips powerpc pnacl
+LLVM_OPTIONAL_COMPONENTS=x86 arm aarch64 mips powerpc pnacl systemz
 LLVM_REQUIRED_COMPONENTS=ipo bitreader bitwriter linker asmparser mcjit \
                 interpreter instrumentation
 
diff --git a/src/rustllvm/PassWrapper.cpp b/src/rustllvm/PassWrapper.cpp
index 0555a96ff24..a271987210b 100644
--- a/src/rustllvm/PassWrapper.cpp
+++ b/src/rustllvm/PassWrapper.cpp
@@ -131,12 +131,19 @@ LLVMRustAddPass(LLVMPassManagerRef PM, LLVMPassRef rust_pass) {
 #define SUBTARGET_PPC
 #endif
 
+#ifdef LLVM_COMPONENT_SYSTEMZ
+#define SUBTARGET_SYSTEMZ SUBTARGET(SystemZ)
+#else
+#define SUBTARGET_SYSTEMZ
+#endif
+
 #define GEN_SUBTARGETS    \
         SUBTARGET_X86     \
         SUBTARGET_ARM     \
         SUBTARGET_AARCH64 \
         SUBTARGET_MIPS    \
-        SUBTARGET_PPC
+        SUBTARGET_PPC     \
+        SUBTARGET_SYSTEMZ
 
 #define SUBTARGET(x) namespace llvm {                \
     extern const SubtargetFeatureKV x##FeatureKV[];  \