diff mbox series

[2/5] target/i386: tcg stubs

Message ID 20171030030553.21259-3-f4bug@amsat.org
State New
Headers show
Series build fixes for --disable-tcg | expand

Commit Message

Philippe Mathieu-Daudé Oct. 30, 2017, 3:05 a.m. UTC
missing since 55c3ceef61:

    LINK    x86_64-softmmu/qemu-system-x86_64
  target/i386/cpu.o: In function `x86_cpu_common_class_init':
  target/i386/cpu.c:4215: undefined reference to `tcg_x86_init'

Suggested-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 target/i386/tcg-stub.c    | 13 +++++++++++++
 target/i386/Makefile.objs |  1 +
 2 files changed, 14 insertions(+)
 create mode 100644 target/i386/tcg-stub.c

Comments

Eduardo Habkost Oct. 30, 2017, 9:05 a.m. UTC | #1
On Mon, Oct 30, 2017 at 12:05:50AM -0300, Philippe Mathieu-Daudé wrote:
> missing since 55c3ceef61:
> 
>     LINK    x86_64-softmmu/qemu-system-x86_64
>   target/i386/cpu.o: In function `x86_cpu_common_class_init':
>   target/i386/cpu.c:4215: undefined reference to `tcg_x86_init'
> 
> Suggested-by: Eduardo Habkost <ehabkost@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  target/i386/tcg-stub.c    | 13 +++++++++++++
>  target/i386/Makefile.objs |  1 +
>  2 files changed, 14 insertions(+)
>  create mode 100644 target/i386/tcg-stub.c
> 
> diff --git a/target/i386/tcg-stub.c b/target/i386/tcg-stub.c
> new file mode 100644
> index 0000000000..e13d993a80
> --- /dev/null
> +++ b/target/i386/tcg-stub.c
> @@ -0,0 +1,13 @@
> +/*
> + * QEMU TCG x86 specific function stubs
> + *
> + * This work is licensed under the terms of the GNU GPL, version 2 or later.
> + * See the COPYING file in the top-level directory.
> + *
> + */
> +#include "qemu/osdep.h"
> +#include "cpu.h"
> +
> +void tcg_x86_init(void)
> +{
> +}

I'm not sure my suggestion was really a good one.  Requiring a
separate stub file for each architecture looks like too much
boilerplate code, which defeats the purpose of eliminating the
#ifdefs.  What if we just define inline stubs at target-*/cpu.h?


> diff --git a/target/i386/Makefile.objs b/target/i386/Makefile.objs
> index 6a26e9d9f0..2b3db1e5c2 100644
> --- a/target/i386/Makefile.objs
> +++ b/target/i386/Makefile.objs
> @@ -3,6 +3,7 @@ obj-$(CONFIG_TCG) += translate.o
>  obj-$(CONFIG_TCG) += bpt_helper.o cc_helper.o excp_helper.o fpu_helper.o
>  obj-$(CONFIG_TCG) += int_helper.o mem_helper.o misc_helper.o mpx_helper.o
>  obj-$(CONFIG_TCG) += seg_helper.o smm_helper.o svm_helper.o
> +obj-$(call lnot,$(CONFIG_TCG)) += tcg-stub.o
>  obj-$(CONFIG_SOFTMMU) += machine.o arch_memory_mapping.o arch_dump.o monitor.o
>  obj-$(CONFIG_KVM) += kvm.o hyperv.o
>  obj-$(call lnot,$(CONFIG_KVM)) += kvm-stub.o
> -- 
> 2.15.0.rc2
>
diff mbox series

Patch

diff --git a/target/i386/tcg-stub.c b/target/i386/tcg-stub.c
new file mode 100644
index 0000000000..e13d993a80
--- /dev/null
+++ b/target/i386/tcg-stub.c
@@ -0,0 +1,13 @@ 
+/*
+ * QEMU TCG x86 specific function stubs
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ *
+ */
+#include "qemu/osdep.h"
+#include "cpu.h"
+
+void tcg_x86_init(void)
+{
+}
diff --git a/target/i386/Makefile.objs b/target/i386/Makefile.objs
index 6a26e9d9f0..2b3db1e5c2 100644
--- a/target/i386/Makefile.objs
+++ b/target/i386/Makefile.objs
@@ -3,6 +3,7 @@  obj-$(CONFIG_TCG) += translate.o
 obj-$(CONFIG_TCG) += bpt_helper.o cc_helper.o excp_helper.o fpu_helper.o
 obj-$(CONFIG_TCG) += int_helper.o mem_helper.o misc_helper.o mpx_helper.o
 obj-$(CONFIG_TCG) += seg_helper.o smm_helper.o svm_helper.o
+obj-$(call lnot,$(CONFIG_TCG)) += tcg-stub.o
 obj-$(CONFIG_SOFTMMU) += machine.o arch_memory_mapping.o arch_dump.o monitor.o
 obj-$(CONFIG_KVM) += kvm.o hyperv.o
 obj-$(call lnot,$(CONFIG_KVM)) += kvm-stub.o