Commit b81e0e2a26 for qemu.org
commit b81e0e2a26308cf54bc4afdcb00648a52882f431
Author: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Date: Thu Apr 30 01:56:45 2026 +0200
target/xtensa/core: register types using type_init
Instead of using a static constructor, delay registering those types
until we call module_init(MODULE_INIT_QOM).
This is not yet a problem, but since we will start initializing
target-info types before any other, without this patch
qemu-system-xtensa* fails with:
Type 'dsp3400-xtensa-cpu' is missing its parent 'xtensa-cpu'
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Message-ID: <20260430203842.29156-4-pierrick.bouvier@oss.qualcomm.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
diff --git a/target/xtensa/overlay_tool.h b/target/xtensa/overlay_tool.h
index 701c00eed2..b9eaffa487 100644
--- a/target/xtensa/overlay_tool.h
+++ b/target/xtensa/overlay_tool.h
@@ -451,13 +451,14 @@
#if TARGET_BIG_ENDIAN == (XCHAL_HAVE_BE != 0)
#define REGISTER_CORE(core) \
- static void __attribute__((constructor)) register_core(void) \
+ static void register_core(void) \
{ \
static XtensaConfigList node = { \
.config = &core, \
}; \
xtensa_register_core(&node); \
- }
+ } \
+ type_init(register_core)
#else
#define REGISTER_CORE(core)
#endif