Tiron Raul
Tiron Raul

Reputation: 1

LLVM linker does not work on MacOS while trying to develop on-chain Solana app (C++)

this is the error i get:

./account_logger.so ()
dyld[61282]: Library not loaded: @rpath/libLLVM.dylib
  Referenced from: <A9E4BE2A-BF8D-3956-BCA9-E3BC5A6C9F9C> /Users/myusername/.local/share/solana/install/releases/stable-6c6442ff1444dc4404b1de5cb3ffc6fa48e8a73d/solana-release/bin/sdk/sbf/dependencies/platform-tools/llvm/bin/ld.lld
  Reason: tried: '/Users/myusername/.local/share/solana/install/releases/stable-6c6442ff1444dc4404b1de5cb3ffc6fa48e8a73d/solana-release/bin/sdk/sbf/dependencies/platform-tools/llvm/bin/../lib/libLLVM.dylib' (no such file), '/Users/myusername/.local/share/solana/install/releases/stable-6c6442ff1444dc4404b1de5cb3ffc6fa48e8a73d/solana-release/bin/sdk/sbf/dependencies/platform-tools/llvm/bin/../lib/libLLVM.dylib' (no such file)
make: *** [account_logger.so] Abort trap: 6

I tried reinstalling LLVM several times and with multiple methods and it still didn't work. I'm on macOS.

Upvotes: -1

Views: 92

Answers (1)

Rareș
Rareș

Reputation: 1

I have the same problem but using WSL2 (Linux)...

I figured out a temporary fix:

The problem was the path ~/.local/share/solana/install/releases/1.18.17/solana-release/bin/sdk/sbf/dependencies/platform-tools/llvm/bin/llvm-readelf which is a symlink to ~/.cache/solana/v1.41/platform-tools/llvm/bin/llvm-readelf which is again a symlink to~/.cache/solana/v1.41/platform-tools/llvm/bin/llvm-readobj, file which I didn't have.

However, I had it under /usr/bin/llvm-readobj, so I just did cp /usr/bin/llvm-readobj ~/.cache/solana/v1.41/platform-tools/llvm/bin/llvm-readobj and the problem was fixed.

Upvotes: 0

Related Questions