rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
96.91k stars 12.52k forks source link

Cannot compile on arch linux #30323

Closed gchp closed 8 years ago

gchp commented 8 years ago

Getting the following error when compiling on master:

~/s/g/g/rust git:master ❯❯❯ make                                                                                                      ⏎
cfg: version 1.7.0-dev (01e5c4865 2015-12-11)
cfg: build triple x86_64-unknown-linux-gnu
cfg: host triples x86_64-unknown-linux-gnu
cfg: target triples x86_64-unknown-linux-gnu
cfg: host for x86_64-unknown-linux-gnu is x86_64
cfg: os for x86_64-unknown-linux-gnu is unknown-linux-gnu
cfg: good valgrind for x86_64-unknown-linux-gnu is 1
cfg: using CC=gcc (CFG_CC)
cfg: disabling valgrind run-pass tests
rustc: x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore
fatal runtime error: Could not unwind stack, error = 5/home/gchp/src/github.com/gchp/rust/mk/target.mk:195: recipe for target 'x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/stamp.core' failed
make: *** [x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/stamp.core] Illegal instruction (core dumped)
~/s/g/g/rust git:master ❯❯❯ uname -a
Linux latitude 4.2.5-1-ARCH #1 SMP PREEMPT Tue Oct 27 08:13:28 CET 2015 x86_64 GNU/Linux

Not sure what other info I can provide. Let me know and I'll update!

gchp commented 8 years ago

Just wondering if anyone else is seeing this? Still happening on latest master. The build system is a bit of an unknown to me unfortunately, so I'm at a loss as to what the issue might be.

bltavares commented 8 years ago

@gchp did you run ./configure before make?

gchp commented 8 years ago

@bltavares yes. I've tried just ./configure on its own, and also with some options to use clang instead of gcc, and to enable debug, and combinations of both, but same result each time.

bltavares commented 8 years ago

@gchp I've just created a new VM with Arch and I was not able to reproduce.

I've executed the following

git clone https://github.com/rust-lang/rust.git
cd rust/
./configure
make

Here is the system info

vagrant@archlinux:~/rust$ g++ --version
g++ (GCC) 5.3.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

vagrant@archlinux:~/rust$ python --version
Python 3.5.1
vagrant@archlinux:~/rust$ make --version
GNU Make 4.1
Built for x86_64-unknown-linux-gnu
Copyright (C) 1988-2014 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.
vagrant@archlinux:~/rust$ curl --version
curl 7.46.0 (x86_64-pc-linux-gnu) libcurl/7.46.0 OpenSSL/1.0.2e zlib/1.2.8 libidn/1.32 libssh2/1.6.0
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP UnixSockets
vagrant@archlinux:~/rust$ git --version
git version 2.6.4
vagrant@archlinux:~/rust$ uname -a
Linux archlinux.vagrant.vm 4.3.3-2-ARCH #1 SMP PREEMPT Wed Dec 23 20:09:18 CET 2015 x86_64 GNU/Linux

Could you try to execute make clean and give it another try?

rillian commented 8 years ago

I can't reproduce either. Maybe compare your system with the docker container from https://github.com/rillian/rust-archlinux or check your code generation settings?

gchp commented 8 years ago

Hmm, ok. I'm AFk now, but will check my versions against the ones above and see whats different. Must be something wrong with my setup. Thanks for looking into this @rillian and @bltavares.

gchp commented 8 years ago

Ok, so, tried out @rillian's docker container, and it builds find in there. I compared all the package versions installed on my machine against those installed in the docker container and they are alll the extact same. My versions are also the same as @bltavares's versions above bar python. I'm using python 2.7 as the Rust README says not to use python 3.

Still failing though. Any other suggestions on what I can do to dig into this further? Thanks again for the help so far.

brson commented 8 years ago

Since the error is 'illegal instruction' you might run with VERBOSE=1, then run the failing command in a debugger to see what the instruction is.

Is there any chance your CPU is very old? Perhaps the default architecture choices don't work for your CPU. That's pretty uncommon though.

gchp commented 8 years ago

So, I ended up deleting my x86_64-unknown-linux-gnu and re-running configure and make. It is working now.

It looks like (maybe) there was a problem with my original llvm build, and it wasn't being cleaned when I ran make clean. When I removed the entire folder, it re-compiled llvm when I ran make, and it didn't hit the illegal instruction again. Ot it could have been jemalloc...

@brson should make clean clean up the llvm & jemalloc build artifacts along with everything else?

rillian commented 8 years ago

Glad you got it working.

There are clean-llvm and clean-all targets which will get rid of the llvm artifacts. I guess llvm doesn't change as fast as the rest of rustc, so it was left out of the normal clean target to speed up rebuilds.

gchp commented 8 years ago

@rillian didn't know about those - makes sense. Thanks again for the help!