All of lore.kernel.org
 help / color / mirror / Atom feed
diff for duplicates of <87h7ugn6e4.fsf@linaro.org>

diff --git a/a/1.txt b/N1/1.txt
index bbcfed7..e575e36 100644
--- a/a/1.txt
+++ b/N1/1.txt
@@ -1,4 +1,3 @@
-
 Emilio G. Cota <1885827@bugs.launchpad.net> writes:
 
 > You should then find out why libqemu_plugin.dll.a is not working. It is
@@ -24,3 +23,97 @@ Thanks.
 
 -- 
 Alex Bennée
+
+-- 
+You received this bug notification because you are a member of qemu-
+devel-ml, which is subscribed to QEMU.
+https://bugs.launchpad.net/bugs/1885827
+
+Title:
+  building plugin failed on Windows with mingw
+
+Status in QEMU:
+  New
+
+Bug description:
+  I want to build QEMU 4.2.0's plugin module on Windows 7/10 with Mingw, but the building process faild.
+   
+  The step I follow is listed below:
+  1. create "dsp_build" diretory under source file folder
+
+  2.  change directory to dsp_build , and run ../configure --target-list=dsp-softmmu --cross-prefix=x86_64-w64-mingw32- --enable-gtk --enable-sdl --enable-debug --enable-plugins
+  3. build qemu project
+  4. switch dir to /dsp_build, make -C tests/plugin, yeilds error: 
+     CC      bb.o
+   D:/emu_devl/qemu_src/qemu-sr-dsp-a/qemu_tidsp_c3x/tests/plugin/bb.c:17:24: error: variable 'qemu_plugin_version' definition is marked dllimport
+     17 | QEMU_PLUGIN_EXPORT int qemu_plugin_version = QEMU_PLUGIN_VERSION;
+        |                        ^~~~~~~~~~~~~~~~~~~
+   D:/emu_devl/qemu_src/qemu-sr-dsp-a/qemu_tidsp_c3x/tests/plugin/bb.c:17:24: warning: 'qemu_plugin_version' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
+   D:/emu_devl/qemu_src/qemu-sr-dsp-a/qemu_tidsp_c3x/tests/plugin/bb.c: In function 'vcpu_tb_exec':
+   D:/emu_devl/qemu_src/qemu-sr-dsp-a/qemu_tidsp_c3x/tests/plugin/bb.c:33:29: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
+     33 |     unsigned long n_insns = (unsigned long)udata;
+        |                             ^
+   D:/emu_devl/qemu_src/qemu-sr-dsp-a/qemu_tidsp_c3x/tests/plugin/bb.c: In function 'vcpu_tb_trans':
+   D:/emu_devl/qemu_src/qemu-sr-dsp-a/qemu_tidsp_c3x/tests/plugin/bb.c:51:46: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
+     51 |                                              (void *)n_insns);
+
+  5.  Then , I modified the QEMU_flags and the compilation command
+  arguments($(CC) ..) in  the  makefile :
+
+                  BUILD_DIR := $(CURDIR)/../..
+
+  		include $(BUILD_DIR)/config-host.mak
+  		include $(SRC_PATH)/rules.mak
+
+                  $(call set-vpath, $(SRC_PATH)/tests/plugin)
+
+  		NAMES :=
+  		NAMES += bb
+  		NAMES += empty
+  		NAMES += insn
+  		NAMES += mem
+  		NAMES += hotblocks
+  		NAMES += howvec
+  		NAMES += hotpages
+
+                  SONAMES := $(addsuffix .so,$(addprefix lib,$(NAMES)))
+
+  		QEMU_CFLAGS += -fPIC	-DBUILDING_DLL  		#added  -DBUILDING_DLL
+  		QEMU_CFLAGS += -I$(SRC_PATH)/include/qemu
+
+                  all: $(SONAMES)
+
+  		lib%.so: %.o
+  			$(CC) -fPIC -shared -o $@ $^ $(LDLIBS) -L /c/msys64/mingw64/lib/ -lglib-2.0
+  			# original cmd: $(CC) -shared -Wl,-soname,$@ -o $@ $^ $(LDLIBS)
+
+  		clean:
+  			rm -f *.o *.so *.d
+  			rm -Rf .libs
+
+                  .PHONY: all clean
+
+  6.  Executing make yeilds:
+
+  make: enter   “/d/emu_devl/qemu_src/qemu-sr-dsp-a/qemu_tidsp_c3x/build_dsp/tests/plugin”
+    CC      bb.o
+  x86_64-w64-mingw32-gcc -fPIC -shared -o libbb.so bb.o  -L /c/msys64/mingw64/lib/ -lglib-2.0
+  C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: bb.o: in function `plugin_exit':
+  D:/emu_devl/qemu_src/qemu-sr-dsp-a/qemu_tidsp_c3x/tests/plugin/bb.c:28: undefined reference to `qemu_plugin_outs'
+  C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/emu_devl/qemu_src/qemu-sr-dsp-a/qemu_tidsp_c3x/tests/plugin/bb.c:29: undefined reference to `__stack_chk_fail'
+  C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: bb.o: in function `vcpu_tb_trans':
+  D:/emu_devl/qemu_src/qemu-sr-dsp-a/qemu_tidsp_c3x/tests/plugin/bb.c:41: undefined reference to `qemu_plugin_tb_n_insns'
+  C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/emu_devl/qemu_src/qemu-sr-dsp-a/qemu_tidsp_c3x/tests/plugin/bb.c:44: undefined reference to `qemu_plugin_register_vcpu_tb_exec_inline'
+  C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/emu_devl/qemu_src/qemu-sr-dsp-a/qemu_tidsp_c3x/tests/plugin/bb.c:46: undefined reference to `qemu_plugin_register_vcpu_tb_exec_inline'
+  C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/emu_devl/qemu_src/qemu-sr-dsp-a/qemu_tidsp_c3x/tests/plugin/bb.c:49: undefined reference to `qemu_plugin_register_vcpu_tb_exec_cb'
+  C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: bb.o: in function `qemu_plugin_install':
+  D:/emu_devl/qemu_src/qemu-sr-dsp-a/qemu_tidsp_c3x/tests/plugin/bb.c:63: undefined reference to `qemu_plugin_register_vcpu_tb_trans_cb'
+  C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/emu_devl/qemu_src/qemu-sr-dsp-a/qemu_tidsp_c3x/tests/plugin/bb.c:64: undefined reference to `qemu_plugin_register_atexit_cb'
+  C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: bb.o:bb.c:(.rdata$.refptr.__stack_chk_guard[.refptr.__stack_chk_guard]+0x0): undefined reference to `__stack_chk_guard'
+  collect2.exe: error: ld returned 1 exit status
+
+     It looks like linking problem(fail to link functions defined in api.c, core.c...), but I have no idea what goes wrong. If I mannualy add api.o, core.o in the compilation command, still get error like undefined reference to '__stack_chk_guard'. 
+     My collegue can build 4.2.0  plugins on Ubuntu Linux without any problem.
+
+To manage notifications about this bug go to:
+https://bugs.launchpad.net/qemu/+bug/1885827/+subscriptions
diff --git a/a/content_digest b/N1/content_digest
index b987f45..f7018e4 100644
--- a/a/content_digest
+++ b/N1/content_digest
@@ -1,13 +1,11 @@
  "ref\0159357217483.1717.4076077243388027502.malonedeb@chaenomeles.canonical.com\0"
  "ref\0159426310588.27029.9451813776430828516.malone@gac.canonical.com\0"
