Page MenuHomePhabricator

Fail to compile PSoC64 with GNUARM
Closed, ResolvedPublic

Description

This patch causing compiling error on PSoC64 platform

254ee97369 Core: Move PSA API to SPRTL

Based on code

cba9078290 (HEAD, origin/master, origin/HEAD) Core: Suppress NS jumping message

With compiler (GNUARM)

arm-none-eabi-gcc (GNU Tools for Arm Embedded Processors 8-2019-q3-update) 8.3.1 20190703 (release) [gcc-8-branch revision 273027]

On Regression IPC Level 2 configuration

Command example:

$ cmake ../ -G"Unix Makefiles" -DPROJ_CONFIG=`readlink -f ../configs/ConfigRegressionIPCTfmLevel2.cmake` -DTARGET_PLATFORM=psoc64 -DCOMPILER=GNUARM -DBL2=False -DCMAKE_BUILD_TYPE=Release
$ cmake --build . -- -j

Error:

[  0%] Building C object secure_fw/lib/sprt/CMakeFiles/libtfmsprt.dir/__/__/__/interface/src/psa/psa_client.o
/tmp/cc1kP379.s: Assembler messages:
/tmp/cc1kP379.s:28: Error: SVC is not permitted on this architecture
/tmp/cc1kP379.s:50: Error: SVC is not permitted on this architecture
/tmp/cc1kP379.s:72: Error: SVC is not permitted on this architecture
/tmp/cc1kP379.s:94: Error: SVC is not permitted on this architecture
/tmp/cc1kP379.s:141: Error: SVC is not permitted on this architecture
secure_fw/lib/sprt/CMakeFiles/libtfmsprt.dir/build.make:114: recipe for target 'secure_fw/lib/sprt/CMakeFiles/libtfmsprt.dir/__/__/__/interface/src/psa/psa_client.o' failed

Flags

C_FLAGS = -mcpu=cortex-m0plus -mcpu=cortex-m0plus -march=armv6-m ...

Event Timeline

AlamyLiu triaged this task as High priority.Jan 10 2020, 5:57 AM
AlamyLiu created this task.

The root cause is:

  1. When building SPRTL, arch type is fetched from GNUARM cmake file since SPRTL CMake file is included with add_subdirectory() instead of include().
  2. The CM0+ arch type should be "armv6s-m". However, it is set to "armv6-m" in GNUARM cmake file, which stands for CM0. CM0 doesn't support SVC. Thus the build failed.
  3. Previously, the psa_client.c and` psa_service.c` were not in SPRTL folder. When building the both files, cpu type is fetched which is correct.

Fix the arch type of CM0+ to "armv6s-m" in GNUARM cmake files.

Add an arch type string "ARMv6S-M" for Cortex-M0plus in GNUARM.
Because Armclang doesn't have a dedicated flag as "armv6s-m", twostrings "ARMv6-M" and "ARMv6S-M" exist and stand for Cortex-M0plus arch type in Armclang and GNUARM respectively.

davidhuziji closed this task as Resolved.Jan 13 2020, 3:10 AM