FreeBSD expects _Unwind_GetGR, _Unwind_SetGR, and _Unwind_SetIP to be
symbols and not macros. Make this so. This fixes a few ports that try to link against these functions but fail as they previously didn't exist.
This commit is contained in:
parent
cb46e6c2af
commit
573a66c3dc
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=278023
@ -25,6 +25,7 @@
|
|||||||
along with this program; see the file COPYING. If not, write to
|
along with this program; see the file COPYING. If not, write to
|
||||||
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||||
Boston, MA 02110-1301, USA. */
|
Boston, MA 02110-1301, USA. */
|
||||||
|
#define __ARM_STATIC_INLINE
|
||||||
#include "unwind.h"
|
#include "unwind.h"
|
||||||
|
|
||||||
/* We add a prototype for abort here to avoid creating a dependency on
|
/* We add a prototype for abort here to avoid creating a dependency on
|
||||||
@ -1089,4 +1090,11 @@ _Unwind_GetIPInfo (struct _Unwind_Context *context, int *ip_before_insn)
|
|||||||
*ip_before_insn = 0;
|
*ip_before_insn = 0;
|
||||||
return _Unwind_GetGR (context, 15) & ~(_Unwind_Word)1;
|
return _Unwind_GetGR (context, 15) & ~(_Unwind_Word)1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
_Unwind_SetIP (struct _Unwind_Context *context, _Unwind_Ptr val)
|
||||||
|
{
|
||||||
|
_Unwind_SetGR (context, 15, val | (_Unwind_GetGR (context, 15) & 1));
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -34,6 +34,10 @@
|
|||||||
|
|
||||||
#define __ARM_EABI_UNWINDER__ 1
|
#define __ARM_EABI_UNWINDER__ 1
|
||||||
|
|
||||||
|
#ifndef __ARM_STATIC_INLINE
|
||||||
|
#define __ARM_STATIC_INLINE static inline
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
@ -245,7 +249,7 @@ extern "C" {
|
|||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline _Unwind_Word
|
__ARM_STATIC_INLINE _Unwind_Word
|
||||||
_Unwind_GetGR (_Unwind_Context *context, int regno)
|
_Unwind_GetGR (_Unwind_Context *context, int regno)
|
||||||
{
|
{
|
||||||
_uw val;
|
_uw val;
|
||||||
@ -253,6 +257,12 @@ extern "C" {
|
|||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
__ARM_STATIC_INLINE void
|
||||||
|
_Unwind_SetGR (_Unwind_Context *context, int regno, _Unwind_Word val)
|
||||||
|
{
|
||||||
|
_Unwind_VRS_Set (context, _UVRSC_CORE, regno, _UVRSD_UINT32, &val);
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef __FreeBSD__
|
#ifndef __FreeBSD__
|
||||||
/* Return the address of the instruction, not the actual IP value. */
|
/* Return the address of the instruction, not the actual IP value. */
|
||||||
#define _Unwind_GetIP(context) \
|
#define _Unwind_GetIP(context) \
|
||||||
@ -260,21 +270,16 @@ extern "C" {
|
|||||||
|
|
||||||
#define _Unwind_GetIPInfo(context, ip_before_insn) \
|
#define _Unwind_GetIPInfo(context, ip_before_insn) \
|
||||||
(*ip_before_insn = 0, _Unwind_GetGR (context, 15) & ~(_Unwind_Word)1)
|
(*ip_before_insn = 0, _Unwind_GetGR (context, 15) & ~(_Unwind_Word)1)
|
||||||
#else
|
|
||||||
_Unwind_Ptr _Unwind_GetIP (struct _Unwind_Context *);
|
|
||||||
_Unwind_Ptr _Unwind_GetIPInfo (struct _Unwind_Context *, int *);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static inline void
|
|
||||||
_Unwind_SetGR (_Unwind_Context *context, int regno, _Unwind_Word val)
|
|
||||||
{
|
|
||||||
_Unwind_VRS_Set (context, _UVRSC_CORE, regno, _UVRSD_UINT32, &val);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* The dwarf unwinder doesn't understand arm/thumb state. We assume the
|
/* The dwarf unwinder doesn't understand arm/thumb state. We assume the
|
||||||
landing pad uses the same instruction set as the call site. */
|
landing pad uses the same instruction set as the call site. */
|
||||||
#define _Unwind_SetIP(context, val) \
|
#define _Unwind_SetIP(context, val) \
|
||||||
_Unwind_SetGR (context, 15, val | (_Unwind_GetGR (context, 15) & 1))
|
_Unwind_SetGR (context, 15, val | (_Unwind_GetGR (context, 15) & 1))
|
||||||
|
#else
|
||||||
|
_Unwind_Ptr _Unwind_GetIP (struct _Unwind_Context *);
|
||||||
|
_Unwind_Ptr _Unwind_GetIPInfo (struct _Unwind_Context *, int *);
|
||||||
|
void _Unwind_SetIP (struct _Unwind_Context *, _Unwind_Ptr);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} /* extern "C" */
|
} /* extern "C" */
|
||||||
|
Loading…
Reference in New Issue
Block a user