Re: [Pkg-rust-maintainers] Bug#881845: Bug#881845: Bug#881845: Bug#881845: Bug#881845: Bug#881845: Bug#881845: Bug#881845: rustc: FTBFS on mips*: test failures

John Paul Adrian Glaubitz <[email protected]>
Newsgroups gmane.linux.debian.ports.mips
Message-ID <[email protected]>
Hello!

With the attached patch, I can almost fully build rustc 1.29 natively on mips,
but it fails again with an out-of-memory error while generating the Rustbook:

Rustbook (mips-unknown-linux-gnu) - unstable-book
running: "/home/glaubitz/rustc/rustc-1.29.0+dfsg1/build/mips-unknown-linux-gnu/stage0-tools-bin/rustbook" "build"
"/home/glaubitz/rustc/rustc-1.29.0+dfsg1/build/mips-unknown-linux-gnu/md-doc/unstable-book" "-d"
"/home/glaubitz/rustc/rustc-1.29.0+dfsg1/build/mips-unknown-linux-gnu/doc/unstable-book"
memory allocation of 1342177280 bytes failed

command did not execute successfully: "/home/glaubitz/rustc/rustc-1.29.0+dfsg1/build/mips-unknown-linux-gnu/stage0-tools-bin/rustbook" "build"
"/home/glaubitz/rustc/rustc-1.29.0+dfsg1/build/mips-unknown-linux-gnu/md-doc/unstable-book" "-d"
"/home/glaubitz/rustc/rustc-1.29.0+dfsg1/build/mips-unknown-linux-gnu/doc/unstable-book"
expected success, got: signal: 6


Traceback (most recent call last):
  File "./x.py", line 20, in <module>
    bootstrap.main()
  File "/home/glaubitz/rustc/rustc-1.29.0+dfsg1/src/bootstrap/bootstrap.py", line 842, in main
    bootstrap(help_triggered)
  File "/home/glaubitz/rustc/rustc-1.29.0+dfsg1/src/bootstrap/bootstrap.py", line 833, in bootstrap
    run(args, env=env, verbose=build.verbose)
  File "/home/glaubitz/rustc/rustc-1.29.0+dfsg1/src/bootstrap/bootstrap.py", line 149, in run
    raise RuntimeError(err)
RuntimeError: failed to run: /home/glaubitz/rustc/rustc-1.29.0+dfsg1/build/bootstrap/debug/bootstrap install --config debian/config.toml -vv --on-fail env
make[1]: *** [debian/rules:271: override_dh_auto_install] Error 1
make[1]: Leaving directory '/home/glaubitz/rustc/rustc-1.29.0+dfsg1'
make: *** [debian/rules:132: binary-arch] Error 2
dpkg-buildpackage: error: fakeroot debian/rules binary-arch subprocess returned exit status 2

I also disabled the debug symbols for stdlib on mips/mipsel (same as for 32-bit ARM):

        [ $(DEB_BUILD_ARCH) != mips -a \
          $(DEB_BUILD_ARCH) != mipsel ] || sed -i -e '/^debuginfo-only-std = /d' "$@"

So, if we move the generation of the Rustbook into the binary-indep target (which
we should do anyway, shouldn't we), then rustc should build fine on 32-bit MIPS.

Note: We still need this one patch for LLVM backported to fix the atomics issue
      otherwise the testsuite will hang.

Adrian

-- 
 .''`.  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/x-patch, 3 KB)
Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 rustc (1.29.0+dfsg1-1) unstable; urgency=medium
 .
   * Upload to unstable.
   * Drop d-armel-disable-kernel-helpers.patch as a necessary part of the
     fix to #906520, so it is actually fixed.
   * Backport a patch to fix the rand crate on powerpc. (Closes: #909400)
   * Lower the s390x allowed failures back to 25.
Author: Ximin Luo <[email protected]>
Bug-Debian: https://bugs.debian.org/909400

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
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.