From patchwork Thu Sep 20 20:22:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 29493 Received: (qmail 44525 invoked by alias); 20 Sep 2018 20:23:15 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 44391 invoked by uid 89); 20 Sep 2018 20:23:14 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.2 spammy=ULONGEST, ulongest X-HELO: sesbmg23.ericsson.net Received: from sesbmg23.ericsson.net (HELO sesbmg23.ericsson.net) (193.180.251.37) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 20 Sep 2018 20:23:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; d=ericsson.com; s=mailgw201801; c=relaxed/simple; q=dns/txt; i=@ericsson.com; t=1537474991; h=From:Sender:Reply-To:Subject:Date:Message-ID:To:CC:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=1dZJZWpxz1s8GCqnTuzwbE2vvrG/knqAogzaxxJCKHw=; b=HFF7IL/xPjGsitMv/ID9DoeOzwewMdHTWWuVhVi3Xau3+xToVkhQp6hCnCKaOvsb n1ZI+fM3EnM1YvOB8e3AuF9ZLD5RqYmAfpe8TBVSKl+H15ExABriRLpR0uPOANnf jAvFEtFoJlAq+E0jo1rOSPVo2YP89lN6oRudfcvA2/Y=; Received: from ESESSMB501.ericsson.se (Unknown_Domain [153.88.183.119]) by sesbmg23.ericsson.net (Symantec Mail Security) with SMTP id F8.98.05037.EA104AB5; Thu, 20 Sep 2018 22:23:11 +0200 (CEST) Received: from ESESBMB504.ericsson.se (153.88.183.171) by ESESSMB501.ericsson.se (153.88.183.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Thu, 20 Sep 2018 22:22:29 +0200 Received: from NAM05-DM3-obe.outbound.protection.outlook.com (153.88.183.157) by ESESBMB504.ericsson.se (153.88.183.171) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3 via Frontend Transport; Thu, 20 Sep 2018 22:22:29 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericsson.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sKvE8L0yDx30//pA6Mk8+qV7hbjCQNICrHk9sTBqi0Q=; b=Nh9DqmwzMUgCjG25w6wwNM95Qhh2afwkqAPF39J0Hzl4RQ7yVDWIzsu8y1u3yMG7Dj9cP8OthDKdktDBPCt4U04/Czr0Pmg53aD+21qkkZyYV7B9uQKXa/DnuSB9Lqu2vVdbPmYNV0scybf4a+FytgHbXmOoO2T5Nt0bd/Sqc1s= Received: from BYAPR15MB2390.namprd15.prod.outlook.com (52.135.198.30) by BYAPR15MB2374.namprd15.prod.outlook.com (52.135.198.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.18; Thu, 20 Sep 2018 20:22:27 +0000 Received: from BYAPR15MB2390.namprd15.prod.outlook.com ([fe80::6d9c:234d:1f2f:cecd]) by BYAPR15MB2390.namprd15.prod.outlook.com ([fe80::6d9c:234d:1f2f:cecd%4]) with mapi id 15.20.1143.017; Thu, 20 Sep 2018 20:22:27 +0000 From: Simon Marchi To: "gdb-patches@sourceware.org" CC: Alan Hayward , Simon Marchi Subject: [PATCH] Fix build error in aarch64-linux-tdep.c on macOS Date: Thu, 20 Sep 2018 20:22:26 +0000 Message-ID: <20180920202212.26274-1-simon.marchi@ericsson.com> authentication-results: spf=none (sender IP is ) smtp.mailfrom=simon.marchi@ericsson.com; received-spf: None (protection.outlook.com: ericsson.com does not designate permitted sender hosts) MIME-Version: 1.0 Return-Path: simon.marchi@ericsson.com X-IsSubscribed: yes When building with --enable-targets=all on macOS, I get this error: CXX aarch64-linux-tdep.o /Users/simark/src/binutils-gdb/gdb/aarch64-linux-tdep.c:328:7: error: no matching function for call to 'store_integer' store_integer ((gdb_byte *)&vg_target, sizeof (uint64_t), byte_order, ^~~~~~~~~~~~~ /Users/simark/src/binutils-gdb/gdb/defs.h:556:13: note: candidate template ignored: requirement 'Or, is_same >::value' was not satisfied [with T = unsigned long long] extern void store_integer (gdb_byte *addr, int len, enum bfd_endian byte_order, ^ I believe it's because uint64_t is defined as "unsigned long long" on macOS, even though "unsigned long" is also 64 bits. Other 64-bits platforms define uint64_t as "unsigned long". This makes the type of the argument to store_integer (unsigned long long) not match the requirement that it must be the same as ULONGEST, which is unsigned long. Fix it by changing the type of the vl variable to be ULONGEST, which is what extract_unsigned_integer returns anyway. gdb/ChangeLog: * aarch64-linux-tdep.c (aarch64_linux_supply_sve_regset): Change type of vl to ULONGEST. --- gdb/aarch64-linux-tdep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c index dc2b89121a6..42cd49e0154 100644 --- a/gdb/aarch64-linux-tdep.c +++ b/gdb/aarch64-linux-tdep.c @@ -316,7 +316,7 @@ aarch64_linux_supply_sve_regset (const struct regset *regset, passed in SVE regset or a NEON fpregset. */ /* Extract required fields from the header. */ - uint64_t vl = extract_unsigned_integer (header + SVE_HEADER_VL_OFFSET, + ULONGEST vl = extract_unsigned_integer (header + SVE_HEADER_VL_OFFSET, SVE_HEADER_VL_LENGTH, byte_order); uint16_t flags = extract_unsigned_integer (header + SVE_HEADER_FLAGS_OFFSET, SVE_HEADER_FLAGS_LENGTH,