Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build issue on Arch Linux #11

Open
nham opened this issue Jun 23, 2014 · 4 comments
Open

Build issue on Arch Linux #11

nham opened this issue Jun 23, 2014 · 4 comments

Comments

@nham
Copy link

nham commented Jun 23, 2014

Hi. I'm running Arch Linux, and while following the directions in the README, I'm unable to compile Rust master. I'm attempting to use the commands to minimize build time since I'm on a netbook and plain old "make" on Rust master takes several hours before I end up killing it.

So running this:

$ ./configure --target=i686-unknown-linux-gnu --llvm-root=/usr
$ make rustc-stage1

Results in the configure command succeeding, but "make rustc-stage1" failing thusly:

cp: x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler-rt.a
rustc: x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore
rustc: x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc
rustc: x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/librand
/home/nh/code/rust/src/librand/lib.rs:32:1: 32:19 error: multiple rlib candidates for `core` found
/home/nh/code/rust/src/librand/lib.rs:32 extern crate core;
                                         ^~~~~~~~~~~~~~~~~~
/home/nh/code/rust/src/librand/lib.rs:32:1: 32:19 note: candidate #1: /mnt/bits/code/rust/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-c5ed6fb4-0.11.0-pre.rlib
/home/nh/code/rust/src/librand/lib.rs:32 extern crate core;
                                         ^~~~~~~~~~~~~~~~~~
/home/nh/code/rust/src/librand/lib.rs:32:1: 32:19 note: candidate #2: /usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-c5ed6fb4-0.11.0-pre.rlib
/home/nh/code/rust/src/librand/lib.rs:32 extern crate core;
                                         ^~~~~~~~~~~~~~~~~~
error: aborting due to previous error
/home/nh/code/rust/mk/target.mk:164: recipe for target 'x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/stamp.rand' failed
make: *** [x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/stamp.rand] Error 101

What is this I don't even.

Also, this is probably a stupid question, but is it necessary to compile Rust master in this way? I have thestinger's nightlies (http://pkgbuild.com/~thestinger/repo/x86_64/) installed, but rustboot make also fails:

make[1]: Entering directory '/mnt/bits/code/rustboot/arch/x86'
make[1]: *** No rule to make target 'config.mk'.  Stop.
make[1]: Leaving directory '/mnt/bits/code/rustboot/arch/x86'
make[1]: Entering directory '/mnt/bits/code/rustboot/arch/x86'
/usr/bin/rustc --target i686-unknown-linux-gnu -Z no-landing-pads --opt-level=2 -Z lto -L ./boot --out-dir ./boot --dep-info --emit=bc ../../common/lib.rs
../../common/lib.rs:6:1: 7:7 warning: phase(syntax) is a deprecated synonym for phase(plugin)
../../common/lib.rs:6 #[phase(syntax, link)]
../../common/lib.rs:7 extern crate core;
../../common/lib.rs:7:1: 7:19 error: can't find crate for `core`
../../common/lib.rs:7 extern crate core;
                      ^~~~~~~~~~~~~~~~~~
error: aborting due to previous error
../../common/Makefile:39: recipe for target 'boot/main.bc' failed
make[1]: *** [boot/main.bc] Error 101
make[1]: Leaving directory '/mnt/bits/code/rustboot/arch/x86'
Makefile:20: recipe for target 'all' failed
make: *** [all] Error 2

How can I solve these problems?

@pczarn
Copy link
Owner

pczarn commented Jun 23, 2014

  1. uninstall thestinger's nightlies
  2. or set RUST_ROOT to /usr and use nightlies

@Ericson2314
Copy link
Collaborator

For more context, stock rustc nighties can probably cross compile fine, but won't come with the std library compiled for the architectures rustboot runs. The README instructions have you build the compiler by hand to make sure you can cross compiler, and more importantly give you the libs you need.

Your first error when building the rust is because the boostrap libraries and thestinger-build libraries (native arch, needed to build the compiler itself) are both seen by the compiler, and it doesn't know which to chose.

Your second error is because you never built a libcore for the target architecture.

rust-lang/rfcs#131 and/or something related should hopefully make cross compiling easier.

@alexchandel
Copy link

In case it helps, I just build the libcore crate directly from source in /common

@Ericson2314
Copy link
Collaborator

Yeah to be clear building libcore by hand should work, and avoids downloading the rust source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants