CONFIG_COMPILER_OPT is occasionally not applied when building in VSCode

I try to set custom compiler flags for the whole project including Zephyr via prj.conf / CONFIG_COMPILER_OPT to compute worst case stack usage as follows:

CONFIG_COMPILER_OPT="-fcallgraph-info=su -O3 -ffp-contract=fast"

The "-fcallgraph-info=su" option should create an *.ci file for each compilation unit in the build folder [1].

Sometimes when i run the build get a bunch of *.ci files in the build directory but most of the time they are not created.

Setting the option via "target_compile_options" works for my code but i obviously need the option to be applied to the Zephyr code too.

This is rather annoying as it seems to happen completely random.

nRF Connect SDK v3.1.1

nRF Connect for VS Code Extension Pack v2025.4.4

[1] gcc.gnu.org/.../Developer-Options.html

Parents
  • When i modify my prj.conf before each build it seems to work partially. At least for the Zephyr code.

    I just increment CONFIG_MAIN_STACK_SIZE before each build and then the *.ci file are generated each time..

    Are you using a some sort of stupid caching system for the object files (ccache maybe) ? If only the object files would be cached that would break all compiler options that generate additional files (-fstack-usage for example). 

Reply
  • When i modify my prj.conf before each build it seems to work partially. At least for the Zephyr code.

    I just increment CONFIG_MAIN_STACK_SIZE before each build and then the *.ci file are generated each time..

    Are you using a some sort of stupid caching system for the object files (ccache maybe) ? If only the object files would be cached that would break all compiler options that generate additional files (-fstack-usage for example). 

Children
Related