summaryrefslogblamecommitdiff
path: root/system/gcc/206-arm-unwind-functionise.patch
blob: a5cc9236ecf2f0ddca2fe4cb1bf47028d94c22b5 (plain) (tree)
1
2
3

                                                                                           
                     




























                                                                                           
                 









                                                                           
                 








                                                                         
--- gcc-8.5.0/libgcc/config/arm/unwind-arm.c.old	2021-05-14 03:42:10.000000000 -0500
+++ gcc-8.5.0/libgcc/config/arm/unwind-arm.c	2022-12-24 20:04:04.085095067 -0600
@@ -539,22 +539,22 @@
   return __gnu_unwind_pr_common (state, ucbp, context, 2);
 }
 
-#ifdef __FreeBSD__
-/* FreeBSD expects these to be functions */
-inline _Unwind_Ptr
+#if !defined(IN_STAGE1_ADA) && (defined(__FreeBSD__) || defined(linux))
+/* Some packages expect these to be functions */
+_Unwind_Ptr
 _Unwind_GetIP (struct _Unwind_Context *context)
 {
   return _Unwind_GetGR (context, 15) & ~(_Unwind_Word)1;
 }
 
-inline _Unwind_Ptr
+_Unwind_Ptr
 _Unwind_GetIPInfo (struct _Unwind_Context *context, int *ip_before_insn)
 {
   *ip_before_insn = 0;
   return _Unwind_GetIP (context);
 }
 
-inline void
+void
 _Unwind_SetIP (struct _Unwind_Context *context, _Unwind_Ptr val)
 {
   _Unwind_SetGR (context, 15, val | (_Unwind_GetGR (context, 15) & 1));
--- gcc-8.5.0/libgcc/config/arm/unwind-arm.h.old	2021-05-14 03:42:10.000000000 -0500
+++ gcc-8.5.0/libgcc/config/arm/unwind-arm.h	2022-12-24 20:03:41.415095129 -0600
@@ -97,7 +97,7 @@
     {
       return _URC_FAILURE;
     }
-#ifndef __FreeBSD__
+#if defined(IN_STAGE1_ADA) || (!defined(__FreeBSD__) && !defined(linux))
   /* Return the address of the instruction, not the actual IP value.  */
 #define _Unwind_GetIP(context) \
   (_Unwind_GetGR (context, 15) & ~(_Unwind_Word)1)
--- gcc-8.5.0/gcc/ada/raise-gcc.c.old	2021-05-14 03:42:08.000000000 -0500
+++ gcc-8.5.0/gcc/ada/raise-gcc.c	2022-12-24 22:43:03.605084414 -0600
@@ -90,7 +90,9 @@
      This is a hack ???, the real fix is to link gnat1/gnatbind with the
      runtime of the build compiler.  */
 # ifdef EH_MECHANISM_arm
+#   define IN_STAGE1_ADA  /* even worse hack  */
 #   include "config/arm/unwind-arm.h"
+#   undef IN_STAGE1_ADA
 # else
 #   include "unwind-generic.h"
 # endif