From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@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 02:31:00 -0000 Message-ID: Subject: [PATCH][sim] Fix linkage errors in Clang. From: Masaki Muranaka To: gdb-patches@sourceware.org Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2014-05/txt/msg00186.txt.bz2 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))) -- 1.8.5.2 (Apple Git-48)