Closed Thegaram closed 2 years ago
Hey @Thegaram. I've run into the same issue. What I figured out after a couple of days of trial&error is the following:
You need specifically Apple Clang 12
to build this project. Not Apple Clang 13
, vanilla Clang 12
, Homebrew Clang 12
or anything else. Only Apple Clang 12
!
You can download the older Command Line Tools for Xcode 12.5.1 from Apple's developer portal.
If it says the package is too old to install on your system, you'll have to extract the tools manually. This is how I did it:
# after mounting 'Command_Line_Tools_for_Xcode_12.5.1.dmg'
❯ pkgutil --expand-full /Volumes/Command\ Line\ Developer\ Tools/Command\ Line\ Tools.pkg /tmp/CLTools
# rename CLTools v13
❯ sudo mv /Library/Developer/CommandLineTools /Library/Developer/CommandLineTools@13
# move CLTools v12 into place
❯ sudo mv /tmp/CLTools/CLTools_Executables.pkg/Payload/Library/Developer/CommandLineTools /Library/Developer/CommandLineTools
# symlink shared SDKs
❯ sudo ln -s /Library/Developer/CommandLineTools@13/SDKs /Library/Developer/CommandLineTools/SDKs
# clean up
❯ rm -rf /tmp/CLTools
I can now compile the Rust project in question:
❯ clang --version
Apple clang version 12.0.5 (clang-1205.0.22.11)
❯ cargo build --release
...
Finished dev [unoptimized + debuginfo] target(s) in 0.05s
If you wanna restore Apple Clang 13
you ofc just do:
❯ sudo mv /Library/Developer/CommandLineTools /Library/Developer/CommandLineTools@12
❯ sudo mv /Library/Developer/CommandLineTools@13 /Library/Developer/CommandLineTools
And by the way, this actually worked on my Apple M1 Silicon machine with arm64
.
For anyone interested in that, I had to install the xPack GNU Arm Embedded GCC toolchain which recently added Apple Silicon support:
❯ npm install --global xpm@latest
❯ xpm install --global @xpack-dev-tools/arm-none-eabi-gcc@latest
❯ echo 'export PATH="$HOME/Library/xPacks/@xpack-dev-tools/arm-none-eabi-gcc/10.3.1-2.3.1/.content/bin:$PATH"' >> ~/.bashrc
❯ source ~/.bashrc
❯ arm-none-eabi-gcc --version
arm-none-eabi-gcc (xPack GNU Arm Embedded GCC arm64) 10.3.1 20210824 (release)
❯ file `which arm-none-eabi-gcc`
~/Library/xPacks/@xpack-dev-tools/arm-none-eabi-gcc/10.3.1-2.3.1/.content/bin/arm-none-eabi-gcc:
Mach-O 64-bit executable arm64
Awesome, thanks @mandrean, I'll try again following your instructions.
I'm having the same problem but on linux. No sure what version of clang to use. 12 & 14 do not work.
Hello, indeed it seems from LLVM 12+ this problem appears. The fix is here if you want to try?
Wow that was fast! I will try your fix. @yhql
Not that fast actually, I've stumbled on this before and forgot to publish the fix 😞
It works!
edit: ledger-nanos-ui also depend on ledger-nanos-sdk so more fiddling is need to make it work dependency wise.
Hi, thank you for providing this project.
I tried building on Mac but I'm getting the following error. I was wondering if you could give some pointers as to how to resolve this.