Received: from eggs.gnu.org ([2001:4830:134:3::10]:37157) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cqg1b-0006Mk-6Q for qemu-devel@nongnu.org; Wed, 22 Mar 2017 09:10:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cqg1X-0001wd-Vr for qemu-devel@nongnu.org; Wed, 22 Mar 2017 09:10:03 -0400 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:33339) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cqg1X-0001wW-Ot for qemu-devel@nongnu.org; Wed, 22 Mar 2017 09:09:59 -0400 Received: by mail-wm0-x241.google.com with SMTP id n11so9558645wma.0 for ; Wed, 22 Mar 2017 06:09:59 -0700 (PDT) From: Sameeh Jubran Date: Wed, 22 Mar 2017 15:09:52 +0200 Message-Id: <20170322130952.8997-1-sameeh@daynix.com> Subject: [Qemu-devel] [PATCH qemu-ga] qga: Make qemu-ga compile statically for Windows List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, Michael Roth Cc: Yan Vugenfirer , Stefan Hajnoczi , Peter Maydell Attempting to compile qemu-ga statically as follows for Windows causes the following error: Compilation: ./configure --disable-docs --target-list=x86_64-softmmu \ --cross-prefix=x86_64-w64-mingw32- --static \ --enable-guest-agent-msi --with-vss-sdk=/path/to/VSSSDK72 make -j8 qemu-ga Error: path/to/qemu/stubs/error-printf.c:7: undefined reference to `__imp_g_test_config_vars' collect2: error: ld returned 1 exit status Makefile:444: recipe for target 'qemu-ga.exe' failed make: *** [qemu-ga.exe] Error 1 This is caused by a bug in the pkg-config file for glib as it doesn't define GLIB_STATIC_COMPILATION for pkg-config --static. Signed-off-by: Stefan Hajnoczi Signed-off-by: Sameeh Jubran --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index b9a30cf..6f7b460 100755 --- a/configure +++ b/configure @@ -4138,7 +4138,7 @@ int main(void) { return VSS_CTX_BACKUP; } EOF if compile_prog "$vss_win32_include" "" ; then guest_agent_with_vss="yes" - QEMU_CFLAGS="$QEMU_CFLAGS $vss_win32_include" + QEMU_CFLAGS="-DGLIB_STATIC_COMPILATION $QEMU_CFLAGS $vss_win32_include" libs_qga="-lole32 -loleaut32 -lshlwapi -lstdc++ -Wl,--enable-stdcall-fixup $libs_qga" qga_vss_provider="qga/vss-win32/qga-vss.dll qga/vss-win32/qga-vss.tlb" else -- 2.9.3