diff options
| author | Frédéric Desbiens <[email protected]> | 2026-10-02 10:42:44 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-10-02 10:42:44 -0400 |
| commit | 93387b0a60382a29579bbad5045c68328e3751df (patch) | |
| tree | 42be790d602cb76f55090e5a7c418df7ea2b3428 /cmake | |
| parent | 44d7c95c582d415c4ad84527180b29c93c3bf664 (diff) | |
| parent | 28281cd5647d4671236ca08d19bd18ed15b2265a (diff) | |
Merge pull request #783 from eclipse-threadx/devv6.5.2.202603_rel
Merged changes ahead of the v6.5.2.202603 release
Diffstat (limited to 'cmake')
36 files changed, 783 insertions, 4 deletions
diff --git a/cmake/aarch64-none-elf.cmake b/cmake/aarch64-none-elf.cmake new file mode 100644 index 00000000..dada9fec --- /dev/null +++ b/cmake/aarch64-none-elf.cmake @@ -0,0 +1,44 @@ +# Copyright (c) 2026 Eclipse ThreadX contributors +# SPDX-License-Identifier: MIT +# Portions of this file were generated with AI assistance. +# +# Shared settings for the AArch64 bare metal ports, the counterpart of +# arm-none-eabi.cmake beside it. The two differ by more than the tool prefix: +# AArch64 has no -marm or -mthumb to choose between, no -mfloat-abi, and +# aarch64-none-elf-gcc rejects -mlong-calls outright, so that flag cannot simply +# be carried across. +# +# The tools are named without a path, so an aarch64-none-elf toolchain must be +# on PATH. Override CMAKE_C_COMPILER and friends on the command line to use one +# that is not. + +# Toolchain settings +set(CMAKE_C_COMPILER aarch64-none-elf-gcc) +set(CMAKE_CXX_COMPILER aarch64-none-elf-g++) +set(AS aarch64-none-elf-as) +set(AR aarch64-none-elf-ar) +set(OBJCOPY aarch64-none-elf-objcopy) +set(OBJDUMP aarch64-none-elf-objdump) +set(SIZE aarch64-none-elf-size) + +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) + +# Build the try-compile as a static library so no linker script or startup code +# is needed just to test the compiler. +set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) + +set(CMAKE_C_FLAGS "${MCPU_FLAGS} ${VFP_FLAGS} ${SPEC_FLAGS} -fdata-sections -ffunction-sections" CACHE INTERNAL "c compiler flags") +set(CMAKE_CXX_FLAGS "${MCPU_FLAGS} ${VFP_FLAGS} -fdata-sections -ffunction-sections -fno-rtti -fno-exceptions" CACHE INTERNAL "cxx compiler flags") +set(CMAKE_ASM_FLAGS "${MCPU_FLAGS} ${VFP_FLAGS} -x assembler-with-cpp" CACHE INTERNAL "asm compiler flags") +set(CMAKE_EXE_LINKER_FLAGS "${MCPU_FLAGS} ${LD_FLAGS} -Wl,--gc-sections" CACHE INTERNAL "exe link flags") + +set(CMAKE_C_FLAGS_DEBUG "-Og -g -ggdb3" CACHE INTERNAL "c debug compiler flags") +set(CMAKE_CXX_FLAGS_DEBUG "-Og -g -ggdb3" CACHE INTERNAL "cxx debug compiler flags") +set(CMAKE_ASM_FLAGS_DEBUG "-g -ggdb3" CACHE INTERNAL "asm debug compiler flags") + +set(CMAKE_C_FLAGS_RELEASE "-O3" CACHE INTERNAL "c release compiler flags") +set(CMAKE_CXX_FLAGS_RELEASE "-O3" CACHE INTERNAL "cxx release compiler flags") +set(CMAKE_ASM_FLAGS_RELEASE "" CACHE INTERNAL "asm release compiler flags") diff --git a/cmake/arm11.cmake b/cmake/arm11.cmake new file mode 100644 index 00000000..957e1f05 --- /dev/null +++ b/cmake/arm11.cmake @@ -0,0 +1,19 @@ +# Copyright (c) 2026 Eclipse ThreadX contributors +# SPDX-License-Identifier: MIT +# Portions of this file were generated with AI assistance. +# +# Toolchain file for ARM11 using GNU tools. The port readme identifies the +# target as ARM1136J-S, which is what -mcpu selects. + +# Name of the target +set(CMAKE_SYSTEM_NAME Generic) +set(CMAKE_SYSTEM_PROCESSOR arm1136j-s) + +set(THREADX_ARCH "arm11") +set(THREADX_TOOLCHAIN "gnu") + +set(MCPU_FLAGS "-marm -mcpu=arm1136j-s") +set(VFP_FLAGS "") +set(SPEC_FLAGS "--specs=nosys.specs") + +include(${CMAKE_CURRENT_LIST_DIR}/arm-none-eabi.cmake) diff --git a/cmake/arm9.cmake b/cmake/arm9.cmake new file mode 100644 index 00000000..436d232e --- /dev/null +++ b/cmake/arm9.cmake @@ -0,0 +1,19 @@ +# Copyright (c) 2026 Eclipse ThreadX contributors +# SPDX-License-Identifier: MIT +# Portions of this file were generated with AI assistance. +# +# Toolchain file for ARM9 using GNU tools. This is the oldest core in the +# CMake build; the port readme names ARM9 itself. + +# Name of the target +set(CMAKE_SYSTEM_NAME Generic) +set(CMAKE_SYSTEM_PROCESSOR arm9) + +set(THREADX_ARCH "arm9") +set(THREADX_TOOLCHAIN "gnu") + +set(MCPU_FLAGS "-marm -mcpu=arm9") +set(VFP_FLAGS "") +set(SPEC_FLAGS "--specs=nosys.specs") + +include(${CMAKE_CURRENT_LIST_DIR}/arm-none-eabi.cmake) diff --git a/cmake/cortex_a12.cmake b/cmake/cortex_a12.cmake new file mode 100644 index 00000000..4c5a603e --- /dev/null +++ b/cmake/cortex_a12.cmake @@ -0,0 +1,18 @@ +# Copyright (c) 2026 Eclipse ThreadX contributors +# SPDX-License-Identifier: MIT +# Portions of this file were generated with AI assistance. +# +# Toolchain file for Arm Cortex-A12 using GNU tools. + +# Name of the target +set(CMAKE_SYSTEM_NAME Generic) +set(CMAKE_SYSTEM_PROCESSOR cortex-a12) + +set(THREADX_ARCH "cortex_a12") +set(THREADX_TOOLCHAIN "gnu") + +set(MCPU_FLAGS "-marm -mcpu=cortex-a12") +set(VFP_FLAGS "") +set(SPEC_FLAGS "--specs=nosys.specs") + +include(${CMAKE_CURRENT_LIST_DIR}/arm-none-eabi.cmake) diff --git a/cmake/cortex_a15.cmake b/cmake/cortex_a15.cmake new file mode 100644 index 00000000..30ab71d2 --- /dev/null +++ b/cmake/cortex_a15.cmake @@ -0,0 +1,18 @@ +# Copyright (c) 2026 Eclipse ThreadX contributors +# SPDX-License-Identifier: MIT +# Portions of this file were generated with AI assistance. +# +# Toolchain file for Arm Cortex-A15 using GNU tools. + +# Name of the target +set(CMAKE_SYSTEM_NAME Generic) +set(CMAKE_SYSTEM_PROCESSOR cortex-a15) + +set(THREADX_ARCH "cortex_a15") +set(THREADX_TOOLCHAIN "gnu") + +set(MCPU_FLAGS "-marm -mcpu=cortex-a15") +set(VFP_FLAGS "") +set(SPEC_FLAGS "--specs=nosys.specs") + +include(${CMAKE_CURRENT_LIST_DIR}/arm-none-eabi.cmake) diff --git a/cmake/cortex_a17.cmake b/cmake/cortex_a17.cmake new file mode 100644 index 00000000..c0f7e86b --- /dev/null +++ b/cmake/cortex_a17.cmake @@ -0,0 +1,18 @@ +# Copyright (c) 2026 Eclipse ThreadX contributors +# SPDX-License-Identifier: MIT +# Portions of this file were generated with AI assistance. +# +# Toolchain file for Arm Cortex-A17 using GNU tools. + +# Name of the target +set(CMAKE_SYSTEM_NAME Generic) +set(CMAKE_SYSTEM_PROCESSOR cortex-a17) + +set(THREADX_ARCH "cortex_a17") +set(THREADX_TOOLCHAIN "gnu") + +set(MCPU_FLAGS "-marm -mcpu=cortex-a17") +set(VFP_FLAGS "") +set(SPEC_FLAGS "--specs=nosys.specs") + +include(${CMAKE_CURRENT_LIST_DIR}/arm-none-eabi.cmake) diff --git a/cmake/cortex_a34.cmake b/cmake/cortex_a34.cmake new file mode 100644 index 00000000..14d244ea --- /dev/null +++ b/cmake/cortex_a34.cmake @@ -0,0 +1,18 @@ +# Copyright (c) 2026 Eclipse ThreadX contributors +# SPDX-License-Identifier: MIT +# Portions of this file were generated with AI assistance. +# +# Toolchain file for Arm Cortex-A34 using GNU tools. + +# Name of the target +set(CMAKE_SYSTEM_NAME Generic) +set(CMAKE_SYSTEM_PROCESSOR cortex-a34) + +set(THREADX_ARCH "cortex_a34") +set(THREADX_TOOLCHAIN "gnu") + +set(MCPU_FLAGS "-mcpu=cortex-a34") +set(VFP_FLAGS "") +set(SPEC_FLAGS "--specs=nosys.specs") + +include(${CMAKE_CURRENT_LIST_DIR}/aarch64-none-elf.cmake) diff --git a/cmake/cortex_a35.cmake b/cmake/cortex_a35.cmake new file mode 100644 index 00000000..60107e31 --- /dev/null +++ b/cmake/cortex_a35.cmake @@ -0,0 +1,18 @@ +# Copyright (c) 2026 Eclipse ThreadX contributors +# SPDX-License-Identifier: MIT +# Portions of this file were generated with AI assistance. +# +# Toolchain file for Arm Cortex-A35 using GNU tools. + +# Name of the target +set(CMAKE_SYSTEM_NAME Generic) +set(CMAKE_SYSTEM_PROCESSOR cortex-a35) + +set(THREADX_ARCH "cortex_a35") +set(THREADX_TOOLCHAIN "gnu") + +set(MCPU_FLAGS "-mcpu=cortex-a35") +set(VFP_FLAGS "") +set(SPEC_FLAGS "--specs=nosys.specs") + +include(${CMAKE_CURRENT_LIST_DIR}/aarch64-none-elf.cmake) diff --git a/cmake/cortex_a5.cmake b/cmake/cortex_a5.cmake new file mode 100644 index 00000000..501695db --- /dev/null +++ b/cmake/cortex_a5.cmake @@ -0,0 +1,18 @@ +# Copyright (c) 2026 Eclipse ThreadX contributors +# SPDX-License-Identifier: MIT +# Portions of this file were generated with AI assistance. +# +# Toolchain file for Arm Cortex-A5 using GNU tools. + +# Name of the target +set(CMAKE_SYSTEM_NAME Generic) +set(CMAKE_SYSTEM_PROCESSOR cortex-a5) + +set(THREADX_ARCH "cortex_a5") +set(THREADX_TOOLCHAIN "gnu") + +set(MCPU_FLAGS "-marm -mcpu=cortex-a5") +set(VFP_FLAGS "") +set(SPEC_FLAGS "--specs=nosys.specs") + +include(${CMAKE_CURRENT_LIST_DIR}/arm-none-eabi.cmake) diff --git a/cmake/cortex_a53.cmake b/cmake/cortex_a53.cmake new file mode 100644 index 00000000..97580857 --- /dev/null +++ b/cmake/cortex_a53.cmake @@ -0,0 +1,18 @@ +# Copyright (c) 2026 Eclipse ThreadX contributors +# SPDX-License-Identifier: MIT +# Portions of this file were generated with AI assistance. +# +# Toolchain file for Arm Cortex-A53 using GNU tools. + +# Name of the target +set(CMAKE_SYSTEM_NAME Generic) +set(CMAKE_SYSTEM_PROCESSOR cortex-a53) + +set(THREADX_ARCH "cortex_a53") +set(THREADX_TOOLCHAIN "gnu") + +set(MCPU_FLAGS "-mcpu=cortex-a53") +set(VFP_FLAGS "") +set(SPEC_FLAGS "--specs=nosys.specs") + +include(${CMAKE_CURRENT_LIST_DIR}/aarch64-none-elf.cmake) diff --git a/cmake/cortex_a55.cmake b/cmake/cortex_a55.cmake new file mode 100644 index 00000000..fd13fd27 --- /dev/null +++ b/cmake/cortex_a55.cmake @@ -0,0 +1,18 @@ +# Copyright (c) 2026 Eclipse ThreadX contributors +# SPDX-License-Identifier: MIT +# Portions of this file were generated with AI assistance. +# +# Toolchain file for Arm Cortex-A55 using GNU tools. + +# Name of the target +set(CMAKE_SYSTEM_NAME Generic) +set(CMAKE_SYSTEM_PROCESSOR cortex-a55) + +set(THREADX_ARCH "cortex_a55") +set(THREADX_TOOLCHAIN "gnu") + +set(MCPU_FLAGS "-mcpu=cortex-a55") +set(VFP_FLAGS "") +set(SPEC_FLAGS "--specs=nosys.specs") + +include(${CMAKE_CURRENT_LIST_DIR}/aarch64-none-elf.cmake) diff --git a/cmake/cortex_a57.cmake b/cmake/cortex_a57.cmake new file mode 100644 index 00000000..ca2a1902 --- /dev/null +++ b/cmake/cortex_a57.cmake @@ -0,0 +1,18 @@ +# Copyright (c) 2026 Eclipse ThreadX contributors +# SPDX-License-Identifier: MIT +# Portions of this file were generated with AI assistance. +# +# Toolchain file for Arm Cortex-A57 using GNU tools. + +# Name of the target +set(CMAKE_SYSTEM_NAME Generic) +set(CMAKE_SYSTEM_PROCESSOR cortex-a57) + +set(THREADX_ARCH "cortex_a57") +set(THREADX_TOOLCHAIN "gnu") + +set(MCPU_FLAGS "-mcpu=cortex-a57") +set(VFP_FLAGS "") +set(SPEC_FLAGS "--specs=nosys.specs") + +include(${CMAKE_CURRENT_LIST_DIR}/aarch64-none-elf.cmake) diff --git a/cmake/cortex_a5x.cmake b/cmake/cortex_a5x.cmake new file mode 100644 index 00000000..b212cb87 --- /dev/null +++ b/cmake/cortex_a5x.cmake @@ -0,0 +1,20 @@ +# Copyright (c) 2026 Eclipse ThreadX contributors +# SPDX-License-Identifier: MIT +# Portions of this file were generated with AI assistance. +# +# Toolchain file for the Arm Cortex-A5x SMP port using GNU tools. That port +# targets the family rather than one core: its readme and example name A53, +# A55 and A57, so -mcpu selects Cortex-A53, the baseline of the three. + +# Name of the target +set(CMAKE_SYSTEM_NAME Generic) +set(CMAKE_SYSTEM_PROCESSOR cortex-a53) + +set(THREADX_ARCH "cortex_a5x") +set(THREADX_TOOLCHAIN "gnu") + +set(MCPU_FLAGS "-mcpu=cortex-a53") +set(VFP_FLAGS "") +set(SPEC_FLAGS "--specs=nosys.specs") + +include(${CMAKE_CURRENT_LIST_DIR}/aarch64-none-elf.cmake) diff --git a/cmake/cortex_a65.cmake b/cmake/cortex_a65.cmake new file mode 100644 index 00000000..6011522c --- /dev/null +++ b/cmake/cortex_a65.cmake @@ -0,0 +1,18 @@ +# Copyright (c) 2026 Eclipse ThreadX contributors +# SPDX-License-Identifier: MIT +# Portions of this file were generated with AI assistance. +# +# Toolchain file for Arm Cortex-A65 using GNU tools. + +# Name of the target +set(CMAKE_SYSTEM_NAME Generic) +set(CMAKE_SYSTEM_PROCESSOR cortex-a65) + +set(THREADX_ARCH "cortex_a65") +set(THREADX_TOOLCHAIN "gnu") + +set(MCPU_FLAGS "-mcpu=cortex-a65") +set(VFP_FLAGS "") +set(SPEC_FLAGS "--specs=nosys.specs") + +include(${CMAKE_CURRENT_LIST_DIR}/aarch64-none-elf.cmake) diff --git a/cmake/cortex_a65ae.cmake b/cmake/cortex_a65ae.cmake new file mode 100644 index 00000000..d0bf1d50 --- /dev/null +++ b/cmake/cortex_a65ae.cmake @@ -0,0 +1,18 @@ +# Copyright (c) 2026 Eclipse ThreadX contributors +# SPDX-License-Identifier: MIT +# Portions of this file were generated with AI assistance. +# +# Toolchain file for Arm Cortex-A65ae using GNU tools. + +# Name of the target +set(CMAKE_SYSTEM_NAME Generic) +set(CMAKE_SYSTEM_PROCESSOR cortex-a65ae) + +set(THREADX_ARCH "cortex_a65ae") +set(THREADX_TOOLCHAIN "gnu") + +set(MCPU_FLAGS "-mcpu=cortex-a65ae") +set(VFP_FLAGS "") +set(SPEC_FLAGS "--specs=nosys.specs") + +include(${CMAKE_CURRENT_LIST_DIR}/aarch64-none-elf.cmake) diff --git a/cmake/cortex_a7.cmake b/cmake/cortex_a7.cmake new file mode 100644 index 00000000..2f0fb5c8 --- /dev/null +++ b/cmake/cortex_a7.cmake @@ -0,0 +1,18 @@ +# Copyright (c) 2026 Eclipse ThreadX contributors +# SPDX-License-Identifier: MIT +# Portions of this file were generated with AI assistance. +# +# Toolchain file for Arm Cortex-A7 using GNU tools. + +# Name of the target +set(CMAKE_SYSTEM_NAME Generic) +set(CMAKE_SYSTEM_PROCESSOR cortex-a7) + +set(THREADX_ARCH "cortex_a7") +set(THREADX_TOOLCHAIN "gnu") + +set(MCPU_FLAGS "-marm -mcpu=cortex-a7") +set(VFP_FLAGS "") +set(SPEC_FLAGS "--specs=nosys.specs") + +include(${CMAKE_CURRENT_LIST_DIR}/arm-none-eabi.cmake) diff --git a/cmake/cortex_a72.cmake b/cmake/cortex_a72.cmake new file mode 100644 index 00000000..3e07e47d --- /dev/null +++ b/cmake/cortex_a72.cmake @@ -0,0 +1,18 @@ +# Copyright (c) 2026 Eclipse ThreadX contributors +# SPDX-License-Identifier: MIT +# Portions of this file were generated with AI assistance. +# +# Toolchain file for Arm Cortex-A72 using GNU tools. + +# Name of the target +set(CMAKE_SYSTEM_NAME Generic) +set(CMAKE_SYSTEM_PROCESSOR cortex-a72) + +set(THREADX_ARCH "cortex_a72") +set(THREADX_TOOLCHAIN "gnu") + +set(MCPU_FLAGS "-mcpu=cortex-a72") +set(VFP_FLAGS "") +set(SPEC_FLAGS "--specs=nosys.specs") + +include(${CMAKE_CURRENT_LIST_DIR}/aarch64-none-elf.cmake) diff --git a/cmake/cortex_a73.cmake b/cmake/cortex_a73.cmake new file mode 100644 index 00000000..eb95c4f1 --- /dev/null +++ b/cmake/cortex_a73.cmake @@ -0,0 +1,18 @@ +# Copyright (c) 2026 Eclipse ThreadX contributors +# SPDX-License-Identifier: MIT +# Portions of this file were generated with AI assistance. +# +# Toolchain file for Arm Cortex-A73 using GNU tools. + +# Name of the target +set(CMAKE_SYSTEM_NAME Generic) +set(CMAKE_SYSTEM_PROCESSOR cortex-a73) + +set(THREADX_ARCH "cortex_a73") +set(THREADX_TOOLCHAIN "gnu") + +set(MCPU_FLAGS "-mcpu=cortex-a73") +set(VFP_FLAGS "") +set(SPEC_FLAGS "--specs=nosys.specs") + +include(${CMAKE_CURRENT_LIST_DIR}/aarch64-none-elf.cmake) diff --git a/cmake/cortex_a75.cmake b/cmake/cortex_a75.cmake new file mode 100644 index 00000000..851a6f90 --- /dev/null +++ b/cmake/cortex_a75.cmake @@ -0,0 +1,18 @@ +# Copyright (c) 2026 Eclipse ThreadX contributors +# SPDX-License-Identifier: MIT +# Portions of this file were generated with AI assistance. +# +# Toolchain file for Arm Cortex-A75 using GNU tools. + +# Name of the target +set(CMAKE_SYSTEM_NAME Generic) +set(CMAKE_SYSTEM_PROCESSOR cortex-a75) + +set(THREADX_ARCH "cortex_a75") +set(THREADX_TOOLCHAIN "gnu") + +set(MCPU_FLAGS "-mcpu=cortex-a75") +set(VFP_FLAGS "") +set(SPEC_FLAGS "--specs=nosys.specs") + +include(${CMAKE_CURRENT_LIST_DIR}/aarch64-none-elf.cmake) diff --git a/cmake/cortex_a76.cmake b/cmake/cortex_a76.cmake new file mode 100644 index 00000000..1d3766e9 --- /dev/null +++ b/cmake/cortex_a76.cmake @@ -0,0 +1,18 @@ +# Copyright (c) 2026 Eclipse ThreadX contributors +# SPDX-License-Identifier: MIT +# Portions of this file were generated with AI assistance. +# +# Toolchain file for Arm Cortex-A76 using GNU tools. + +# Name of the target +set(CMAKE_SYSTEM_NAME Generic) +set(CMAKE_SYSTEM_PROCESSOR cortex-a76) + +set(THREADX_ARCH "cortex_a76") +set(THREADX_TOOLCHAIN "gnu") + +set(MCPU_FLAGS "-mcpu=cortex-a76") +set(VFP_FLAGS "") +set(SPEC_FLAGS "--specs=nosys.specs") + +include(${CMAKE_CURRENT_LIST_DIR}/aarch64-none-elf.cmake) diff --git a/cmake/cortex_a76ae.cmake b/cmake/cortex_a76ae.cmake new file mode 100644 index 00000000..99e4de80 --- /dev/null +++ b/cmake/cortex_a76ae.cmake @@ -0,0 +1,18 @@ +# Copyright (c) 2026 Eclipse ThreadX contributors +# SPDX-License-Identifier: MIT +# Portions of this file were generated with AI assistance. +# +# Toolchain file for Arm Cortex-A76ae using GNU tools. + +# Name of the target +set(CMAKE_SYSTEM_NAME Generic) +set(CMAKE_SYSTEM_PROCESSOR cortex-a76ae) + +set(THREADX_ARCH "cortex_a76ae") +set(THREADX_TOOLCHAIN "gnu") + +set(MCPU_FLAGS "-mcpu=cortex-a76ae") +set(VFP_FLAGS "") +set(SPEC_FLAGS "--specs=nosys.specs") + +include(${CMAKE_CURRENT_LIST_DIR}/aarch64-none-elf.cmake) diff --git a/cmake/cortex_a77.cmake b/cmake/cortex_a77.cmake new file mode 100644 index 00000000..2df67ddd --- /dev/null +++ b/cmake/cortex_a77.cmake @@ -0,0 +1,18 @@ +# Copyright (c) 2026 Eclipse ThreadX contributors +# SPDX-License-Identifier: MIT +# Portions of this file were generated with AI assistance. +# +# Toolchain file for Arm Cortex-A77 using GNU tools. + +# Name of the target +set(CMAKE_SYSTEM_NAME Generic) +set(CMAKE_SYSTEM_PROCESSOR cortex-a77) + +set(THREADX_ARCH "cortex_a77") +set(THREADX_TOOLCHAIN "gnu") + +set(MCPU_FLAGS "-mcpu=cortex-a77") +set(VFP_FLAGS "") +set(SPEC_FLAGS "--specs=nosys.specs") + +include(${CMAKE_CURRENT_LIST_DIR}/aarch64-none-elf.cmake) diff --git a/cmake/cortex_a78.cmake b/cmake/cortex_a78.cmake new file mode 100644 index 00000000..fdd8324b --- /dev/null +++ b/cmake/cortex_a78.cmake @@ -0,0 +1,18 @@ +# Copyright (c) 2026 Eclipse ThreadX contributors +# SPDX-License-Identifier: MIT +# Portions of this file were generated with AI assistance. +# +# Toolchain file for Arm Cortex-A78 using GNU tools. + +# Name of the target +set(CMAKE_SYSTEM_NAME Generic) +set(CMAKE_SYSTEM_PROCESSOR cortex-a78) + +set(THREADX_ARCH "cortex_a78") +set(THREADX_TOOLCHAIN "gnu") + +set(MCPU_FLAGS "-mcpu=cortex-a78") +set(VFP_FLAGS "") +set(SPEC_FLAGS "--specs=nosys.specs") + +include(${CMAKE_CURRENT_LIST_DIR}/aarch64-none-elf.cmake) diff --git a/cmake/cortex_a8.cmake b/cmake/cortex_a8.cmake new file mode 100644 index 00000000..92db6228 --- /dev/null +++ b/cmake/cortex_a8.cmake @@ -0,0 +1,18 @@ +# Copyright (c) 2026 Eclipse ThreadX contributors +# SPDX-License-Identifier: MIT +# Portions of this file were generated with AI assistance. +# +# Toolchain file for Arm Cortex-A8 using GNU tools. + +# Name of the target +set(CMAKE_SYSTEM_NAME Generic) +set(CMAKE_SYSTEM_PROCESSOR cortex-a8) + +set(THREADX_ARCH "cortex_a8") +set(THREADX_TOOLCHAIN "gnu") + +set(MCPU_FLAGS "-marm -mcpu=cortex-a8") +set(VFP_FLAGS "") +set(SPEC_FLAGS "--specs=nosys.specs") + +include(${CMAKE_CURRENT_LIST_DIR}/arm-none-eabi.cmake) diff --git a/cmake/cortex_m23.cmake b/cmake/cortex_m23.cmake new file mode 100644 index 00000000..a8ed7125 --- /dev/null +++ b/cmake/cortex_m23.cmake @@ -0,0 +1,19 @@ +# Copyright (c) 2026 Eclipse ThreadX contributors +# SPDX-License-Identifier: MIT +# Portions of this file were generated with AI assistance. +# +# Toolchain file for Arm Cortex-M23 using GNU tools. Armv8-M Baseline is +# Thumb only, hence -mthumb with no Arm state alternative. + +# Name of the target +set(CMAKE_SYSTEM_NAME Generic) +set(CMAKE_SYSTEM_PROCESSOR cortex-m23) + +set(THREADX_ARCH "cortex_m23") +set(THREADX_TOOLCHAIN "gnu") + +set(MCPU_FLAGS "-mthumb -mcpu=cortex-m23") +set(VFP_FLAGS "") +set(SPEC_FLAGS "--specs=nosys.specs") + +include(${CMAKE_CURRENT_LIST_DIR}/arm-none-eabi.cmake) diff --git a/cmake/cortex_m33.cmake b/cmake/cortex_m33.cmake new file mode 100644 index 00000000..c7dff48a --- /dev/null +++ b/cmake/cortex_m33.cmake @@ -0,0 +1,18 @@ +# Copyright (c) 2026 Eclipse ThreadX contributors +# SPDX-License-Identifier: MIT +# Portions of this file were generated with AI assistance. +# +# Toolchain file for Arm Cortex-M33 using GNU tools. + +# Name of the target +set(CMAKE_SYSTEM_NAME Generic) +set(CMAKE_SYSTEM_PROCESSOR cortex-m33) + +set(THREADX_ARCH "cortex_m33") +set(THREADX_TOOLCHAIN "gnu") + +set(MCPU_FLAGS "-mthumb -mcpu=cortex-m33") +set(VFP_FLAGS "") +set(SPEC_FLAGS "--specs=nosys.specs") + +include(${CMAKE_CURRENT_LIST_DIR}/arm-none-eabi.cmake) diff --git a/cmake/cortex_m52.cmake b/cmake/cortex_m52.cmake new file mode 100644 index 00000000..21a7d487 --- /dev/null +++ b/cmake/cortex_m52.cmake @@ -0,0 +1,44 @@ +# Copyright (c) 2026 Eclipse ThreadX contributors +# SPDX-License-Identifier: MIT +# Portions of this file were generated with AI assistance. +# +# Toolchain file for Arm Cortex-M52 using GNU tools. +# +# The FPU and the MVE unit come with the core, so the hard float ABI +# is selected here rather than left to the caller. scripts/check_clang.sh +# builds this core the same way. + +# Name of the target +set(CMAKE_SYSTEM_NAME Generic) +set(CMAKE_SYSTEM_PROCESSOR cortex-m52) + +set(THREADX_ARCH "cortex_m52") +set(THREADX_TOOLCHAIN "gnu") + +# The hard float ABI is not optional here: -mcpu=cortex-m52 implies Helium, and +# the soft-float variant has no matching library. +set(MCPU_FLAGS "-mthumb -mcpu=cortex-m52") +set(VFP_FLAGS "-mfloat-abi=hard") +set(SPEC_FLAGS "--specs=nosys.specs") + +include(${CMAKE_CURRENT_LIST_DIR}/arm-none-eabi.cmake) + +# Pin the reference cross toolchain, as cmake/cortex_r52.cmake does. This core +# needs it rather than merely preferring it: arm-none-eabi-gcc only learned +# -mcpu=cortex-m52 in GCC 14, so a distribution compiler on PATH is likely to +# reject the port outright. Override with -DARM_TOOLCHAIN_PATH=<dir containing +# arm-none-eabi-gcc> to build with a different compiler. The check leaves PATH +# alone when the pinned directory is absent. +# +# As in cortex_r52.cmake, the default below serves local builds and nothing +# else -- no CI job has that directory, so on a runner the EXISTS check falls +# through and the compiler comes from PATH. See the longer note there. +if(NOT DEFINED ARM_TOOLCHAIN_PATH) + set(ARM_TOOLCHAIN_PATH + "$ENV{HOME}/toolchains/arm-gnu-toolchain-14.3.rel1-x86_64-arm-none-eabi/bin") +endif() +if(EXISTS "${ARM_TOOLCHAIN_PATH}/arm-none-eabi-gcc") + set(CMAKE_C_COMPILER "${ARM_TOOLCHAIN_PATH}/arm-none-eabi-gcc") + set(CMAKE_CXX_COMPILER "${ARM_TOOLCHAIN_PATH}/arm-none-eabi-g++") + set(CMAKE_ASM_COMPILER "${ARM_TOOLCHAIN_PATH}/arm-none-eabi-gcc") +endif() diff --git a/cmake/cortex_m55.cmake b/cmake/cortex_m55.cmake new file mode 100644 index 00000000..abdf3264 --- /dev/null +++ b/cmake/cortex_m55.cmake @@ -0,0 +1,22 @@ +# Copyright (c) 2026 Eclipse ThreadX contributors +# SPDX-License-Identifier: MIT +# Portions of this file were generated with AI assistance. +# +# Toolchain file for Arm Cortex-M55 using GNU tools. +# +# The FPU and the MVE unit come with the core, so the hard float ABI +# is selected here rather than left to the caller. scripts/check_clang.sh +# builds this core the same way. + +# Name of the target +set(CMAKE_SYSTEM_NAME Generic) +set(CMAKE_SYSTEM_PROCESSOR cortex-m55) + +set(THREADX_ARCH "cortex_m55") +set(THREADX_TOOLCHAIN "gnu") + +set(MCPU_FLAGS "-mthumb -mcpu=cortex-m55") +set(VFP_FLAGS "-mfloat-abi=hard") +set(SPEC_FLAGS "--specs=nosys.specs") + +include(${CMAKE_CURRENT_LIST_DIR}/arm-none-eabi.cmake) diff --git a/cmake/cortex_m85.cmake b/cmake/cortex_m85.cmake new file mode 100644 index 00000000..e8eb7c29 --- /dev/null +++ b/cmake/cortex_m85.cmake @@ -0,0 +1,22 @@ +# Copyright (c) 2026 Eclipse ThreadX contributors +# SPDX-License-Identifier: MIT +# Portions of this file were generated with AI assistance. +# +# Toolchain file for Arm Cortex-M85 using GNU tools. +# +# The FPU and the MVE unit come with the core, so the hard float ABI +# is selected here rather than left to the caller. scripts/check_clang.sh +# builds this core the same way. + +# Name of the target +set(CMAKE_SYSTEM_NAME Generic) +set(CMAKE_SYSTEM_PROCESSOR cortex-m85) + +set(THREADX_ARCH "cortex_m85") +set(THREADX_TOOLCHAIN "gnu") + +set(MCPU_FLAGS "-mthumb -mcpu=cortex-m85") +set(VFP_FLAGS "-mfloat-abi=hard") +set(SPEC_FLAGS "--specs=nosys.specs") + +include(${CMAKE_CURRENT_LIST_DIR}/arm-none-eabi.cmake) diff --git a/cmake/cortex_r4.cmake b/cmake/cortex_r4.cmake new file mode 100644 index 00000000..88b5ce9e --- /dev/null +++ b/cmake/cortex_r4.cmake @@ -0,0 +1,18 @@ +# Copyright (c) 2026 Eclipse ThreadX contributors +# SPDX-License-Identifier: MIT +# Portions of this file were generated with AI assistance. +# +# Toolchain file for Arm Cortex-R4 using GNU tools. + +# Name of the target +set(CMAKE_SYSTEM_NAME Generic) +set(CMAKE_SYSTEM_PROCESSOR cortex-r4) + +set(THREADX_ARCH "cortex_r4") +set(THREADX_TOOLCHAIN "gnu") + +set(MCPU_FLAGS "-marm -mcpu=cortex-r4") +set(VFP_FLAGS "") +set(SPEC_FLAGS "--specs=nosys.specs") + +include(${CMAKE_CURRENT_LIST_DIR}/arm-none-eabi.cmake) diff --git a/cmake/cortex_r5.cmake b/cmake/cortex_r5.cmake new file mode 100644 index 00000000..6050a4c9 --- /dev/null +++ b/cmake/cortex_r5.cmake @@ -0,0 +1,18 @@ +# Copyright (c) 2026 Eclipse ThreadX contributors +# SPDX-License-Identifier: MIT +# Portions of this file were generated with AI assistance. +# +# Toolchain file for Arm Cortex-R5 using GNU tools. + +# Name of the target +set(CMAKE_SYSTEM_NAME Generic) +set(CMAKE_SYSTEM_PROCESSOR cortex-r5) + +set(THREADX_ARCH "cortex_r5") +set(THREADX_TOOLCHAIN "gnu") + +set(MCPU_FLAGS "-marm -mcpu=cortex-r5") +set(VFP_FLAGS "") +set(SPEC_FLAGS "--specs=nosys.specs") + +include(${CMAKE_CURRENT_LIST_DIR}/arm-none-eabi.cmake) diff --git a/cmake/cortex_r52.cmake b/cmake/cortex_r52.cmake new file mode 100644 index 00000000..183782c9 --- /dev/null +++ b/cmake/cortex_r52.cmake @@ -0,0 +1,55 @@ +# Copyright (c) 2026 Eclipse ThreadX contributors +# SPDX-License-Identifier: MIT +# Portions of this file were generated with AI assistance. +# +# Toolchain file for Arm Cortex-R52 (Armv8-R, AArch32) using GNU tools. + +# Name of the target +set(CMAKE_SYSTEM_NAME Generic) +set(CMAKE_SYSTEM_PROCESSOR cortex-r52) + +set(THREADX_ARCH "cortex_r52") +set(THREADX_TOOLCHAIN "gnu") + +# Floating-point ABI. Cortex-R52 always implements at least a single-precision +# FPU -- GCC rejects "+nofp" for this core and offers only "+nofp.dp" (drop +# double precision). There is therefore no FPU-less R52, so the soft-float +# baseline selects the soft *ABI* rather than removing the FPU. The hard-float +# variant with lazy VFP context save arrives with AR1 milestone M5. +if(NOT DEFINED TX_R52_FLOAT_ABI) + set(TX_R52_FLOAT_ABI "soft" CACHE STRING "R52 float ABI: soft | hard") +endif() + +set(MCPU_FLAGS "-marm -mcpu=cortex-r52") +if(TX_R52_FLOAT_ABI STREQUAL "hard") + set(VFP_FLAGS "-mfpu=fpv5-d16 -mfloat-abi=hard") +else() + set(VFP_FLAGS "-mfloat-abi=soft") +endif() +set(SPEC_FLAGS "--specs=nosys.specs") + +include(${CMAKE_CURRENT_LIST_DIR}/arm-none-eabi.cmake) + +# Pin the project's reference cross toolchain, GCC 14 for Arm. An absolute +# path is used deliberately, so that a build on a machine which has it does not +# depend on PATH ordering. Override with -DARM_TOOLCHAIN_PATH=<dir containing +# arm-none-eabi-gcc> to build with a different compiler -- for example the +# advisory newest-compiler lane. +# +# The default below serves local builds and nothing else. It fires only on a +# machine that already has that directory, and no CI job does: the workflows +# unpack the toolchain into the workspace and put it on PATH, and +# scripts/check_gcc.sh passes -DARM_TOOLCHAIN_PATH at every CMake call site. +# On a runner the EXISTS check therefore falls through and the compiler comes +# from PATH. Do not read the default as something CI depends on -- and do not +# remove it as dead code either, because it is what makes a no-flag build work +# on a developer machine. +if(NOT DEFINED ARM_TOOLCHAIN_PATH) + set(ARM_TOOLCHAIN_PATH + "$ENV{HOME}/toolchains/arm-gnu-toolchain-14.3.rel1-x86_64-arm-none-eabi/bin") +endif() +if(EXISTS "${ARM_TOOLCHAIN_PATH}/arm-none-eabi-gcc") + set(CMAKE_C_COMPILER "${ARM_TOOLCHAIN_PATH}/arm-none-eabi-gcc") + set(CMAKE_CXX_COMPILER "${ARM_TOOLCHAIN_PATH}/arm-none-eabi-g++") + set(CMAKE_ASM_COMPILER "${ARM_TOOLCHAIN_PATH}/arm-none-eabi-gcc") +endif() diff --git a/cmake/cortex_r52_clang.cmake b/cmake/cortex_r52_clang.cmake new file mode 100644 index 00000000..f5669efa --- /dev/null +++ b/cmake/cortex_r52_clang.cmake @@ -0,0 +1,84 @@ +# Copyright (c) 2026 Eclipse ThreadX contributors +# SPDX-License-Identifier: MIT +# Portions of this file were generated with AI assistance. +# +# Toolchain file for Arm Cortex-R52 (Armv8-R, AArch32) using Arm Toolchain for +# Embedded, which is LLVM based and is the successor to Arm Compiler 6. +# +# There is no separate clang port directory: this builds the gnu port sources +# with a different compiler, which is the same thing scripts/check_clang.sh does +# for every other Arm port. THREADX_TOOLCHAIN stays "gnu" for that reason. +# +# cmake -S . -B build -G Ninja \ +# -DCMAKE_TOOLCHAIN_FILE=cmake/cortex_r52_clang.cmake \ +# -DTX_R52_BUILD_FVP_EXAMPLE=ON + +set(CMAKE_SYSTEM_NAME Generic) +set(CMAKE_SYSTEM_PROCESSOR cortex-r52) + +set(THREADX_ARCH "cortex_r52") +set(THREADX_TOOLCHAIN "gnu") + +# Tool names as found on PATH, which is what CI uses: the workflow unpacks the +# toolchain into the workspace and scripts/check_clang.sh passes its location +# through as ATFE_TOOLCHAIN_PATH. +set(CMAKE_C_COMPILER clang) +set(CMAKE_CXX_COMPILER clang++) +set(CMAKE_ASM_COMPILER clang) +set(CMAKE_AR llvm-ar) +set(CMAKE_RANLIB llvm-ranlib) +set(OBJCOPY llvm-objcopy) +set(OBJDUMP llvm-objdump) +set(SIZE llvm-size) + +# Then pin a specific install if one is present, the way cortex_r52.cmake pins +# the GNU toolchain and for the same reason: a local build should not depend on +# PATH ordering. Absent that directory this falls back to the names above rather +# than failing, so the file works on a machine that keeps clang elsewhere. +# Override with -DATFE_TOOLCHAIN_PATH=<dir containing clang>. +if(NOT DEFINED ATFE_TOOLCHAIN_PATH) + set(ATFE_TOOLCHAIN_PATH "$ENV{HOME}/toolchains/ATfE-22.1.0-Linux-x86_64/bin") +endif() +if(EXISTS "${ATFE_TOOLCHAIN_PATH}/clang") + set(CMAKE_C_COMPILER "${ATFE_TOOLCHAIN_PATH}/clang") + set(CMAKE_CXX_COMPILER "${ATFE_TOOLCHAIN_PATH}/clang++") + set(CMAKE_ASM_COMPILER "${ATFE_TOOLCHAIN_PATH}/clang") + set(CMAKE_AR "${ATFE_TOOLCHAIN_PATH}/llvm-ar") + set(CMAKE_RANLIB "${ATFE_TOOLCHAIN_PATH}/llvm-ranlib") + set(OBJCOPY "${ATFE_TOOLCHAIN_PATH}/llvm-objcopy") + set(OBJDUMP "${ATFE_TOOLCHAIN_PATH}/llvm-objdump") + set(SIZE "${ATFE_TOOLCHAIN_PATH}/llvm-size") +endif() + +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) + +# Link the try-compile as a static library, so probing the compiler does not +# need a linker script or a target C library. +set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) + +if(NOT DEFINED TX_R52_FLOAT_ABI) + set(TX_R52_FLOAT_ABI "soft" CACHE STRING "R52 float ABI: soft | hard") +endif() + +set(MCPU_FLAGS "--target=arm-none-eabi -marm -mcpu=cortex-r52") +if(TX_R52_FLOAT_ABI STREQUAL "hard") + set(VFP_FLAGS "-mfpu=fpv5-d16 -mfloat-abi=hard") +else() + set(VFP_FLAGS "-mfloat-abi=soft") +endif() + +set(CMAKE_C_FLAGS "${MCPU_FLAGS} ${VFP_FLAGS} -fdata-sections -ffunction-sections -mlong-calls" CACHE INTERNAL "c compiler flags") +set(CMAKE_CXX_FLAGS "${MCPU_FLAGS} ${VFP_FLAGS} -fdata-sections -ffunction-sections -fno-rtti -fno-exceptions -mlong-calls" CACHE INTERNAL "cxx compiler flags") +set(CMAKE_ASM_FLAGS "${MCPU_FLAGS} ${VFP_FLAGS} -x assembler-with-cpp" CACHE INTERNAL "asm compiler flags") +set(CMAKE_EXE_LINKER_FLAGS "${MCPU_FLAGS} ${VFP_FLAGS} -fuse-ld=lld -Wl,--gc-sections" CACHE INTERNAL "exe link flags") + +set(CMAKE_C_FLAGS_DEBUG "-Og -g" CACHE INTERNAL "c debug compiler flags") +set(CMAKE_CXX_FLAGS_DEBUG "-Og -g" CACHE INTERNAL "cxx debug compiler flags") +set(CMAKE_ASM_FLAGS_DEBUG "-g" CACHE INTERNAL "asm debug compiler flags") + +set(CMAKE_C_FLAGS_RELEASE "-O3" CACHE INTERNAL "c release compiler flags") +set(CMAKE_CXX_FLAGS_RELEASE "-O3" CACHE INTERNAL "cxx release compiler flags") +set(CMAKE_ASM_FLAGS_RELEASE "" CACHE INTERNAL "asm release compiler flags") diff --git a/cmake/linux.cmake b/cmake/linux.cmake index 192425c6..55cd5e00 100644 --- a/cmake/linux.cmake +++ b/cmake/linux.cmake @@ -1,8 +1,25 @@ set(CMAKE_SYSTEM_NAME Linux) set(CMAKE_SYSTEM_PROCESSOR x86_64) -set(CMAKE_C_COMPILER gcc) -set(CMAKE_CXX_COMPILER g++) +# Let the compiler be chosen on the command line or from the environment, for example +# -DCMAKE_C_COMPILER=gcc-14 or CC=gcc-14. CMake reads a toolchain file before it consults +# CC and CXX, so setting these unconditionally would quietly override both and leave no +# way to build with anything but the distribution's default gcc. +if(NOT DEFINED CMAKE_C_COMPILER) + if(DEFINED ENV{CC}) + set(CMAKE_C_COMPILER $ENV{CC}) + else() + set(CMAKE_C_COMPILER gcc) + endif() +endif() + +if(NOT DEFINED CMAKE_CXX_COMPILER) + if(DEFINED ENV{CXX}) + set(CMAKE_CXX_COMPILER $ENV{CXX}) + else() + set(CMAKE_CXX_COMPILER g++) + endif() +endif() set(AS as) set(AR ar) set(OBJCOPY objcopy) diff --git a/cmake/riscv32-unknown-elf.cmake b/cmake/riscv32-unknown-elf.cmake index d21e729c..b428dc8e 100644 --- a/cmake/riscv32-unknown-elf.cmake +++ b/cmake/riscv32-unknown-elf.cmake @@ -20,7 +20,7 @@ set(CMAKE_CXX_FLAGS "${CXXFLAGS}" CACHE INTERNAL "cxx compiler flags") if(DEFINED SOFT_FLOAT) set(CMAKE_ASM_FLAGS "${ASFLAGS} -D__ASSEMBLER__" CACHE INTERNAL "asm compiler flags") else() - set(CMAKE_ASM_FLAGS "${ASFLAGS} -D__ASSEMBLER__ -D__riscv_float_abi_single" CACHE INTERNAL "asm compiler flags") + set(CMAKE_ASM_FLAGS "${ASFLAGS} -D__ASSEMBLER__" CACHE INTERNAL "asm compiler flags") endif() set(CMAKE_EXE_LINKER_FLAGS "${LDFLAGS}" CACHE INTERNAL "exe link flags") diff --git a/cmake/riscv32_gnu.cmake b/cmake/riscv32_gnu.cmake index 6843423c..584cbf0e 100644 --- a/cmake/riscv32_gnu.cmake +++ b/cmake/riscv32_gnu.cmake @@ -5,7 +5,7 @@ set(THREADX_ARCH "risc-v32") set(THREADX_TOOLCHAIN "gnu") if(DEFINED SOFT_FLOAT) set(ARCH_FLAGS "-g -march=rv32ima_zicsr -mabi=ilp32 -mcmodel=medany") - set(CACHE{SOFT_FLOAT} FORCE 1) + set(SOFT_FLOAT 1 CACHE BOOL "build the soft-float rv32ima_zicsr/ilp32 configuration" FORCE) else() set(ARCH_FLAGS "-g -march=rv32gc -mabi=ilp32d -mcmodel=medany -mrelax") endif() |
