NationalSecurityAgency / ghidra

Ghidra is a software reverse engineering (SRE) framework
https://www.nsa.gov/ghidra
Apache License 2.0
51.9k stars 5.89k forks source link

Cannot compile on ARM64 MacOS #6982

Closed Kiblyn11 closed 1 month ago

Kiblyn11 commented 1 month ago

Hello,

I have errors compiling with buildNatives, it does not find cstdint.

$ > gradle buildNatives
> Configure project :Debugger-swig-lldb                                                                                                                                                                                                      
OS: Mac OS X                                                                                                                                                                                                                                 
Arch: aarch64                                                                                                                                                                                                                                
Using platform: mac_arm_64                                                                                                                                                                                                                   

> Configure project :Decompiler                                                                                                                                                                                                              
OS: Mac OS X
Arch: aarch64
Using platform: mac_arm_64

> Configure project :DemanglerGnu
OS: Mac OS X
Arch: aarch64
Using platform: mac_arm_64

> Configure project :FileFormats
OS: Mac OS X
Arch: aarch64
Using platform: mac_arm_64

> Configure project :PDB
OS: Mac OS X
Arch: aarch64
Using platform: mac_arm_64
...
/opt/homebrew/Caskroom/ghidra/11.2-20240926/ghidra_11.2_PUBLIC/Ghidra/Features/Decompiler/src/decompile/cpp/types.h:22:10: fatal error: 'cstdint' file not found
...

I do have installed the XCode command line tools, clang, gcc, make, etc.

clang --version
Apple clang version 16.0.0 (clang-1600.0.26.3)
Target: arm64-apple-darwin23.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
ryanmkurtz commented 1 month ago

I just tried on my ARM64 macOS with the official 11.2 download and it worked fine. What directory are you in when running your gradle command? What is the output of gradle -v?

Kiblyn11 commented 1 month ago

I'm running it from: /opt/homebrew/Caskroom/ghidra/11.2-20240926/ghidra_11.2_PUBLIC/support/gradle

gradle -v

------------------------------------------------------------
Gradle 8.10.2
------------------------------------------------------------

Build time:    2024-09-23 21:28:39 UTC
Revision:      415adb9e06a516c44b391edff552fd42139443f7

Kotlin:        1.9.24
Groovy:        3.0.22
Ant:           Apache Ant(TM) version 1.10.14 compiled on August 16 2023
Launcher JVM:  23 (Homebrew 23)
Daemon JVM:    /opt/homebrew/Cellar/openjdk/23/libexec/openjdk.jdk/Contents/Home (no JDK specified, using current Java home)
OS:            Mac OS X 14.7 aarch64
ryanmkurtz commented 1 month ago

I'm not sure what if anything is different about that homebrew distro, which we don't support. Can you try our official release which can be downloaded here: direct download link

If that still fails, there is something weird about your dev environment which we haven't encountered yet.

Kiblyn11 commented 1 month ago

Just tried with official release and it is the same error.

Kiblyn11 commented 1 month ago

Well I managed to build it, using homebrew llvm package, not Apple's one.

ryanmkurtz commented 1 month ago

Ok. I've only ever used whatever XCode installs and never had an issues. I've never used homebrew.