Re: binutils 2.30 still breaks rust builds on sparc64

2018-02-11 Thread Eric Botcazou
> Ok, I just cloned binutils from git, built it and installed it locally
> on deb4g. The crash is gone \o/.

With the master and not the 2.30 branch, right?

-- 
Eric Botcazou



Re: binutils 2.30 still breaks rust builds on sparc64

2018-02-11 Thread John Paul Adrian Glaubitz
On 02/11/2018 06:36 PM, Eric Botcazou wrote:
>> Ok, I just cloned binutils from git, built it and installed it locally
>> on deb4g. The crash is gone \o/.
> 
> With the master and not the 2.30 branch, right?

Yes, I just cloned git master and built and installed with:

# git clone git://sourceware.org/git/binutils-gdb.git
# cd binutils-gdb
# ./configure
# make && make install

It did fix the crash in the compiled "bootstrap" binary, but the internal
error as reported in 22832 is still there.

Adrian

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



Re: binutils 2.30 still breaks rust builds on sparc64

2018-02-11 Thread John Paul Adrian Glaubitz
On 02/11/2018 06:27 PM, John Paul Adrian Glaubitz wrote:
> Ok, I just cloned binutils from git, built it and installed it locally
> on deb4g. The crash is gone \o/.
> 
> Now testing the cross-building issue.

And the internal error is still there for native builds:

  = note: /usr/local/bin/ld: BFD (GNU Binutils) 2.30.51.20180211 internal 
error, aborting at elflink.c:9710 in elf_link_output_extsym

  /usr/local/bin/ld: Please report this bug.

  collect2: error: ld returned 1 exit status


error: aborting due to previous error

error: Could not compile `std`.

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



Re: binutils 2.30 still breaks rust builds on sparc64

2018-02-11 Thread John Paul Adrian Glaubitz
On 02/11/2018 03:31 PM, John Paul Adrian Glaubitz wrote:
> On 02/11/2018 03:25 PM, Eric Botcazou wrote:
>>> 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.
>>
>> Can you try with current 2.30 branch (and current 2.29 branch if possible)?
> 
> I applied your GOT patch to the Debian binutils_2.30-4 package, rebuilt it on
> deb4g and tried again to bootstrap rustc on sparc64 natively:
> 
> Finished dev [unoptimized] target(s) in 88.99 secs
> failed to run: /srv/glaubitz/rust/rust/build/bootstrap/debug/bootstrap build
> Build completed unsuccessfully in 0:01:29

Ok, I just cloned binutils from git, built it and installed it locally
on deb4g. The crash is gone \o/.

Now testing the cross-building issue.

Adrian

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



Re: binutils 2.30 still breaks rust builds on sparc64

2018-02-11 Thread Eric Botcazou
> 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.

Can you try with current 2.30 branch (and current 2.29 branch if possible)?

-- 
Eric Botcazou



Re: binutils 2.30 still breaks rust builds on sparc64

2018-02-11 Thread John Paul Adrian Glaubitz
On 02/11/2018 03:25 PM, Eric Botcazou wrote:
>> 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.
> 
> Can you try with current 2.30 branch (and current 2.29 branch if possible)?

I applied your GOT patch to the Debian binutils_2.30-4 package, rebuilt it on
deb4g and tried again to bootstrap rustc on sparc64 natively:

Finished dev [unoptimized] target(s) in 88.99 secs
failed to run: /srv/glaubitz/rust/rust/build/bootstrap/debug/bootstrap build
Build completed unsuccessfully in 0:01:29

The compiled bootstrap binary still crashes. Downgrading binutils to 2.28
fixes the problem.

I am still checking whether the internal error generated during the cross-
build is fixed by this patch.

Adrian

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



binutils 2.30 still breaks rust builds on sparc64

2018-02-11 Thread John Paul Adrian Glaubitz
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 
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:
.
Find the GDB manual and other documentation resources online at:
.
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.
0x0171b7f0 in std::sys::unix::thread::guard::init::h0b6f29eeaf90d9dd ()
(gdb) bt
#0  0x0171b7f0 in 
std::sys::unix::thread::guard::init::h0b6f29eeaf90d9dd ()
#1  0x0170d8d4 in std::rt::lang_start_internal::hc30929b82ea45cfd ()
#2  0x01037408 in std::rt::lang_start::hcc8e1ba764aa24dc 
(main=0x1037d04 , argc=1, 
argv=0x7feefc8)
at /srv/glaubitz/rust/rust/src/libstd/rt.rs:74
#3  0x01037e70 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"