Subject: Re: [bug#28433] [WIP] Rust update

From: Danny Milosavljevic <[email-masked]>
Date: Sat, 28 Oct 2017 12:42:58 +0200

Aha!  I digged some more and found that rust-bootstrap doesn't specify #:system "i686-linux", while rustc-bootstrap does.

Symptom:

$ guix environment --pure rustc
[env]$ ls -l /gnu/store/15hcgm941wgxfk08w0wrwpd9p7wjbq87-profile/bin/cc
lrwxrwxrwx 2 root root 72 Jan  1  1970 /gnu/store/15hcgm941wgxfk08w0wrwpd9p7wjbq87-profile/bin/cc -> /gnu/store/a3gr3imzn6nqzs9q1ql0pilr0dnbpps4-rust-bootstrap-1.15.0/bin/cc
[env]$ file /gnu/store/a3gr3imzn6nqzs9q1ql0pilr0dnbpps4-rust-bootstrap-1.15.0/bin/cc
/gnu/store/a3gr3imzn6nqzs9q1ql0pilr0dnbpps4-rust-bootstrap-1.15.0/bin/cc: symbolic link to /gnu/store/8yxpqz65fgvcab60ypih009xv777ni66-gcc-5.4.0/bin/gcc
[env]$ file /gnu/store/8yxpqz65fgvcab60ypih009xv777ni66-gcc-5.4.0/bin/gcc
/gnu/store/8yxpqz65fgvcab60ypih009xv777ni66-gcc-5.4.0/bin/gcc: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /gnu/store/3h31zsqxjjg52da5gp3qmhkh4x8klhah-glibc-2.25/lib/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, not stripped, with debug_info

Note "x86-64".

On the other hand:

[env]$ file -L /gnu/store/15hcgm941wgxfk08w0wrwpd9p7wjbq87-profile/bin/rustc
/gnu/store/15hcgm941wgxfk08w0wrwpd9p7wjbq87-profile/bin/rustc: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /gnu/store/kzkgc8avgnanrv3ab2g3g8yj7l4bcavj-glibc-2.25/lib/ld-linux.so.2, for GNU/Linux 2.6.9, not stripped, with debug_info

[env]$ file -L /gnu/store/kzkgc8avgnanrv3ab2g3g8yj7l4bcavj-glibc-2.25/lib/ld-linux.so.2
/gnu/store/kzkgc8avgnanrv3ab2g3g8yj7l4bcavj-glibc-2.25/lib/ld-linux.so.2: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, not stripped, with debug_info

Note "32-bit", "80386".

But when I change rust-bootstrap to specify #:system "i686-linux", then I get:

  |
  = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m32" "-L" "/gnu/store/zmcc9gizicl91qvpcnl7ric2klnqhsdq-rustc-bootstrap-1.17.0/lib/rustlib/i686-unknown-linux-gnu/lib" "/tmp/guix-build-rustc-1.18.0.drv-0/rustc-1.18.0-src/build/bootstrap/debug/deps/rustc-f53d5ba9fb00bcc2.0.o" "-o" "/tmp/guix-build-rustc-1.18.0.drv-0/rustc-1.18.0-src/build/bootstrap/debug/deps/rustc-f53d5ba9fb00bcc2" "-Wl,--gc-sections" "-pie" "-nodefaultlibs" "-L" "/tmp/guix-build-rustc-1.18.0.drv-0/rustc-1.18.0-src/build/bootstrap/debug/deps" "-L" "/gnu/store/zmcc9gizicl91qvpcnl7ric2klnqhsdq-rustc-bootstrap-1.17.0/lib/rustlib/i686-unknown-linux-gnu/lib" "-Wl,-Bstatic" "-Wl,-Bdynamic" "/tmp/guix-build-rustc-1.18.0.drv-0/rustc-1.18.0-src/build/bootstrap/debug/deps/libbootstrap-3ebfecab87ea2884.rlib" "/tmp/guix-build-rustc-1.18.0.drv-0/rustc-1.18.0-src/build/bootstrap/debug/deps/libtoml-3495572d91ba2dfe.rlib" "/tmp/guix-build-rustc-1.18.0.drv-0/rustc-1.18.0-src/build/bootstrap/debug/deps/librustc_serialize-5c8c719
 f8cb442df.rlib" "/tmp/guix-build-rustc-1.18.0.drv-0/rustc-1.18.0-src/build/bootstrap/debug/deps/libnum_cpus-d81d39a56ecc4645.rlib" "/tmp/guix-build-rustc-1.18.0.drv-0/rustc-1.18.0-src/build/bootstrap/debug/deps/libcmake-4feacbf6844c5e86.rlib" "/tmp/guix-build-rustc-1.18.0.drv-0/rustc-1.18.0-src/build/bootstrap/debug/deps/libgcc-3c79a13fa356000a.rlib" "/tmp/guix-build-rustc-1.18.0.drv-0/rustc-1.18.0-src/build/bootstrap/debug/deps/libbuild_helper-d1189496287db707.rlib" "/tmp/guix-build-rustc-1.18.0.drv-0/rustc-1.18.0-src/build/bootstrap/debug/deps/libfiletime-1fba24aeada37bf3.rlib" "/tmp/guix-build-rustc-1.18.0.drv-0/rustc-1.18.0-src/build/bootstrap/debug/deps/liblibc-1ece201356dd0812.rlib" "/tmp/guix-build-rustc-1.18.0.drv-0/rustc-1.18.0-src/build/bootstrap/debug/deps/libgetopts-781edef4d7eacd14.rlib" "/gnu/store/zmcc9gizicl91qvpcnl7ric2klnqhsdq-rustc-bootstrap-1.17.0/lib/rustlib/i686-unknown-linux-gnu/lib/libstd-f4594d3e53dcb114.rlib" "/gnu/store/zmcc9gizicl91qvpcnl7ric2klnqhsdq-rus
 tc-bootstrap-1.17.0/lib/rustlib/i686-unknown-linux-gnu/lib/libpanic_unwind-a0157c0ca919c364.rlib" "/gnu/store/zmcc9gizicl91qvpcnl7ric2klnqhsdq-rustc-bootstrap-1.17.0/lib/rustlib/i686-unknown-linux-gnu/lib/libunwind-488b4ab4bd53a138.rlib" "/gnu/store/zmcc9gizicl91qvpcnl7ric2klnqhsdq-rustc-bootstrap-1.17.0/lib/rustlib/i686-unknown-linux-gnu/lib/librand-1efbcfd8938372b6.rlib" "/gnu/store/zmcc9gizicl91qvpcnl7ric2klnqhsdq-rustc-bootstrap-1.17.0/lib/rustlib/i686-unknown-linux-gnu/lib/libcollections-532a3dbf317eff86.rlib" "/gnu/store/zmcc9gizicl91qvpcnl7ric2klnqhsdq-rustc-bootstrap-1.17.0/lib/rustlib/i686-unknown-linux-gnu/lib/liballoc-ca07b617414dd0fa.rlib" "/gnu/store/zmcc9gizicl91qvpcnl7ric2klnqhsdq-rustc-bootstrap-1.17.0/lib/rustlib/i686-unknown-linux-gnu/lib/liballoc_jemalloc-492d8ea7fa3384ff.rlib" "/gnu/store/zmcc9gizicl91qvpcnl7ric2klnqhsdq-rustc-bootstrap-1.17.0/lib/rustlib/i686-unknown-linux-gnu/lib/liblibc-88c194c15fdb6521.rlib" "/gnu/store/zmcc9gizicl91qvpcnl7ric2klnqhsdq-rustc-
 bootstrap-1.17.0/lib/rustlib/i686-unknown-linux-gnu/lib/libstd_unicode-cfbd6648f7db2ee5.rlib" "/gnu/store/zmcc9gizicl91qvpcnl7ric2klnqhsdq-rustc-bootstrap-1.17.0/lib/rustlib/i686-unknown-linux-gnu/lib/libcore-687e6a964d22cbb4.rlib" "/gnu/store/zmcc9gizicl91qvpcnl7ric2klnqhsdq-rustc-bootstrap-1.17.0/lib/rustlib/i686-unknown-linux-gnu/lib/libcompiler_builtins-987729be881d4d32.rlib" "-l" "util" "-l" "dl" "-l" "rt" "-l" "pthread" "-l" "gcc_s" "-l" "pthread" "-l" "c" "-l" "m" "-l" "rt" "-l" "util"
  = note: ld: /gnu/store/w8swvn15kqzzl3q5d0d9zjnhg5pk9ksw-gcc-5.4.0/libexec/gcc/i686-unknown-linux-gnu/5.4.0/liblto_plugin.so: error loading plugin: /gnu/store/w8swvn15kqzzl3q5d0d9zjnhg5pk9ksw-gcc-5.4.0/libexec/gcc/i686-unknown-linux-gnu/5.4.0/liblto_plugin.so: wrong ELF class: ELFCLASS32