From e7aabddb349b2a56ddd209d462353019e8dc67ff Mon Sep 17 00:00:00 2001
From: Tiago Gasiba
Date: Tue, 19 Mar 2024 14:32:47 +0100
Subject: [PATCH] Add support for FreeBSD ARM 64bit (no debugger support)
---
GPL/DemanglerGnu/build.gradle | 2 ++
GPL/nativeBuildProperties.gradle | 6 +++++-
GPL/nativePlatforms.gradle | 3 ++-
Ghidra/Features/Decompiler/buildNatives.gradle | 2 ++
.../Generic/src/main/java/ghidra/framework/Platform.java | 5 +++++
GhidraDocs/InstallationGuide.html | 1 +
6 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/GPL/DemanglerGnu/build.gradle b/GPL/DemanglerGnu/build.gradle
index 174747549f..7a56684947 100644
--- a/GPL/DemanglerGnu/build.gradle
+++ b/GPL/DemanglerGnu/build.gradle
@@ -82,6 +82,7 @@ model {
targetPlatform "mac_x86_64"
targetPlatform "mac_arm_64"
targetPlatform "freebsd_x86_64"
+ targetPlatform "freebsd_arm_64"
sources {
c {
source {
@@ -104,6 +105,7 @@ model {
targetPlatform "mac_x86_64"
targetPlatform "mac_arm_64"
targetPlatform "freebsd_x86_64"
+ targetPlatform "freebsd_arm_64"
sources {
c {
source {
diff --git a/GPL/nativeBuildProperties.gradle b/GPL/nativeBuildProperties.gradle
index 6ba0409b6a..e349420335 100644
--- a/GPL/nativeBuildProperties.gradle
+++ b/GPL/nativeBuildProperties.gradle
@@ -54,7 +54,11 @@ model {
}
if (isCurrentFreeBSD()) {
gcc(Gcc) {
- target("freebsd_x86_64")
+ if (isCurrentArm_64()) {
+ target("freebsd_arm_64")
+ } else {
+ target("freebsd_x86_64")
+ }
}
}
if (isCurrentWindows() && VISUAL_STUDIO_INSTALL_DIR) {
diff --git a/GPL/nativePlatforms.gradle b/GPL/nativePlatforms.gradle
index 24d540f10a..0a2c02a2d2 100644
--- a/GPL/nativePlatforms.gradle
+++ b/GPL/nativePlatforms.gradle
@@ -25,7 +25,8 @@ project.ext.PLATFORMS = [
[name: "linux_arm_64", os: "linux", arch: "arm64"],
[name: "mac_x86_64", os: "osx", arch: "x86_64"],
[name: "mac_arm_64", os: "osx", arch: "arm64"],
- [name: "freebsd_x86_64", os: "freebsd", arch: "x86_64"]
+ [name: "freebsd_x86_64", os: "freebsd", arch: "x86_64"],
+ [name: "freebsd_arm_64", os: "freebsd", arch: "arm64"]
]
/*********************************************************************************
diff --git a/Ghidra/Features/Decompiler/buildNatives.gradle b/Ghidra/Features/Decompiler/buildNatives.gradle
index 62bd81d266..26ffd0d0df 100644
--- a/Ghidra/Features/Decompiler/buildNatives.gradle
+++ b/Ghidra/Features/Decompiler/buildNatives.gradle
@@ -43,6 +43,7 @@ model {
targetPlatform "mac_x86_64"
targetPlatform "mac_arm_64"
targetPlatform "freebsd_x86_64"
+ targetPlatform "freebsd_arm_64"
sources {
cpp {
// NOTE: The bison/flex generated files are assumed to be up-to-date.
@@ -149,6 +150,7 @@ model {
targetPlatform "mac_x86_64"
targetPlatform "mac_arm_64"
targetPlatform "freebsd_x86_64"
+ targetPlatform "freebsd_arm_64"
sources {
cpp {
// NOTE: The bison/flex generated files are assumed to be up-to-date.
diff --git a/Ghidra/Framework/Generic/src/main/java/ghidra/framework/Platform.java b/Ghidra/Framework/Generic/src/main/java/ghidra/framework/Platform.java
index 68f5d476fb..a283cdb953 100644
--- a/Ghidra/Framework/Generic/src/main/java/ghidra/framework/Platform.java
+++ b/Ghidra/Framework/Generic/src/main/java/ghidra/framework/Platform.java
@@ -70,6 +70,11 @@ public enum Platform {
*/
FREEBSD_X86_64(OperatingSystem.FREE_BSD, Architecture.X86_64, "freebsd_x86_64", ".so", ""),
+ /**
+ * Identifies a FreeBSD ARM 64-bit OS.
+ */
+ FREEBSD_ARM_64(OperatingSystem.FREE_BSD, Architecture.ARM_64, "freebsd_arm_64", ".so", ""),
+
/**
* Identifies an unsupported OS.
*/
diff --git a/GhidraDocs/InstallationGuide.html b/GhidraDocs/InstallationGuide.html
index 3c47400b84..75bfed9bfd 100644
--- a/GhidraDocs/InstallationGuide.html
+++ b/GhidraDocs/InstallationGuide.html
@@ -317,6 +317,7 @@ Ghidra release includes native binaries for the following platforms:
- Linux ARM 64-bit
- FreeBSD x86 64-bit (no debugger support)
+ - FreeBSD arm 64-bit (no debugger support)
In order to build native binaries for your platform, you will need the following installed on your
system: