217

I have two "unlocked" devices, an iPad mini 3, and a Galaxy Edge 6, both endowed with a terminal and a minimalistic set of unix commands. I thought both devices have arm64 processors but when I ran

uname -a

on both devices I got the following :

for the iPad mini 3 :

xxxxs-iPad:/var/mobile root# uname -a
Darwin xxxx-iPad 14.0.0 Darwin Kernel Version 14.0.0: Wed Jun 24 00:50:15 PDT 2015; root:xnu-2784.30.7-30/RELEASE_ARM64_S5L8960X iPad4, **arm64**, J85mAP

for the Samsung Galaxy s6 Edge :

u0_a203@zerolte:/ $ uname -a
Linux localhost 3.10.61-4497415 #1 SMP PREEMPT Thu Apr 9 15:06:40 KST 2015 **aarch64** GNU/Linux

If I am not wrong, the last info in both case, J85mAP and GNU/Linux, stand for firmwares, and the antepenultimate infos, arm64 and aarch64, stand for the processors.

My questions are the following : obviously the strings "arm64" and "aarch64" are not the same, but I always thought arm64 and aarch64 were the same. (It's even told when you put the arm64 tag to a question here.)

So, are they really identical?

Especially, what should I worry about in case of cross-building libraries for both targets ? In fact, I have gcc 5.2.0 in mind, but maybe also lower versions. Can I just pass

-target=arm64

or

-target=aarch64

according to which device I target and just worry about the rest of options to configure?

EDIT Hum, look for this again, without success.

Sopalajo de Arrierez
  • 3,543
  • 4
  • 34
  • 52
Olórin
  • 3,367
  • 2
  • 22
  • 42
  • 2
    `containerd` normalises "aarch64" to "arm64", so in that sense they're both the same https://github.com/containerd/containerd/blob/v1.2.6/platforms/platforms.go#L88-L89 – Alf Eaton Mar 12 '21 at 19:55
  • 1
    I was really hoping that one of the answers below would be to the effect of _"everyone should be using <`arm64`/`aarch64`> because "_, so that I don't have to support special logic in my parser to look for _both_ `arm64` and `aarch64` :( – Rick B Oct 05 '22 at 22:18

5 Answers5

230

"AArch64" and "ARM64" refer to the same thing.

AArch64 is the 64-bit state introduced in the Armv8-A architecture. The 32-bit state which is backwards compatible with Armv7-A and previous 32-bit Arm architectures is referred to as AArch32. Therefore the GNU triplet for the 64-bit ISA is aarch64. The Linux kernel community chose to call their port of the kernel to this architecture arm64 rather than aarch64, so that's where some of the arm64 usage comes from.

The Apple-developed backend for AArch64 was called "ARM64" whereas the LLVM community-developed backend was called "AArch64" (as it is the canonical name for the 64-bit ISA). The two were merged in 2014 and the backend now is called "AArch64".

Boris Verkhovskiy
  • 14,854
  • 11
  • 100
  • 103
Kyrill
  • 2,963
  • 1
  • 8
  • 12
88

It seems that ARM64 was created by Apple and AARCH64 by the others, most notably GNU/GCC guys.

After some googling I found this link:

The LLVM 64-bit ARM64/AArch64 Back-Ends Have Merged

So it makes sense, iPad calls itself ARM64, as Apple is using LLVM, and Edge uses AARCH64, as Android is using GNU GCC toolchain.

pelotasplus
  • 9,852
  • 1
  • 35
  • 37
  • 1
    Thx for this answer. So, in theory at least, for cross-compiling gcc from mac os or ubuntu to ipad or edge, I should not really worry about the -target option passed to the configure script, provided that it is one among arm64 and aarch64 ? – Olórin Aug 06 '15 at 11:05
  • 9
    Though I have nothing new to add to above information, I would like to highlight the slide 10 of https://events.linuxfoundation.org/images/stories/pdf/lcna_co2012_marinas.pdf - It highlights how Linux Kernel refers to AARCH64 under ARM64 naming. So, while cross building of binaries which require support for linux kernel headers, probably ARCH=arm64 would be the correct one - even though target is "aarch64". – Shrey Sep 16 '15 at 06:20
  • 6
    Your answer is correct. The [commit to clang](https://github.com/llvm-mirror/clang/commit/8d681a2f93552ae452fbde8840b8f1553c591d7a) for that ARM64/AArch64 merge is pretty straightforward. arm64 and aarch64 appear synonymous for most purposes. –  Mar 16 '17 at 17:58
2

"AArch64" is the official name, it means "Arm Architecture 64-bit".

"arm64" is an unofficial name some people use because the official name sucks.

Originally there was just the 32-bit architecture, called "ARM". Then in October 2011 the ARMv8-A spec added a new 64-bit execution state called "AArch64", retroactively renaming the old 32-bit architecture "AArch32". Then to add a bit more confusion, in 2017 the company rebranded from being called "ARM" (an acronym for "Advanced RISC Machines") to just "Arm".

Support for AArch64 was added to Linux in 2012. The patchset was initially called "aarch64" but was renamed to "arm64". The LLVM community and Apple started working in parallel to support it in clang in 2012, the LLVM community called it "aarch64" and Apple called it "arm64". Apple open-sourced their changes and the two efforts lived together in LLVM under their different names and were eventually merged in 2014 so LLVM/clang now just calls it "aarch64".

Boris Verkhovskiy
  • 14,854
  • 11
  • 100
  • 103
  • based on the other answers, AArch64 is official by GNU while arm64 is official by Linux. Has ARM who controls the architecture stated anything officially? – user239558 Aug 08 '23 at 08:28
  • @user239558 did you read my answer? ARM named it AArch64, they decide the official name because they make it. – Boris Verkhovskiy Aug 08 '23 at 10:03
-3

It is easy to make the mistake that they are not the same. I have a library from Maxim Integrated developed presumably with GNU toolchain (aarch64). It is completely unusable in the XCode development environment for arm64. The MacBook Pro is model A1278. XCode is version 12.4. macOS Catalina v10.15.7. The ld command on the Mac will indicate that we are trying to link with an unknown-unsupported file format. Further investigation shows that the Maxim library, created with the ar command I believe, needs to be modified by running ranlib on it. At first I thought this was an aarch64 vs arm64 issue; I was wrong.

Butch
  • 7
  • 1
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 18 '21 at 04:43
  • Could somebody shed a little light on the nuts and bolts in this scenario? Is the actual underlying ISA compatible and this is some sort of ABI or convention incompatibility that is at play? It sounds like the answerer here did get it working "with ranlib" somehow. – Steven Lu Feb 11 '22 at 08:09
-4

GCC thinks they differ;

https://gcc.gnu.org/onlinedocs/gcc/AArch64-Options.html

https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html

LLVM thinks they are the same;

https://www.phoronix.com/scan.php?page=news_item&px=MTY5ODk

Linux thinks they are the same;

find ./* -name aarch64
./tools/testing/selftests/kvm/lib/aarch64
./tools/testing/selftests/kvm/include/aarch64
./tools/testing/selftests/kvm/aarch64

find ./* -name arm64
./arch/arm64    
./Documentation/arm64
./Documentation/translations/zh_CN/arm64
./drivers/acpi/arm64
./include/config/crypto/ghash/arm64
./include/config/crypto/crct10dif/arm64
./include/config/crypto/aes/arm64
./include/config/crypto/sha1/arm64
./include/config/crypto/sha2/arm64
./include/config/crypto/sm3/arm64
./include/config/crypto/sha512/arm64
./include/config/arm64
./include/config/exynos/arm64
./scripts/dtc/include-prefixes/arm64
./tools/testing/selftests/arm64
./tools/arch/arm64
./tools/perf/arch/arm64
./tools/perf/pmu-events/arch/arm64
user1133275
  • 2,642
  • 27
  • 31