Hello, I'm trying to build rust on my local aarch64 machine. The commands I used are exactly what GitHub - rust-lang/rust: Empowering everyone to build reliable and efficient software. suggests:
git clone https://github.com/rust-lang/rust.git
cd rust
./configure --set install.prefix=$RUST_DIR/install
./x.py build && ./x.py install
Then I got the following errors:
Building compiler artifacts (stage0 -> stage1)
Compiling rustc_driver v0.0.0 (/home/chenmindong/rust/compiler/rustc_driver)
Compiling rustc-main v0.0.0 (/home/chenmindong/rust/compiler/rustc)
error: linking with `cc` failed: exit status: 1
/usr/bin/ld: $HOME/rust/build/aarch64-unknown-linux-gnu/stage0-sysroot/lib/rustlib/aarch64-unknown-linux-gnu/lib/libstd-d0f55b1b575b8363.so: undefined reference to `__aarch64_ldadd4_relax'
/usr/bin/ld: $HOME/rust/build/aarch64-unknown-linux-gnu/stage0-rustc/aarch64-unknown-linux-gnu/release/deps/librustc_driver-0e51d15bced64312.so: undefined reference to `__aarch64_ldset1_relax'
/usr/bin/ld: $HOME/rust/build/aarch64-unknown-linux-gnu/stage0-rustc/aarch64-unknown-linux-gnu/release/deps/librustc_driver-0e51d15bced64312.so: undefined reference to `__aarch64_swp4_rel'
I can find these symbols in stage0 std:
nm stage0/lib/rustlib/aarch64-unknown-linux-gnu/lib/libstd-005479bee49a9ef6.so | grep __aarch64_ldadd4_relax
0000000000126070 t __aarch64_ldadd4_relax
but not in the recompiled(if I understand correctly) stage0-sysroot:
nm stage0-sysroot/./lib/rustlib/aarch64-unknown-linux-gnu/lib/libstd-d0f55b1b575b8363.so | grep __aarch64_ldadd4_relax
U __aarch64_ldadd4_relax
Any suggestions are welcome!
Environment: ldd (GNU libc) 2.28/ GCC 7.3.0