On Thu, 17 Dec 2020 at 22:45, Claudio Fontana <cfont...@suse.de> wrote: > > On 12/17/20 9:15 PM, Peter Maydell wrote: > > On Thu, 17 Dec 2020 at 19:46, Claudio Fontana <cfont...@suse.de> wrote: > > Yeah, don't try to ifdef out struct fields in common-compiled code... > > or should I? Using > > #ifdef NEED_CPU_H > #ifdef CONFIG_SOFTMMU > > seems to do what I expect. Is it wrong?
I think that gives you two versions of the struct: - one seen by compiled-once files and by compiled-per-target softmmu files - one seen by compiled-per-target user-only files Since the user-only target executables link both compiled-per-target and compiled-once files I think they end up with different C files thinking the same struct has a different layout/size which seems like it's going to cause problems. thanks -- PMM