On 2/6/26 14:21, Pierrick Bouvier wrote:
In next commit, we'll apply same helper pattern for base helpers remaining.Our new helper pattern always include helper-*-common.h, which ends up including include/tcg/tcg.h, which contains one occurrence of CONFIG_USER_ONLY. Thus, common files not being duplicated between system and target relying on helpers will fail to compile. Existing occurrences are: - target/arm/tcg/arith_helper.c - target/arm/tcg/crypto_helper.c There is a single occurrence of CONFIG_USER_ONLY, for defining variable tcg_use_softmmu. The fix seemed simple, always define it. However, it prevents some dead code elimination which ends up triggering: include/qemu/osdep.h:283:35: error: call to 'qemu_build_not_reached_always' declared with attribute error: code path is reachable 283 | #define qemu_build_not_reached() qemu_build_not_reached_always() | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ tcg/x86_64/tcg-target.c.inc:1907:45: note: in expansion of macro 'qemu_build_not_reached' 1907 | # define x86_guest_base (*(HostAddress *)({ qemu_build_not_reached(); NULL; })) | ^~~~~~~~~~~~~~~~~~~~~~ tcg/x86_64/tcg-target.c.inc:1934:14: note: in expansion of macro 'x86_guest_base' 1934 | *h = x86_guest_base; | ^~~~~~~~~~~~~~ So, roll your eyes, then rollback code, and simply duplicate the two files concerned. We could also do a "special include trick" to prevent pulling helper-*-common.h but it would be sad since the whole point of the series up to here is to have something coherent using the exact same pattern.
tcg_use_softmmu is a stub, waiting for softmmu to be enabled for user-only. Which is a long way away. It's also not used outside of tcg/, which means we should move it to tcg/tcg-internal.h. r~
