From patchwork Tue Feb 23 14:56:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christian Ehrhardt X-Patchwork-Id: 12100443 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5AD08C433E0 for ; Tue, 23 Feb 2021 15:05:41 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0C35A64DDA for ; Tue, 23 Feb 2021 15:05:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0C35A64DDA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=canonical.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:38792 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lEZFm-0007BH-LY for qemu-devel@archiver.kernel.org; Tue, 23 Feb 2021 10:05:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46794) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lEZE9-0005Y2-W2 for qemu-devel@nongnu.org; Tue, 23 Feb 2021 10:03:54 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:60548) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.90_1) (envelope-from ) id 1lEZE7-00014L-RV for qemu-devel@nongnu.org; Tue, 23 Feb 2021 10:03:53 -0500 Received: from 2.general.paelzer.uk.vpn ([10.172.196.173] helo=Keschdeichel.fritz.box) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lEZE4-0005Jz-Qg; Tue, 23 Feb 2021 15:03:48 +0000 From: Christian Ehrhardt To: qemu-devel Subject: [PATCH] disas: Fix build with glib2.0 >=2.67.3 Date: Tue, 23 Feb 2021 15:56:46 +0100 Message-Id: <20210223145646.4129643-1-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 Received-SPF: none client-ip=91.189.89.112; envelope-from=christian.ehrhardt@canonical.com; helo=youngberry.canonical.com X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Christian Ehrhardt Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" glib2.0 introduced a change in 2.67.3 and later which triggers an issue [1] for anyone including it's headers in a "extern C" context which a few files in disas/* do. An example of such an include chain and error look like: ../../disas/arm-a64.cc In file included from /usr/include/glib-2.0/glib/gmacros.h:241, from /usr/lib/x86_64-linux-gnu/glib-2.0/include/glibconfig.h:9, from /usr/include/glib-2.0/glib/gtypes.h:32, from /usr/include/glib-2.0/glib/galloca.h:32, from /usr/include/glib-2.0/glib.h:30, from /<>/qemu-5.2+dfsg/include/glib-compat.h:32, from /<>/qemu-5.2+dfsg/include/qemu/osdep.h:126, from ../../disas/arm-a64.cc:21: /usr/include/c++/10/type_traits:56:3: error: template with C linkage 56 | template | ^~~~~~~~ ../../disas/arm-a64.cc:20:1: note: ‘extern "C"’ linkage started here 20 | extern "C" { | ^~~~~~~~~~ To fix that move the include of osdep.h out of that section. It was added already as C++ fixup by e78490c44: "disas/arm-a64.cc: Include osdep.h first". [1]: https://gitlab.gnome.org/GNOME/glib/-/issues/2331 Signed-off-by: Christian Ehrhardt --- disas/arm-a64.cc | 2 +- disas/nanomips.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/disas/arm-a64.cc b/disas/arm-a64.cc index 9fa779e175..27613d4b25 100644 --- a/disas/arm-a64.cc +++ b/disas/arm-a64.cc @@ -17,8 +17,8 @@ * along with this program. If not, see . */ -extern "C" { #include "qemu/osdep.h" +extern "C" { #include "disas/dis-asm.h" } diff --git a/disas/nanomips.cpp b/disas/nanomips.cpp index 90e63b8367..3c202075cc 100644 --- a/disas/nanomips.cpp +++ b/disas/nanomips.cpp @@ -27,8 +27,8 @@ * Reference Manual", Revision 01.01, April 27, 2018 */ -extern "C" { #include "qemu/osdep.h" +extern "C" { #include "disas/dis-asm.h" }