ncs-zigbee 1.4.0 release with mandatory LTO

Hi there,

I'm evaluating the latest release of NCS ZigBee addon version 1.4.0, wanted to try and migrate my existing project to the newer version. I've encountered the following problem while attempting to do that:

Apparently with this version you are shipping zboss libraries with mandatory LTO requirement as a build option. I can build your sample projects with the latest toolchain 3.4.0 based on gcc 14.  

However in my projects with older version of ZigBee addon (1.3.0) I was successfully using alternative toolchains to build and deploy firmware: llvm-based and a custom-built gcc 16-based.

I'm using those to get an access to the latest C++ features. And it was working fine with the older version of addon because zboss libraries and a configuration around it were not requiring LTO to be used. Unfortunately I cannot use those toolchains anymore since apparently you've hard-coded LTO into the 1.4.0. And I can only link it using your official GCC 14 and that is very limiting without a good reason.

I'd like to make a feature request:

please, provide non-LTO versions of zboss libraries and make it possible to opt out of the LTO build. Or if zboss sources were available it would also lift the limitations of the current approach.

If you could also provide pointers as to how I could workaround this limitation now it would also be very helpful.

Thank you! 

Parents
  • For anyone having same issues and questions here's an update:

    I've vibe-coded together a short script that using official toolchain's (3.4.0) gcc (14) compiles all *.o files in static libraries (libzboss.a, libzboss.ed.a) and effectively de-lto's it and re-packs into 'normal' non-LTO static libraries.

    Re-packed libraries (cortex-m33, hard-float), script itself are attached.

    However in my case I had also to actually turn off LTO so for that I've added to Kconfig of my project:

    config ZBOSS_PREBUILT_STACK_LTO
        default n
    

    Also in file `ncs-zigbee.git/lib/zboss/include/osif/libzboss_config.ed.h` or `ncs-zigbee.git/lib/zboss/include/osif/libzboss_config.h` I had to replace

    `#define CONFIG_ZBOSS_STACK_LTO y` with `//define CONFIG_ZBOSS_STACK_LTO y`.

    Note: I had to remove hashtag symbol since it's checked in `ncs-zigbee.git/lib/zboss/CMakeLists.txt:146`

    My feature request to devs still stands. I believe it would be more flexible and beneficial overall to leave that choice to the user whether build the whole thing with LTO or not and not force them into it.

    de-lto.sh

    de-lto.ed.sh

    0246.libzboss.a

    1817.libzboss.ed.a

  • Hi,

    I am looking into it, thanks for sharing your current solution!

    Regards,

Reply Children
No Data
Related