All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] target i386 compile problem for hw/core/nmi.c
@ 2015-11-27 15:03 Tim Sander
  2015-11-27 16:21 ` Peter Maydell
  0 siblings, 1 reply; 2+ messages in thread
From: Tim Sander @ 2015-11-27 15:03 UTC (permalink / raw)
  To: qemu-devel@nongnu.org

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:24
hw/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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] target i386 compile problem for hw/core/nmi.c
  2015-11-27 15:03 [Qemu-devel] target i386 compile problem for hw/core/nmi.c Tim Sander
@ 2015-11-27 16:21 ` Peter Maydell
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Maydell @ 2015-11-27 16:21 UTC (permalink / raw)
  To: Tim Sander; +Cc: qemu-devel@nongnu.org

On 27 November 2015 at 15:03, Tim Sander <tim@krieglstein.org> wrote:
> 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:24
> hw/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?

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-11-27 16:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-27 15:03 [Qemu-devel] target i386 compile problem for hw/core/nmi.c Tim Sander
2015-11-27 16:21 ` Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.