Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds toolchain file for Raspberry Pi 5 #778

Merged
merged 1 commit into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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