Bug#881845: rustc: FTBFS on mips*: test failures

John Paul Adrian Glaubitz <[email protected]>
Newsgroups gmane.linux.debian.ports.mips
Message-ID <154067444894.4053.11070340462576624894.reportbug__19286.9562343278$1540674982$gmane$org@z6.physik.fu-berlin.de>
Package: src:rustc
Followup-For: Bug #881845
User: [email protected]
Usertags: mips

Hi!

Attaching a cleaned-up patch for rustc_1.29.

Could you include it in the next upload to fix rustc on mips*?

Additionally, we will need to backport the LLVM atomics fixes for
MIPS for llvm-toolchain-6.0 [1]. I'm working on this but it's a
bit involved.

After that, we need to move the generation of doc files to the
binary-indep target such that "rustdoc" is not run on 32-Bit MIPS
targets which fails with an out-of-memory error.

Adrian

> [1] https://reviews.llvm.org/rL336328

--
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - [email protected]
`. `'   Freie Universitaet Berlin - [email protected]
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
mips-fixes.diff (text/plain, 1.9 KB)
Description: Various fixes for Rust on MIPS
Author: Dragan Mladjenovic <[email protected]>
Bug-Debian: https://bugs.debian.org/881845
Last-Update: 2018-10-24

--- rustc-1.29.0+dfsg1.orig/src/librustc_codegen_llvm/llvm_util.rs
+++ rustc-1.29.0+dfsg1/src/librustc_codegen_llvm/llvm_util.rs
@@ -66,6 +66,8 @@ unsafe fn configure_llvm(sess: &Session)
             add("-disable-preinline");
         }
 
+	if sess.target.target.arch == "mips" || sess.target.target.arch == "mips64" { add("-fast-isel=0"); }
+
         for arg in &sess.opts.cg.llvm_args {
             add(&(*arg));
         }
--- rustc-1.29.0+dfsg1.orig/src/test/run-pass/invalid_const_promotion.rs
+++ rustc-1.29.0+dfsg1/src/test/run-pass/invalid_const_promotion.rs
@@ -33,7 +33,8 @@ fn check_status(status: std::process::Ex
     use std::os::unix::process::ExitStatusExt;
 
     assert!(status.signal() == Some(libc::SIGILL)
-            || status.signal() == Some(libc::SIGABRT));
+            || status.signal() == Some(libc::SIGABRT)
+	    || status.signal() == Some(libc::SIGTRAP));
 }
 
 #[cfg(not(unix))]
--- rustc-1.29.0+dfsg1.orig/src/test/ui/asm-out-assign-imm.rs
+++ rustc-1.29.0+dfsg1/src/test/ui/asm-out-assign-imm.rs
@@ -10,6 +10,8 @@
 
 // ignore-s390x
 // ignore-emscripten
+// ignore-mips
+// ignore-mips64
 // ignore-powerpc
 // ignore-powerpc64
 // ignore-powerpc64le
--- rustc-1.29.0+dfsg1.orig/src/test/ui/target-feature-gate.rs
+++ rustc-1.29.0+dfsg1/src/test/ui/target-feature-gate.rs
@@ -12,6 +12,8 @@
 // ignore-aarch64
 // ignore-wasm
 // ignore-emscripten
+// ignore-mips
+// ignore-mips64
 // ignore-powerpc64
 // ignore-powerpc64le
 // gate-test-sse4a_target_feature
--- rustc-1.29.0+dfsg1.orig/src/test/ui/target-feature-wrong.rs
+++ rustc-1.29.0+dfsg1/src/test/ui/target-feature-wrong.rs
@@ -13,6 +13,7 @@
 // ignore-wasm
 // ignore-emscripten
 // ignore-mips
+// ignore-mips64
 // ignore-powerpc
 // ignore-powerpc64
 // ignore-powerpc64le
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.