From nobody Wed Feb 5 14:53:48 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1737044087; cv=none; d=zohomail.com; s=zohoarc; b=NheZJIUETW5zppM4+x3NZfgXRkRz5p8wTvQUzOjR+ea46U/mmyF4NfI1PGL1uKXA98StEiGiIMLR2nkvbh2GlXD3+u7Z+Of8VfeOVXNAF2jJqWAxSVCFsRAC2D28Rlfrb7XDvfJoG6LUZl9RICWd6CwP5/rO2WCJ7jHeITGi2zE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1737044087; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=r8aoZ+4wIpFt1loPUkrjNZIwpI4hyfnz2K8d4L8ae9I=; b=aOmHjp2LoWdjFy00mkw0/HFDEl3yCbqdCGu5JZ1wznhM5IwjuD5RZwKbmnz5NZLiQUgj2bGy05WKTI9jUyQC86eRKG/2nh/L2ig0wERWw7V5BcWvCTwh85R/QF0F02QrbdNjk5SM0LnzRo59/BzNdZ1nN8t5SVUU0BmZHaHMsgY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1737044087912957.3957838235174; Thu, 16 Jan 2025 08:14:47 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYSVU-0008Lr-FX; Thu, 16 Jan 2025 11:14:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tYSTw-0003m1-9V for qemu-devel@nongnu.org; Thu, 16 Jan 2025 11:12:41 -0500 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYSTj-0004Wx-Hr for qemu-devel@nongnu.org; Thu, 16 Jan 2025 11:12:29 -0500 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-385de9f789cso880794f8f.2 for ; Thu, 16 Jan 2025 08:12:19 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38bf3221b5asm238633f8f.21.2025.01.16.08.12.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jan 2025 08:12:15 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id B1806608D2; Thu, 16 Jan 2025 16:03:08 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737043938; x=1737648738; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=r8aoZ+4wIpFt1loPUkrjNZIwpI4hyfnz2K8d4L8ae9I=; b=dyGCsp8MXtoz1cxO0M2BIymsCRCpWD5xJg6dQGTg8oSihysF2KUVO++6c46OzaUPIf 0WGTFQ24V4WyLhgJmxnxylJ1Yicx46rRsWxvXhdfPr5OlRLEJxMUlQBq6D4Bf6Zjg8X3 zOEPP3T12Bmt1BlsyFRSJ4aHBLvghh/kLMSdZaQrKBwm6LAHKbavd8mrlbd3bKHqUgWy g+3zRNGROStNfYR3/v+C8QJnTIFZ/VKZ6ScdQl0HsSb2KAoj5Yam1zNu/q6gII7a69lB OTYXJw9cWK03X6aB8oDAn/jcWpbrNREgwSpc6Lk18Q84ykxhYPbEx//OpPc/zQjL/j2w RGJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737043938; x=1737648738; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=r8aoZ+4wIpFt1loPUkrjNZIwpI4hyfnz2K8d4L8ae9I=; b=N0Hvy4+hin5+7v5cnkrgvC6t/7X9eQEY7LBYuw4ZVcnMaKAl1aXXnccF5vPseWChC+ I+OfVZYat0tTOEYwbewZ8hS3ygnMn/fIFO2A94btZqcIHqW/hYhQ8mAzRLjpoFRndOiM TOXF/dNDiixOGOQbnX7TI8rjrYUGCaDkqA+yoUkAXi+o9LOoQL68S6lzTIG7yMPioSJB JBffh2bC6j4tGlOJEuS6Y1Ygt4azmvPSbcP6BuJacl3NcaftHriLt9F9UmaKJRFB6OMw ooyDB040XNpYTKIlj+i67FYmxg5M3cOjOSiLqGGXzuYJX1wwCsnfF1kbcnMf/7Stf31U tYRA== X-Gm-Message-State: AOJu0Yze4eBzpO5rSJdYobLnJKwjFsbNgQodyby7Pz3ZlPRmjoG9HLSC sDCwnlOXCFvwcq4q9HM4rFFQNEij8I2CKHa7kfOT6OndNwdPY4NWp6ehDglMfB0= X-Gm-Gg: ASbGncveAtGryZo+FzpCCdN4DsyOSSkzpDrMl7n14cPgjCEiuDFpgDS9leZ0bQyjgOb v3jQ71ZXxp+yuiLeLMsU8Oc6iLcqArPH4/wB4lJZxdQoS8MwAlB5hVksIRGYLND4QsPvyQP1aZ4 8iBIVWJIxWFE0If2nyD4nZnKITrNsaonisWXgmp5qBaXyWBSg5Lql8F/8bRe7I23H4mA2bDAikj /slbqowVD4FJm/lb051qlxsP7wT4FsKZiDmrLFJBrnEqFnpOOLHt6g= X-Google-Smtp-Source: AGHT+IFaB1wLQxQYs7LjX16DzCaYtwmpePr9HH7XSW4w/QdpdC0d/9H4WPpLX9h8tVZERkhRdWPAYw== X-Received: by 2002:a5d:47c5:0:b0:38b:ed6f:f00f with SMTP id ffacd0b85a97d-38bed6ff21emr2468045f8f.17.1737043937822; Thu, 16 Jan 2025 08:12:17 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Markus Armbruster , Yuri Benditovich , Jason Wang , Cleber Rosa , "Dr. David Alan Gilbert" , Peter Xu , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefan Weil , Stefano Garzarella , qemu-arm@nongnu.org, Michael Roth , Laurent Vivier , Mahmoud Mandour , Andrew Melnychenko , Konstantin Kostiuk , Kyle Evans , Richard Henderson , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , John Snow , David Hildenbrand , Fabiano Rosas , Alexandre Iooss , Eric Blake , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Vladimir Sementsov-Ogievskiy , Pierrick Bouvier , Kevin Wolf , Peter Maydell , Laurent Vivier , "Michael S. Tsirkin" , Thomas Huth , Warner Losh , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v3 23/37] win32: remove usage of attribute gcc_struct Date: Thu, 16 Jan 2025 16:02:52 +0000 Message-Id: <20250116160306.1709518-24-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250116160306.1709518-1-alex.bennee@linaro.org> References: <20250116160306.1709518-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x433.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1737044090022019000 From: Pierrick Bouvier This attribute is not recognized by clang. An investigation has been performed to ensure this attribute has no effect on layout of structures we use in QEMU [1], so it's safe to remove now. In the future, we'll forbid introducing new bitfields in packed struct, as they are the one potentially impacted by this change. [1] https://lore.kernel.org/qemu-devel/66c346de-7e20-4831-b3eb-1cda83240af9= @linaro.org/ Reviewed-by: Thomas Huth Reviewed-by: Richard Henderson Acked-by: Stefano Garzarella Signed-off-by: Pierrick Bouvier Acked-by: Michael S. Tsirkin Tested-by: Stefan Weil Tested-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20250110203401.178532-2-pierrick.bouvier@linaro.org> Signed-off-by: Alex Benn=C3=A9e --- meson.build | 5 ----- include/qemu/compiler.h | 7 +------ scripts/cocci-macro-file.h | 6 +----- subprojects/libvhost-user/libvhost-user.h | 6 +----- 4 files changed, 3 insertions(+), 21 deletions(-) diff --git a/meson.build b/meson.build index d06f59095c..da279cc112 100644 --- a/meson.build +++ b/meson.build @@ -377,11 +377,6 @@ elif host_os =3D=3D 'sunos' qemu_common_flags +=3D '-D__EXTENSIONS__' elif host_os =3D=3D 'haiku' qemu_common_flags +=3D ['-DB_USE_POSITIVE_POSIX_ERRORS', '-D_BSD_SOURCE'= , '-fPIC'] -elif host_os =3D=3D 'windows' - if not compiler.compiles('struct x { int y; } __attribute__((gcc_struct)= );', - args: '-Werror') - error('Your compiler does not support __attribute__((gcc_struct)) - pl= ease use GCC instead of Clang') - endif endif =20 # Choose instruction set (currently x86-only) diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h index c06954ccb4..d904408e5e 100644 --- a/include/qemu/compiler.h +++ b/include/qemu/compiler.h @@ -22,12 +22,7 @@ #define QEMU_EXTERN_C extern #endif =20 -#if defined(_WIN32) && (defined(__x86_64__) || defined(__i386__)) -# define QEMU_PACKED __attribute__((gcc_struct, packed)) -#else -# define QEMU_PACKED __attribute__((packed)) -#endif - +#define QEMU_PACKED __attribute__((packed)) #define QEMU_ALIGNED(X) __attribute__((aligned(X))) =20 #ifndef glue diff --git a/scripts/cocci-macro-file.h b/scripts/cocci-macro-file.h index d247a5086e..c64831d540 100644 --- a/scripts/cocci-macro-file.h +++ b/scripts/cocci-macro-file.h @@ -23,11 +23,7 @@ #define G_GNUC_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) #define G_GNUC_NULL_TERMINATED __attribute__((sentinel)) =20 -#if defined(_WIN32) && (defined(__x86_64__) || defined(__i386__)) -# define QEMU_PACKED __attribute__((gcc_struct, packed)) -#else -# define QEMU_PACKED __attribute__((packed)) -#endif +#define QEMU_PACKED __attribute__((packed)) =20 #define cat(x,y) x ## y #define cat2(x,y) cat(x,y) diff --git a/subprojects/libvhost-user/libvhost-user.h b/subprojects/libvho= st-user/libvhost-user.h index deb40e77b3..2ffc58c11b 100644 --- a/subprojects/libvhost-user/libvhost-user.h +++ b/subprojects/libvhost-user/libvhost-user.h @@ -186,11 +186,7 @@ typedef struct VhostUserShared { unsigned char uuid[UUID_LEN]; } VhostUserShared; =20 -#if defined(_WIN32) && (defined(__x86_64__) || defined(__i386__)) -# define VU_PACKED __attribute__((gcc_struct, packed)) -#else -# define VU_PACKED __attribute__((packed)) -#endif +#define VU_PACKED __attribute__((packed)) =20 typedef struct VhostUserMsg { int request; --=20 2.39.5