This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Build fails with gcc-arm-none-eabi-9-2019-q4-major on Windows 10

I'm facing an issue with the build failing when using the gcc-arm-none-eabi-9-2019-q4-major toolchain on Windows 10. I saw a similar post here, github.com/.../22060, but it didn't have a solution for me.

Windows 10:
gcc-arm-none-eabi-9-2019-q4-major installed at c:\gnuarmemb
cmake version 3.19.0-rc1
Environment Variables:
GNUARMEMB_TOOLCHAIN_PATH=C:\gnuarmemb
ZEPHYR_BASE=C:\ncs\zephyr\
ZEPHYR_TOOLCHAIN_VARIANT=gnuarmemb
PATH:
c:\gnuarmemb\bin
C:\Python37\Scripts\
C:\Python37\
C:\Program Files\Nordic Semiconductor\nrf-command-line-tools\bin\
C:\Program Files\CMake\bin

C:\ncs\zephyr\samples\basic\blinky>west build -b circuitdojo_feather_nrf9160ns
-- west build: generating a build system
Including boilerplate (Zephyr base): C:/ncs/zephyr/cmake/app/boilerplate.cmake
-- Application: C:/ncs/zephyr/samples/basic/blinky
-- Zephyr version: 2.4.0 (C:/ncs/zephyr)
-- Found Python3: C:/Python37/python.exe (found suitable exact version "3.7.9") found components: Interpreter
-- Found west (found suitable version "0.8.0", minimum required is "0.7.1")
-- Board: circuitdojo_feather_nrf9160ns
-- Cache files will be written to: C:/ncs/zephyr/.cache
-- Found toolchain: gnuarmemb (C:/gnuarmemb)
-- Found BOARD.dts: C:/ncs/zephyr/boards/arm/circuitdojo_feather_nrf9160/circuitdojo_feather_nrf9160ns.dts
-- Generated zephyr.dts: C:/ncs/zephyr/samples/basic/blinky/build/zephyr/zephyr.dts
-- Generated devicetree_unfixed.h: C:/ncs/zephyr/samples/basic/blinky/build/zephyr/include/generated/devicetree_unfixed.h
Parsing C:/ncs/zephyr/Kconfig
Loaded configuration 'C:/ncs/zephyr/boards/arm/circuitdojo_feather_nrf9160/circuitdojo_feather_nrf9160ns_defconfig'
Merged configuration 'C:/ncs/zephyr/samples/basic/blinky/prj.conf'
Configuration saved to 'C:/ncs/zephyr/samples/basic/blinky/build/zephyr/.config'
Kconfig header saved to 'C:/ncs/zephyr/samples/basic/blinky/build/zephyr/include/generated/autoconf.h'
-- The C compiler identification is GNU 9.2.1
-- The CXX compiler identification is GNU 9.2.1
-- The ASM compiler identification is GNU
-- Found assembler: C:/gnuarmemb/bin/arm-none-eabi-gcc.exe
CMake Error at C:/ncs/zephyr/cmake/extensions.cmake:1325 (if):
Maximum recursion depth of 1000 exceeded
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.19/Modules/CheckCCompilerFlag.cmake:40 (check_compiler_flag)
C:/ncs/zephyr/cmake/extensions.cmake:1335 (check_c_compiler_flag)
.....
C:/ncs/zephyr/cmake/extensions.cmake:1465 (zephyr_check_compiler_flag)
C:/ncs/zephyr/cmake/linker/linker_flags_template.cmake:7 (check_set_linker_property)
C:/ncs/zephyr/cmake/target_toolchain_flags.cmake:12 (include)
C:/ncs/zephyr/cmake/app/boilerplate.cmake:627 (include)
C:/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
C:/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:35 (include_boilerplate)
CMakeLists.txt:4 (find_package)


-- Configuring incomplete, errors occurred!
See also "C:/ncs/zephyr/samples/basic/blinky/build/CMakeFiles/CMakeOutput.log".
See also "C:/ncs/zephyr/samples/basic/blinky/build/CMakeFiles/CMakeError.log".
FATAL ERROR: command exited with status 1: 'C:\Program Files\CMake\bin\cmake.EXE' '-DWEST_PYTHON=c:\python37\python.exe' '-BC:\ncs\zephyr\samples\basic\blinky\build' '-SC:\ncs\zephyr\samples\basic\blinky' -GNinja -DBOARD=circuitdojo_feather_nrf9160ns


CMakeError.log

Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: C:/gnuarmemb/bin/arm-none-eabi-gcc.exe
Build flags:
Id flags:

The output was:
1
c:/gnuarmemb/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: c:/gnuarmemb/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/lib\libc.a(lib_a-exit.o): in function `exit':
exit.c:(.text.exit+0x2c): undefined reference to `_exit'
collect2.exe: error: ld returned 1 exit status


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: C:/gnuarmemb/bin/arm-none-eabi-gcc.exe
Build flags:
Id flags:

The output was:
1
c:/gnuarmemb/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: c:/gnuarmemb/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/lib\libc.a(lib_a-exit.o): in function `exit':
exit.c:(.text.exit+0x2c): undefined reference to `_exit'
collect2.exe: error: ld returned 1 exit status

Related