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

Failed to manually build blinky example

Had tried to build it from the IDE before.  Couldn't do it.
Tried to build manually, got exactly the same error I was getting in the IDE.

Parsing C:/Users/mario.raposo/zephyrproject/zephyr/Kconfig
Loaded configuration 'C:/Users/mario.raposo/zephyrproject/zephyr/build/zephyr/.config'
No change to configuration in 'C:/Users/mario.raposo/zephyrproject/zephyr/build/zephyr/.config'
No change to Kconfig header in 'C:/Users/mario.raposo/zephyrproject/zephyr/build/zephyr/include/generated/autoconf.h'
CMake Error at ../../../cmake/extensions.cmake:1557 (message):
Assertion failed: The toolchain is unable to build a dummy C file. See
CMakeError.log.
Call Stack (most recent call first):
../../../CMakeLists.txt:42 (assert)


-- Configuring incomplete, errors occurred!
See also "C:/Users/mario.raposo/zephyrproject/zephyr/build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/mario.raposo/zephyrproject/zephyr/build/CMakeFiles/CMakeError.log".

Parents
  • I was able to get a little bit forward.
    Now getting a "undefined reference to _exit" error.
    I opened a new case:

    devzone.nordicsemi.com/.../undefined-reference-to-_exit-when-building-blinky

  • Uninstalled my installed cmake.
    Uninstalled NCS.
    Re-installed using Toolchain manager.



    Same error.

    Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
    Compiler: C:/Users/mario.raposo/ncs/v1.3.1/toolchain/opt/bin/arm-none-eabi-gcc.exe 
    Build flags: 
    Id flags:  
    
    The output was:
    1
    c:/users/mario.raposo/ncs/v1.3.1/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: c:/users/mario.raposo/ncs/v1.3.1/toolchain/opt/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:/Users/mario.raposo/ncs/v1.3.1/toolchain/opt/bin/arm-none-eabi-gcc.exe 
    Build flags: 
    Id flags:  
    
    The output was:
    1
    c:/users/mario.raposo/ncs/v1.3.1/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: c:/users/mario.raposo/ncs/v1.3.1/toolchain/opt/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
    
    
    Performing C SOURCE FILE Test check_C__nostartfiles__nostdlib__isystem__c__users_mario_raposo_ncs_v1_3_1_toolchain_opt_bin____lib_gcc_arm_none_eabi_9_2_1_include___isystem__c__users_mario_raposo_ncs_v1_3_1_toolchain_opt_bin____lib_gcc_arm_none_eabi_9_2_1_include_fixed___Wl___unresolved_symbols_ignore_in_object_files__Wl___entry_0 failed with the following output:
    Change Dir: C:/Users/mario.raposo/ncs/v1.3.1/zephyr/samples/basic/blinky/build_thingy91_nrf9160/CMakeFiles/CMakeTmp
    
    Run Build Command:"C:/Users/mario.raposo/ncs/v1.3.1/toolchain/opt/bin/ninja.exe" "cmTC_ef9e1"
    [1/2] Building C object CMakeFiles/cmTC_ef9e1.dir/src.c.obj
    
    [2/2] Linking C executable cmTC_ef9e1
    
    FAILED: cmTC_ef9e1 
    
    cmd.exe /C "cd . && C:\Users\mario.raposo\ncs\v1.3.1\toolchain\opt\bin\arm-none-eabi-gcc.exe -Dcheck_C__nostartfiles__nostdlib__isystem__c__users_mario_raposo_ncs_v1_3_1_toolchain_opt_bin____lib_gcc_arm_none_eabi_9_2_1_include___isystem__c__users_mario_raposo_ncs_v1_3_1_toolchain_opt_bin____lib_gcc_arm_none_eabi_9_2_1_include_fixed___Wl___unresolved_symbols_ignore_in_object_files__Wl___entry_0 -nostartfiles -nostdlib -isystem "c:/users/mario.raposo/ncs/v1.3.1/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/include" -isystem "c:/users/mario.raposo/ncs/v1.3.1/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/include-fixed" -Wl,--unresolved-symbols=ignore-in-object-files -Wl,--entry=0   CMakeFiles/cmTC_ef9e1.dir/src.c.obj  -o cmTC_ef9e1   && cd ."
    
    The system cannot find the path specified.
    
    ninja: build stopped: subcommand failed.
    
    
    Source file was:
    int main(void) { return 0; }
    
    The target system is: Generic - 2.3.0 - arm
    The host system is: Windows - 10.0.17134 - AMD64
    Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded.
    Compiler: C:/Users/mario.raposo/ncs/v1.3.1/toolchain/opt/bin/arm-none-eabi-gcc.exe 
    Build flags: 
    Id flags: -c 
    
    The output was:
    0
    
    
    Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "CMakeCCompilerId.o"
    
    The C compiler identification is GNU, found in "C:/Users/mario.raposo/ncs/v1.3.1/zephyr/samples/basic/blinky/build_thingy91_nrf9160/CMakeFiles/3.13.4/CompilerIdC/CMakeCCompilerId.o"
    
    Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded.
    Compiler: C:/Users/mario.raposo/ncs/v1.3.1/toolchain/opt/bin/arm-none-eabi-gcc.exe 
    Build flags: 
    Id flags: -c 
    
    The output was:
    0
    
    
    Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "CMakeCXXCompilerId.o"
    
    The CXX compiler identification is GNU, found in "C:/Users/mario.raposo/ncs/v1.3.1/zephyr/samples/basic/blinky/build_thingy91_nrf9160/CMakeFiles/3.13.4/CompilerIdCXX/CMakeCXXCompilerId.o"
    
    Checking whether the ASM compiler is GNU using "--version" matched "(GNU assembler)|(GCC)|(Free Software Foundation)":
    arm-none-eabi-gcc.exe (GNU Tools for Arm Embedded Processors 9-2019-q4-major) 9.2.1 20191025 (release) [ARM/arm-9-branch revision 277599]
    Copyright (C) 2019 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    
    




Reply
  • Uninstalled my installed cmake.
    Uninstalled NCS.
    Re-installed using Toolchain manager.



    Same error.

    Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
    Compiler: C:/Users/mario.raposo/ncs/v1.3.1/toolchain/opt/bin/arm-none-eabi-gcc.exe 
    Build flags: 
    Id flags:  
    
    The output was:
    1
    c:/users/mario.raposo/ncs/v1.3.1/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: c:/users/mario.raposo/ncs/v1.3.1/toolchain/opt/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:/Users/mario.raposo/ncs/v1.3.1/toolchain/opt/bin/arm-none-eabi-gcc.exe 
    Build flags: 
    Id flags:  
    
    The output was:
    1
    c:/users/mario.raposo/ncs/v1.3.1/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: c:/users/mario.raposo/ncs/v1.3.1/toolchain/opt/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
    
    
    Performing C SOURCE FILE Test check_C__nostartfiles__nostdlib__isystem__c__users_mario_raposo_ncs_v1_3_1_toolchain_opt_bin____lib_gcc_arm_none_eabi_9_2_1_include___isystem__c__users_mario_raposo_ncs_v1_3_1_toolchain_opt_bin____lib_gcc_arm_none_eabi_9_2_1_include_fixed___Wl___unresolved_symbols_ignore_in_object_files__Wl___entry_0 failed with the following output:
    Change Dir: C:/Users/mario.raposo/ncs/v1.3.1/zephyr/samples/basic/blinky/build_thingy91_nrf9160/CMakeFiles/CMakeTmp
    
    Run Build Command:"C:/Users/mario.raposo/ncs/v1.3.1/toolchain/opt/bin/ninja.exe" "cmTC_ef9e1"
    [1/2] Building C object CMakeFiles/cmTC_ef9e1.dir/src.c.obj
    
    [2/2] Linking C executable cmTC_ef9e1
    
    FAILED: cmTC_ef9e1 
    
    cmd.exe /C "cd . && C:\Users\mario.raposo\ncs\v1.3.1\toolchain\opt\bin\arm-none-eabi-gcc.exe -Dcheck_C__nostartfiles__nostdlib__isystem__c__users_mario_raposo_ncs_v1_3_1_toolchain_opt_bin____lib_gcc_arm_none_eabi_9_2_1_include___isystem__c__users_mario_raposo_ncs_v1_3_1_toolchain_opt_bin____lib_gcc_arm_none_eabi_9_2_1_include_fixed___Wl___unresolved_symbols_ignore_in_object_files__Wl___entry_0 -nostartfiles -nostdlib -isystem "c:/users/mario.raposo/ncs/v1.3.1/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/include" -isystem "c:/users/mario.raposo/ncs/v1.3.1/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/include-fixed" -Wl,--unresolved-symbols=ignore-in-object-files -Wl,--entry=0   CMakeFiles/cmTC_ef9e1.dir/src.c.obj  -o cmTC_ef9e1   && cd ."
    
    The system cannot find the path specified.
    
    ninja: build stopped: subcommand failed.
    
    
    Source file was:
    int main(void) { return 0; }
    
    The target system is: Generic - 2.3.0 - arm
    The host system is: Windows - 10.0.17134 - AMD64
    Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded.
    Compiler: C:/Users/mario.raposo/ncs/v1.3.1/toolchain/opt/bin/arm-none-eabi-gcc.exe 
    Build flags: 
    Id flags: -c 
    
    The output was:
    0
    
    
    Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "CMakeCCompilerId.o"
    
    The C compiler identification is GNU, found in "C:/Users/mario.raposo/ncs/v1.3.1/zephyr/samples/basic/blinky/build_thingy91_nrf9160/CMakeFiles/3.13.4/CompilerIdC/CMakeCCompilerId.o"
    
    Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded.
    Compiler: C:/Users/mario.raposo/ncs/v1.3.1/toolchain/opt/bin/arm-none-eabi-gcc.exe 
    Build flags: 
    Id flags: -c 
    
    The output was:
    0
    
    
    Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "CMakeCXXCompilerId.o"
    
    The CXX compiler identification is GNU, found in "C:/Users/mario.raposo/ncs/v1.3.1/zephyr/samples/basic/blinky/build_thingy91_nrf9160/CMakeFiles/3.13.4/CompilerIdCXX/CMakeCXXCompilerId.o"
    
    Checking whether the ASM compiler is GNU using "--version" matched "(GNU assembler)|(GCC)|(Free Software Foundation)":
    arm-none-eabi-gcc.exe (GNU Tools for Arm Embedded Processors 9-2019-q4-major) 9.2.1 20191025 (release) [ARM/arm-9-branch revision 277599]
    Copyright (C) 2019 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    
    




Children
Related