Skip to content

Commit de88c48

Browse files
dcandlerpratlucas
authored andcommitted
Rename to Arm Toolchain for Embedded and update directories
This updates all the files with the toolchain's new name and directory structure. The main functional difference is that because the CMake scripts now live inside a fork of llvm-project, it is no longer necessary to checkout that repo. However the downstream patches remain for the moment as these have not yet been applied to the new repo, and will need to be manually applied before a build. Documentation will likely need further updates, but these should be enough to start building.
1 parent 9659a70 commit de88c48

26 files changed

+119
-377
lines changed

.cmakelintrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/workflows/lint.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

arm-software/embedded/CHANGELOG.md

Lines changed: 0 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -3,108 +3,3 @@
33
All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
6-
7-
## [Unreleased]
8-
9-
### Added
10-
- Armv8.1-M PACBTI library variants (#489).
11-
12-
### Changed
13-
- -nostartfiles required when using crt0-semihosting (#460).
14-
15-
## [19.0.0]
16-
17-
### Added
18-
- AArch32 v8-A and v8-R can now be targeted (#484) (#486).
19-
- Experimental support for building llvm-libc overlay package (#452).
20-
- Additional library variants for Armv7 (#464) (#491) (#494).
21-
- Additional multilib mappings for v7ve and Thumb target triples (#479) (#481).
22-
- Omax and OmaxLTO config files (#454).
23-
24-
### Changed
25-
- Use unstable libc++ ABI (#294).
26-
- Merge v7-M and v7E-M library variants (#482).
27-
- AArch64 A-profile library made distinct (#468).
28-
29-
## [18.0.0]
30-
31-
### Added
32-
33-
- Documentation for the newlib overlay package (#399).
34-
- Support for C++ exceptions and RTTI added in the standard libraries (#339).
35-
36-
## [17.0.0]
37-
38-
### Fixed
39-
- Building from sources created by git archive (#242).
40-
- macOS no longer quarantines files from the macOS package.
41-
42-
### Changed
43-
- Updated multilib to use LLVM multilib.yaml 1.0 (#250).
44-
- `*.cfg` files for library variant selection removed in favor of multilib
45-
- The macOS package is now a `.dmg` instead of `.tar.gz`.
46-
- Linux packages are now in `tar.xz` format instead of `tar.gz`.
47-
48-
### Removed
49-
50-
- Dependency on libtinfo.so.
51-
- Coloured terminal output.
52-
53-
## [16.0.0]
54-
55-
### Added
56-
57-
- Support for locales and input/output streams (#149)
58-
- Experimental support for Armv4T and Armv5TE architectures (#177)
59-
- Provide binary releases for macOS (#86)
60-
- Support for building locally on Windows & macOS (#188)
61-
- Experimental support for multilib (#110).
62-
63-
### Fixed
64-
65-
- lld freezing on Windows (#83)
66-
- Packages now extract into a LLVMEmbeddedToolchainForArm-VERSION-PLATFORM subdirectory (#179)
67-
68-
### Changed
69-
70-
- Updated to [LLVM 16.0.0](https://github.com/llvm/llvm-project/releases/tag/llvmorg-16.0.0)
71-
- Windows release packages are now signed.
72-
73-
74-
## [15.0.2]
75-
76-
### Added
77-
78-
- A changelog
79-
- Support for building with CMake directly
80-
- Support for C++17's aligned operator new
81-
82-
### Changed
83-
84-
- Updated to [LLVM 15.0.2](https://github.com/llvm/llvm-project/releases/tag/llvmorg-15.0.2)
85-
- Replaced newlib with [picolibc](https://github.com/picolibc/picolibc) (GitHub issue #61)
86-
- Renamed and updated configuration files
87-
- Configuration files must now be specified including the file name suffix e.g. `--config armv6m_soft_nofp.cfg`
88-
89-
### Removed
90-
91-
- Wide character support in libc++
92-
93-
94-
## [14.0.0] - 2022-05-03
95-
96-
### Changed
97-
98-
- Updated to [LLVM 14.0.0](https://github.com/llvm/llvm-project/releases/tag/llvmorg-14.0.0)
99-
100-
## [13.0.0] - 2021-12-16
101-
102-
### Added
103-
104-
- Initial release of LLVM Embedded Toolchain for Arm
105-
106-
[unreleased]: https://github.com/ARM-software/LLVM-embedded-toolchain-for-Arm/compare/release-16.0.0...HEAD
107-
[16.0.0]: https://github.com/ARM-software/LLVM-embedded-toolchain-for-Arm/compare/release-15.0.2...release-16.0.0
108-
[15.0.2]: https://github.com/ARM-software/LLVM-embedded-toolchain-for-Arm/compare/release-14.0.0...release-15.0.2
109-
[14.0.0]: https://github.com/ARM-software/LLVM-embedded-toolchain-for-Arm/compare/release-13.0.0...release-14.0.0
110-
[13.0.0]: https://github.com/ARM-software/LLVM-embedded-toolchain-for-Arm/releases/tag/release-13.0.0

arm-software/embedded/CMakeLists.txt

Lines changed: 36 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
# How to use this file
2020
#
21-
# This file is used to build LLVM Embedded Toolchain for Arm.
21+
# This file is used to build Arm Toolchain for Embedded.
2222
# Recent versions of the following tools are pre-requisites:
2323
# * A toolchain such as gcc & binutils
2424
# * cmake
@@ -35,7 +35,7 @@
3535
# ninja check-llvm-toolchain
3636
#
3737
# To make it easy to get started, the above command checks out
38-
# llvm-project & picolibc Git repos automatically.
38+
# the picolibc Git repos automatically.
3939
#
4040
# If the repos are checked out automatically then cmake will fetch the
4141
# latest changes and check them out every time it runs. To disable this
@@ -44,13 +44,11 @@
4444
#
4545
# If you prefer you can check out and patch the repos manually and use those:
4646
# mkdir repos
47-
# git -C repos clone https://github.com/llvm/llvm-project.git
48-
# git -C repos/llvm-project am -k $PWD/patches/llvm-project/*.patch
4947
# git -C repos clone https://github.com/picolibc/picolibc.git
5048
# git -C repos/picolibc am -k $PWD/patches/picolibc/*.patch
5149
# mkdir build
5250
# cd build
53-
# cmake .. -GNinja -DFETCHCONTENT_SOURCE_DIR_LLVMPROJECT=../repos/llvm-project -DFETCHCONTENT_SOURCE_DIR_PICOLIBC=../repos/picolibc
51+
# cmake .. -GNinja -DFETCHCONTENT_SOURCE_DIR_PICOLIBC=../repos/picolibc
5452
# ninja
5553
# ninja check-llvm-toolchain
5654
#
@@ -75,7 +73,7 @@
7573
# If cross-building, there will be two toolchains built:
7674
# 1. The "build" toolchain. This is used to build the libraries.
7775
# 2. The "host" toolchain. This is the toolchain that will be packaged
78-
# up into "LLVM Embedded Toolchain for Arm".
76+
# up into "Arm Toolchain for Embedded".
7977
# For "native" builds the "build" toolchain is also used as the "host"
8078
# toolchain.
8179
#
@@ -145,11 +143,6 @@ option(
145143
be used to speed up repeated builds. This is not done by default,
146144
as it can also make the inital build slower due to the cold cache."
147145
)
148-
option(
149-
APPLY_LLVM_PERFORMANCE_PATCHES
150-
"During checkout, apply optional downstream patches to
151-
llvm-project to improve performance."
152-
)
153146
option(
154147
ENABLE_QEMU_TESTING
155148
"Enable tests that use QEMU. This option is ON by default."
@@ -193,7 +186,7 @@ if(LLVM_TOOLCHAIN_LIBRARY_OVERLAY_INSTALL)
193186
endif()
194187
endif()
195188

196-
set(BUG_REPORT_URL "https://github.com/ARM-software/LLVM-embedded-toolchain-for-Arm/issues" CACHE STRING "")
189+
set(BUG_REPORT_URL "https://gitlab.arm.com/toolchains/arm-toolchain/-/issues" CACHE STRING "")
197190
set(LLVM_DISTRIBUTION_COMPONENTS
198191
clang-resource-headers
199192
clang
@@ -266,18 +259,17 @@ include(ExternalProject)
266259
include(FetchContent)
267260
include(ProcessorCount)
268261

269-
# Check out and patch llvm-project and picolibc.
262+
# Check out and patch picolibc or newlib if required.
270263
#
271264
# If you'd rather check out and patch manually then run cmake with
272-
# -DFETCHCONTENT_SOURCE_DIR_LLVMPROJECT=/path/to/llvm-project
273265
# -DFETCHCONTENT_SOURCE_DIR_PICOLIBC=/path/to/picolibc
266+
# -DFETCHCONTENT_SOURCE_DIR_NEWLIB=/path/to/newlib
274267
#
275268
# By default check out will be silent but this can be changed by running
276269
# cmake with -DFETCHCONTENT_QUIET=OFF
277270
#
278271
# If you want to stop cmake updating the repos then run
279272
# cmake . -DFETCHCONTENT_FULLY_DISCONNECTED=ON
280-
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/fetch_llvm.cmake)
281273
if(LLVM_TOOLCHAIN_C_LIBRARY STREQUAL picolibc)
282274
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/fetch_picolibc.cmake)
283275
endif()
@@ -288,7 +280,7 @@ endif()
288280
##################################################################################################
289281
# We set all project properties later, this call is just to enable the
290282
# CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT check
291-
project(LLVMEmbeddedToolchainForArm)
283+
project(ArmToolchainForEmbedded)
292284
# We generally want to install to a local directory to see what the
293285
# output will look like rather than install into the system, so change
294286
# the default accordingly.
@@ -321,6 +313,11 @@ install(
321313
COMPONENT llvm-toolchain-config-files
322314
)
323315

316+
set(llvmproject_src_dir ${CMAKE_CURRENT_SOURCE_DIR}/../..)
317+
add_subdirectory(
318+
${llvmproject_src_dir}/llvm llvm
319+
)
320+
324321
if(LLVM_TOOLCHAIN_C_LIBRARY STREQUAL llvmlibc)
325322
install(
326323
FILES
@@ -339,7 +336,7 @@ if(LLVM_TOOLCHAIN_C_LIBRARY STREQUAL llvmlibc)
339336
# We need to build libc-hdrgen
340337
ExternalProject_Add(
341338
libc_hdrgen
342-
SOURCE_DIR ${llvmproject_SOURCE_DIR}/llvm
339+
SOURCE_DIR ${llvmproject_src_dir}/llvm
343340
DEPENDS ${lib_tool_dependencies}
344341
CMAKE_ARGS
345342
-DLLVM_ENABLE_RUNTIMES=libc
@@ -362,30 +359,26 @@ if(LLVM_TOOLCHAIN_C_LIBRARY STREQUAL llvmlibc)
362359
# them to the same location and point libc to that.
363360
set(LIBC_CFG_DIR ${CMAKE_BINARY_DIR}/llvmlibc-config)
364361
file(COPY
365-
${llvmproject_SOURCE_DIR}/libc/config/baremetal/config.json
366-
${llvmproject_SOURCE_DIR}/libc/config/baremetal/arm/.
362+
${llvmproject_src_dir}/libc/config/baremetal/config.json
363+
${llvmproject_src_dir}/libc/config/baremetal/arm/.
367364
DESTINATION
368365
${LIBC_CFG_DIR}
369366
)
370367
endif()
371368

372-
add_subdirectory(
373-
${llvmproject_SOURCE_DIR}/llvm llvm
374-
)
375-
376-
get_directory_property(LLVM_VERSION_MAJOR DIRECTORY ${llvmproject_SOURCE_DIR}/llvm DEFINITION LLVM_VERSION_MAJOR)
377-
get_directory_property(LLVM_VERSION_MINOR DIRECTORY ${llvmproject_SOURCE_DIR}/llvm DEFINITION LLVM_VERSION_MINOR)
378-
get_directory_property(LLVM_VERSION_PATCH DIRECTORY ${llvmproject_SOURCE_DIR}/llvm DEFINITION LLVM_VERSION_PATCH)
369+
get_directory_property(LLVM_VERSION_MAJOR DIRECTORY ${llvmproject_src_dir}/llvm DEFINITION LLVM_VERSION_MAJOR)
370+
get_directory_property(LLVM_VERSION_MINOR DIRECTORY ${llvmproject_src_dir}/llvm DEFINITION LLVM_VERSION_MINOR)
371+
get_directory_property(LLVM_VERSION_PATCH DIRECTORY ${llvmproject_src_dir}/llvm DEFINITION LLVM_VERSION_PATCH)
379372

380373
project(
381-
LLVMEmbeddedToolchainForArm
374+
ArmToolchainForEmbedded
382375
VERSION ${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}
383-
DESCRIPTION "LLVM Embedded Toolchain for Arm"
384-
HOMEPAGE_URL "https://github.com/ARM-software/LLVM-embedded-toolchain-for-Arm"
376+
DESCRIPTION "Arm Toolchain for Embedded"
377+
HOMEPAGE_URL "https://gitlab.arm.com/toolchains/arm-toolchain"
385378
)
386379

387380
# Set package name for shorter archive file name
388-
set(SHORT_PACKAGE_NAME "LLVM-ET-Arm")
381+
set(SHORT_PACKAGE_NAME "ATfE")
389382

390383
# Set package name and version.
391384
if(DEFINED LLVM_TOOLCHAIN_PACKAGE_NAME)
@@ -473,7 +466,7 @@ set(CPACK_PACKAGE_FILE_NAME ${PACKAGE_FILE_NAME})
473466
include(CPack)
474467

475468
# Ensure LLVM tool symlinks are installed.
476-
list(APPEND CMAKE_MODULE_PATH ${llvmproject_SOURCE_DIR}/llvm/cmake/modules)
469+
list(APPEND CMAKE_MODULE_PATH ${llvmproject_src_dir}/llvm/cmake/modules)
477470
llvm_install_symlink(LLVM llvm-ranlib llvm-ar ALWAYS_GENERATE)
478471
llvm_install_symlink(LLVM llvm-readelf llvm-readobj ALWAYS_GENERATE)
479472
llvm_install_symlink(LLVM llvm-strip llvm-objcopy ALWAYS_GENERATE)
@@ -486,9 +479,9 @@ add_custom_target(
486479
version_txt
487480
COMMAND
488481
"${CMAKE_COMMAND}"
489-
-DLLVMEmbeddedToolchainForArm_VERSION=${LLVMEmbeddedToolchainForArm_VERSION}
490-
-DLLVMEmbeddedToolchainForArm_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}
491-
-Dllvmproject_SOURCE_DIR=${llvmproject_SOURCE_DIR}
482+
-DArmToolchainForEmbedded_VERSION=${ArmToolchainForEmbedded_VERSION}
483+
-DArmToolchainForEmbedded_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}
484+
-Dllvmproject_src_dir=${llvmproject_src_dir}
492485
# at most one of picolibc and newlib source dirs is needed, but easiest to
493486
# specify both definitions
494487
-Dpicolibc_SOURCE_DIR=${picolibc_SOURCE_DIR}
@@ -604,7 +597,6 @@ if(NOT PREBUILT_TARGET_LIBRARIES)
604597
-DENABLE_QEMU_TESTING=${ENABLE_QEMU_TESTING}
605598
-DENABLE_FVP_TESTING=${ENABLE_FVP_TESTING}
606599
-DFVP_CONFIG_DIR=${CMAKE_CURRENT_SOURCE_DIR}/fvp/config
607-
-DFETCHCONTENT_SOURCE_DIR_LLVMPROJECT=${FETCHCONTENT_SOURCE_DIR_LLVMPROJECT}
608600
-DFETCHCONTENT_SOURCE_DIR_PICOLIBC=${FETCHCONTENT_SOURCE_DIR_PICOLIBC}
609601
-DFETCHCONTENT_SOURCE_DIR_NEWLIB=${FETCHCONTENT_SOURCE_DIR_NEWLIB}
610602
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
@@ -717,13 +709,13 @@ install(
717709
)
718710

719711
set(third_party_license_files
720-
${llvmproject_SOURCE_DIR}/llvm/LICENSE.TXT LLVM-LICENSE.txt
721-
${llvmproject_SOURCE_DIR}/clang/LICENSE.TXT CLANG-LICENSE.txt
722-
${llvmproject_SOURCE_DIR}/lld/LICENSE.TXT LLD-LICENSE.txt
723-
${llvmproject_SOURCE_DIR}/compiler-rt/LICENSE.TXT COMPILER-RT-LICENSE.txt
724-
${llvmproject_SOURCE_DIR}/libcxx/LICENSE.TXT LIBCXX-LICENSE.txt
725-
${llvmproject_SOURCE_DIR}/libcxxabi/LICENSE.TXT LIBCXXABI-LICENSE.txt
726-
${llvmproject_SOURCE_DIR}/libunwind/LICENSE.TXT LIBUNWIND-LICENSE.txt
712+
${llvmproject_src_dir}/llvm/LICENSE.TXT LLVM-LICENSE.txt
713+
${llvmproject_src_dir}/clang/LICENSE.TXT CLANG-LICENSE.txt
714+
${llvmproject_src_dir}/lld/LICENSE.TXT LLD-LICENSE.txt
715+
${llvmproject_src_dir}/compiler-rt/LICENSE.TXT COMPILER-RT-LICENSE.txt
716+
${llvmproject_src_dir}/libcxx/LICENSE.TXT LIBCXX-LICENSE.txt
717+
${llvmproject_src_dir}/libcxxabi/LICENSE.TXT LIBCXXABI-LICENSE.txt
718+
${llvmproject_src_dir}/libunwind/LICENSE.TXT LIBUNWIND-LICENSE.txt
727719
)
728720
if(LLVM_TOOLCHAIN_C_LIBRARY STREQUAL picolibc)
729721
list(APPEND third_party_license_files
@@ -739,7 +731,7 @@ if(LLVM_TOOLCHAIN_C_LIBRARY STREQUAL newlib)
739731
endif()
740732
if(LLVM_TOOLCHAIN_C_LIBRARY STREQUAL llvmlibc)
741733
list(APPEND third_party_license_files
742-
${llvmproject_SOURCE_DIR}/libc/LICENSE.TXT LIBC-LICENSE.TXT
734+
${llvmproject_src_dir}/libc/LICENSE.TXT LIBC-LICENSE.TXT
743735
)
744736
endif()
745737

@@ -869,7 +861,7 @@ if(LLVM_TOOLCHAIN_CROSS_BUILD_MINGW)
869861
string(REPLACE ";" "," LLVM_TARGETS_TO_BUILD_comma "${LLVM_TARGETS_TO_BUILD}")
870862
ExternalProject_Add(
871863
mingw-llvm
872-
SOURCE_DIR ${llvmproject_SOURCE_DIR}/llvm
864+
SOURCE_DIR ${llvmproject_src_dir}/llvm
873865
PREFIX mingw-llvm
874866
INSTALL_DIR mingw-llvm/install
875867
DEPENDS clang-tblgen llvm-config llvm-tblgen

0 commit comments

Comments
 (0)