[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

binutils 2.30 still breaks rust builds on sparc64



Hi!

binutils 2.30 has unfortunately still at least two issues on sparc64 which become
visible when trying to build rust code. Both issues do not exist with 2.28.

When trying to build rustc from git natively using a known to work rustc
compiler that was cross-built, I get:

glaubitz@deb4g:/srv/glaubitz/rust/rust$ ./x.py build
   Compiling cfg-if v0.1.2
   Compiling itoa v0.3.4
   Compiling quote v0.3.15
   Compiling getopts v0.2.15
   Compiling lazy_static v0.2.11
   Compiling libc v0.2.36
   Compiling num-traits v0.1.41
   Compiling serde v1.0.27
   Compiling cc v1.0.4
   Compiling unicode-xid v0.0.4
   Compiling dtoa v0.4.2
   Compiling synom v0.11.3
   Compiling syn v0.11.11
   Compiling num_cpus v1.8.0
   Compiling time v0.1.39
   Compiling filetime v0.1.15
   Compiling build_helper v0.1.0 (file:///srv/glaubitz/rust/rust/src/build_helper)
   Compiling cmake v0.1.29
   Compiling serde_derive_internals v0.19.0
   Compiling serde_derive v1.0.27
   Compiling toml v0.4.5
   Compiling serde_json v1.0.9
   Compiling bootstrap v0.0.0 (file:///srv/glaubitz/rust/rust/src/bootstrap)
    Finished dev [unoptimized] target(s) in 89.84 secs
failed to run: /srv/glaubitz/rust/rust/build/bootstrap/debug/bootstrap build
Build completed unsuccessfully in 0:01:31
glaubitz@deb4g:/srv/glaubitz/rust/rust$ /srv/glaubitz/rust/rust/build/bootstrap/debug/bootstrap
Segmentation fault
glaubitz@deb4g:/srv/glaubitz/rust/rust$ gdb /srv/glaubitz/rust/rust/build/bootstrap/debug/bootstrap
GNU gdb (Debian 7.12-6+b1) 7.12.0.20161007-git
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "sparc64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /srv/glaubitz/rust/rust/build/bootstrap/debug/bootstrap...done.
warning: Missing auto-load script at offset 0 in section .debug_gdb_scripts
of file /srv/glaubitz/rust/rust/build/bootstrap/debug/bootstrap.
Use `info auto-load python-scripts [REGEXP]' to list them.
(gdb) r
Starting program: /srv/glaubitz/rust/rust/build/bootstrap/debug/bootstrap
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/sparc64-linux-gnu/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x000001000071b7f0 in std::sys::unix::thread::guard::init::h0b6f29eeaf90d9dd ()
(gdb) bt
#0  0x000001000071b7f0 in std::sys::unix::thread::guard::init::h0b6f29eeaf90d9dd ()
#1  0x000001000070d8d4 in std::rt::lang_start_internal::hc30929b82ea45cfd ()
#2  0x0000010000037408 in std::rt::lang_start::hcc8e1ba764aa24dc (main=0x10000037d04 <bootstrap::main::h103efa76c920eaa9>, argc=1, argv=0x7feffffefc8)
    at /srv/glaubitz/rust/rust/src/libstd/rt.rs:74
#3  0x0000010000037e70 in main ()
(gdb)

Downgrading binutils to 2.28 fixes this issue.

A second problem occurs when trying to cross-build the rust compiler for sparc64 on x86_64:

error: linking with `sparc64-linux-gnu-gcc` failed: exit code: 1
  |
  = note: "sparc64-linux-gnu-gcc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-L"
"/srv/glaubitz/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/sparc64-unknown-linux-gnu/lib"
"/srv/glaubitz/rust/rust/build/x86_64-unknown-linux-gnu/stage1-std/sparc64-unknown-linux-gnu/release/deps/std-50a30754efc77185.std0-7456b92f185380f18a646928cc900174.rs.rcgu.o"
"/srv/glaubitz/rust/rust/build/x86_64-unknown-linux-gnu/stage1-std/sparc64-unknown-linux-gnu/release/deps/std-50a30754efc77185.std1-7456b92f185380f18a646928cc900174.rs.rcgu.o"
"/srv/glaubitz/rust/rust/build/x86_64-unknown-linux-gnu/stage1-std/sparc64-unknown-linux-gnu/release/deps/std-50a30754efc77185.std10-7456b92f185380f18a6
46928cc900174.rs.rcgu.o"
"/srv/glaubitz/rust/rust/build/x86_64-unknown-linux-gnu/stage1-std/sparc64-unknown-linux-gnu/release/deps/std-50a30754efc77185.std11-7456b92f185380f18a646928cc900174.rs.rcgu.o"
"/srv/glaubitz/rust/rust/build/x86_64-unknown-linux-gnu/stage1-std/sparc64-unknown-linux-gnu/release/deps/std-50a30754efc77185.std12-7456b92f185380f18a646928cc900174.rs.rcgu.o"
"/srv/glaubitz/rust/rust/build/x86_64-unknown-linux-gnu/stage1-std/sparc64-unknown-linux-gnu/release/deps/std-50a30754efc77185.std13-7456
b92f185380f18a646928cc900174.rs.rcgu.o"
"/srv/glaubitz/rust/rust/build/x86_64-unknown-linux-gnu/stage1-std/sparc64-unknown-linux-gnu/release/deps/std-50a30754efc77185.std14-7456b92f185380f18a646928cc900174.rs.rcgu.o"
"/srv/glaubitz/rust/rust/build/x86_64-unknown-linux-gnu/stage1-std/sparc64-unknown-linux-gnu/release/deps/std-50a30754efc77185.std15-7456b92f185380f18a646928cc900174.rs.rcgu.o"
"/srv/glaubitz/rust/rust/build/x86_64-unknown-linux-gnu/stage1-std/sparc64-unknown-linux-gnu/release/deps/std-50a30754efc77185.std2-7456b92f185380f18a646928cc900174.rs.rcgu.o"
"/srv/glaubitz/rust/rust/build/x86_64-unknown-linux-gnu/stage1-std/sparc64-unknown-linux-gnu/release/deps/std-50a30754efc77185.std3-7456b92f185380f18a646928cc900174.rs.rcgu.o"
"/srv/glaubitz/rust/rust/build/x86_64-unknown-linux-gnu/stage1-std/sparc64-unknown-linux-gnu/release/deps/std-50a30754efc77185.std4-7456b92f185380f18a646928cc900174.rs.rcgu.o"
"/srv/glaubitz/rust/rust/build/x86_64-unknown-linux-gnu/stage1-std/sparc64-unknown-linux-gnu/release/deps/std-50a30754efc77185.std5-7456b92f185380f18a646928cc900174.rs.rcgu.o"
"/srv/glaubitz/rust/rust/build/x86_64-unknown-linux-gnu/stage1-std/sparc64-unknown-linux-gnu/release/deps/std-50a30754efc77185.std6-7456b92f185380f18a646928cc900174.rs.rcgu.o"
"/srv/glaubitz/rust/rust/build/x86_64-unknown-linux-gnu/stage1-std/sparc64-unknown-linux-gnu/release/deps/std-50a30754efc77185.std7-7456b92f185380f18a646928cc900174.rs.rcgu.o"
"/srv/glaubitz/rust/rust/build/x86_64-unknown-linux-gnu/stage1-std/sparc64-unknown-linux-gnu/release/deps/std-50a30754efc77185.std8-7456b92f185380f18a646928cc900174.rs.rcgu.o"
"/srv/glaubitz/rust/rust/build/x86_64-unknown-linux-gnu/stage1-std/sparc64-unknown-linux-gnu/release/deps/std-50a30754efc77185.std9-7456b92f185380f18a646928cc900174.rs.rcgu.o"
"-o" "/srv/glaubitz/rust/rust/build/x86_64-unknown-linux-gnu/stage1-std/sparc64-unknown-linux-gnu/release/deps/libstd-50a30754efc77185.so"
"/srv/glaubitz/rust/rust/build/x86_64-unknown-linux-gnu/stage1-std/sparc64-unknown-linux-gnu/release/deps/std-50a30754efc77185.crate.metadata.rcgu.o"
"/srv/glaubitz/rust/rust/build/x86_64-unknown-linux-gnu/stage1-std/sparc64-unknown-linux-gnu/release/deps/std-50a30754efc77185.crate.allocator.rcgu.o"
"-Wl,-z,relro,-z,now" "-Wl,-O1" "-nodefaultlibs" "-L" "/srv/glaubitz/rust/rust/build/x86_64-unknown-linux-gnu/stage1-std/sparc64-unknown-linux-gnu/release/deps"
"-L" "/srv/glaubitz/rust/rust/build/x86_64-unknown-linux-gnu/stage1-std/release/deps" "-L"
"/srv/glaubitz/rust/rust/build/sparc64-unknown-linux-gnu/native/libbacktrace/.libs" "-L"
"/srv/glaubitz/rust/rust/build/sparc64-unknown-linux-gnu/native/jemalloc/lib" "-L"
"/srv/glaubitz/rust/rust/build/x86_64-unknown-linux-gnu/stage1-std/sparc64-unknown-linux-gnu/release/build/compiler_builtins-990f7637d0503f4e/out" "-L"
"/srv/glaubitz/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/sparc64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "-Wl,--whole-archive" "-l" "backtrace"
"-Wl,--no-whole-archive" "-Wl,-Bdynamic" "-l" "dl" "-l" "rt" "-l" "pthread" "-Wl,-Bstatic" "-Wl,--whole-archive"
"/tmp/rustc.SObmSkbjz1fo/libpanic_unwind-4f85ba5d0e870e29.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive"
"/tmp/rustc.SObmSkbjz1fo/libunwind-c86c9565da689e14.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive"
"/tmp/rustc.SObmSkbjz1fo/liballoc_system-655151fba596847e.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive"
"/tmp/rustc.SObmSkbjz1fo/liblibc-b8f9bb8294d9a014.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.SObmSkbjz1fo/liballoc-513d34708cb20443.rlib"
"-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.SObmSkbjz1fo/libstd_unicode-5211f032242a5357.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive"
"/tmp/rustc.SObmSkbjz1fo/libcore-e2f49b08d2bc06b5.rlib" "-Wl,--no-whole-archive" "/tmp/rustc.SObmSkbjz1fo/libcompiler_builtins-136e26942e0df602.rlib"
"-Wl,-Bdynamic" "-l" "gcc_s" "-l" "c" "-l" "m" "-l" "rt" "-l" "pthread" "-l" "util" "-l" "util" "-shared" "-Wl,-rpath,$ORIGIN/../lib"
  = note: /usr/lib/gcc-cross/sparc64-linux-gnu/7/../../../../sparc64-linux-gnu/bin/ld: BFD (GNU Binutils for Debian) 2.30 internal error, aborting at
../../bfd/elflink.c:9710 in elf_link_output_extsym

          /usr/lib/gcc-cross/sparc64-linux-gnu/7/../../../../sparc64-linux-gnu/bin/ld: Please report this bug.

          collect2: error: ld returned 1 exit status

This is also fixed by downgrading binutils to 2.28. I have reported this issue upstream [1].

Adrian

> [1] https://sourceware.org/bugzilla/show_bug.cgi?id=22832

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaubitz@debian.org
`. `'   Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913


Reply to: