Skip to content

Commit 6bc2011

Browse files
authored
Downstream patch to add bootcode for AArch64 FVPs #852 (ARM-software#564)
This patch: 1. Create new picolibc changes in downstream to add bootcode for AArch64 FVPs which is authored by: **Oliver Stannard**. The AArch64 FVP (Fixed Virtual Platform) models differ from QEMU in a few ways which affect the crt0 code: * The memory map is different, so needs different page tables. * They boot up at EL3, instead of EL1, so we need to set the EL3 versions of the system registers. * Add option to build crt0 bootcode for different machines * Build new FVP variants of crt0, instead of replacing QEMU ones * Split assembly parts of AArch64 crt0 into a separate file * Make error checking target-specific And also this patch: 1. Split and group the related picolibc changes into single patch. 2. Do the necessary changes in the documentation to reflect these changes.
1 parent 77002e7 commit 6bc2011

File tree

4 files changed

+892
-5
lines changed

4 files changed

+892
-5
lines changed

CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
# git -C repos clone https://github.com/llvm/llvm-project.git
4848
# git -C repos/llvm-project am -k $PWD/patches/llvm-project/*.patch
4949
# git -C repos clone https://github.com/picolibc/picolibc.git
50-
# git -C repos/picolibc apply $PWD/patches/picolibc.patch
50+
# git -C repos/picolibc apply $PWD/patches/picolibc/*.patch
5151
# mkdir build
5252
# cd build
5353
# cmake .. -GNinja -DFETCHCONTENT_SOURCE_DIR_LLVMPROJECT=../repos/llvm-project -DFETCHCONTENT_SOURCE_DIR_PICOLIBC=../repos/picolibc
@@ -289,6 +289,11 @@ set(LLVM_PATCH_COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/p
289289
if(APPLY_LLVM_PERFORMANCE_PATCHES)
290290
set(LLVM_PATCH_COMMAND ${LLVM_PATCH_COMMAND} && ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/patch_llvm.py ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project-perf)
291291
endif()
292+
set(
293+
picolibc_patches
294+
${CMAKE_CURRENT_SOURCE_DIR}/patches/picolibc/0001-Enable-libcxx-builds.patch
295+
${CMAKE_CURRENT_SOURCE_DIR}/patches/picolibc/0002-Add-bootcode-for-AArch64-FVPs.patch
296+
)
292297

293298
FetchContent_Declare(llvmproject
294299
GIT_REPOSITORY https://github.com/llvm/llvm-project.git
@@ -308,7 +313,7 @@ FetchContent_Declare(picolibc
308313
GIT_TAG "${picolibc_TAG}"
309314
GIT_SHALLOW "${picolibc_SHALLOW}"
310315
GIT_PROGRESS TRUE
311-
PATCH_COMMAND git reset --quiet --hard && git clean --quiet --force -dx && git apply ${CMAKE_CURRENT_SOURCE_DIR}/patches/picolibc.patch
316+
PATCH_COMMAND git reset --quiet --hard && git clean --quiet --force -dx && git apply ${picolibc_patches}
312317
# We only want to download the content, not configure it at this
313318
# stage. picolibc will be built in many configurations using
314319
# ExternalProject_Add using the sources that are checked out here.

docs/building-from-source.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ mkdir repos
8989
git -C repos clone https://github.com/llvm/llvm-project.git
9090
git -C repos/llvm-project am -k "$PWD"/patches/llvm-project/*.patch
9191
git -C repos clone https://github.com/picolibc/picolibc.git
92-
git -C repos/picolibc apply "$PWD"/patches/picolibc.patch
92+
git -C repos/picolibc apply "$PWD"/patches/picolibc/*.patch
9393
mkdir build
9494
cd build
9595
cmake .. -GNinja -DFETCHCONTENT_SOURCE_DIR_LLVMPROJECT=../repos/llvm-project -DFETCHCONTENT_SOURCE_DIR_PICOLIBC=../repos/picolibc

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

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
1+
From 42f07bef7775a1387f9707e959f8b6782f9d6808 Mon Sep 17 00:00:00 2001
2+
From: Simi Pallipurath <[email protected]>
3+
Date: Thu, 14 Nov 2024 10:07:08 +0000
4+
Subject: [PATCH 1/2] [PATCH 1/2] Enable libcxx builds
5+
6+
Modifications to build config and linker script required to enable
7+
libc++ builds.
8+
---
9+
meson.build | 12 ++++++++++++
10+
picolibc.ld.in | 3 +++
11+
2 files changed, 15 insertions(+)
12+
113
diff --git a/meson.build b/meson.build
2-
index f90f5b818..2f8d63733 100644
14+
index 012d664bd..4161d6574 100644
315
--- a/meson.build
416
+++ b/meson.build
5-
@@ -1310,6 +1310,18 @@ if get_option('newlib-retargetable-locking') != get_option('newlib-multithread')
17+
@@ -1318,6 +1318,18 @@ if get_option('newlib-retargetable-locking') != get_option('newlib-multithread')
618
error('newlib-retargetable-locking and newlib-multithread must be set to the same value')
719
endif
820

0 commit comments

Comments
 (0)