target i386 compile problem for hw/core/nmi.c
Hi
We are trying to call "inject_nmi" from a device on a x386 target. Unfortunatly it gets called with the wrong defines and the define TARGET_I386 is *not* defined. If we define TARGET_I386 for testing the code in the defines fails to compile.
Trying to fix this by including:
"qom/cpu.h" and "target-i386/qom-cpu.h" leads to target-i386/cpu-qom.h:24hw/core/nmi.c:27:include/config.h:2:27: fatal error: config-target.h: No such file or directory compilation terminated.
There is literally the same code in the function qmp_inject_nmi which has the right defines and works from command line.
The question is what needs to be done that inject_nmi gets compiled for the right context (configure --target-list=softmmu-i386) with the TARGET_I386 define enabled?
Best regards
Tim
Quoted 12 lines · Tim Sander
We are trying to call "
inject_nmi" from a device on a x386 target. Unfortunatly it gets called with the wrong defines and the defineTARGET_I386is *not* defined. If we defineTARGET_I386for testing the code in the defines fails to compile.Trying to fix this by including:
"qom/cpu.h" and "target-i386/qom-cpu.h" leads totarget-i386/cpu-qom.h:24hw/core/nmi.c:27:include/config.h:2:27: fatal error:config-target.h: No such file or directory compilation terminated.
Quoted 6 lines
There is literally the same code in the function
qmp_inject_nmiwhich has the right defines and works from command line.The question is what needs to be done that
inject_nmigets compiled for the right context (configure --target-list=softmmu-i386) with theTARGET_I386define enabled?
The problem here is that nmi.o is listed in common-obj-y in hw/core/Makefile.objs, which means it is built only once and must not have any code which is built differently for different targets. Either the code needs to be changed not to have the target-dependency, or the file should be put in obj-y instead of common-obj-y.
thanks
-- PMM