michaeleisel / zld

A faster version of Apple's linker
MIT License
1.19k stars 50 forks source link

rust error: image not found #92

Closed DavidBJaffe closed 3 years ago

DavidBJaffe commented 3 years ago

I downloaded https://github.com/michaeleisel/zld/releases/tag/1.3.2, unzipped and untarred, and moved zld.

I added this

[target.x86_64-apple-darwin]
rustflags = ["-C", "link-arg=-fuse-ld=/Users/david.jaffe/bin/zld"]

to .cargo/config in my rust workspace.

Then I did cargo b, yielding this error:

  = note: dyld: Library not loaded: @rpath/libLTO.dylib
            Referenced from: /Users/david.jaffe/bin/zld
            Reason: image not found
          clang: error: unable to execute command: Abort trap: 6

This is with macOS Catalina 10.15.7, using rust 1.53.0.

michaeleisel commented 3 years ago

do you have xcode installed?

DavidBJaffe commented 3 years ago

I'm not sure what I had, but I've now gone to the apple developer site and installed xcode 12.5.

michaeleisel commented 3 years ago

and you still have the same issue?

DavidBJaffe commented 3 years ago

Ah. I downloaded it but did not install it. It won't install on this version of macOS. Let me try installing xcode 12.4.

DavidBJaffe commented 3 years ago

Same error. I don't know anything about xcode. It is in my Downloads directory as Xcode.app and seems to be functional. I assume that xcode files have been sprinkled elsewhere in the filesystem. Is it possible that I need to add something to my path or some such?

michaeleisel commented 3 years ago

run xcode-select -s /path/to/Xcode.app

DavidBJaffe commented 3 years ago

Yes, that worked, thank you very much!