[PATCH] Remove _Unwind_{Get,Set}{GR,IP} from ARM EHABI build.

Logan Chien tzuhsiang.chien at gmail.com
Tue Jan 20 05:02:57 PST 2015


Ping?

On Sat, Jan 17, 2015 at 3:58 PM, Logan Chien <tzuhsiang.chien at gmail.com>
wrote:

> Hi danalbert, rengolin, jroelofs,
>
> I found that declaring _Unwind_{Get,Set}{GR,IP} as the external
> functions will break the build with libgcc, which does not define
> these functions in their libraries.
>
> Besides, IMO, since these are not part of the ARM EHABI specification
> it will be better to avoid introducing ABI backward incompatible
> changes.
>
> This commit partially reverts r219629.
>
> Please have a look.  Thanks.
>
> (p.s. This is the 1/6 patch to fix the backtrace_test and libgcc support.)
>
> http://reviews.llvm.org/D7029
>
> Files:
>   include/unwind.h
>   src/Unwind/Unwind-EHABI.cpp
>
> Index: include/unwind.h
> ===================================================================
> --- include/unwind.h
> +++ include/unwind.h
> @@ -208,11 +208,37 @@
>                  _Unwind_VRS_DataRepresentation representation);
>  #endif
>
> +#if LIBCXXABI_ARM_EHABI && !LIBCXXABI_USE_LLVM_UNWINDER
> +static inline uintptr_t _Unwind_GetGR(struct _Unwind_Context* context,
> +                                      int index) {
> +  uintptr_t value = 0;
> +  _Unwind_VRS_Get(context, _UVRSC_CORE, (uint32_t)index, _UVRSD_UINT32,
> &value);
> +  return value;
> +}
> +
> +static inline void _Unwind_SetGR(struct _Unwind_Context* context, int
> index,
> +                                 uintptr_t new_value) {
> +  _Unwind_VRS_Set(context, _UVRSC_CORE, (uint32_t)index,
> +                  _UVRSD_UINT32, &new_value);
> +}
> +
> +static inline uintptr_t _Unwind_GetIP(struct _Unwind_Context* context) {
> +  // remove the thumb-bit before returning
> +  return (_Unwind_GetGR(context, 15) & (~(uintptr_t)0x1));
> +}
> +
> +static inline void _Unwind_SetIP(struct _Unwind_Context* context,
> +                                 uintptr_t new_value) {
> +  uintptr_t thumb_bit = _Unwind_GetGR(context, 15) & ((uintptr_t)0x1);
> +  _Unwind_SetGR(context, 15, new_value | thumb_bit);
> +}
> +#else
>  extern uintptr_t _Unwind_GetGR(struct _Unwind_Context *context, int
> index);
>  extern void _Unwind_SetGR(struct _Unwind_Context *context, int index,
>                            uintptr_t new_value);
>  extern uintptr_t _Unwind_GetIP(struct _Unwind_Context *context);
>  extern void _Unwind_SetIP(struct _Unwind_Context *, uintptr_t new_value);
> +#endif
>
>  extern uintptr_t _Unwind_GetRegionStart(struct _Unwind_Context *context);
>  extern uintptr_t
> Index: src/Unwind/Unwind-EHABI.cpp
> ===================================================================
> --- src/Unwind/Unwind-EHABI.cpp
> +++ src/Unwind/Unwind-EHABI.cpp
> @@ -206,28 +206,6 @@
>
>  } // end anonymous namespace
>
> -uintptr_t _Unwind_GetGR(struct _Unwind_Context* context, int index) {
> -  uintptr_t value = 0;
> -  _Unwind_VRS_Get(context, _UVRSC_CORE, (uint32_t)index, _UVRSD_UINT32,
> &value);
> -  return value;
> -}
> -
> -void _Unwind_SetGR(struct _Unwind_Context* context, int index, uintptr_t
> -    new_value) {
> -  _Unwind_VRS_Set(context, _UVRSC_CORE, (uint32_t)index,
> -                  _UVRSD_UINT32, &new_value);
> -}
> -
> -uintptr_t _Unwind_GetIP(struct _Unwind_Context* context) {
> -  // remove the thumb-bit before returning
> -  return (_Unwind_GetGR(context, 15) & (~(uintptr_t)0x1));
> -}
> -
> -void _Unwind_SetIP(struct _Unwind_Context* context, uintptr_t new_value) {
> -  uintptr_t thumb_bit = _Unwind_GetGR(context, 15) & ((uintptr_t)0x1);
> -  _Unwind_SetGR(context, 15, new_value | thumb_bit);
> -}
> -
>  /**
>   * Decodes an EHT entry.
>   *
>
> EMAIL PREFERENCES
>   http://reviews.llvm.org/settings/panel/emailpreferences/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150120/4be26061/attachment.html>


More information about the cfe-commits mailing list