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

Bootstrap rust for ARM64 #28467

Closed
pranith opened this issue Sep 17, 2015 · 2 comments
Closed

Bootstrap rust for ARM64 #28467

pranith opened this issue Sep 17, 2015 · 2 comments

Comments

@pranith
Copy link

pranith commented Sep 17, 2015

I am trying to bootstrap rust for ARM64. I am trying to build an arm64 stage0 rustc on an x86 machine so that I can use that to natively compile rustc on ARM64. I have the aarch64-linux-gnu-gcc cross compiler installed. I am configuring rust as follows:

$ ../configure --host=aarch64-unknown-linux-gnu --target=aarch64-unknown-linux-gnu --disable-jemalloc

On building using make, I am getting the following error:

error: linking with `aarch64-linux-gnu-gcc` failed: exit code: 1
note: "aarch64-linux-gnu-gcc" "-Wl,--as-needed" "-L" "rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/aarch64-unknown-linux-gnu/lib" "x86_64-unknown-linux-gnu/stage1/lib/rustlib/aarch64-unknown-linux-gnu/lib/std-a5fc0d6c.0.o" "-o" "x86_64-unknown-linux-gnu/stage1/lib/rustlib/aarch64-unknown-linux-gnu/lib/libstd-a5fc0d6c.so" "x86_64-unknown-linux-gnu/stage1/lib/rustlib/aarch64-unknown-linux-gnu/lib/std-a5fc0d6c.metadata.o" "-Wl,-O1" "-nodefaultlibs" "-Wl,--whole-archive" "/tmp/rustc.0Icc9db0gqxD/libcollections-a5fc0d6c.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.0Icc9db0gqxD/liballoc-a5fc0d6c.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.0Icc9db0gqxD/librustc_unicode-a5fc0d6c.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.0Icc9db0gqxD/liballoc_system-a5fc0d6c.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.0Icc9db0gqxD/liblibc-a5fc0d6c.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.0Icc9db0gqxD/librand-a5fc0d6c.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.0Icc9db0gqxD/libcore-a5fc0d6c.rlib" "-Wl,--no-whole-archive" "-L" "aarch64-unknown-linux-gnu/rt" "-L" "rust/build/aarch64-unknown-linux-gnu/llvm/Release/lib" "-L" "rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/aarch64-unknown-linux-gnu/lib" "-L" "rust/build/.rust/lib/aarch64-unknown-linux-gnu" "-L" "rust/build/lib/aarch64-unknown-linux-gnu" "-Wl,-Bstatic" "-Wl,--whole-archive" "-l" "rust_builtin" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "backtrace" "-Wl,--no-whole-archive" "-Wl,-Bdynamic" "-l" "dl" "-l" "pthread" "-l" "rt" "-l" "gcc_s" "-l" "c" "-l" "m" "-shared" "-l" "compiler-rt"
note: /usr/lib/gcc-cross/aarch64-linux-gnu/4.8/../../../../aarch64-linux-gnu/bin/ld: skipping incompatible rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/aarch64-unknown-linux-gnu/lib/libcompiler-rt.a when searching for -lcompiler-rt
/usr/lib/gcc-cross/aarch64-linux-gnu/4.8/../../../../aarch64-linux-gnu/bin/ld: skipping incompatible aarch64-unknown-linux-gnu/rt/libcompiler-rt.a when searching for -lcompiler-rt
/usr/lib/gcc-cross/aarch64-linux-gnu/4.8/../../../../aarch64-linux-gnu/bin/ld: skipping incompatible rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/aarch64-unknown-linux-gnu/lib/libcompiler-rt.a when searching for -lcompiler-rt
/usr/lib/gcc-cross/aarch64-linux-gnu/4.8/../../../../aarch64-linux-gnu/bin/ld: cannot find -lcompiler-rt
collect2: error: ld returned 1 exit status

error: aborting due to previous error
fatal runtime error: Could not unwind stack, error = 5
Illegal instruction (core dumped)
make: *** [x86_64-unknown-linux-gnu/stage1/lib/rustlib/aarch64-unknown-linux-gnu/lib/stamp.std] Error 132
make: *** Waiting for unfinished jobs....

Any ideas on how to fix this? Thanks!

@steveklabnik
Copy link
Member

/cc @alexcrichton

@alexcrichton
Copy link
Member

Unfortunately it's a currently known bug in our build system that we can't cross-compile a compiler for a target which can't actually be run on the host. In this case you're indicating that via --host=.... You may want instead to just generate a compiler which can target ARM64, in which case you only need to pass --target=....

As this is a known bug with the build system (#5258), however, I'm going to close this for now.

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

3 participants