diff --git a/configure b/configure index 602ddfda04..18b44d9ef5 100755 --- a/configure +++ b/configure @@ -32,7 +32,7 @@ options: directory under "cross-tools". The HAIKU_* tools variables will be set accordingly. specifies the target architecture, either - "x86_gcc2", "x86", "x86_64", "ppc", "m68k", "arm" + "x86_gcc2", "x86", "x86_64", "ppc", "m68k", "arm", "arm64" This option and --cross-tools-prefix can be specified multiple times. The first cross tools specify the primary tools, the subsequent ones the @@ -254,6 +254,7 @@ standard_gcc_settings() # determine architecture from machine triple case $gccMachine in arm-*) targetCpu=arm;; + arm64-*) targetCpu=arm64;; i?86-*) targetCpu=x86;; m68k-*) targetCpu=m68k;; powerpc-*) targetCpu=ppc;; @@ -599,6 +600,7 @@ export haikuRequiredLegacyGCCVersion # version of legacy gcc required to build haiku supportedTargetArchs=" arm + arm64 m68k ppc x86 @@ -706,6 +708,7 @@ while [ $# -gt 0 ] ; do x86_64) targetMachine=x86_64-unknown-haiku;; ppc) targetMachine=powerpc-apple-haiku;; arm) targetMachine=arm-unknown-haiku;; + arm64) targetMachine=arm64-unknown-haiku;; *) echo "Unsupported target architecture: $2" >&2 exit 1 diff --git a/headers/config/HaikuConfig.h b/headers/config/HaikuConfig.h index d99a23285b..f28e193f9e 100644 --- a/headers/config/HaikuConfig.h +++ b/headers/config/HaikuConfig.h @@ -56,6 +56,11 @@ # define __HAIKU_ARCH_ABI "armeb" # define __HAIKU_ARCH_ARM 1 # define __HAIKU_BIG_ENDIAN 1 +#elif defined(__arm64__) +# define __HAIKU_ARCH arm64 +# define __HAIKU_ARCH_ABI "arm64" +# define __HAIKU_ARCH_ARM64 1 +# define __HAIKU_ARCH_BITS 64 #else # error Unsupported architecture! #endif diff --git a/headers/os/kernel/elf.h b/headers/os/kernel/elf.h index 0449cb47c5..45a8212a74 100644 --- a/headers/os/kernel/elf.h +++ b/headers/os/kernel/elf.h @@ -186,7 +186,8 @@ typedef struct { #define EM_BLACKFIN 106 /* Analog Devices Blackfin (DSP) processor */ #define EM_ARCA 109 /* Arca RISC Microprocessor */ #define EM_VIDCORE3 137 /* Broadcom VideoCore III */ -#define EM_AARCH64 183 /* ARM 64 bit */ +#define EM_ARM64 183 /* ARM 64 bit */ +#define EM_AARCH64 EM_ARM64 #define EM_AVR32 185 /* AVR-32 */ #define EM_STM8 186 /* ST STM8S */ #define EM_CUDA 190 /* Nvidia CUDA */ diff --git a/src/system/runtime_loader/runtime_loader.cpp b/src/system/runtime_loader/runtime_loader.cpp index e632895e92..b92f01eb1e 100644 --- a/src/system/runtime_loader/runtime_loader.cpp +++ b/src/system/runtime_loader/runtime_loader.cpp @@ -667,8 +667,8 @@ get_executable_architecture(int fd, const char** _architecture) case EM_ARM: architecture = "arm"; break; - case EM_AARCH64: - architecture = "aarch64"; + case EM_ARM64: + architecture = "arm64"; break; case EM_X86_64: architecture = "x86_64";