Closed
Description
It gives the following error:
= note: rust-lld: error: relocation R_X86_64_64 cannot be used against local symbol; recompile with -fPIC
>>> defined in /home/user/projects/rustc_codegen_gcc/test-backend/target/debug/deps/test_rust-48376029011c759c.test_rust.e423519ea9e9089e-cgu.0.rcgu.o
>>> referenced by fake.c
>>> /home/user/projects/rustc_codegen_gcc/test-backend/target/debug/deps/test_rust-48376029011c759c.test_rust.e423519ea9e9089e-cgu.0.rcgu.o:(global.0)
Command:
y cargo rustc --bin test-rust -- -Clink-arg=-fuse-ld=lld
This also happens when using -Clinker-flavor=gnu-lld-cc
which is used by Rust for Linux.
Command:
./y.sh cargo rustc --bin test-rust -- -Z unstable-options -Clinker-flavor=gnu-lld-cc