From 85417770ce86527e553dadc56074868fc54b2a04 Mon Sep 17 00:00:00 2001 From: tinyboxvk <13696594+tinyboxvk@users.noreply.github.com> Date: Sat, 16 Nov 2024 17:59:19 -0400 Subject: [PATCH] Adds toolchain file for Raspberry Pi 5 Signed-off-by: tinyboxvk <13696594+tinyboxvk@users.noreply.github.com> --- README.md | 5 +++-- .../arm_cortex_a76_hardfp_native.cmake | 21 +++++++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 cmake/Toolchains/arm_cortex_a76_hardfp_native.cmake diff --git a/README.md b/README.md index 9f1f0d04..799b670e 100644 --- a/README.md +++ b/README.md @@ -74,12 +74,13 @@ To build for these boards you need specify the correct cmake toolchain file for _Note: There is no need for adding extra options to the compiler for 64 bit._ +* Raspberry Pi 5 `arm_cortex_a76_hardfp_native.cmake` * Raspberry Pi 4 `arm_cortex_a72_hardfp_native.cmake` * Raspberry Pi 3 `arm_cortex_a53_hardfp_native.cmake` ```bash $ mkdir build && cd build -$ cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchains/arm_cortex_a72_hardfp_native.cmake .. +$ cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchains/arm_cortex_a76_hardfp_native.cmake .. # make -j4 might be faster $ make $ make test @@ -136,4 +137,4 @@ notices at the top of source files list which years changes have been made. For some files, changes have occurred in many consecutive years. These files may often have the format of a year range (e.g., "2006 - 2011"), which indicates that these files have had copyrightable changes made -during each year in the range, inclusive. \ No newline at end of file +during each year in the range, inclusive. diff --git a/cmake/Toolchains/arm_cortex_a76_hardfp_native.cmake b/cmake/Toolchains/arm_cortex_a76_hardfp_native.cmake new file mode 100644 index 00000000..a540c933 --- /dev/null +++ b/cmake/Toolchains/arm_cortex_a76_hardfp_native.cmake @@ -0,0 +1,21 @@ +# +# This file is part of VOLK +# +# SPDX-License-Identifier: LGPL-3.0-or-later +# + +######################################################################## +# Toolchain file for building native on a ARM Cortex A76 w/ NEON +# Usage: cmake -DCMAKE_TOOLCHAIN_FILE= +######################################################################## +set(CMAKE_CXX_COMPILER g++) +set(CMAKE_C_COMPILER gcc) +set(CMAKE_CXX_FLAGS + "-march=armv8.2-a -mtune=cortex-a76 -mfpu=neon-fp-armv8 -mfloat-abi=hard" + CACHE STRING "" FORCE) +set(CMAKE_C_FLAGS + ${CMAKE_CXX_FLAGS} + CACHE STRING "" FORCE) #same flags for C sources +set(CMAKE_ASM_FLAGS + "${CMAKE_CXX_FLAGS} -mthumb -g" + CACHE STRING "" FORCE) #same flags for asm sources