Skip to content

Create option to modify the toolchain PREFIX for cmake #2300

@KeilChris

Description

@KeilChris

The Zephyr SDK contains a GCC toolchain that differs from the GNU Arm Embedded toolchain in the way that the executables are not called arm-none-eabi- but arm-zephyr-eabi-. Currently, the GCC.10.3.1.cmake file has this hardcoded:

if(DEFINED TOOLCHAIN_ROOT)
  set(PREFIX arm-none-eabi-)

Thus, a compilation with the Zephyr SDK will fail as the wrong exeutable is called:

Loading Zephyr default modules (Zephyr base (cached)).
CMake Error at /Users/user/zephyrproject/zephyr/cmake/compiler/gcc/generic.cmake:9 (message):
  Zephyr was unable to find the toolchain.  Is the environment misconfigured?

  User-configuration:

  ZEPHYR_TOOLCHAIN_VARIANT: gnuarmemb

  Internal variables:

  CROSS_COMPILE:
  /Users/user/zephyr-sdk-0.17.4/arm-zephyr-eabi//bin/arm-none-eabi-

  TOOLCHAIN_HOME: /Users/user/zephyr-sdk-0.17.4/arm-zephyr-eabi/

A possible solution could be that we honor an environment variable (for example TOOLCHAIN_PREFIX) that can be set by the user if they encounter such a problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions