OK, try this for size. Seems to work for me
(rebuild all of perl with -mstrongarmk-fix, ran the regression tests, all tests
(except lib/anydbm passed), whereas before 2 other tests failed.)

Built a new kernel with it, now running on the kernel.

If you're into minimalist rebuild of gcc, I think all you need to do is
cd gcc; rm arm.o toplev.o; make cc1
and then install the new cc1. Phil B will undoubtedly correct me if I'm wrong.

Nick

*** gcc/config/arm/arm.h.orig   Fri Feb  5 20:06:48 1999
--- gcc/config/arm/arm.h        Thu Mar 28 18:32:34 2002
***************
*** 308,313 ****
--- 308,318 ----
     big-endian (for backwards compatibility with older versions of GCC).  */
  #define ARM_FLAG_LITTLE_WORDS (0x2000)
  
+ /* Nonzero if we should work around StrongARM K bug by aligning function exit
+    LDM ... pc} to 8 byte boundary to ensure that it is not last instruction of
+    a page.  */
+ #define ARM_FLAG_STRONGARM_K  (0x4000)
+ 
  #define TARGET_APCS                   (target_flags & ARM_FLAG_APCS_FRAME)
  #define TARGET_POKE_FUNCTION_NAME     (target_flags & ARM_FLAG_POKE)
  #define TARGET_FPE                    (target_flags & ARM_FLAG_FPE)
***************
*** 323,328 ****
--- 328,334 ----
  #define TARGET_BIG_END                        (target_flags & ARM_FLAG_BIG_END)
  #define TARGET_THUMB_INTERWORK                (target_flags & ARM_FLAG_THUMB)
  #define TARGET_LITTLE_WORDS           (target_flags & ARM_FLAG_LITTLE_WORDS)
+ #define TARGET_STRONGARM_K            (target_flags & ARM_FLAG_STRONGARM_K)
  
  /* SUBTARGET_SWITCHES is used to add flags on a per-config basis.
     Bit 31 is reserved.  See riscix.h.  */
***************
*** 359,364 ****
--- 365,371 ----
    {"thumb-interwork",         ARM_FLAG_THUMB},        \
    {"no-thumb-interwork",       -ARM_FLAG_THUMB},      \
    {"words-little-endian",       ARM_FLAG_LITTLE_WORDS},       \
+   {"strongarmk-fix",          ARM_FLAG_STRONGARM_K},  \
    SUBTARGET_SWITCHES                                  \
    {"",                                TARGET_DEFAULT }        \
  }
*** gcc/config/arm/arm.c.orig   Fri Feb  5 20:06:48 1999
--- gcc/config/arm/arm.c        Thu Mar 28 16:05:39 2002
***************
*** 4798,4808 ****
        if (lr_save_eliminated || ! regs_ever_live[14])
          live_regs++;
  
        if (frame_pointer_needed)
!         strcpy (instr,
                reverse ? "ldm%?%D0ea\t%|fp, {" : "ldm%?%d0ea\t%|fp, {");
        else
!         strcpy (instr, 
                reverse ? "ldm%?%D0fd\t%|sp!, {" : "ldm%?%d0fd\t%|sp!, {");
  
        for (reg = 0; reg <= 10; reg++)
--- 4798,4813 ----
        if (lr_save_eliminated || ! regs_ever_live[14])
          live_regs++;
  
+       if (TARGET_STRONGARM_K && really_return)
+       strcpy (instr, ".align 3; ");
+       else
+       *instr = '\0';
+       
        if (frame_pointer_needed)
!         strcat (instr,
                reverse ? "ldm%?%D0ea\t%|fp, {" : "ldm%?%d0ea\t%|fp, {");
        else
!         strcat (instr, 
                reverse ? "ldm%?%D0fd\t%|sp!, {" : "ldm%?%d0fd\t%|sp!, {");
  
        for (reg = 0; reg <= 10; reg++)
***************
*** 5042,5049 ****
        else
        {
          live_regs_mask |= 0xA800;
!         print_multi_reg (f, "ldmea\t%sfp", live_regs_mask,
!                          TARGET_APCS_32 ? FALSE : TRUE);
        }
      }
    else
--- 5047,5055 ----
        else
        {
          live_regs_mask |= 0xA800;
!         print_multi_reg (f, (TARGET_STRONGARM_K ? ".align 3; ldmea\t%sfp"
!                              : "ldmea\t%sfp"),
!                          live_regs_mask, TARGET_APCS_32 ? FALSE : TRUE);
        }
      }
    else
***************
*** 5113,5119 ****
                         : "\tmovs\t%spc, %slr\n"),
                     REGISTER_PREFIX, REGISTER_PREFIX, f);
          else
!           print_multi_reg (f, "ldmfd\t%ssp!", live_regs_mask | 0x8000,
                             TARGET_APCS_32 ? FALSE : TRUE);
        }
        else
--- 5119,5126 ----
                         : "\tmovs\t%spc, %slr\n"),
                     REGISTER_PREFIX, REGISTER_PREFIX, f);
          else
!           print_multi_reg (f, (TARGET_STRONGARM_K ? ".align 3; ldmfd\t%ssp!"
!                                : "ldmfd\t%ssp!"), live_regs_mask | 0x8000,
                             TARGET_APCS_32 ? FALSE : TRUE);
        }
        else
unsubscribe: body of `unsubscribe linux-arm' to [EMAIL PROTECTED]

Reply via email to