On Mon, Sep 28, 2020 at 11:47 PM Alex Bennée <
alex.bennee@linaro.org> wrote:
>
>
> Paolo Bonzini <
pbonzini@redhat.com> writes:
>
> > On 25/09/20 21:12, 罗勇刚(Yonggang Luo) wrote:
> >> currently the empty.c plugin are failed of linkage error
> >>
> >> The fowlloing are the failing message:
> >> Compiling C object tests/plugin/libbb.dll.p/bb.c.obj
> >> Linking target tests/plugin/libempty.dll
> >> Linking target tests/plugin/libinsn.dll
> >> Linking target tests/plugin/libmem.dll
> >> ../tests/plugin/bb.c: In function 'vcpu_tb_exec':
> >> ../tests/plugin/bb.c:75:29: error: cast from pointer to integer of
> >> different size [-Werror=pointer-to-int-cast]
> >> 75 | unsigned long n_insns = (unsigned long)udata;
> >> | ^
> >> ../tests/plugin/bb.c: In function 'vcpu_tb_trans':
> >> ../tests/plugin/bb.c:95:46: error: cast to pointer from integer of
> >> different size [-Werror=int-to-pointer-cast]
> >> 95 | (void *)n_insns);
> >> | ^
> >
> > Plugins cannot work on Windows, because they would be specific to one
> > executable as far as I know. Plugins would have to link with the
> > emulator's import library, but there would be one import library per
> > emulator.
>
> I'm not sure I follow. There is nothing specific about the QEMU binary
> it cares about as long as the API symbols exist. Are you saying each
> QEMU binary will have different resolvable names for the external
> functions in plugins/api.c?
Hi, I've submit patches to fix the issue on win32, please have a look, it's have some advantage
that we doesn't need the configure procedure anymore, and the .symobls files are also no need
anymore, like the the OpenGL does.
>
> >
> > Paolo
> >
> >> C:/CI-Tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
> >> tests/plugin/libempty.dll.p/empty.c.obj: in function `qemu_plugin_install':
> >> C:\work\xemu\qemu\build/../tests/plugin/empty.c:30: undefined reference
> >> to `qemu_plugin_register_vcpu_tb_trans_cb'
> >> cc1.exe: all warnings being treated as errors
> >> collect2.exe: error: ld returned 1 exit status
> >> make: *** [Makefile.ninja:2433:tests/plugin/libempty.dll] 错误 1
> >> make: *** 正在等待未完成的任务....
> >> make: *** [Makefile.ninja:2420:tests/plugin/libbb.dll.p/bb.c.obj] 错误 1
> >> C:/CI-Tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
> >> tests/plugin/libinsn.dll.p/insn.c.obj: in function `vcpu_tb_trans':
> >> C:\work\xemu\qemu\build/../tests/plugin/insn.c:29: undefined reference
> >> to `qemu_plugin_tb_n_insns'
> >> C:/CI-Tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
> >> C:\work\xemu\qemu\build/../tests/plugin/insn.c:33: undefined reference
> >> to `qemu_plugin_tb_get_insn'
> >> C:/CI-Tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
> >> C:\work\xemu\qemu\build/../tests/plugin/insn.c:36: undefined reference
> >> to `qemu_plugin_register_vcpu_insn_exec_inline'
> >> C:/CI-Tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
> >> C:\work\xemu\qemu\build/../tests/plugin/insn.c:39: undefined reference
> >> to `qemu_plugin_register_vcpu_insn_exec_cb'
> >> C:/CI-Tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
> >> tests/plugin/libinsn.dll.p/insn.c.obj: in function `plugin_exit':
> >> C:\work\xemu\qemu\build/../tests/plugin/insn.c:48: undefined reference
> >> to `qemu_plugin_outs'
> >> C:/CI-Tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
> >> tests/plugin/libinsn.dll.p/insn.c.obj: in function `qemu_plugin_install':
> >> C:\work\xemu\qemu\build/../tests/plugin/insn.c:59: undefined reference
> >> to `qemu_plugin_register_vcpu_tb_trans_cb'
> >> C:/CI-Tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
> >> C:\work\xemu\qemu\build/../tests/plugin/insn.c:60: undefined reference
> >> to `qemu_plugin_register_atexit_cb'
> >> collect2.exe: error: ld returned 1 exit status
> >> C:/CI-Tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
> >> tests/plugin/libmem.dll.p/mem.c.obj: in function `plugin_exit':
> >> C:\work\xemu\qemu\build/../tests/plugin/mem.c:33: undefined reference to
> >> `qemu_plugin_outs'
> >> C:/CI-Tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
> >> tests/plugin/libmem.dll.p/mem.c.obj: in function `vcpu_mem':
> >> C:\work\xemu\qemu\build/../tests/plugin/mem.c:41: undefined reference to
> >> `qemu_plugin_get_hwaddr'
> >> C:/CI-Tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
> >> C:\work\xemu\qemu\build/../tests/plugin/mem.c:42: undefined reference to
> >> `qemu_plugin_hwaddr_is_io'
> >> C:/CI-Tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
> >> tests/plugin/libmem.dll.p/mem.c.obj: in function `vcpu_tb_trans':
> >> C:\work\xemu\qemu\build/../tests/plugin/mem.c:54: undefined reference to
> >> `qemu_plugin_tb_n_insns'
> >> C:/CI-Tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
> >> C:\work\xemu\qemu\build/../tests/plugin/mem.c:58: undefined reference to
> >> `qemu_plugin_tb_get_insn'
> >> C:/CI-Tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
> >> C:\work\xemu\qemu\build/../tests/plugin/mem.c:61: undefined reference to
> >> `qemu_plugin_register_vcpu_mem_inline'
> >> C:/CI-Tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
> >> C:\work\xemu\qemu\build/../tests/plugin/mem.c:65: undefined reference to
> >> `qemu_plugin_register_vcpu_mem_cb'
> >> C:/CI-Tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
> >> tests/plugin/libmem.dll.p/mem.c.obj: in function `qemu_plugin_install':
> >> C:\work\xemu\qemu\build/../tests/plugin/mem.c:96: undefined reference to
> >> `qemu_plugin_register_vcpu_tb_trans_cb'
> >> C:/CI-Tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
> >> C:\work\xemu\qemu\build/../tests/plugin/mem.c:97: undefined reference to
> >> `qemu_plugin_register_atexit_cb'
> >> make: *** [Makefile.ninja:2440:tests/plugin/libinsn.dll] 错误 1
> >> collect2.exe: error: ld returned 1 exit status
> >> make: *** [Makefile.ninja:2447:tests/plugin/libmem.dll] 错误 1
> >> make -C /c/work/xemu/qemu/slirp
> >> BUILD_DIR="/c/work/xemu/qemu/build/slirp" PKG_CONFIG="pkg-config"
> >> CC="cc" AR="ar" LD="ld" RANLIB="ranlib" CFLAGS="-m64 -mcx16
> >> -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
> >> -Wstrict-prototypes -Wredundant-decls -Wundef -Wwrite-strings
> >> -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv
> >> -Wold-style-declaration -Wold-style-definition -Wtype-limits
> >> -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers
> >> -Wempty-body -Wnested-externs -Wendif-labels -Wexpansion-to-defined
> >> -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-psabi
> >> -fstack-protector-strong -g -fno-pie -mthreads -std=gnu99 -Wall"
> >> LDFLAGS="-Wl,--warn-common -m64 -fstack-protector-strong"
> >> make[1]: 进入目录“/c/work/xemu/qemu/slirp”
> >> make[1]: 对“all”无需做任何事。
> >> make[1]: 离开目录“/c/work/xemu/qemu/slirp”
> >> make -I/c/work/xemu/qemu/dtc VPATH=/c/work/xemu/qemu/dtc -C dtc V="1"
> >> LIBFDT_lib="" CPPFLAGS="-I/c/work/xemu/qemu/dtc/libfdt" CFLAGS="-g
> >> -fno-pie -mthreads -std=gnu99 -Wall -m64 -mcx16 -D_GNU_SOURCE
> >> -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes
> >> -Wredundant-decls -Wundef -Wwrite-strings -Wmissing-prototypes
> >> -fno-strict-aliasing -fno-common -fwrapv -Wold-style-declaration
> >> -Wold-style-definition -Wtype-limits -Wformat-security -Wformat-y2k
> >> -Winit-self -Wignored-qualifiers -Wempty-body -Wnested-externs
> >> -Wendif-labels -Wexpansion-to-defined -Wno-missing-include-dirs
> >> -Wno-shift-negative-value -Wno-psabi -fstack-protector-strong"
> >> LDFLAGS="-Wl,--warn-common -m64 -fstack-protector-strong" ARFLAGS="rv"
> >> CC="cc" AR="ar" LD="ld" libfdt
> >> make[1]: 进入目录“/c/work/xemu/qemu/build/dtc”
> >> make[1]: 对“libfdt”无需做任何事。
> >> make[1]: 离开目录“/c/work/xemu/qemu/build/dtc”
> >> "C:/CI-Tools/msys64/mingw64/bin/python3.exe"
> >> "C:/work/xemu/qemu/meson/meson.py" "--internal" "exe" "--capture"
> >> "qemu-version.h" "--" "sh" "C:/work/xemu/qemu/scripts/qemu-version.sh"
> >> "C:/work/xemu/qemu" "" "5.1.50" && if test -e qemu-version.h; then
> >> printf '%s\n' qemu-version.h > qemu-version.h.stamp; fi
> >> "ar" csrD libqemuutil.a @libqemuutil.a.rsp
> >> "C:/CI-Tools/msys64/mingw64/bin/python3.exe"
> >> "C:/work/xemu/qemu/meson/meson.py" "--internal" "exe" "--unpickle"
> >> "C:/work/xemu/qemu/build/meson-private/meson_exe_python3.exe_2b18a272e12652a9e7600847543c3524867d85d7.dat"
> >> && if test -e block.syms; then printf '%s\n' block.syms >
> >> block.syms.stamp; fi
> >> "ar" csrD libblock.fa @libblock.fa.rsp
> >> "C:/CI-Tools/msys64/mingw64/bin/python3.exe"
> >> "C:/work/xemu/qemu/meson/meson.py" "--internal" "exe" "--unpickle"
> >> "C:/work/xemu/qemu/build/meson-private/meson_exe_python3.exe_269c5ec9ac7976b6693320b9cb25885f5b2f71c7.dat"
> >> && if test -e qemu.syms; then printf '%s\n' qemu.syms > qemu.syms.stamp; fi
> >> "c++" @qemu-system-ppc.exe.rsp
> >>
> >> --
> >> 此致
> >> 礼
> >> 罗勇刚
> >> Yours
> >> sincerely,
> >> Yonggang Luo
>
>
> --
> Alex Bennée
--
此致
礼
罗勇刚
Yours
sincerely,
Yonggang Luo