From 31b3db431e7dd8c4ecac54d95e1608b996a26989 Mon Sep 17 00:00:00 2001 From: Tom Nelson Date: Fri, 15 Jan 2021 17:38:50 +0000 Subject: [PATCH] changes for M1 --- Ghidra/Features/Decompiler/build.gradle | 1 + .../Features/Decompiler/src/decompile/cpp/types.h | 14 ++++++++++++++ build.gradle | 4 ++++ 3 files changed, 19 insertions(+) diff --git a/Ghidra/Features/Decompiler/build.gradle b/Ghidra/Features/Decompiler/build.gradle index f398c9414d..d0251eb6a9 100644 --- a/Ghidra/Features/Decompiler/build.gradle +++ b/Ghidra/Features/Decompiler/build.gradle @@ -546,6 +546,7 @@ model { } } else if (b.toolChain in Clang) { + b.cppCompiler.args "-std=c++11" b.cppCompiler.args "-Wall" b.cppCompiler.args "-O2" // for DEBUG, comment this line out // b.cppCompiler.args "-g" // for DEBUG, uncomment this line diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/types.h b/Ghidra/Features/Decompiler/src/decompile/cpp/types.h index d549d65959..d109066370 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/types.h +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/types.h @@ -181,6 +181,20 @@ typedef char int1; typedef uint8 uintp; #endif +#if defined (__APPLE_CC__) && defined (__aarch64__) +#define HOST_ENDIAN 0 +typedef unsigned int uintm; +typedef int intm; +typedef unsigned long uint8; +typedef long int8; +typedef unsigned int uint4; +typedef int int4; +typedef unsigned short uint2; +typedef short int2; +typedef unsigned char uint1; +typedef char int1; +typedef uint8 uintp; +#endif #if defined(_WINDOWS) #pragma warning (disable:4312) diff --git a/build.gradle b/build.gradle index bbe7667495..ecd372c4a5 100644 --- a/build.gradle +++ b/build.gradle @@ -265,6 +265,7 @@ String getCurrentPlatformName() { boolean isX86_32 = archName.equals("x86") || archName.equals("i386"); boolean isX86_64 = archName.equals("x86_64") || archName.equals("amd64"); + boolean isAARCH_64 = archName.equals("aarch64"); if (osName.startsWith("Windows")) { if (isX86_32) { @@ -283,6 +284,9 @@ String getCurrentPlatformName() { if (isX86_64) { return 'osx64' } + if (isAARCH_64) { + return 'aarch64' + } } throw new GradleException("Unrecognized current platform -> osName = $osName, archName = $archName") }