blob: 0185b570457c35d49373f02f246fc96fab21b9e2 [file] [log] [blame]
Patrick Williamsb48b7b42016-08-17 15:04:38 -05001Upstream-Status: Backport
2
3https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=92fc615
4
5Signed-off-by: Kai Kang <kai.kang@windriver.com>
6--
7From 92fc6153a6fdf2a027d9780f5945712aafad4a9e Mon Sep 17 00:00:00 2001
8From: Mike Frysinger <vapier@gentoo.org>
9Date: Sun, 29 Mar 2015 15:59:01 -0400
10Subject: [PATCH] sim: common: sim-arange: fix extern inline handling
11
12With newer versions of gcc (5.x), the extern inline we're using with the
13sim-arange module no longer works. Since this code really wants the gnu
14inline semantics, use that attribute explicitly.
15
16Reported-by: DJ Delorie <dj@redhat.com>
17Reported-by: Joel Sherrill <joel.sherrill@oarcorp.com>
18---
19 gdb-7.6/sim/common/sim-arange.h | 20 ++++++++++++--------
20 gdb-7.6/sim/common/sim-inline.h | 4 +++-
21 2 files changed, 15 insertions(+), 9 deletions(-)
22
23diff --git a/gdb-7.6/sim/common/sim-arange.h b/gdb-7.6/sim/common/sim-arange.h
24index 73117f3..de842c9 100644
25--- a/gdb-7.6/sim/common/sim-arange.h
26+++ b/gdb-7.6/sim/common/sim-arange.h
27@@ -60,22 +60,26 @@ extern void sim_addr_range_delete (ADDR_RANGE * /*ar*/,
28 address_word /*start*/,
29 address_word /*end*/);
30
31+/* TODO: This should get moved into sim-inline.h. */
32+#ifdef HAVE_INLINE
33+#ifdef SIM_ARANGE_C
34+#define SIM_ARANGE_INLINE INLINE
35+#else
36+#define SIM_ARANGE_INLINE EXTERN_INLINE
37+#endif
38+#else
39+#define SIM_ARANGE_INLINE EXTERN
40+#endif
41+
42 /* Return non-zero if ADDR is in range AR, traversing the entire tree.
43 If no range is specified, that is defined to mean "everything". */
44-extern INLINE int
45+SIM_ARANGE_INLINE int
46 sim_addr_range_hit_p (ADDR_RANGE * /*ar*/, address_word /*addr*/);
47 #define ADDR_RANGE_HIT_P(ar, addr) \
48 ((ar)->range_tree == NULL || sim_addr_range_hit_p ((ar), (addr)))
49
50 #ifdef HAVE_INLINE
51-#ifdef SIM_ARANGE_C
52-#define SIM_ARANGE_INLINE INLINE
53-#else
54-#define SIM_ARANGE_INLINE EXTERN_INLINE
55-#endif
56 #include "sim-arange.c"
57-#else
58-#define SIM_ARANGE_INLINE
59 #endif
60 #define SIM_ARANGE_C_INCLUDED
61
62diff --git a/gdb-7.6/sim/common/sim-inline.h b/gdb-7.6/sim/common/sim-inline.h
63index af75562..8a9c286 100644
64--- a/gdb-7.6/sim/common/sim-inline.h
65+++ b/gdb-7.6/sim/common/sim-inline.h
66@@ -303,7 +303,9 @@
67 /* ??? Temporary, pending decision to always use extern inline and do a vast
68 cleanup of inline support. */
69 #ifndef INLINE2
70-#if defined (__GNUC__)
71+#if defined (__GNUC_GNU_INLINE__) || defined (__GNUC_STDC_INLINE__)
72+#define INLINE2 __inline__ __attribute__ ((__gnu_inline__))
73+#elif defined (__GNUC__)
74 #define INLINE2 __inline__
75 #else
76 #define INLINE2 /*inline*/
77--
782.6.1
79