clang-based platform like amd64. This commit makes Ghidra build with clang by:
* Adding a clang toolChains block in nativeBuildProperties.gradle
* Adding COMPILER="base-clang ports-clang"
* Updating WANTLIB by replacing libstdc++ with ${COMPILER_LIBCXX}
In addition, honor CXX by setting tools.cppCompiler.executable and
tools.linker.executable in nativeBuildProperties.gradle to ${CXX}. Also print
those variables so that we can confirm that they are set properly.
Lastly, add --stacktrace to the gradle command to facilitate future debugging.
Thanks to daniel@ for bringing this to my attention, naddy@ for his detailed
report of the g++ and CXX issues, and sthen@ for suggesting a possible fix.
ok naddy@ sthen@
OpenBSD. This is based on a pull request from Jeremy O'Brien at
https://github.com/NationalSecurityAgency/ghidra/pull/490 and the Ghidra
build guide at
https://github.com/NationalSecurityAgency/ghidra/blob/master/DevGuide.md .
In addition, I have made these changes to make Ghidra work better as an OpenBSD
port:
1. I removed the explicit check for Gradle 5.0 because I was able to build
Ghidra with latest versions of Gradle. At the time of commit, our
java/gradle port is 5.5.1 which is the latest version of Gradle.
2. By default, the Ghidra build process tries to fetch dependent files on demand
while building. This will cause the build to fail if the port is built using
the _pbuild user. To fix this, I made the port fetch all the dependent .jar
files prior to building. I also used gradle's --offline flag which
explicitly tells gradle to "Execute the build without accessing network
resources".
3. To prevent the build process from touching $HOME, I made gradle use
${WRKDIR}/gradle as its home and also modified GHelpBuilder.java
(the program that builds help files during build) to log to ${WRKDIR}
instead of $HOME/.ghidra.
4. One of the Gradle scripts (ip.gradle) scans the Ghidra source tree so
I had to explicitly tell it to exclude *.orig and *.beforesubst.
help from bentley@ and Jeremy O'Brien
ok bentley@ rpointel@ (maintainer)