zephyr: Build fails with gcc-arm-none-eabi-9-2019-q4-major

Describe the bug There is a Toolchain issue with gnuarmemb 9.2 (current version) under Windows

To Reproduce Steps to reproduce the behaviour: Just follow getting started and 3rd party toolchain

I installed to c:/gnuarmemb but I don’t think this should matter

Expected behavior west -b nucleo_f401re samples\hello_world should work but I get error (see below)

Impact Showstopper for new developers should be easy fixable for people with knowledge to cross compile on windows

Screenshots or console output

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

Environment (please complete the following information):

  • Windows
  • gnuarmemb 9.2
  • v2.1.0

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 24 (4 by maintainers)

Commits related to this issue

Most upvoted comments

Like last comment, this worked for me on Windows 10 (Powershell):

choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System' --version=3.17.2 --allow-downgrade
rm -r build
rm -r .cache

I’m having the same issue. in window10.when I delete the contents of the “zephyr\.cache\ToolchainCapabilityDatabase” folder, the problem is solved

Can reproduce on Linux by deleting build folder and ~/.cache/zephyr and then trying to build with either CMake 3.19.0 or 3.19.1

The third point seems relevant: https://cmake.org/cmake/help/latest/release/3.19.html#modules

After downgrading CMake to 3.18.5 the error is resolved.