From bdedee5a0f156d05eb62c704e702bfd1c506dc5d Mon Sep 17 00:00:00 2001 From: Boyan Karatotev Date: Thu, 9 Feb 2023 15:55:34 +0000 Subject: [PATCH 1/3] fix(deps): add missing aeabi_memset.S This file provides __aeabi_memclr8 builtin which the Ubuntu 22.04 version of clang 14 needs to compile. Add it to prevent this oddity from failing the build. Signed-off-by: Boyan Karatotev Change-Id: Id67aa0abba4a27c51b3ed6bb1be84b4e803b44bf --- lib/compiler-rt/builtins/arm/aeabi_memset.S | 49 +++++++++++++++++++++ lib/compiler-rt/compiler-rt.mk | 1 + 2 files changed, 50 insertions(+) create mode 100644 lib/compiler-rt/builtins/arm/aeabi_memset.S diff --git a/lib/compiler-rt/builtins/arm/aeabi_memset.S b/lib/compiler-rt/builtins/arm/aeabi_memset.S new file mode 100644 index 000000000..2aa8ec0c4 --- /dev/null +++ b/lib/compiler-rt/builtins/arm/aeabi_memset.S @@ -0,0 +1,49 @@ +//===-- aeabi_memset.S - EABI memset implementation -----------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#include "../assembly.h" + +// void __aeabi_memset(void *dest, size_t n, int c) { memset(dest, c, n); } +// void __aeabi_memclr(void *dest, size_t n) { __aeabi_memset(dest, n, 0); } + + .syntax unified + .p2align 2 +DEFINE_COMPILERRT_FUNCTION(__aeabi_memset) + mov r3, r1 + mov r1, r2 + mov r2, r3 +#ifdef USE_THUMB_1 + push {r7, lr} + bl memset + pop {r7, pc} +#else + b memset +#endif +END_COMPILERRT_FUNCTION(__aeabi_memset) + +DEFINE_AEABI_FUNCTION_ALIAS(__aeabi_memset4, __aeabi_memset) +DEFINE_AEABI_FUNCTION_ALIAS(__aeabi_memset8, __aeabi_memset) + + .p2align 2 +DEFINE_COMPILERRT_FUNCTION(__aeabi_memclr) + mov r2, r1 + movs r1, #0 +#ifdef USE_THUMB_1 + push {r7, lr} + bl memset + pop {r7, pc} +#else + b memset +#endif +END_COMPILERRT_FUNCTION(__aeabi_memclr) + +DEFINE_AEABI_FUNCTION_ALIAS(__aeabi_memclr4, __aeabi_memclr) +DEFINE_AEABI_FUNCTION_ALIAS(__aeabi_memclr8, __aeabi_memclr) + +NO_EXEC_STACK_DIRECTIVE + diff --git a/lib/compiler-rt/compiler-rt.mk b/lib/compiler-rt/compiler-rt.mk index 2338908f3..b41c4d037 100644 --- a/lib/compiler-rt/compiler-rt.mk +++ b/lib/compiler-rt/compiler-rt.mk @@ -35,6 +35,7 @@ ifeq (${ARCH},aarch32) COMPILER_RT_SRCS += lib/compiler-rt/builtins/arm/aeabi_ldivmod.S \ lib/compiler-rt/builtins/arm/aeabi_uldivmod.S \ lib/compiler-rt/builtins/arm/aeabi_memcpy.S \ + lib/compiler-rt/builtins/arm/aeabi_memset.S \ lib/compiler-rt/builtins/ctzdi2.c \ lib/compiler-rt/builtins/divdi3.c \ lib/compiler-rt/builtins/divmoddi4.c \ From 415195c03e6e1b3a5335ee242ab4116d2d1ac0b1 Mon Sep 17 00:00:00 2001 From: Boyan Karatotev Date: Thu, 9 Feb 2023 15:59:39 +0000 Subject: [PATCH 2/3] fix(docs): make required compiler version == rather than >= TF-A carries its own compiler-rt so higher versions of the compilers may not necessarily work. Because TF-A is only tested on the specified versions in the CI, any breakage remains unknown. Update the prerequisites guide to make it more apparent that this is the case. Signed-off-by: Boyan Karatotev Change-Id: Ia5da9c5ff505ead99f579f3f5fbe3a480d697c1d --- docs/getting_started/prerequisites.rst | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/getting_started/prerequisites.rst b/docs/getting_started/prerequisites.rst index 37232942b..5b49d2e0d 100644 --- a/docs/getting_started/prerequisites.rst +++ b/docs/getting_started/prerequisites.rst @@ -31,11 +31,17 @@ target the Armv7-A or Armv8-A architectures: You will need the targets ``arm-none-eabi`` and ``aarch64-none-elf`` for AArch32 and AArch64 builds respectively. -- Clang >= 14.0.0 -- Arm Compiler >= 6.18 +- Clang == 14.0.0 +- Arm Compiler == 6.18 In addition, a native compiler is required to build the supporting tools. +.. note:: + Versions greater than the ones specified are likely but not guaranteed to + work. This is predominantly because TF-A carries its own copy of compiler-rt, + which may be older than the version expected by the compiler. Fixes and bug + reports are always welcome. + .. note:: The software has also been built on Windows 7 Enterprise SP1, using CMD.EXE, Cygwin, and Msys (MinGW) shells, using version 5.3.1 of the GNU toolchain. From b7c37e4a80e3f00ba760044b74838297a3129118 Mon Sep 17 00:00:00 2001 From: Boyan Karatotev Date: Mon, 9 Jan 2023 11:50:24 +0000 Subject: [PATCH 3/3] build(docs): update Python dependencies Update the python dependencies for building the project's Sphinx documentation. Sphinx plugins are updated to the latest version, while Sphinx itself is only updated to 5.3.0 (latest 5.x.x revision) due to sphinx-rtd-theme not supporting any higher (both require incompatible versions of docutils). Myst-parser is also updated to the latest version to prevent a docutils clash as well. The effect of this is to bump certifi to version 2022.12.7 and wheel to 0.38.4 as suggested by dependabot. Signed-off-by: Boyan Karatotev Change-Id: I0ced5b127494255ce01aa7f51665bfcba161d135 --- docs/requirements.in | 8 ++--- docs/requirements.txt | 78 +++++++++++++++++++++++-------------------- 2 files changed, 45 insertions(+), 41 deletions(-) diff --git a/docs/requirements.in b/docs/requirements.in index 5d771e58e..ae20b7d97 100644 --- a/docs/requirements.in +++ b/docs/requirements.in @@ -1,5 +1,5 @@ -myst-parser==0.15.2 +myst-parser==0.18.1 pip-tools==6.4.0 -sphinx==4.2.0 -sphinx-rtd-theme==1.0.0 -sphinxcontrib-plantuml==0.22 +sphinx==5.3.0 +sphinx-rtd-theme==1.1.1 +sphinxcontrib-plantuml==0.24.1 diff --git a/docs/requirements.txt b/docs/requirements.txt index 03b11891c..1ed78d09f 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,71 +1,71 @@ # -# This file is autogenerated by pip-compile with python 3.8 -# To update, run: +# This file is autogenerated by pip-compile with Python 3.8 +# by the following command: # -# pip-compile +# pip-compile docs/requirements.in # alabaster==0.7.12 # via sphinx -attrs==21.2.0 - # via markdown-it-py -babel==2.9.1 +babel==2.11.0 # via sphinx -certifi==2021.5.30 +certifi==2022.12.7 # via requests -charset-normalizer==2.0.4 +charset-normalizer==2.1.1 # via requests -click==8.0.1 +click==8.1.3 # via pip-tools -docutils==0.16 +docutils==0.17.1 # via # myst-parser # sphinx # sphinx-rtd-theme -idna==3.2 +idna==3.4 # via requests -imagesize==1.2.0 +imagesize==1.4.1 # via sphinx -jinja2==3.0.1 +importlib-metadata==6.0.0 + # via sphinx +jinja2==3.1.2 # via # myst-parser # sphinx -markdown-it-py==1.1.0 +markdown-it-py==2.1.0 # via # mdit-py-plugins # myst-parser -markupsafe==2.0.1 +markupsafe==2.1.1 # via jinja2 -mdit-py-plugins==0.2.8 +mdit-py-plugins==0.3.3 # via myst-parser -myst-parser==0.15.2 - # via -r requirements.in -packaging==21.0 +mdurl==0.1.2 + # via markdown-it-py +myst-parser==0.18.1 + # via -r docs/requirements.in +packaging==23.0 # via sphinx -pep517==0.11.0 +pep517==0.13.0 # via pip-tools pip-tools==6.4.0 - # via -r requirements.in -pygments==2.10.0 + # via -r docs/requirements.in +pygments==2.14.0 # via sphinx -pyparsing==2.4.7 - # via packaging -pytz==2021.1 +pytz==2022.7 # via babel pyyaml==6.0 # via myst-parser -requests==2.26.0 +requests==2.28.1 # via sphinx -snowballstemmer==2.1.0 +snowballstemmer==2.2.0 # via sphinx -sphinx==4.2.0 +sphinx==5.3.0 # via - # -r requirements.in + # -r docs/requirements.in # myst-parser # sphinx-rtd-theme # sphinxcontrib-plantuml -sphinx-rtd-theme==1.0.0 - # via -r requirements.in -sphinxcontrib-applehelp==1.0.2 +sphinx-rtd-theme==1.1.1 + # via -r docs/requirements.in +sphinxcontrib-applehelp==1.0.3 # via sphinx sphinxcontrib-devhelp==1.0.2 # via sphinx @@ -73,18 +73,22 @@ sphinxcontrib-htmlhelp==2.0.0 # via sphinx sphinxcontrib-jsmath==1.0.1 # via sphinx -sphinxcontrib-plantuml==0.22 - # via -r requirements.in +sphinxcontrib-plantuml==0.24.1 + # via -r docs/requirements.in sphinxcontrib-qthelp==1.0.3 # via sphinx sphinxcontrib-serializinghtml==1.1.5 # via sphinx -tomli==1.2.1 +tomli==2.0.1 # via pep517 -urllib3==1.26.6 +typing-extensions==4.4.0 + # via myst-parser +urllib3==1.26.13 # via requests -wheel==0.37.0 +wheel==0.38.4 # via pip-tools +zipp==3.11.0 + # via importlib-metadata # The following packages are considered to be unsafe in a requirements file: # pip