Skip to content

Commit d6cfb2e

Browse files
committed
GP-5547: Improved Gradle support for building natives on AARCH64
1 parent f2890f0 commit d6cfb2e

File tree

3 files changed

+16
-31
lines changed

3 files changed

+16
-31
lines changed

GPL/nativeBuildProperties.gradle

+14-28
Original file line numberDiff line numberDiff line change
@@ -34,37 +34,23 @@ model {
3434
}
3535
}
3636

37-
// The toolChains block is needed because Gradle doesn't find gcc/clang on ARM-based Linux
38-
// and macOS platforms without explicitly declaring their targets. Might be a bug in the
39-
// native Gradle plugin.
37+
// The toolChains block is needed because Gradle doesn't find the native toolchain in various
38+
// scenarios. These checks, can be removed when Gradle fixes them, and we advertise a
39+
// minimum Gradle version that includes the fix.
4040
toolChains {
41-
if (isCurrentLinux()) {
42-
gcc(Gcc) {
43-
if (isCurrentArm_64()) {
44-
target("linux_arm_64")
45-
}
46-
}
41+
def current = getCurrentPlatformName()
42+
if (isLinux(current)) {
43+
// https://github.com/gradle/gradle/issues/17660 (fixed in Gradle 8.11)
44+
gcc(Gcc).target(current)
45+
clang(Clang).target(current)
4746
}
48-
if (isCurrentMac()) {
49-
clang(Clang) {
50-
if (isCurrentArm_64()) {
51-
target("mac_arm_64")
52-
}
53-
}
54-
}
55-
if (isCurrentFreeBSD()) {
56-
gcc(Gcc) {
57-
if (isCurrentArm_64()) {
58-
target("freebsd_arm_64")
59-
}
60-
else {
61-
target("freebsd_x86_64")
62-
}
63-
}
47+
if (isFreeBSD(current)) {
48+
// https://github.com/gradle/gradle/issues/32895
49+
gcc(Gcc).target(current)
50+
clang(Clang).target(current)
6451
}
65-
if (isCurrentWindows() && VISUAL_STUDIO_INSTALL_DIR) {
66-
// specify installDir because Gradle doesn't find VS Build Tools.
67-
// See https://github.com/gradle/gradle-native/issues/617#issuecomment-575735288
52+
if (isWindows(current) && VISUAL_STUDIO_INSTALL_DIR) {
53+
// https://github.com/gradle/gradle-native/issues/617#issuecomment-575735288
6854
visualCpp(VisualCpp) {
6955
installDir = VISUAL_STUDIO_INSTALL_DIR
7056
}

GhidraDocs/InstallationGuide.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,7 @@ binaries for your platform, you will need the following installed on your system
211211
App Store while _Command Line Tools for Xcode_ may be installed using the command:
212212
`xcode-select --install`.
213213
* __Linux/FreeBSD:__ the 64-bit versions of the following packages should installed:
214-
* gcc 8.5 or later
215-
* gcc-c++ / g++ 8.5 or later
214+
* gcc/g++ or clang
216215
* make
217216
* __Windows:__
218217
[Microsoft Visual Studio](https://visualstudio.microsoft.com/vs/community) 2017 or later, or

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ To create the latest development build for your platform from this source reposi
4747
* [JDK 21 64-bit][jdk]
4848
* [Gradle 8.5+][gradle] (or provided Gradle wrapper if Internet connection is available)
4949
* [Python3][python3] (version 3.9 to 3.13) with bundled pip
50-
* make, gcc, and g++ (Linux/macOS-only)
50+
* make, gcc/g++ or clang (Linux/macOS-only)
5151
* [Microsoft Visual Studio][vs] 2017+ or [Microsoft C++ Build Tools][vcbuildtools] with the
5252
following components installed (Windows-only):
5353
- MSVC

0 commit comments

Comments
 (0)