From nobody Fri May 3 02:59:17 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1541780339620788.6087860179406; Fri, 9 Nov 2018 08:18:59 -0800 (PST) Received: from localhost ([::1]:34874 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gL9Fk-0000DI-RN for importer@patchew.org; Fri, 09 Nov 2018 11:03:24 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56060) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gL9E2-0007nA-LN for qemu-devel@nongnu.org; Fri, 09 Nov 2018 11:01:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gL9E1-000820-3x for qemu-devel@nongnu.org; Fri, 09 Nov 2018 11:01:38 -0500 Received: from mail-ot1-x341.google.com ([2607:f8b0:4864:20::341]:42801) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gL9E0-0007Fk-KM for qemu-devel@nongnu.org; Fri, 09 Nov 2018 11:01:36 -0500 Received: by mail-ot1-x341.google.com with SMTP id n46so2018525otb.9 for ; Fri, 09 Nov 2018 08:00:42 -0800 (PST) Received: from localhost ([2600:1700:70:e488:a976:aac5:9bc6:1403]) by smtp.gmail.com with ESMTPSA id e42sm8163191oth.36.2018.11.09.08.00.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 09 Nov 2018 08:00:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=GTpSlPYPGw7bW5czi+FnZIklECkUbMRMls0Lp/cEXT0=; b=oLQh091dZYMLf7eyjvUOowArmC/stHdcxRxW6k/jcaQ8v5fIWodwz+gBBNE0Q3HvsT d5/9jmtDFhkpQ/ZN8H7ljtGVf4MzHftenAlWIr5quAPYfJanyEuO9BCiweAl1edBfYqA iniPWSCO66E4bke8ksBZF1LLFT1ftNk2WCpbBHRx5dx8lXtH0YeQrMR8SgSjB2Pr63Qi Vm1VUKlmeP/R2FbshovamXe6xZChT1ksNEpjr/9VIZXJbEIWTF/snB18EWUb8P9EDjmg USQXu9k4r054yGxACYO6oxYhProRDNq7G+ecGqhSWe+Lm/DfE4jmdL1ZYN2aGoiIYFoD rElA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=GTpSlPYPGw7bW5czi+FnZIklECkUbMRMls0Lp/cEXT0=; b=s2fBDWjHpKDx8bxNa55wydy6lJ6RztoHg1pcbTGp9fmOammv2LQTNVafZBpQo6QYJY qaONvKiUq3VhkXym79faC5YEyWzPNVOIpDd90ZAbCGOADdw3Yq3wbjMy7yYngFq9QE3M VGlOpRFOELrZFMFzmJ5AjCCjjWSYR6PnzQha/Fpt/4+WYKyags0U6o0ry0QU+fviEDRl bDUS+76ctueaYa2Ddwv4dnTGpSXU/b36Ya18Ri5kgVUjuP5H4ofwiabbe6tqpmFvVf2b d3DPC426Cujz3lOgqxjFIYd32wr0Amz9dW0rQFvscbxlSI2oWtzIK7PfJawiBt+gblcr dMxA== X-Gm-Message-State: AGRZ1gLjtexU6OSunVUSQqJ1EJjzgwCz2YPcSibtnkcfZd3vibf0ms5v yp1Li9e1+6H3NqNkwBC6ysGAgdh3 X-Google-Smtp-Source: AJdET5e8prgcQV62SoVJC9XZzZ32ei8wtENOTCy5EZOZIFXTmwxIJyHmZaFF/+3Uy+jL3y/ntFAIow== X-Received: by 2002:a9d:7097:: with SMTP id l23mr5385782otj.49.1541779240562; Fri, 09 Nov 2018 08:00:40 -0800 (PST) From: Michael Roth To: qemu-devel@nongnu.org Date: Fri, 9 Nov 2018 10:00:14 -0600 Message-Id: <20181109160014.28646-1-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::341 Subject: [Qemu-devel] [PATCH] build: qga: add macro to force use of native mingw32 assert() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" When building qemu-ga for w32 with VSS support, some parts of qemu-ga are not linked against glib, specifically the C++ bits used to create the VSS provider DLL. With 3ebee3b191e, we now define assert() as g_assert() for all mingw32 builds via osdep.h, which results in the following build breakage: x86_64-w64-mingw32-g++ -o qga/vss-win32/qga-vss.dll qga/vss-win32/request= er.o qga/vss-win32/provider.o qga/vss-win32/install.o /home/mdroth/w/qemu4.= git/qga/vss-win32/qga-vss.def -shared -Wl,--add-stdcall-alias,--enable-std= call-fixup -lole32 -loleaut32 -lshlwapi -luuid -static qga/vss-win32/requester.o: In function `requester_freeze': /home/mdroth/w/qemu4.git/qga/vss-win32/requester.cpp:284: undefined refer= ence to `g_assertion_message_expr' qga/vss-win32/requester.o: In function `requester_thaw': /home/mdroth/w/qemu4.git/qga/vss-win32/requester.cpp:508: undefined refer= ence to `g_assertion_message_expr' /home/mdroth/w/qemu4.git/qga/vss-win32/requester.cpp:509: undefined refer= ence to `g_assertion_message_expr' collect2: error: ld returned 1 exit status make: *** [/home/mdroth/w/qemu4.git/qga/vss-win32/Makefile.objs:10: qga/v= ss-win32/qga-vss.dll] Error 1 make: *** Waiting for unfinished jobs.... Fix this by introducing a USE_NATIVE_MINGW32_ASSERT macro that can be defined prior to inclusion of osdep.h in individual C/C++ files that don't link against glib. Cc: Richard Henderson Signed-off-by: Michael Roth --- include/qemu/osdep.h | 2 +- qga/vss-win32/install.cpp | 2 +- qga/vss-win32/provider.cpp | 2 +- qga/vss-win32/requester.cpp | 2 +- qga/vss-win32/vss-common.h | 2 ++ 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 3bf48bcdec..59364bfeb0 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -129,7 +129,7 @@ extern int daemon(int, int); * code that is unreachable when features are disabled. * All supported versions of Glib's g_assert() satisfy this requirement. */ -#ifdef __MINGW32__ +#if defined(__MINGW32__) && !defined(USE_NATIVE_MINGW32_ASSERT) #undef assert #define assert(x) g_assert(x) #endif diff --git a/qga/vss-win32/install.cpp b/qga/vss-win32/install.cpp index 6713e58670..6ed2d5930c 100644 --- a/qga/vss-win32/install.cpp +++ b/qga/vss-win32/install.cpp @@ -10,9 +10,9 @@ * See the COPYING file in the top-level directory. */ =20 +#include "vss-common.h" #include "qemu/osdep.h" =20 -#include "vss-common.h" #include #include "install.h" #include diff --git a/qga/vss-win32/provider.cpp b/qga/vss-win32/provider.cpp index 72d8b0e19d..d298af91b2 100644 --- a/qga/vss-win32/provider.cpp +++ b/qga/vss-win32/provider.cpp @@ -10,8 +10,8 @@ * See the COPYING file in the top-level directory. */ =20 -#include "qemu/osdep.h" #include "vss-common.h" +#include "qemu/osdep.h" #include #include =20 diff --git a/qga/vss-win32/requester.cpp b/qga/vss-win32/requester.cpp index 5378c55d23..d239bd9598 100644 --- a/qga/vss-win32/requester.cpp +++ b/qga/vss-win32/requester.cpp @@ -10,8 +10,8 @@ * See the COPYING file in the top-level directory. */ =20 -#include "qemu/osdep.h" #include "vss-common.h" +#include "qemu/osdep.h" #include "requester.h" #include "install.h" #include diff --git a/qga/vss-win32/vss-common.h b/qga/vss-win32/vss-common.h index 61c170b52e..275cbb59c5 100644 --- a/qga/vss-win32/vss-common.h +++ b/qga/vss-win32/vss-common.h @@ -13,6 +13,8 @@ #ifndef VSS_COMMON_H #define VSS_COMMON_H =20 +#define USE_NATIVE_MINGW32_ASSERT + #define __MIDL_user_allocate_free_DEFINED__ #include #include --=20 2.17.1