Differences between arm64 and aarch64
AndroidIosGccArmArm64Android Problem Overview
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.
Android Solutions
Solution 1 - Android
AArch64 is the 64-bit state introduced in the Armv8-A architecture (https://en.wikipedia.org/wiki/ARM_architecture#ARMv8-A). 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.
As far as I know the Apple 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) and later the two were merged and the backend now is called aarch64.
So AArch64 and ARM64 refer to the same thing.
Solution 2 - Android
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.
Solution 3 - Android
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.
Solution 4 - Android
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
Solution 5 - Android
x86/x64 processors: They’re fast and powerful, but they require a lot of electricity. So, they’re used in desktop computers that can plug into the wall. All versions of Windows run on x86/x64.
ARM & AARCH64 processors: They’re weak but low-power processors for smartphones and other devices that aren’t plugged into the wall. Mobile iOS and Android operating systems run on ARM.