openbsd-ports/security/ghidra/patches/patch-GPL_nativeBuildProperties_gradle
lteo f8789dabac Ghidra's build system prefers g++ over clang, which is not what we want on a
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@
2019-09-12 02:10:07 +00:00

34 lines
884 B
Plaintext

$OpenBSD: patch-GPL_nativeBuildProperties_gradle,v 1.2 2019/09/12 02:10:07 lteo Exp $
Adapted from https://github.com/NationalSecurityAgency/ghidra/pull/490
Force use of Clang and honor CXX.
Index: GPL/nativeBuildProperties.gradle
--- GPL/nativeBuildProperties.gradle.orig
+++ GPL/nativeBuildProperties.gradle
@@ -75,7 +75,23 @@ model {
architecture 'x86_64'
operatingSystem 'osx'
}
+ openbsd64 {
+ architecture 'x86_64'
+ operatingSystem 'openbsd'
+ }
}
+
+ toolChains {
+ // Force use of Clang
+ clang(Clang) {
+ eachPlatform { tools ->
+ tools.cppCompiler.executable = "${CXX}"
+ tools.linker.executable = "${CXX}"
+ println "C++ compiler is [${tools.cppCompiler.executable}]"
+ println "Linker is [${tools.linker.executable}]"
+ }
+ }
+ }
}
/*******************************************************************************************