Skip to content

Commit

Permalink
Adds toolchain file for Raspberry Pi 5
Browse files Browse the repository at this point in the history
Signed-off-by: tinyboxvk <13696594+tinyboxvk@users.noreply.github.com>
  • Loading branch information
tinyboxvk committed Nov 16, 2024
1 parent 4824b55 commit 8541777
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
during each year in the range, inclusive.
21 changes: 21 additions & 0 deletions cmake/Toolchains/arm_cortex_a76_hardfp_native.cmake
Original file line number Diff line number Diff line change
@@ -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=<this file> <source directory>
########################################################################
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

0 comments on commit 8541777

Please sign in to comment.