rustc_codegen_cranelift: Linker error for postsse with lld
After modifying:
diff --git a/config.sh b/config.sh
index 9a745ad..f3043ad 100644
--- a/config.sh
+++ b/config.sh
@@ -15,7 +15,7 @@ TARGET_TRIPLE=$HOST_TRIPLE
#TARGET_TRIPLE="x86_64-pc-windows-gnu"
#TARGET_TRIPLE="aarch64-unknown-linux-gnu"
-linker=''
+linker='-C link-arg=-fuse-ld=lld'
RUN_WRAPPER=''
if [[ "$HOST_TRIPLE" != "$TARGET_TRIPLE" ]]; then
if [[ "$TARGET_TRIPLE" == "aarch64-unknown-linux-gnu" ]]; then
= note: ld.lld: error: can't create dynamic relocation R_X86_64_64 against symbol: std::sys::unix::args::imp::ARGV_INIT_ARRAY::init_wrapper::h2e1f40e42719be71 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
>>> defined in /mnt/src/git/rustc_codegen_cranelift/build_sysroot/sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd.rlib(std.4wc6fj0sdfl4hunt.rcgu.o)
>>> referenced by 4wc6fj0sdfl4hunt.o
>>> std.4wc6fj0sdfl4hunt.rcgu.o:(std::sys::unix::args::imp::ARGV_INIT_ARRAY::h5712c7aebe4a0e3d) in archive /mnt/src/git/rustc_codegen_cranelift/build_sysroot/sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd.rlib
_Originally posted by @vi in https://github.com/bjorn3/rustc_codegen_cranelift/issues/1052#issuecomment-649670800_
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 15 (15 by maintainers)
Commits related to this issue
- Use pcrel pointers in .eh_frame Fixes #1055 — committed to rust-lang/rustc_codegen_cranelift by bjorn3 4 years ago
- Use pcrel pointers in .eh_frame Fixes #1055 — committed to rust-lang/rustc_codegen_cranelift by bjorn3 4 years ago
Great. By the way, you may have missed this in the doc for
write_eh_pointer: The given size is only used forDW_EH_PE_absptrformats. So forpcrel, you should be getting the size from the format (udata4).