From patchwork Wed May 14 02:31:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masaki Muranaka X-Patchwork-Id: 900 X-Patchwork-Delegate: vapier@gentoo.org Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx22.g.dreamhost.com (mx2.sub5.homie.mail.dreamhost.com [208.113.200.128]) by wilcox.dreamhost.com (Postfix) with ESMTP id 0A572360098 for ; Tue, 13 May 2014 19:31:16 -0700 (PDT) Received: by homiemail-mx22.g.dreamhost.com (Postfix, from userid 14314964) id A96A1568CBAB; Tue, 13 May 2014 19:31:16 -0700 (PDT) X-Original-To: gdb@patchwork.siddhesh.in Delivered-To: x14314964@homiemail-mx22.g.dreamhost.com Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by homiemail-mx22.g.dreamhost.com (Postfix) with ESMTPS id 6349C570FC6C for ; Tue, 13 May 2014 19:31:16 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:date:message-id:subject:from:to :content-type; q=dns; s=default; b=UPykmM8jG72T4UjBu5NIqQQbCgohr yRP5Qcfp8SCC7l2SLPDJaeIR2YKKEUjEC4GtbvwhZFtx9VvqwdX0Sv9IlrNe0Wox j2EjTAUB0Rc5VioFmreSPyfbblK1Ks40feXweiECRbOe1dBspyw1LO9PW7EFhqzE EiKM3aVrFYthDg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:date:message-id:subject:from:to :content-type; s=default; bh=jUBlGk2PUg0WTdPZB1htnylHSNE=; b=ac/ nzn6gNmaurE+mWmuyHGIcPYTt0vtpbHtjq0IHDAb410mug6ZFOCdZopEVSR7tqXW ZCzbZ6JPL+VL6kBs/IIaJ/1O9c0nXQ6RzfT+afsHEw9Vy3A8bZpxuoCPi0gbqJ1P 77b048W+jqxclFGNOGS+pOk5HtrG64diBa+el/Cc= Received: (qmail 21230 invoked by alias); 14 May 2014 02:31:14 -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 21206 invoked by uid 89); 14 May 2014 02:31:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-HELO: mail-lb0-f174.google.com Received: from mail-lb0-f174.google.com (HELO mail-lb0-f174.google.com) (209.85.217.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 14 May 2014 02:31:06 +0000 Received: by mail-lb0-f174.google.com with SMTP id n15so929698lbi.33 for ; Tue, 13 May 2014 19:31:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to :content-type; bh=AAe+9CBIeRlBAclrWDUTAOzxx0CyDNcdgi+0pjz2J6o=; b=ejf4EWRaDhoKPCJ+KPtVdVsozwMXWJRrXXwvYKO61BzYmpb7QWHbJU7eJR45jZ6O8X ncHnlQ++cg8qqlMqwTROtDut1tFC4CZuNtLw88IPvTNNtCQQhOAQ3TmRvpQ1lx8VDWOi PD3E83N+4fsXiEAFol8Z/E7yesN5/Bw7IDF89iadjd7e7ak7rdd9Ha63oyLud0HvWLWN 3etdDFzI36BuUjuWCmW0VLBAlD88ypaXLZnbbhDPgfFOAQlV3wwREoTkYoByHktOxq1o zqx6xH90FMunGWWa2LDvem83hosc46IJc7IiySVjNe+C87dJGzOwsVmPtfxG8WasSc1U v2Xg== X-Gm-Message-State: ALoCoQlC/VQuA3sKodhiUEmE23VePR15lu0qyiQAP8jPRVUKxlW6jSZrbsC0inxGu/iyXV68/7Wu MIME-Version: 1.0 X-Received: by 10.152.29.168 with SMTP id l8mr428310lah.35.1400034662861; Tue, 13 May 2014 19:31:02 -0700 (PDT) Received: by 10.114.98.41 with HTTP; Tue, 13 May 2014 19:31:02 -0700 (PDT) Date: Wed, 14 May 2014 11:31:02 +0900 Message-ID: Subject: [PATCH][sim] Fix linkage errors in Clang. From: Masaki Muranaka To: gdb-patches@sourceware.org X-IsSubscribed: yes X-DH-Original-To: gdb@patchwork.siddhesh.in Hello. By differences about inline function, we can't build simulators on Clang. I have write after approval permission. Ok to apply this? >From 4c2093a1765fdf626335d3f3479bd076627bdb3b Mon Sep 17 00:00:00 2001 From: Masaki Muranaka Date: Wed, 14 May 2014 11:17:12 +0900 Subject: [PATCH] Fix linkage errors in Clang * common/cgen-mem.h: Fix linkage errors in Clang * common/cgen-ops.h: Ditto. * common/sim-arange.h: Ditto. --- sim/ChangeLog | 6 ++++++ sim/common/cgen-mem.h | 4 +++- sim/common/cgen-ops.h | 7 ++++++- sim/common/sim-arange.h | 7 ++++++- 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/sim/ChangeLog b/sim/ChangeLog index 35d0920..94445fa 100644 --- a/sim/ChangeLog +++ b/sim/ChangeLog @@ -1,3 +1,9 @@ +2014-05-14 Muranaka Masaki + + * common/cgen-mem.h: Fix linkage errors in Clang + * common/cgen-ops.h: Ditto. + * common/sim-arange.h: Ditto. + 2014-03-12 Nick Clifton * MAINTAINERS: Add myself as the maintainer for the MSP430. diff --git a/sim/common/cgen-mem.h b/sim/common/cgen-mem.h index 1999b29..f2d93a1 100644 --- a/sim/common/cgen-mem.h +++ b/sim/common/cgen-mem.h @@ -20,7 +20,9 @@ along with this program. If not, see . */ #ifndef CGEN_MEM_H #define CGEN_MEM_H -#ifdef MEMOPS_DEFINE_INLINE +#if defined (__clang__) +#define MEMOPS_INLINE static inline +#elif defined (MEMOPS_DEFINE_INLINE) #define MEMOPS_INLINE #else #define MEMOPS_INLINE extern inline diff --git a/sim/common/cgen-ops.h b/sim/common/cgen-ops.h index e1a827a..96372b3 100644 --- a/sim/common/cgen-ops.h +++ b/sim/common/cgen-ops.h @@ -24,7 +24,12 @@ along with this program. If not, see . #include -#if defined (__GNUC__) && ! defined (SEMOPS_DEFINE_INLINE) +#if defined (__clang__) +#ifndef SEMOPS_DEFINE_INLINE +#define SEMOPS_DEFINE_INLINE +#endif +#define SEMOPS_INLINE static inline +#elif defined (__GNUC__) && ! defined (SEMOPS_DEFINE_INLINE) #define SEMOPS_DEFINE_INLINE #define SEMOPS_INLINE extern inline #else diff --git a/sim/common/sim-arange.h b/sim/common/sim-arange.h index 61cd4d4..b001105 100644 --- a/sim/common/sim-arange.h +++ b/sim/common/sim-arange.h @@ -62,7 +62,12 @@ extern void sim_addr_range_delete (ADDR_RANGE * /*ar*/, /* Return non-zero if ADDR is in range AR, traversing the entire tree. If no range is specified, that is defined to mean "everything". */ -extern INLINE int +#if defined (__clang__) +static +#else +extern +#endif +INLINE int sim_addr_range_hit_p (ADDR_RANGE * /*ar*/, address_word /*addr*/); #define ADDR_RANGE_HIT_P(ar, addr) \ ((ar)->range_tree == NULL || sim_addr_range_hit_p ((ar), (addr)))