Closed 0x-Singularity closed 1 week ago
What version of the JDK are you using? This doesn't appear to be an issue on my machine. In theory, it shouldn't matter that you're on an M1.
That said, the proposed change seems innocuous.
FWIW, it works fine on my M1.
My JDK version: javac 22.0.1
These are the steps I took that gave me the error that wouldn't let me build Ghidra.
Cloned the repo
Initialized gradle "gradle -I gradle/dependencies.gradle init"
ran "gradle buildGhidra"
This gave me the following error: 'Compiling with JDK Java compiler API. /Users/XXXXX/reverseEngineering/ghidra/Ghidra/Debug/ProposedUtils/src/main/java/ghidra/util/datastruct/PrivatelyQueuedListener.java:36: error: variable OBJECT_HASHCODE might not have been initialized private static final Method OBJECT_HASHCODE;
I made the changes I included in the PR, attempted to build again, and I was able to build successfully after that.
Looks to be a JDK 22 thing. I upgraded from 21 to 22 on my M1 and am reproducing the issue.
Description This patch fixes the initialization of OBJECT_HASHCODE in the ListenerHandler class. The variable OBJECT_HASHCODE was not initialized, causing a compilation error. By initializing it properly, we ensure that the build process completes successfully.
Context This issue was encountered when building Ghidra from source on Apple Silicon (M1) machines. The uninitialized OBJECT_HASHCODE caused a compilation error, preventing successful builds. This patch resolves the issue and allows Ghidra to be built on Apple Silicon systems.