Es scheint so zu sein, dass ARMv8 nicht zwingend 64Bit heißt. Ich habe
auf einem Raspi 3B mal ein paar Test gemacht :
1 | uname -a
|
2 | Linux raspi 5.4.83-v7+ #1379 SMP Mon Dec 14 13:08:57 GMT 2020 armv7l GNU/Linux
|
1 | lscpu
|
2 | Architecture: armv7l
|
3 | Byte Order: Little Endian
|
4 | CPU(s): 4
|
5 | On-line CPU(s) list: 0-3
|
6 | Thread(s) per core: 1
|
7 | Core(s) per socket: 4
|
8 | Socket(s): 1
|
9 | Vendor ID: ARM
|
10 | Model: 4
|
11 | Model name: Cortex-A53
|
12 | Stepping: r0p4
|
13 | CPU max MHz: 1200,0000
|
14 | CPU min MHz: 600,0000
|
15 | BogoMIPS: 38.40
|
16 | Flags: half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
|
Ich habe also ein Raspi mit Cortex-A53 welcher ein ARMv8 ist obwohl oben
armv7l steht. Der Kernel ist also wohl für einen ARMv7 erstellt worden.
Ich habe nun mal ein Hello World Programm geschrieben und es mit
1 | gcc helloworld.c -o helloworld-raspi8 -march=armv8-a
|
kompiliert. Das Ergebnis ist ein 32Bit Programm für ARMv8 welches auch
auf dem Raspi läuft.
1 | file helloworld-raspi8
|
2 | helloworld-raspi8: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=dd425965122ac2e56f9ac85581f1b1a121efcd6a, with debug_info, not stripped
|
1 | readelf -A helloworld-raspi8
|
2 | Attribute Section: aeabi
|
3 | File Attributes
|
4 | Tag_CPU_name: "8-A"
|
5 | Tag_CPU_arch: v8
|
6 | Tag_CPU_arch_profile: Application
|
7 | Tag_ARM_ISA_use: Yes
|
8 | Tag_THUMB_ISA_use: Thumb-2
|
9 | Tag_FP_arch: VFPv2
|
10 | Tag_ABI_PCS_wchar_t: 4
|
11 | Tag_ABI_FP_rounding: Needed
|
12 | Tag_ABI_FP_denormal: Needed
|
13 | Tag_ABI_FP_exceptions: Needed
|
14 | Tag_ABI_FP_number_model: IEEE 754
|
15 | Tag_ABI_align_needed: 8-byte
|
16 | Tag_ABI_align_preserved: 8-byte, except leaf SP
|
17 | Tag_ABI_enum_size: int
|
18 | Tag_ABI_VFP_args: VFP registers
|
19 | Tag_CPU_unaligned_access: v6
|
20 | Tag_MPextension_use: Allowed
|
21 | Tag_Virtualization_use: TrustZone and Virtualization Extensions
|
Ich habe das Hello World auch mal auf einem PC mit ARMv8-gcc kompiliert.
Das Programm läuft auch auf dem Raspi. Das sind noch ein paar andere
Optimierungen vom Compiler her.
1 | readelf -A helloworld-crossarmv8
|
2 | Attribute Section: aeabi
|
3 | File Attributes
|
4 | Tag_CPU_name: "8-A"
|
5 | Tag_CPU_arch: v8
|
6 | Tag_CPU_arch_profile: Application
|
7 | Tag_ARM_ISA_use: Yes
|
8 | Tag_THUMB_ISA_use: Thumb-2
|
9 | Tag_FP_arch: FP for ARMv8
|
10 | Tag_Advanced_SIMD_arch: NEON for ARMv8
|
11 | Tag_ABI_PCS_wchar_t: 4
|
12 | Tag_ABI_FP_rounding: Needed
|
13 | Tag_ABI_FP_denormal: Needed
|
14 | Tag_ABI_FP_exceptions: Needed
|
15 | Tag_ABI_FP_number_model: IEEE 754
|
16 | Tag_ABI_align_needed: 8-byte
|
17 | Tag_ABI_align_preserved: 8-byte, except leaf SP
|
18 | Tag_ABI_enum_size: int
|
19 | Tag_ABI_VFP_args: VFP registers
|
20 | Tag_CPU_unaligned_access: v6
|
21 | Tag_MPextension_use: Allowed
|
22 | Tag_Virtualization_use: TrustZone and Virtualization Extensions
|