qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Patch for 64 bit mingw compilation
@ 2015-03-11 14:51 Joseph Hindin
  2015-03-12 13:57 ` Stefan Hajnoczi
  2015-05-03  8:33 ` Olga Krishtal
  0 siblings, 2 replies; 4+ messages in thread
From: Joseph Hindin @ 2015-03-11 14:51 UTC (permalink / raw)
  To: qemu-devel; +Cc: Michael Roth


[-- Attachment #1.1: Type: text/plain, Size: 376 bytes --]

Hi

   When compiling the QEMU Guest Agent with 64-bit MinGW toolchain version
4.9.2, I run into the following problem: qga-vss.dll linking failed as
linker reported a lot of unresolved symbol __stack_chk_fail errors stemming
from the stack protection. The attached patch solves the problem by adding
libssp to the qga-vss.dll libraries list.

   Regards,
      Joseph Hindin

[-- Attachment #1.2: Type: text/html, Size: 478 bytes --]

[-- Attachment #2: 0001-windows-build-lssp-added-to-qga-vss.dll-library-list.patch --]
[-- Type: application/octet-stream, Size: 1785 bytes --]

From 29d647419c04a8f990fa29c033a718abb4120b20 Mon Sep 17 00:00:00 2001
From: Joseph Hindin <jhindin@daynix.com>
Date: Wed, 11 Mar 2015 15:58:06 +0200
Subject: [PATCH] windows build: -lssp added to qga-vss.dll libraries list

When building qga-bss.dll with 64-bit mingw toolchain v. 4.9.2, the
qga-vss.dll linking fails with unresolved symbols from libssp,
stack protection support, like the following message:

.../qga/vss-win32/install.cpp:52: undefined reference to `__stack_chk_fail'

The patch fixes the problem by adding libssp to the qga-vss.dll
libraries list.

Signed-off-by: Joseph Hindin <jhindin@daynix.com>
---
 qga/vss-win32/Makefile.objs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qga/vss-win32/Makefile.objs b/qga/vss-win32/Makefile.objs
index 6a69d50..bd0840d 100644
--- a/qga/vss-win32/Makefile.objs
+++ b/qga/vss-win32/Makefile.objs
@@ -5,7 +5,7 @@ qga-vss-dll-obj-y += requester.o provider.o install.o
 obj-qga-vss-dll-obj-y = $(addprefix $(obj)/, $(qga-vss-dll-obj-y))
 $(obj-qga-vss-dll-obj-y): QEMU_CXXFLAGS = $(filter-out -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wold-style-declaration -Wold-style-definition -Wredundant-decls -fstack-protector-all, $(QEMU_CFLAGS)) -Wno-unknown-pragmas -Wno-delete-non-virtual-dtor
 
-$(obj)/qga-vss.dll: LDFLAGS = -shared -Wl,--add-stdcall-alias,--enable-stdcall-fixup -lole32 -loleaut32 -lshlwapi -luuid -static
+$(obj)/qga-vss.dll: LDFLAGS = -shared -Wl,--add-stdcall-alias,--enable-stdcall-fixup -lole32 -loleaut32 -lshlwapi -luuid -lssp -static
 $(obj)/qga-vss.dll: $(obj-qga-vss-dll-obj-y) $(SRC_PATH)/$(obj)/qga-vss.def
 	$(call quiet-command,$(CXX) -o $@ $(qga-vss-dll-obj-y) $(SRC_PATH)/qga/vss-win32/qga-vss.def $(CXXFLAGS) $(LDFLAGS),"  LINK  $(TARGET_DIR)$@")
 
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] Patch for 64 bit mingw compilation
  2015-03-11 14:51 [Qemu-devel] Patch for 64 bit mingw compilation Joseph Hindin
@ 2015-03-12 13:57 ` Stefan Hajnoczi
  2015-05-03  8:33 ` Olga Krishtal
  1 sibling, 0 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2015-03-12 13:57 UTC (permalink / raw)
  To: Joseph Hindin; +Cc: qemu-devel, Michael Roth

[-- Attachment #1: Type: text/plain, Size: 745 bytes --]

On Wed, Mar 11, 2015 at 04:51:02PM +0200, Joseph Hindin wrote:
>    When compiling the QEMU Guest Agent with 64-bit MinGW toolchain version
> 4.9.2, I run into the following problem: qga-vss.dll linking failed as
> linker reported a lot of unresolved symbol __stack_chk_fail errors stemming
> from the stack protection. The attached patch solves the problem by adding
> libssp to the qga-vss.dll libraries list.

Please send patches inline and not as an attachment.

Guidelines on how to submit patches:
http://qemu-project.org/Contribute/SubmitAPatch

Sometimes maintainers manually apply patches that are not formatted
according to these guidelines, but given the level of traffic on
qemu-devel it helps a lot to follow them.  Thanks!

Stefan

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] Patch for 64 bit mingw compilation
  2015-03-11 14:51 [Qemu-devel] Patch for 64 bit mingw compilation Joseph Hindin
  2015-03-12 13:57 ` Stefan Hajnoczi
@ 2015-05-03  8:33 ` Olga Krishtal
  2015-05-04  8:46   ` Joseph Hindin
  1 sibling, 1 reply; 4+ messages in thread
From: Olga Krishtal @ 2015-05-03  8:33 UTC (permalink / raw)
  To: Joseph Hindin, qemu-devel; +Cc: Michael Roth

On 11/03/15 17:51, Joseph Hindin wrote:
> Hi
>
>     When compiling the QEMU Guest Agent with 64-bit MinGW toolchain version
> 4.9.2, I run into the following problem: qga-vss.dll linking failed as
> linker reported a lot of unresolved symbol __stack_chk_fail errors stemming
> from the stack protection. The attached patch solves the problem by adding
> libssp to the qga-vss.dll libraries list.
>
>     Regards,
>        Joseph Hindin
>
Are you sure that it is necessary?
I worked with VSS-provider in order to check it on 64 bit platform (Win 
Server 2008) , and I did not have such
problems.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] Patch for 64 bit mingw compilation
  2015-05-03  8:33 ` Olga Krishtal
@ 2015-05-04  8:46   ` Joseph Hindin
  0 siblings, 0 replies; 4+ messages in thread
From: Joseph Hindin @ 2015-05-04  8:46 UTC (permalink / raw)
  To: Olga Krishtal; +Cc: Dmitry Fleytman, Yan Vugenfirer, qemu-devel, Michael Roth

[-- Attachment #1: Type: text/plain, Size: 4919 bytes --]

Hi
   The changes appear to be necessary. I was building Windows QEMU GA on
Fedora 21, MINGW cross-compiler v. 4.9.2, build 20141030, Fedora MinGW
4.9.2-1.fc21 and before the changes, linking failed.

Below is the building log for qga-vss.dll before the changes:

-----
$ make qga/vss-win32/qga-vss.dll
        CHK version_gen.h
  CXX   qga/vss-win32/requester.o
qga/vss-win32/requester.cpp:1:0: warning: -fPIC ignored for target (all
code is position independent)
 /*
 ^
qga/vss-win32/requester.cpp:1:0: warning: -fPIC ignored for target (all
code is position independent)
 /*
 ^
In file included from qga/vss-win32/requester.cpp:17:0:
./inc/win2003/vswriter.h:39:2: warning: 'typedef' was ignored in this
declaration
  };
  ^
./inc/win2003/vswriter.h:47:2: warning: 'typedef' was ignored in this
declaration
  };
  ^
./inc/win2003/vswriter.h:59:2: warning: 'typedef' was ignored in this
declaration
  };
  ^
./inc/win2003/vswriter.h:67:2: warning: 'typedef' was ignored in this
declaration
  };
  ^
./inc/win2003/vswriter.h:75:2: warning: 'typedef' was ignored in this
declaration
  };
  ^
./inc/win2003/vswriter.h:83:5: warning: 'typedef' was ignored in this
declaration
     };
     ^
./inc/win2003/vswriter.h:93:5: warning: 'typedef' was ignored in this
declaration
     };
     ^
./inc/win2003/vswriter.h:103:2: warning: 'typedef' was ignored in this
declaration
  };
  ^
./inc/win2003/vswriter.h:112:2: warning: 'typedef' was ignored in this
declaration
  };
  ^
./inc/win2003/vswriter.h:119:2: warning: 'typedef' was ignored in this
declaration
  };
  ^
  CXX   qga/vss-win32/provider.o
qga/vss-win32/provider.cpp:1:0: warning: -fPIC ignored for target (all code
is position independent)
 /*
 ^
qga/vss-win32/provider.cpp:1:0: warning: -fPIC ignored for target (all code
is position independent)
 /*
 ^
  CXX   qga/vss-win32/install.o
qga/vss-win32/install.cpp:1:0: warning: -fPIC ignored for target (all code
is position independent)
 /*
 ^
qga/vss-win32/install.cpp:1:0: warning: -fPIC ignored for target (all code
is position independent)
 /*
 ^
  LINK  qga/vss-win32/qga-vss.dll
qga/vss-win32/requester.o: In function `WaitForAsync':
/home/jhindin/development/qemu_upstream/qga/vss-win32/requester.cpp:148:
undefined reference to `__stack_chk_fail'
qga/vss-win32/requester.o: In function `requester_freeze':
/home/jhindin/development/qemu_upstream/qga/vss-win32/requester.cpp:435:
undefined reference to `__stack_chk_fail'
qga/vss-win32/requester.o: In function `requester_thaw':
/home/jhindin/development/qemu_upstream/qga/vss-win32/requester.cpp:503:
undefined reference to `__stack_chk_fail'
qga/vss-win32/requester.o: In function `fprintf(_iobuf*, char const*, ...)':
/usr/x86_64-w64-mingw32/sys-root/mingw/include/stdio.h:292: undefined
reference to `__stack_chk_fail'
qga/vss-win32/requester.o:requester.cpp:(.rdata$.refptr.__stack_chk_guard[.refptr.__stack_chk_guard]+0x0):
undefined reference to `__stack_chk_guard'
qga/vss-win32/install.o: In function `errmsg_dialog':
/home/jhindin/development/qemu_upstream/qga/vss-win32/install.cpp:65:
undefined reference to `__stack_chk_fail'
qga/vss-win32/install.o: In function `CreateRegistryKey':
/home/jhindin/development/qemu_upstream/qga/vss-win32/install.cpp:349:
undefined reference to `__stack_chk_fail'
qga/vss-win32/install.o: In function `errmsg(unsigned long, char const*)':
/home/jhindin/development/qemu_upstream/qga/vss-win32/install.cpp:52:
undefined reference to `__stack_chk_fail'
qga/vss-win32/install.o: In function `QGAProviderFind':
/home/jhindin/development/qemu_upstream/qga/vss-win32/install.cpp:175:
undefined reference to `__stack_chk_fail'
qga/vss-win32/install.o: In function `DllUnregisterServer':
/home/jhindin/development/qemu_upstream/qga/vss-win32/install.cpp:445:
undefined reference to `__stack_chk_fail'
qga/vss-win32/install.o:/home/jhindin/development/qemu_upstream/qga/vss-win32/install.cpp:422:
more undefined references to `__stack_chk_fail' follow
collect2: error: ld returned 1 exit status
/home/jhindin/development/qemu_upstream/qga/vss-win32/Makefile.objs:10:
recipe for target 'qga/vss-win32/qga-vss.dll' failed
make: *** [qga/vss-win32/qga-vss.dll] Error 1
------




   Regards,
      Joseph Hindin

On Sun, May 3, 2015 at 11:33 AM, Olga Krishtal <okrishtal@parallels.com>
wrote:

> On 11/03/15 17:51, Joseph Hindin wrote:
>
>> Hi
>>
>>     When compiling the QEMU Guest Agent with 64-bit MinGW toolchain
>> version
>> 4.9.2, I run into the following problem: qga-vss.dll linking failed as
>> linker reported a lot of unresolved symbol __stack_chk_fail errors
>> stemming
>> from the stack protection. The attached patch solves the problem by adding
>> libssp to the qga-vss.dll libraries list.
>>
>>     Regards,
>>        Joseph Hindin
>>
>>  Are you sure that it is necessary?
> I worked with VSS-provider in order to check it on 64 bit platform (Win
> Server 2008) , and I did not have such
> problems.
>

[-- Attachment #2: Type: text/html, Size: 6577 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-05-04  8:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-11 14:51 [Qemu-devel] Patch for 64 bit mingw compilation Joseph Hindin
2015-03-12 13:57 ` Stefan Hajnoczi
2015-05-03  8:33 ` Olga Krishtal
2015-05-04  8:46   ` Joseph Hindin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).