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 <[email protected]>
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.
>