Skip to content
This repository was archived by the owner on Apr 13, 2021. It is now read-only.

Commit e92adb0

Browse files
committed
Merge pull request #327 from jacobmcnamee/toolchain
Add cortex-a9 to toolchain file
2 parents 901e251 + d6e3510 commit e92adb0

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ script:
4949
- make check-style
5050
# Install locally to avoid sudo
5151
- make DESTDIR="./install" install
52-
# Test ARM cross-compile
52+
# Test cortex-m4 cross-compile
5353
- cd $TRAVIS_BUILD_DIR
5454
- mkdir build_arm
5555
- cd build_arm/
56-
- cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-gcc-arm-embedded.cmake ../
56+
- cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-gcc-arm-embedded.cmake -DCMAKE_SYSTEM_PROCESSOR=cortex-m4 ../
5757
- make
5858
# Test libswiftnav-python
5959
- cd ../python
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/* arith.h definitions for ARM Cortex-A9
2+
* Calculated by running arithchk on an ZYNQ7000 target. */
3+
#define IEEE_8087
4+
#define Arith_Kind_ASL 1
5+
#define Double_Align
6+
#define QNaN0 0x0
7+
#define QNaN1 0x7ff80000

cmake/Toolchain-gcc-arm-embedded.cmake

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ include(CMakeForceCompiler)
1515

1616
# Targeting an embedded system, no OS.
1717
set(CMAKE_SYSTEM_NAME Generic)
18-
set(CMAKE_SYSTEM_PROCESSOR cortex-m4)
1918

2019
CMAKE_FORCE_C_COMPILER(arm-none-eabi-gcc GNU)
2120
CMAKE_FORCE_CXX_COMPILER(arm-none-eabi-g++ GNU)
@@ -47,10 +46,7 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
4746
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
4847
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
4948

50-
set(CMAKE_C_FLAGS
51-
"${CMAKE_C_FLAGS}"
52-
"-fno-common -ffunction-sections -fdata-sections"
53-
)
49+
set(CMAKE_C_FLAGS "-fno-common -ffunction-sections -fdata-sections")
5450

5551
if (CMAKE_SYSTEM_PROCESSOR STREQUAL "cortex-m4")
5652

@@ -68,6 +64,14 @@ elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "cortex-m3")
6864
"-msoft-float"
6965
)
7066

67+
elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "cortex-a9")
68+
69+
set(CMAKE_C_FLAGS
70+
"${CMAKE_C_FLAGS}"
71+
"-mcpu=cortex-a9 -march=armv7-a -mthumb"
72+
"-mfloat-abi=hard -mfpu=neon"
73+
)
74+
7175
else ()
7276
message(WARNING
7377
"Processor not recognised in toolchain file, "

0 commit comments

Comments
 (0)