svn commit: r278023 - head/contrib/gcc/config/arm

Andrew Turner andrew at FreeBSD.org
Sun Feb 1 09:50:35 UTC 2015


Author: andrew
Date: Sun Feb  1 09:50:33 2015
New Revision: 278023
URL: https://svnweb.freebsd.org/changeset/base/278023

Log:
  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.

Modified:
  head/contrib/gcc/config/arm/unwind-arm.c
  head/contrib/gcc/config/arm/unwind-arm.h

Modified: head/contrib/gcc/config/arm/unwind-arm.c
==============================================================================
--- head/contrib/gcc/config/arm/unwind-arm.c	Sun Feb  1 06:45:31 2015	(r278022)
+++ head/contrib/gcc/config/arm/unwind-arm.c	Sun Feb  1 09:50:33 2015	(r278023)
@@ -25,6 +25,7 @@
    along with this program; see the file COPYING.  If not, write to
    the Free Software Foundation, 51 Franklin Street, Fifth Floor,
    Boston, MA 02110-1301, USA.  */
+#define __ARM_STATIC_INLINE
 #include "unwind.h"
 
 /* We add a prototype for abort here to avoid creating a dependency on
@@ -1089,4 +1090,11 @@ _Unwind_GetIPInfo (struct _Unwind_Contex
   *ip_before_insn = 0;
   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

Modified: head/contrib/gcc/config/arm/unwind-arm.h
==============================================================================
--- head/contrib/gcc/config/arm/unwind-arm.h	Sun Feb  1 06:45:31 2015	(r278022)
+++ head/contrib/gcc/config/arm/unwind-arm.h	Sun Feb  1 09:50:33 2015	(r278023)
@@ -34,6 +34,10 @@
 
 #define __ARM_EABI_UNWINDER__ 1
 
+#ifndef __ARM_STATIC_INLINE
+#define __ARM_STATIC_INLINE static inline
+#endif
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -245,7 +249,7 @@ extern "C" {
       return tmp;
     }
 
-  static inline _Unwind_Word
+  __ARM_STATIC_INLINE _Unwind_Word
   _Unwind_GetGR (_Unwind_Context *context, int regno)
     {
       _uw val;
@@ -253,6 +257,12 @@ extern "C" {
       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__
   /* Return the address of the instruction, not the actual IP value.  */
 #define _Unwind_GetIP(context) \
@@ -260,21 +270,16 @@ extern "C" {
 
 #define _Unwind_GetIPInfo(context, ip_before_insn) \
   (*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
      landing pad uses the same instruction set as the call site.  */
 #define _Unwind_SetIP(context, val) \
   _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
 }   /* extern "C" */


More information about the svn-src-head mailing list