2

Trying to cross compile Rust for the Raspberry Pi and running into a lot of issues - I believe I've reduced it down to this 'linker not found' error. Only trouble is, I'm not sure how to go about installing this.

I've started going down the rabbit hole of installing crosstool-ng (per this answer), but this is creating it's own slew of errors relating to not being able to find objcopy or gobjcopy. I've tried installing these using brew install binutils to no avail.

Is this route making my life unneccesarily difficult and I'm missing some easy way to get this running? I figure this would be as simple as

rustup target add aarch64-unknown-linux-gnu

and adding

[build]
target = "aarch64-unknown-linux-gnu"

[target.aarch64-unknown-linux-gnu]
linker = "aarch64-unknown-linux-gnu-gcc"

to my /.cargo/config but alas this has proven to be quite cumbersome.

reeslabree
  • 127
  • 13
  • You said it was cumbersome, but did it work? – Tim Roberts Dec 07 '22 at 19:22
  • @TimRoberts apologies, should have clarified - after chewing away for a while at installing `gobjcopy` and/or `objcopy` through Homebrew `binutils`, I stopped to write this post to make sure I'm not making my life harder for no particular reason. – reeslabree Dec 07 '22 at 19:28
  • You might be able to use `lld` instead – PitaJ Dec 07 '22 at 19:28
  • So, does that mean "yes, this works"? Because I think that's the intended path. – Tim Roberts Dec 07 '22 at 19:37
  • @TimRoberts I have no idea if this works or not - if this is the intended path I'll continue down it. At the moment, I can't get `gobjcopy` or `objcopy` to be recognized after adding it to PATH. – reeslabree Dec 07 '22 at 19:48
  • @PitaJ what is the current way in Rust to link with `lld`? Tried executing with `rustflags = ["-C", "link-arg=-fuse-ld=lld",]` and received the error `error: linking with `cc` failed: exit status: 1` – reeslabree Dec 07 '22 at 19:49

0 Answers0