mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 02:39:44 +02:00
GP-4235: Adding the means to build and find native components on FreeBSD
This commit is contained in:
parent
1281fb979b
commit
d16747cf6c
8 changed files with 42 additions and 7 deletions
|
@ -81,6 +81,7 @@ model {
|
||||||
targetPlatform "linux_arm_64"
|
targetPlatform "linux_arm_64"
|
||||||
targetPlatform "mac_x86_64"
|
targetPlatform "mac_x86_64"
|
||||||
targetPlatform "mac_arm_64"
|
targetPlatform "mac_arm_64"
|
||||||
|
targetPlatform "freebsd_x86_64"
|
||||||
sources {
|
sources {
|
||||||
c {
|
c {
|
||||||
source {
|
source {
|
||||||
|
@ -102,6 +103,7 @@ model {
|
||||||
targetPlatform "linux_arm_64"
|
targetPlatform "linux_arm_64"
|
||||||
targetPlatform "mac_x86_64"
|
targetPlatform "mac_x86_64"
|
||||||
targetPlatform "mac_arm_64"
|
targetPlatform "mac_arm_64"
|
||||||
|
targetPlatform "freebsd_x86_64"
|
||||||
sources {
|
sources {
|
||||||
c {
|
c {
|
||||||
source {
|
source {
|
||||||
|
|
|
@ -52,6 +52,11 @@ model {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (isCurrentFreeBSD()) {
|
||||||
|
gcc(Gcc) {
|
||||||
|
target("freebsd_x86_64")
|
||||||
|
}
|
||||||
|
}
|
||||||
if (isCurrentWindows() && VISUAL_STUDIO_INSTALL_DIR) {
|
if (isCurrentWindows() && VISUAL_STUDIO_INSTALL_DIR) {
|
||||||
// specify installDir because Gradle doesn't find VS Build Tools.
|
// specify installDir because Gradle doesn't find VS Build Tools.
|
||||||
// See https://github.com/gradle/gradle-native/issues/617#issuecomment-575735288
|
// See https://github.com/gradle/gradle-native/issues/617#issuecomment-575735288
|
||||||
|
|
|
@ -24,7 +24,8 @@ project.ext.PLATFORMS = [
|
||||||
[name: "linux_x86_64", os: "linux", arch: "x86_64"],
|
[name: "linux_x86_64", os: "linux", arch: "x86_64"],
|
||||||
[name: "linux_arm_64", os: "linux", arch: "arm64"],
|
[name: "linux_arm_64", os: "linux", arch: "arm64"],
|
||||||
[name: "mac_x86_64", os: "osx", arch: "x86_64"],
|
[name: "mac_x86_64", os: "osx", arch: "x86_64"],
|
||||||
[name: "mac_arm_64", os: "osx", arch: "arm64"]
|
[name: "mac_arm_64", os: "osx", arch: "arm64"],
|
||||||
|
[name: "freebsd_x86_64", os: "freebsd", arch: "x86_64"]
|
||||||
]
|
]
|
||||||
|
|
||||||
/*********************************************************************************
|
/*********************************************************************************
|
||||||
|
@ -51,6 +52,9 @@ ext.getCurrentPlatformName = {
|
||||||
case ~/Mac OS X.*/:
|
case ~/Mac OS X.*/:
|
||||||
os = "mac"
|
os = "mac"
|
||||||
break
|
break
|
||||||
|
case ~/FreeBSD.*/:
|
||||||
|
os = "freebsd"
|
||||||
|
break
|
||||||
default:
|
default:
|
||||||
throw new GradleException("Unrecognized platform operating system: $os")
|
throw new GradleException("Unrecognized platform operating system: $os")
|
||||||
}
|
}
|
||||||
|
@ -112,6 +116,20 @@ ext.isCurrentMac = {
|
||||||
return isMac(getCurrentPlatformName())
|
return isMac(getCurrentPlatformName())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*********************************************************************************
|
||||||
|
* Returns true if the given platform is FreeBSD.
|
||||||
|
*********************************************************************************/
|
||||||
|
ext.isFreeBSD = { platform_name ->
|
||||||
|
return platform_name.startsWith("freebsd")
|
||||||
|
}
|
||||||
|
|
||||||
|
/*********************************************************************************
|
||||||
|
* Returns true if the current platform is FreeBSD.
|
||||||
|
*********************************************************************************/
|
||||||
|
ext.isCurrentFreeBSD = {
|
||||||
|
return isFreeBSD(getCurrentPlatformName())
|
||||||
|
}
|
||||||
|
|
||||||
/*********************************************************************************
|
/*********************************************************************************
|
||||||
* Returns true if the given platform is Windows.
|
* Returns true if the given platform is Windows.
|
||||||
*********************************************************************************/
|
*********************************************************************************/
|
||||||
|
|
|
@ -43,6 +43,7 @@ model {
|
||||||
targetPlatform "linux_arm_64"
|
targetPlatform "linux_arm_64"
|
||||||
targetPlatform "mac_x86_64"
|
targetPlatform "mac_x86_64"
|
||||||
targetPlatform "mac_arm_64"
|
targetPlatform "mac_arm_64"
|
||||||
|
targetPlatform "freebsd_x86_64"
|
||||||
sources {
|
sources {
|
||||||
cpp {
|
cpp {
|
||||||
// NOTE: The bison/flex generated files are assumed to be up-to-date.
|
// NOTE: The bison/flex generated files are assumed to be up-to-date.
|
||||||
|
@ -148,6 +149,7 @@ model {
|
||||||
targetPlatform "linux_arm_64"
|
targetPlatform "linux_arm_64"
|
||||||
targetPlatform "mac_x86_64"
|
targetPlatform "mac_x86_64"
|
||||||
targetPlatform "mac_arm_64"
|
targetPlatform "mac_arm_64"
|
||||||
|
targetPlatform "freebsd_x86_64"
|
||||||
sources {
|
sources {
|
||||||
cpp {
|
cpp {
|
||||||
// NOTE: The bison/flex generated files are assumed to be up-to-date.
|
// NOTE: The bison/flex generated files are assumed to be up-to-date.
|
||||||
|
|
|
@ -65,6 +65,11 @@ public enum Platform {
|
||||||
*/
|
*/
|
||||||
MAC_ARM_64(OperatingSystem.MAC_OS_X, Architecture.ARM_64, "mac_arm_64", ".dylib", ""),
|
MAC_ARM_64(OperatingSystem.MAC_OS_X, Architecture.ARM_64, "mac_arm_64", ".dylib", ""),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Identifies a FreeBSD x86 64-bit OS.
|
||||||
|
*/
|
||||||
|
FREEBSD_X86_64(OperatingSystem.FREE_BSD, Architecture.X86_64, "freebsd_x86_64", ".so", ""),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Identifies an unsupported OS.
|
* Identifies an unsupported OS.
|
||||||
*/
|
*/
|
||||||
|
@ -199,7 +204,8 @@ public enum Platform {
|
||||||
*/
|
*/
|
||||||
public List<String> getAdditionalLibraryPaths() {
|
public List<String> getAdditionalLibraryPaths() {
|
||||||
List<String> paths = new ArrayList<String>();
|
List<String> paths = new ArrayList<String>();
|
||||||
if (operatingSystem == OperatingSystem.LINUX) {
|
if (operatingSystem == OperatingSystem.LINUX ||
|
||||||
|
operatingSystem == OperatingSystem.FREE_BSD) {
|
||||||
paths.add("/bin");
|
paths.add("/bin");
|
||||||
paths.add("/lib");
|
paths.add("/lib");
|
||||||
paths.add("/lib64");
|
paths.add("/lib64");
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
/* ###
|
/* ###
|
||||||
* IP: GHIDRA
|
* IP: GHIDRA
|
||||||
* REVIEWED: YES
|
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -20,6 +19,7 @@ public enum OperatingSystem {
|
||||||
WINDOWS("Windows"),
|
WINDOWS("Windows"),
|
||||||
LINUX("Linux"),
|
LINUX("Linux"),
|
||||||
MAC_OS_X("Mac OS X"),
|
MAC_OS_X("Mac OS X"),
|
||||||
|
FREE_BSD("FreeBSD"),
|
||||||
UNSUPPORTED("Unsupported Operating System");
|
UNSUPPORTED("Unsupported Operating System");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -225,6 +225,7 @@ public class ApplicationUtilities {
|
||||||
return createDir(switch (OperatingSystem.CURRENT_OPERATING_SYSTEM) {
|
return createDir(switch (OperatingSystem.CURRENT_OPERATING_SYSTEM) {
|
||||||
case WINDOWS -> new File(getEnvFile("LOCALAPPDATA", true), appName);
|
case WINDOWS -> new File(getEnvFile("LOCALAPPDATA", true), appName);
|
||||||
case LINUX -> new File("/var/tmp/" + userDirName);
|
case LINUX -> new File("/var/tmp/" + userDirName);
|
||||||
|
case FREE_BSD -> new File("/var/tmp/" + userDirName);
|
||||||
case MAC_OS_X -> new File("/var/tmp/" + userDirName);
|
case MAC_OS_X -> new File("/var/tmp/" + userDirName);
|
||||||
default -> throw new FileNotFoundException(
|
default -> throw new FileNotFoundException(
|
||||||
"Failed to find the user cache directory: Unsupported operating system.");
|
"Failed to find the user cache directory: Unsupported operating system.");
|
||||||
|
@ -281,6 +282,7 @@ public class ApplicationUtilities {
|
||||||
return createDir(switch (OperatingSystem.CURRENT_OPERATING_SYSTEM) {
|
return createDir(switch (OperatingSystem.CURRENT_OPERATING_SYSTEM) {
|
||||||
case WINDOWS -> new File(getEnvFile("APPDATA", true), versionedSubdir);
|
case WINDOWS -> new File(getEnvFile("APPDATA", true), versionedSubdir);
|
||||||
case LINUX -> new File(userHomeDir, ".config/" + versionedSubdir);
|
case LINUX -> new File(userHomeDir, ".config/" + versionedSubdir);
|
||||||
|
case FREE_BSD -> new File(userHomeDir, ".config/" + versionedSubdir);
|
||||||
case MAC_OS_X -> new File(userHomeDir, "Library/" + versionedSubdir);
|
case MAC_OS_X -> new File(userHomeDir, "Library/" + versionedSubdir);
|
||||||
default -> throw new FileNotFoundException(
|
default -> throw new FileNotFoundException(
|
||||||
"Failed to find the user settings directory: Unsupported operating system.");
|
"Failed to find the user settings directory: Unsupported operating system.");
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
<h1>Ghidra Installation Guide</h1>
|
<h1>Ghidra Installation Guide</h1>
|
||||||
<p>
|
<p>
|
||||||
The installation information provided is effective as of Ghidra 10.2 and is subject to change with
|
The installation information provided is effective as of Ghidra 11.1 and is subject to change with
|
||||||
future releases.
|
future releases.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
@ -310,20 +310,20 @@ Ghidra release includes native binaries for the following platforms:</p>
|
||||||
<li>Windows x86 64-bit</li>
|
<li>Windows x86 64-bit</li>
|
||||||
<li>Linux x86 64-bit</li>
|
<li>Linux x86 64-bit</li>
|
||||||
<li>macOS x86 64-bit</li>
|
<li>macOS x86 64-bit</li>
|
||||||
<li>macOS ARM 64-bit (x86 using Rosetta translation)</li>
|
<li>macOS ARM 64-bit</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>Ghidra supports running on the following additional platforms with user-built native binaries:
|
<p>Ghidra supports running on the following additional platforms with user-built native binaries:
|
||||||
</p>
|
</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Linux ARM 64-bit</li>
|
<li>Linux ARM 64-bit</li>
|
||||||
<li>macOS ARM 64-bit (Apple silicon)</li>
|
<li>FreeBSD x86 64-bit (no debugger support)</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>In order to build native binaries for your platform, you will need the following installed on your
|
<p>In order to build native binaries for your platform, you will need the following installed on your
|
||||||
system:</p>
|
system:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>A <a href="#Requirements">supported</a> version of a Java Development Kit</li>
|
<li>A <a href="#Requirements">supported</a> version of a Java Development Kit</li>
|
||||||
<li><a href="https://gradle.org/releases/">Gradle 7.3+</a></li>
|
<li><a href="https://gradle.org/releases/">Gradle 7.3+</a></li>
|
||||||
<li>make, gcc, and g++ (Linux/macOS-only)</li>
|
<li>make, gcc, and g++ (Linux/macOS/FreeBSD-only)</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="https://visualstudio.microsoft.com/vs/community/">Microsoft Visual Studio</a>
|
<a href="https://visualstudio.microsoft.com/vs/community/">Microsoft Visual Studio</a>
|
||||||
2017 or later, or <a href="https://visualstudio.microsoft.com/visual-cpp-build-tools/">
|
2017 or later, or <a href="https://visualstudio.microsoft.com/visual-cpp-build-tools/">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue