Linking examples fails with empty_file.c.obj not found.

Completed manual*) install of nRF Connect SDK 2.2.0, zephyr-sdk-0.15.1. 

The project is placed in C:\dev\peripheral_nfc_pairing

The SDK in: C:\dev\ncs

Build output:

[244/255] Linking C static library zephyr\kernel\libkernel.a
[245/255] Linking C executable zephyr\zephyr_pre0.elf
FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map C:/dev/peripheral_nfc_pairing/build/zephyr/zephyr_pre0.map
cmd.exe /C "cd . && C:\Users\tnielsen\zephyr-sdk-0.15.1\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe -gdwarf-4 @CMakeFiles\zephyr_pre0.rsp -o zephyr\zephyr_pre0.elf && cmd.exe /C "cd /D C:\dev\peripheral_nfc_pairing\build\zephyr && "C:\Program Files\CMake\bin\cmake.exe" -E echo ""
c:/users/tnielsen/zephyr-sdk-0.15.1/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/../../../../arm-zephyr-eabi/bin/ld.exe: cannot find zephyr/CMakeFiles/zephyr_pre0.dir/misc/empty_file.c.obj: No such file or directory
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

The empty_file.c really is a empty source file - apparently not generating an empty object file.

*) The tool manager would not detect SDK versions above 1.9.1, and found this as an unresolved issue on dev zone, so went with the manual install.

  • Hi Sigurd, 

    I have moved the Zephyr SDK as you suggested, and tried to build peripheral_lbs. Same result.

    I tried to build from the command line, and it yielded the following interesting result:

    C:\dev\ncs\nrf\samples\bluetooth\peripheral_lbs>west build -b nrf52dk_nrf52832
    [1/11] Linking C executable zephyr\zephyr_pre0.elf
    FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map C:/dev/ncs/nrf/samples/bluetooth/peripheral_lbs/build/zephyr/zephyr_pre0.map
    cmd.exe /C "cd . && C:\zephyr-sdk-0.15.1\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe -gdwarf-4 @CMakeFiles\zephyr_pre0.rsp -o zephyr\zephyr_pre0.elf && cmd.exe /C "cd /D C:\dev\ncs\nrf\samples\bluetooth\peripheral_lbs\build\zephyr && "C:\Program Files\CMake\bin\cmake.exe" -E echo ""
    c:/zephyr-sdk-0.15.1/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/../../../../arm-zephyr-eabi/bin/ld.exe: cannot find ´╗┐zephyr/CMakeFiles/zephyr_pre0.dir/misc/empty_file.c.obj: No such file or directory
    collect2.exe: error: ld returned 1 exit status
    ninja: build stopped: subcommand failed.

    So it looks like cmake or some other build generation tool inserts garbage in the search path.

    I took the tools dtc, git and gperf from Cygwin - can that be the cause? Do you or zephyr have an official download of these support tools for windows, that you use in your test?

    Ninja was installed from a previous automated nRF Connect install.

    My support tools are:

    C:\dev\ncs\nrf\samples\bluetooth\peripheral_lbs>ninja --version
    1.10.0

    C:\dev\ncs\nrf\samples\bluetooth\peripheral_lbs>gperf --version
    GNU gperf 3.1
    Copyright (C) 1989-2017 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <gnu.org/.../gpl.html>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.
    Written by Douglas C. Schmidt and Bruno Haible.

    C:\dev\ncs\nrf\samples\bluetooth\peripheral_lbs>dtc --version
    Version: DTC 1.6.1-g2cd89f86-dirty

    C:\dev\ncs\nrf\samples\bluetooth\peripheral_lbs>git --version
    git version 2.39.0

    C:\dev\ncs\nrf\samples\bluetooth\peripheral_lbs>cmake --version
    cmake version 3.25.1

    CMake suite maintained and supported by Kitware (kitware.com/cmake).

    rgds Tage

  • Hi,

    I do not know of such a list.
    But I will ask around a bit and see what I can find.

    If you use the Automatic Install with our Toolchain Manager app, the Toolchain Manager will download all the tools as well, and run the nRF Connect SDK in an environment with the tools.
    Could this be an alternative for you?

    If I do not find a public list, I will go through all the tools I have installed myself, and provide you the versions manually.

    Regards,
    Sigurd Hellesvik

  • Hi

    I could, but my initial problem is that Toolchain Manager does not show SDK version beyond 1.9.1:

    Also, I would prefer to have a revision neutral path for ncs, and control revision with git.

    rgds Tage

  • Hi Tage,

    Tage Korsdal Nielsen said:
    but my initial problem is that Toolchain Manager does not show SDK version beyond 1.9.1:

    This is likely because you use Toolchain Manager v1.2.1, and the current version is 3.12.0.

    If you want to switch, I suggest reinstalling the toolchain manager and maybe nRF Connect for Desktop.

    Tage Korsdal Nielsen said:
    Also, I would prefer to have a revision neutral path for ncs, and control revision with git.

    Fair enough. This is in fact the way I use the nRF Connect SDK myself as well.

    I will continue helping you look into the issue.
    For tools versions, see https://github.com/nrfconnect/sdk-nrf/blob/main/scripts/tools-versions-minimum.txt and other files like nrf/scripts/tools-versions-*-txt.
    Remember to select the correct tag in git to get the right versions.

    This puzzles me though:

    Tage Korsdal Nielsen said:
    ncs/zephyr/samples/hello_worlds builds ok.

    Is it the case that all zephyr samples work, and none of the nRF samples, or is it related to sample complexity?

    Regards,
    Sigurd Hellesvik

  • Hi Sigurd,

    My nRFConnect is revision 3.12.0, the Toolchain Manager is 1.2.1, tagged 19/10 according to Nordic Github.

    I tried to delete anything nrf in my AppData folder and ran tool manager again - then it worked and showed me v2.2.0 which I could install and build prephiral_bms.

    So I think I am set for now. Thank you for the support. Relaxed

    rgds Tage

Related