build fixes for --disable-tcg
cover build fixes for --disable-tcg
Hi,
This series add missing stubs (as suggested by Eduardo in [1]) to build the i386/s390x targets with --disable-tcg (the only targets building without TCG so far).
For git workflow ease, I split by offending commit (so one can branch from this particular commit and cherry-pick the corresponding fix[es]).
Regards,
Phil.
[1]: http://lists.nongnu.org/archive/html/qemu-devel/2017-10/msg06094.html
Philippe Mathieu-Daudé (5):
accel/tcg: add missing target-independent stubs
target/i386: tcg stubs
target/s390x: tcg stubs
accel/tcg: add a stub for tcg_region_init()
accel/tcg: add a stub for tcg_register_thread()
accel/stubs/tcg-stub.c | 27 +++++++++++++++++++++++++++ target/i386/tcg-stub.c | 13 +++++++++++++ target/s390x/tcg-stub.c | 13 +++++++++++++ target/i386/Makefile.objs | 1 + target/s390x/Makefile.objs | 1 + 5 files changed, 55 insertions(+) create mode 100644 target/i386/tcg-stub.c create mode 100644 target/s390x/tcg-stub.c
Signature · 1 line
2.15.0.rc2
PATCH 1/5 accel/tcg: add missing target-independent stubs
missing since 44eff67341:
LINK x86_64-softmmu/qemu-system-x86_64
exec.o: In function `tlb_reset_dirty_range_all':
exec.c:1070: undefined reference to tlb_reset_dirty' exec.o: In function tcg_commit':
exec.c:2704: undefined reference to cpu_reloading_memory_map' cpus.o: In function tcg_cpu_exec':
cpus.c:1270: undefined reference to cpu_exec' cpus.o: In function qemu_tcg_rr_cpu_thread_fn':
cpus.c:1374: undefined reference to cpu_exec_step_atomic' cpus.o: In function qemu_tcg_cpu_thread_fn':
cpus.c:1490: undefined reference to cpu_exec_step_atomic' cpus.o: In function qemu_tcg_init_vcpu':
cpus.c:1675: undefined reference to `parallel_cpus'
--- accel/stubs/tcg-stub.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
accel/stubs/tcg-stub.c +19 -0
@@ -17,6 +17,25 @@#include "exec/cpu-common.h" #include "exec/exec-all.h" +bool parallel_cpus; +void tb_flush (CPUState *cpu) { } + +void tlb_reset_dirty (CPUState *cpu,ram_addr_t start1,ram_addr_t length) +{ +} + +int cpu_exec (CPUState *cpu) +{ +return -1 ; +} + +void cpu_exec_step_atomic (CPUState *cpu) +{ +} + +void cpu_reloading_memory_map (void ) +{ +}
Signature · 1 line
2.15.0.rc2
PATCH 2/5 target/i386: tcg stubs
In reply to Philippe Mathieu-Daudé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'
--- target/i386/tcg-stub.c | 13 +++++++++++++ target/i386/Makefile.objs | 1 + 2 files changed, 14 insertions(+) create mode 100644 target/i386/tcg-stub.c
target/i386/tcg-stub.c new file +13 -0
@@ -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 ) +{ +}
target/i386/Makefile.objs +1 -0
@@ -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
Signature · 1 line
2.15.0.rc2
Re: [Qemu-devel] [PATCH 2/5] target/i386: tcg stubs
Quoted 23 lines · Philippe Mathieu-Daudé
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 <[email protected]>Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/i386/tcg-stub.c | 13 +++++++++++++ target/i386/Makefile.objs | 1 + 2 files changed, 14 insertions(+) create mode 100644 target/i386/tcg-stub.ctarget/i386/tcg-stub.c new file +3
-0@@ -0,0 +1,13 @@ +/* +* QEMU TCG x86 specific function stubs +*
target/i386/tcg-stub.c line 13
Quoted 10 lines
target/i386/tcg-stub.c new file +10
-0+* 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?
Quoted 15 lines
target/i386/Makefile.objs +1
-0@@ -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.oSignature · 1 line
2.15.0.rc2
Signature · 1 line
Eduardo
PATCH 3/5 target/s390x: tcg stubs
In reply to Philippe Mathieu-Daudémissing since 55c3ceef61:
LINK s390x-softmmu/qemu-system-s390x
target/s390x/cpu.o: In function `s390_cpu_class_init':
target/s390x/cpu.c:500: undefined reference to `s390x_translate_init'
--- target/s390x/tcg-stub.c | 13 +++++++++++++ target/s390x/Makefile.objs | 1 + 2 files changed, 14 insertions(+) create mode 100644 target/s390x/tcg-stub.c
target/s390x/tcg-stub.c new file +13 -0
@@ -0,0 +1,13 @@ +/* +* QEMU TCG support -- s390x 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 "internal.h" + +void s390x_translate_init (void ) +{ +}
target/s390x/Makefile.objs +1 -0
@@ -1,6 +1,7 @@ obj-y += cpu.o cpu_models.o cpu_features.o gdbstub.o interrupt.o helper.o obj-$(CONFIG_TCG) += translate.o cc_helper.o excp_helper.o fpu_helper.o obj-$(CONFIG_TCG) += int_helper.o mem_helper.o misc_helper.o crypto_helper.o +obj-$(call lnot,$(CONFIG_TCG)) += tcg-stub.o obj-$(CONFIG_SOFTMMU) += machine.o ioinst.o arch_dump.o mmu_helper.o diag.o obj-$(CONFIG_SOFTMMU) += sigp.o obj-$(CONFIG_KVM) += kvm.o
Signature · 1 line
2.15.0.rc2
Re: [Qemu-devel] [PATCH 3/5] target/s390x: tcg stubs
Quoted 8 lines · Philippe Mathieu-Daudé
missing since
55c3ceef61:LINK s390x-softmmu/qemu-system-s390x
target/s390x/cpu.o: In function `s390_cpu_class_init':
target/s390x/cpu.c:500: undefined reference to `s390x_translate_init'Suggested-by Eduardo Habkost <[email protected]>Signed-off-by Philippe Mathieu-Daudé <[email protected]>
This is fixed already by 74d7fc7f6385158b8a5c524c61baaef1b66f3dac ("tcg: Avoid setting tcg_initialize if !CONFIG_TCG"), so please drop this patch.
Thomas
PATCH 4/5 accel/tcg: add a stub for tcg_region_init()
In reply to Philippe Mathieu-Daudémissing since e8feb96fcc:
LINK x86_64-softmmu/qemu-system-x86_64
cpus.o: In function `qemu_tcg_init_vcpu':
cpus.c:1677: undefined reference to `tcg_region_init'
--- accel/stubs/tcg-stub.c | 4 ++++ 1 file changed, 4 insertions(+)
accel/stubs/tcg-stub.c +4 -0
@@ -39,3 +39,7 @@ void cpu_exec_step_atomic(CPUState *cpu)void cpu_reloading_memory_map (void ) { } + +void tcg_region_init (void ) +{ +}
Signature · 1 line
2.15.0.rc2
PATCH 5/5 accel/tcg: add a stub for tcg_register_thread()
In reply to Philippe Mathieu-Daudémissing since 3468b59e18:
LINK x86_64-softmmu/qemu-system-x86_64
cpus.o: In function `qemu_tcg_rr_cpu_thread_fn':
cpus.c:1310: undefined reference to tcg_register_thread' cpus.o: In function qemu_tcg_cpu_thread_fn':
cpus.c:1458: undefined reference to `tcg_register_thread'
--- accel/stubs/tcg-stub.c | 4 ++++ 1 file changed, 4 insertions(+)
accel/stubs/tcg-stub.c +4 -0
@@ -43,3 +43,7 @@ void cpu_reloading_memory_map(void)void tcg_region_init (void ) { } + +void tcg_register_thread (void ) +{ +}
Signature · 1 line
2.15.0.rc2
Quoted 5 lines · Philippe Mathieu-Daudé
Hi,
This series add missing stubs (as suggested by Eduardo in [1]) to build the i386/s390x targets with --disable-tcg (the only targets building without TCG so far).
Compiling with --disable-tcg works fine for me with the latest master branch as of today, on both x86 and s390x. Are you sure that these patches are still required?
Thomas
Hi Thomas,
Quoted 3 lines · Thomas Huth
Compiling with --disable-tcg works fine for me with the latest master branch as of today, on both x86 and s390x. Are you sure that these patches are still required?
I guess I didn't pulled /master early enough so I missed Peter's merge. Indeed a bug fix got applied so these patches are not required.
However they now allow less #ifdef'fery and might have value in git log history, so I'll wait a bit for Eduardo and Paolo comments before dropping it.
Regards,
Phil.