- "From\0Alex Benn\303\251e <alex.bennee@linaro.org>\0"
+ "From\0Alex Benn\303\251e <1885827@bugs.launchpad.net>\0"
  "Subject\0Re: [Bug 1885827] Re: building plugin failed on Windows with mingw\0"
- "Date\0Thu, 09 Jul 2020 14:51:31 +0100\0"
- "To\0Bug 1885827 <1885827@bugs.launchpad.net>\0"
- "Cc\0qemu-devel@nongnu.org\0"
+ "Date\0Thu, 09 Jul 2020 13:51:31 -0000\0"
+ "To\0qemu-devel@nongnu.org\0"
  "\00:1\0"
  "b\0"
- "\n"
  "Emilio G. Cota <1885827@bugs.launchpad.net> writes:\n"
  "\n"
  "> You should then find out why libqemu_plugin.dll.a is not working. It is\n"
@@ -32,6 +30,100 @@
  "Thanks.\n"
  "\n"
  "-- \n"
- "Alex Benn\303\251e"
+ "Alex Benn\303\251e\n"
+ "\n"
+ "-- \n"
+ "You received this bug notification because you are a member of qemu-\n"
+ "devel-ml, which is subscribed to QEMU.\n"
+ "https://bugs.launchpad.net/bugs/1885827\n"
+ "\n"
+ "Title:\n"
+ "  building plugin failed on Windows with mingw\n"
+ "\n"
+ "Status in QEMU:\n"
+ "  New\n"
+ "\n"
+ "Bug description:\n"
+ "  I want to build QEMU 4.2.0's plugin module on Windows 7/10 with Mingw, but the building process faild.\n"
+ "   \n"
+ "  The step I follow is listed below:\n"
+ "  1. create \"dsp_build\" diretory under source file folder\n"
+ "\n"
+ "  2.  change directory to dsp_build , and run ../configure --target-list=dsp-softmmu --cross-prefix=x86_64-w64-mingw32- --enable-gtk --enable-sdl --enable-debug --enable-plugins\n"
+ "  3. build qemu project\n"
+ "  4. switch dir to /dsp_build, make -C tests/plugin, yeilds error: \n"
+ "     CC      bb.o\n"
+ "   D:/emu_devl/qemu_src/qemu-sr-dsp-a/qemu_tidsp_c3x/tests/plugin/bb.c:17:24: error: variable 'qemu_plugin_version' definition is marked dllimport\n"
+ "     17 | QEMU_PLUGIN_EXPORT int qemu_plugin_version = QEMU_PLUGIN_VERSION;\n"
+ "        |                        ^~~~~~~~~~~~~~~~~~~\n"
+ "   D:/emu_devl/qemu_src/qemu-sr-dsp-a/qemu_tidsp_c3x/tests/plugin/bb.c:17:24: warning: 'qemu_plugin_version' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]\n"
+ "   D:/emu_devl/qemu_src/qemu-sr-dsp-a/qemu_tidsp_c3x/tests/plugin/bb.c: In function 'vcpu_tb_exec':\n"
+ "   D:/emu_devl/qemu_src/qemu-sr-dsp-a/qemu_tidsp_c3x/tests/plugin/bb.c:33:29: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]\n"
+ "     33 |     unsigned long n_insns = (unsigned long)udata;\n"
+ "        |                             ^\n"
+ "   D:/emu_devl/qemu_src/qemu-sr-dsp-a/qemu_tidsp_c3x/tests/plugin/bb.c: In function 'vcpu_tb_trans':\n"
+ "   D:/emu_devl/qemu_src/qemu-sr-dsp-a/qemu_tidsp_c3x/tests/plugin/bb.c:51:46: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]\n"
+ "     51 |                                              (void *)n_insns);\n"
+ "\n"
+ "  5.  Then , I modified the QEMU_flags and the compilation command\n"
+ "  arguments($(CC) ..) in  the  makefile :\n"
+ "\n"
+ "                  BUILD_DIR := $(CURDIR)/../..\n"
+ "\n"
+ "  \t\tinclude $(BUILD_DIR)/config-host.mak\n"
+ "  \t\tinclude $(SRC_PATH)/rules.mak\n"
+ "\n"
+ "                  $(call set-vpath, $(SRC_PATH)/tests/plugin)\n"
+ "\n"
+ "  \t\tNAMES :=\n"
+ "  \t\tNAMES += bb\n"
+ "  \t\tNAMES += empty\n"
+ "  \t\tNAMES += insn\n"
+ "  \t\tNAMES += mem\n"
+ "  \t\tNAMES += hotblocks\n"
+ "  \t\tNAMES += howvec\n"
+ "  \t\tNAMES += hotpages\n"
+ "\n"
+ "                  SONAMES := $(addsuffix .so,$(addprefix lib,$(NAMES)))\n"
+ "\n"
+ "  \t\tQEMU_CFLAGS += -fPIC\t-DBUILDING_DLL  \t\t#added  -DBUILDING_DLL\n"
+ "  \t\tQEMU_CFLAGS += -I$(SRC_PATH)/include/qemu\n"
+ "\n"
+ "                  all: $(SONAMES)\n"
+ "\n"
+ "  \t\tlib%.so: %.o\n"
+ "  \t\t\t$(CC) -fPIC -shared -o $@ $^ $(LDLIBS) -L /c/msys64/mingw64/lib/ -lglib-2.0\n"
+ "  \t\t\t# original cmd: $(CC) -shared -Wl,-soname,$@ -o $@ $^ $(LDLIBS)\n"
+ "\n"
+ "  \t\tclean:\n"
+ "  \t\t\trm -f *.o *.so *.d\n"
+ "  \t\t\trm -Rf .libs\n"
+ "\n"
+ "                  .PHONY: all clean\n"
+ "\n"
+ "  6.  Executing make yeilds:\n"
+ "\n"
+ "  make: enter   \342\200\234/d/emu_devl/qemu_src/qemu-sr-dsp-a/qemu_tidsp_c3x/build_dsp/tests/plugin\342\200\235\n"
+ "    CC      bb.o\n"
+ "  x86_64-w64-mingw32-gcc -fPIC -shared -o libbb.so bb.o  -L /c/msys64/mingw64/lib/ -lglib-2.0\n"
+ "  C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: bb.o: in function `plugin_exit':\n"
+ "  D:/emu_devl/qemu_src/qemu-sr-dsp-a/qemu_tidsp_c3x/tests/plugin/bb.c:28: undefined reference to `qemu_plugin_outs'\n"
+ "  C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/emu_devl/qemu_src/qemu-sr-dsp-a/qemu_tidsp_c3x/tests/plugin/bb.c:29: undefined reference to `__stack_chk_fail'\n"
+ "  C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: bb.o: in function `vcpu_tb_trans':\n"
+ "  D:/emu_devl/qemu_src/qemu-sr-dsp-a/qemu_tidsp_c3x/tests/plugin/bb.c:41: undefined reference to `qemu_plugin_tb_n_insns'\n"
+ "  C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/emu_devl/qemu_src/qemu-sr-dsp-a/qemu_tidsp_c3x/tests/plugin/bb.c:44: undefined reference to `qemu_plugin_register_vcpu_tb_exec_inline'\n"
+ "  C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/emu_devl/qemu_src/qemu-sr-dsp-a/qemu_tidsp_c3x/tests/plugin/bb.c:46: undefined reference to `qemu_plugin_register_vcpu_tb_exec_inline'\n"
+ "  C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/emu_devl/qemu_src/qemu-sr-dsp-a/qemu_tidsp_c3x/tests/plugin/bb.c:49: undefined reference to `qemu_plugin_register_vcpu_tb_exec_cb'\n"
+ "  C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: bb.o: in function `qemu_plugin_install':\n"
+ "  D:/emu_devl/qemu_src/qemu-sr-dsp-a/qemu_tidsp_c3x/tests/plugin/bb.c:63: undefined reference to `qemu_plugin_register_vcpu_tb_trans_cb'\n"
+ "  C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/emu_devl/qemu_src/qemu-sr-dsp-a/qemu_tidsp_c3x/tests/plugin/bb.c:64: undefined reference to `qemu_plugin_register_atexit_cb'\n"
+ "  C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: bb.o:bb.c:(.rdata$.refptr.__stack_chk_guard[.refptr.__stack_chk_guard]+0x0): undefined reference to `__stack_chk_guard'\n"
+ "  collect2.exe: error: ld returned 1 exit status\n"
+ "\n"
+ "     It looks like linking problem(fail to link functions defined in api.c, core.c...), but I have no idea what goes wrong. If I mannualy add api.o, core.o in the compilation command, still get error like undefined reference to '__stack_chk_guard'. \n"
+ "     My collegue can build 4.2.0  plugins on Ubuntu Linux without any problem.\n"
+ "\n"
+ "To manage notifications about this bug go to:\n"
+ https://bugs.launchpad.net/qemu/+bug/1885827/+subscriptions
 
-7424d93d7518d3fd5ff1349bccfc109b7474ba06c0ca24124b56f75afec3b69b
+0dd11be1cd1308d9ecc2cc21775daeeb26bd8b219b9634782618136a466610c1

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.