Stream: t-compiler/wg-llvm

Topic: Relax ELF relocations


Jethro (Nov 25 2019 at 15:52, on Zulip):

how would I modify rustc so it configures a particular LLVM target as if you'd run llc -relax-elf-relocations or llvm-mc -relax-relocations?

Jethro (Nov 25 2019 at 15:53, on Zulip):

problem is I'm trying to use rust-lld, but it treats R_X86_64_GOTPCREL differently from R_X86_64_GOTPCRELX, unlike ld.bfd/ld.gold, which treat it the same

Jethro (Nov 25 2019 at 15:53, on Zulip):

rustc currently emits R_X86_64_GOTPCREL but I think my problem would be solved if it emitted R_X86_64_GOTPCRELX instead

Jethro (Nov 25 2019 at 16:13, on Zulip):

I'm trying to use -C llvm-args but I can't seem to do anything useful with that option

Jethro (Nov 25 2019 at 16:15, on Zulip):

ok I think I can hook in at LLVMRustCreateTargetMachine

mati865 (Nov 26 2019 at 12:01, on Zulip):

There is config option for it: https://github.com/rust-lang/rust/blob/0f6f66fcdc4abf110171ee06b1a72bdd2883b74f/src/librustc_target/spec/mod.rs#L609
You can change in in the target spec file (/src/librustc_target/spec/${TARGET}).

mati865 (Nov 26 2019 at 12:07, on Zulip):

Sorry I misread it.
You could add another option to that file. I don't know if it requires additional changes in rustllvm though.

Last update: Dec 12 2019 at 01:05UTC