From: "Alex Bennée" <alex.bennee@linaro.org>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: luoyonggang@gmail.com, qemu-devel@nongnu.org
Subject: Re: I wanna fixes plugin on windows, any suggestion
Date: Mon, 28 Sep 2020 16:47:52 +0100 [thread overview]
Message-ID: <87zh59q4wn.fsf@linaro.org> (raw)
In-Reply-To: <a50bc12c-7aa1-19a3-c39e-02328aeaca38@redhat.com>
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?
>
> 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
next prev parent reply other threads:[~2020-09-28 15:48 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-25 19:12 I wanna fixes plugin on windows, any suggestion 罗勇刚(Yonggang Luo)
2020-09-25 19:20 ` Paolo Bonzini
2020-09-25 19:23 ` 罗勇刚(Yonggang Luo)
2020-09-25 19:25 ` Paolo Bonzini
2020-09-25 19:30 ` 罗勇刚(Yonggang Luo)
2020-09-25 19:44 ` Paolo Bonzini
2020-09-25 20:50 ` Richard Henderson
2020-09-25 20:59 ` Paolo Bonzini
2020-09-25 22:04 ` 罗勇刚(Yonggang Luo)
2020-09-28 15:47 ` Alex Bennée [this message]
2020-09-28 16:40 ` Paolo Bonzini
2020-09-29 1:56 ` 罗勇刚(Yonggang Luo)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zh59q4wn.fsf@linaro.org \
--to=alex.bennee@linaro.org \
--cc=luoyonggang@gmail.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.