[patch] Armv7 libgloss build failure

Paul Brook paul@codesourcery.com
Fri Feb 24 18:33:00 GMT 2006


Armv7m doesn't implement the cpsr register. The patch below allows building 
libgloss/arm/redboot-crt0.S with -march=armv7 (Thumb-2) by using the cps 
instruction instead.

Tested with cross to arm-none-eabi.
Ok?

Paul

2006-02-24  Paul Brook  <paul@codesourcery.com>

	* arm/redboot-crt0.S: Use cps in Thumb-2 mode.

Index: libgloss/arm/redboot-crt0.S
===================================================================
RCS file: /var/cvsroot/src-cvs/src/libgloss/arm/redboot-crt0.S,v
retrieving revision 1.5
diff -u -p -r1.5 redboot-crt0.S
--- libgloss/arm/redboot-crt0.S	7 Feb 2006 18:46:23 -0000	1.5
+++ libgloss/arm/redboot-crt0.S	24 Feb 2006 18:27:09 -0000
@@ -33,9 +33,13 @@
 	mov	r7, #0	/* Null frame pointer for Thumb.  */
 
 	/* Enable interrupts for gdb debugging.  */
+#ifdef __thumb2__
+	cpsie if
+#else
 	mrs    r0, cpsr
 	bic    r0, r0, #0xC0
 	msr    cpsr, r0
+#endif
 	
 	mov 	a2, #0			/* Second arg: fill value.  */
 	ldr	a1, .LC1		/* First arg: start of memory block.  */



More information about the Newlib mailing list