When trying to build qemu-riscv64_smode_defconfig with
CONFIG_CC_OPTIMIZE_FOR_DEBUG=y it became evident that the build was not
using -Og as expected. This is due to an incorrect update of the build
system with commit 5f520875bdf0 ("kbuild: Bump the build system to 5.1").The first patch reestablishes setting the build flag. But now the build failed due to missing symbols. We have opted to prefer 'if' over '#if' to more easily see problems in contributed code. When compiling with CONFIG_CC_OPTIMIZE_FOR_DEBUG=y the compiler does not execute all optimization paths and references to unused functions are introduced. The issue is resolved by using #ifdef around os_malloc() in our test code and adding stubs for live-tree functions. Maybe we should inject CONFIG_CC_OPTIMIZE_FOR_DEBUG=y into some of our CI builds to ensure that building remains possible. Heinrich Schuchardt (4): Makefile: repair CONFIG_CC_OPTIMIZE_FOR_DEBUG support test: do not imply os_malloc() outside of the sandbox dm: add missing includes in dm/of_addr.h dm: dummy implementations of live-tree functions Makefile | 5 + drivers/core/Makefile | 6 +- drivers/core/nof_access.c | 246 ++++++++++++++++++++++++++++++++++++++ drivers/core/nof_addr.c | 37 ++++++ include/dm/of_addr.h | 4 + test/test-main.c | 2 + 6 files changed, 299 insertions(+), 1 deletion(-) create mode 100644 drivers/core/nof_access.c create mode 100644 drivers/core/nof_addr.c -- 2.51.0

