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

Compiling with -Clink-arg=-fuse-ld=lld fails #574

Open
antoyo opened this issue Nov 28, 2024 · 0 comments
Open

Compiling with -Clink-arg=-fuse-ld=lld fails #574

antoyo opened this issue Nov 28, 2024 · 0 comments

Comments

@antoyo
Copy link
Contributor

antoyo commented Nov 28, 2024

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
@antoyo antoyo changed the title Compiling with -Clinker-flavor=gnu-lld-cc fails Compiling with -Clink-arg=-fuse-ld=lld fails Nov 28, 2024
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

1 participant