Skip to content

Commit 4b047f6

Browse files
simpal01pratlucas
andauthored
Add aarch64 library variants for no-unaligned-access (#572)
This introduces new library variants for aarch64 to support targets where unaligned memory accesses are disabled. To enable these changes a patch to picolibc was required, ensuring the assembly implemenation that relies on unaligned accesses is not used when __ARM_FEATURE_UNALIGNED is not defined. Co-authored by: @pratlucas ( (#567) --------- Co-authored-by: Lucas Prates <[email protected]>
1 parent 00a466f commit 4b047f6

7 files changed

+598
-7
lines changed

arm-multilib/json/multilib.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"json": "aarch64a.json",
1111
"flags": "--target=aarch64-unknown-none-elf -fno-exceptions -fno-rtti"
1212
},
13-
{
13+
{
1414
"variant": "aarch64a_be_exn_rtti",
1515
"json": "aarch64a_be_exn_rtti.json",
1616
"flags": "--target=aarch64_be-unknown-none-elf"
@@ -20,6 +20,16 @@
2020
"json": "aarch64a_be.json",
2121
"flags": "--target=aarch64_be-unknown-none-elf -fno-exceptions -fno-rtti"
2222
},
23+
{
24+
"variant": "aarch64a_strictalign_exn_rtti",
25+
"json": "aarch64a_strictalign_exn_rtti.json",
26+
"flags": "--target=aarch64-unknown-none-elf -mno-unaligned-access"
27+
},
28+
{
29+
"variant": "aarch64a_strictalign",
30+
"json": "aarch64a_strictalign.json",
31+
"flags": "--target=aarch64-unknown-none-elf -mno-unaligned-access -fno-exceptions -fno-rtti"
32+
},
2333
{
2434
"variant": "armv4t_exn_rtti",
2535
"json": "armv4t_exn_rtti.json",
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"args": {
3+
"common": {
4+
"TARGET_ARCH": "aarch64a",
5+
"VARIANT": "aarch64a_strictalign",
6+
"COMPILE_FLAGS": "-march=armv8-a -mno-unaligned-access",
7+
"ENABLE_EXCEPTIONS": "OFF",
8+
"ENABLE_RTTI": "OFF",
9+
"TEST_EXECUTOR": "fvp",
10+
"FVP_MODEL": "aem-a",
11+
"FVP_CONFIG": "v8a-aarch64",
12+
"BOOT_FLASH_ADDRESS": "0x80000000",
13+
"BOOT_FLASH_SIZE": "0x1000",
14+
"FLASH_ADDRESS": "0x80001000",
15+
"FLASH_SIZE": "0xfff000",
16+
"RAM_ADDRESS": "0x81000000",
17+
"RAM_SIZE": "0x1000000",
18+
"STACK_SIZE": "8K"
19+
},
20+
"picolibc": {
21+
"PICOLIBC_BUILD_TYPE": "release",
22+
"ENABLE_CXX_LIBS": "ON",
23+
"ENABLE_LIBC_TESTS": "ON",
24+
"ENABLE_COMPILER_RT_TESTS": "OFF",
25+
"ENABLE_LIBCXX_TESTS": "OFF"
26+
},
27+
"newlib": {
28+
"ENABLE_CXX_LIBS": "ON",
29+
"ENABLE_LIBC_TESTS": "OFF",
30+
"ENABLE_COMPILER_RT_TESTS": "OFF",
31+
"ENABLE_LIBCXX_TESTS": "OFF"
32+
},
33+
"llvmlibc": {
34+
"ENABLE_CXX_LIBS": "OFF",
35+
"ENABLE_LIBC_TESTS": "OFF",
36+
"ENABLE_COMPILER_RT_TESTS": "OFF",
37+
"ENABLE_LIBCXX_TESTS": "OFF"
38+
}
39+
}
40+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"args": {
3+
"common": {
4+
"TARGET_ARCH": "aarch64a",
5+
"VARIANT": "aarch64a_strictalign_exn_rtti",
6+
"COMPILE_FLAGS": "-march=armv8-a -mno-unaligned-access",
7+
"ENABLE_EXCEPTIONS": "ON",
8+
"ENABLE_RTTI": "ON",
9+
"TEST_EXECUTOR": "fvp",
10+
"FVP_MODEL": "aem-a",
11+
"FVP_CONFIG": "v8a-aarch64",
12+
"BOOT_FLASH_ADDRESS": "0x80000000",
13+
"BOOT_FLASH_SIZE": "0x1000",
14+
"FLASH_ADDRESS": "0x80001000",
15+
"FLASH_SIZE": "0xfff000",
16+
"RAM_ADDRESS": "0x81000000",
17+
"RAM_SIZE": "0x1000000",
18+
"STACK_SIZE": "8K"
19+
},
20+
"picolibc": {
21+
"PICOLIBC_BUILD_TYPE": "release",
22+
"ENABLE_CXX_LIBS": "ON",
23+
"ENABLE_LIBC_TESTS": "ON",
24+
"ENABLE_COMPILER_RT_TESTS": "OFF",
25+
"ENABLE_LIBCXX_TESTS": "OFF"
26+
},
27+
"newlib": {
28+
"ENABLE_CXX_LIBS": "ON",
29+
"ENABLE_LIBC_TESTS": "OFF",
30+
"ENABLE_COMPILER_RT_TESTS": "OFF",
31+
"ENABLE_LIBCXX_TESTS": "OFF"
32+
},
33+
"llvmlibc": {
34+
"ENABLE_CXX_LIBS": "OFF",
35+
"ENABLE_LIBC_TESTS": "OFF",
36+
"ENABLE_COMPILER_RT_TESTS": "OFF",
37+
"ENABLE_LIBCXX_TESTS": "OFF"
38+
}
39+
}
40+
}

patches/picolibc/0001-Enable-libcxx-builds.patch

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From 42f07bef7775a1387f9707e959f8b6782f9d6808 Mon Sep 17 00:00:00 2001
1+
From 028fe75e045951a9d091008a85971523358160db Mon Sep 17 00:00:00 2001
22
From: Simi Pallipurath <[email protected]>
33
Date: Thu, 14 Nov 2024 10:07:08 +0000
4-
Subject: [PATCH 1/2] [PATCH 1/2] Enable libcxx builds
4+
Subject: Enable libcxx builds
55

66
Modifications to build config and linker script required to enable
77
libc++ builds.
@@ -47,3 +47,6 @@ index 7b63ba172..cda5e1e7e 100644
4747
*(.gnu.linkonce.t.*)
4848
KEEP (*(.fini .fini.*))
4949
@PREFIX@__text_end = .;
50+
--
51+
2.39.5 (Apple Git-154)
52+

patches/picolibc/0002-Add-bootcode-for-AArch64-FVPs.patch

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From 3b0b62ce6d81211a71eebe63b4b4ef0732da93ef Mon Sep 17 00:00:00 2001
1+
From 58451642e678817d8822b04b8ff07ee4758a8f10 Mon Sep 17 00:00:00 2001
22
From: Simi Pallipurath <[email protected]>
3-
Date: Mon, 25 Nov 2024 11:13:50 +0000
4-
Subject: [PATCH 2/2] [PATCH 2/2] Add bootcode for AArch64 FVPs
3+
Date: Thu, 14 Nov 2024 10:12:33 +0000
4+
Subject: Add bootcode for AArch64 FVPs
55

66
The AArch64 FVP (Fixed Virtual Platform) models differ from QEMU in a
77
few ways which affect the crt0 code:
@@ -886,4 +886,3 @@ index 76965990f..be8f875be 100644
886886
endforeach
887887
--
888888
2.34.1
889-

0 commit comments

Comments
 (0)