Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 1 | Upstream-Status: Backport |
| 2 | |
| 3 | https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=92fc615 |
| 4 | |
| 5 | Signed-off-by: Kai Kang <kai.kang@windriver.com> |
| 6 | -- |
| 7 | From 92fc6153a6fdf2a027d9780f5945712aafad4a9e Mon Sep 17 00:00:00 2001 |
| 8 | From: Mike Frysinger <vapier@gentoo.org> |
| 9 | Date: Sun, 29 Mar 2015 15:59:01 -0400 |
| 10 | Subject: [PATCH] sim: common: sim-arange: fix extern inline handling |
| 11 | |
| 12 | With newer versions of gcc (5.x), the extern inline we're using with the |
| 13 | sim-arange module no longer works. Since this code really wants the gnu |
| 14 | inline semantics, use that attribute explicitly. |
| 15 | |
| 16 | Reported-by: DJ Delorie <dj@redhat.com> |
| 17 | Reported-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 | |
| 23 | diff --git a/gdb-7.6/sim/common/sim-arange.h b/gdb-7.6/sim/common/sim-arange.h |
| 24 | index 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 | |
| 62 | diff --git a/gdb-7.6/sim/common/sim-inline.h b/gdb-7.6/sim/common/sim-inline.h |
| 63 | index 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 | -- |
| 78 | 2.6.1 |
| 79 | |