VS-CODE: build hangs: "Found GnuLd: ld.bfd..."

I am having a recurring problem with NFC-CONNECT: build action. It hangs when building. Gets stuck with the following message in lower-right hand corner of screen:

The procedure I've found to get around this is to cancel the build, and then open a shell in the app directory and do the following:

% rm -rf build*
% export ZEPHYR_BASE=/opt/nordic/ncs/v2.6.0/zephyr
% west build -b nrf52840dk_nrf52840 -p

I can then use the build & build pristine actions.

It might be my environment is not fully supported. The `app` is stand-alone. There is an out-of-the tree module with source i reference with the following CMakeLists.txt fragment:

cmake_minimum_required(VERSION 3.20.0)

set(my-module "${CMAKE_CURRENT_SOURCE_DIR}/../my-module")
set(EXTRA_ZEPHYR_MODULES ${my-module})

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})

This module includes (via settings) board_root, dts_root, & soc_root,  as well as source, library, and include trees picked up from cmake + kconfig variables.

The build environment: Apple M1 Mac, MacOS: 12.6.7 (Monterey), VS-Code: v1.88.1, NRF-Connect: v2024.3.25

The Welcome tab shows SDK + Toolchain: v2.6.0. (I also use stock Zephyr to compile for non-Nordic boards, but am selecting proper SDK + toolchain, and have even removed `.west` directory for stock zephyr installation). 

Sorry to keep complaining about a great tool, but it's frustrating when it stops working.

Thanks. Kent

  • Hi Simon,

    Thanks for trying. As I mentioned, I have a "kitchen sink" zephyr module I include in my build which contains libraries, boards, an SOC implementation, as well as bindings. (Think of it as my `nrf` directory.) I don't know if something in the module bothers the vs-code app, but it obviously doesn't bother `west`.

    I'm on deadline this week and have taken the advice from _r_y_a_n to fallback vs-code versions. When I get my release out, if the problem hasn't cleared, I'll reinstall current vs-code & prune my project to try to find what in my tree is causing the problem.

    Thanks for trying. I'll see what I can do towards the end of the month.

    Kent

  • Hi Kent, thank you for your willingness to help. Our developer came back with some more suggestion to help us try reproducing this on our end. Can you (or someone else) after your dead line of course:

    • Confirm that you have the M1 version of VS Code and the Toolchain installed, and how you installed them exactly.
    • Send the Support information you can generate with VS code.
    • Keep the developer console open (help > toggle developer tools) while building to look for any potentially related errors

    Best regards,

    Simon

  • I also had this issue appear on my system, 2021 M1 MacBook, OS X Sonoma 14.4.1, latest VSCode and latest NCS VS Code extension. As I do a lot of work with Zephyr on other MCUs I had intended to do all the development inside a Docker container, but that was unworkable for NCS due to the lack of distributed aarch64/linux binaries for various tools required by SDK 2.6.0. So I had a partial install of the VSCode NCS tools pointing at a Zephyr-ci-docker container at first which failed miserably.

    Attempting to go back and run the builds natively on my OS X host directly inside VSCode is where I got the hangup at the ld.bfd step, which did not seem to be related to which version of the SDK or toolchain was installed, nor did it matter how the SDK and toolchain were installed. After installing command line tools from the distribution DPKG, and NCS Connect for Desktop, I used the UI toolchain manager to install v2.6.0 (appearing in /opt/nordic/ncs/v2.6.0) and then the VSCode extension. This hung.

    Using the VSCode extension interface I installed SDK 2.5.2 and toolchain 2.5.2, switched active toolchain and SDK, still hung on trying to generate a configuration. Attempting to run the exact west command from a terminal and this also hung at the ld.bfd step. The ld.bfd binary is not failing to run, executing it from a terminal outside of west runs correctly and looking at the binary headers the binary is native arm64, so the install of the tools seems to be fine.

    Notably, I had not restarted VSCode or my system in quite a while, and that made the hangup go away. No idea what steps above produced the lockup, nor what cleared it, but for anyone else on an M1 Mac seeing this maybe these steps can help clear it.

  • Hi

    Noted, thank you for the feedback Theodore!

    Best regards,

    Simon

  • I have m2 pro, problem disappears after first reboot, but when i try to build again, same problem appears.

    System: Apple M2 Pro, Ventura 13.5.2 (22G91)

    sdk: 2.6.1

    vscode: 1.88.1

    nRF Connect for VS Code: v2024.3.25

    what i tried so far is:

    i followed the instruction from  RE: Building infinite loop 

    also tried all versions between 2.5.0 and 2.6.99-cs1, still no luck

Related