[PATCH] Build for ARMv4 archicture

Ray I-Jui Sung(宋宜叡) ijsung@faraday-tech.com
Tue Oct 3 11:34:00 GMT 2006


Hi,
 
When building newlib using GCC with -mcpu=strongarm1110 (i.e. ARMv4 ISA), assembler complains about a BX instruction which is not available in that  ISA:

../../../../../combined/libgloss/arm/linux-syscalls0.S: Assembler messages:
../../../../../combined/libgloss/arm/linux-syscalls0.S:206: Error: selected processor does not support `bx r3'
make[5]: *** [linux-syscalls0.o] Error 1

Below is a patch for this. It looks like that the GNU as magically assembles Thumb mnemonics other than "BX" into equvalent ARM code.


2006-09-29  I-Jui Sung  <ijsung@faraday-tech.com>

	* arm/linux-syscalls0.S: Use BX only when __thumb__ defined.

Index: libgloss/arm/linux-syscalls0.S
===================================================================
--- src/libgloss/arm/linux-syscalls0.S	2006-07-05 07:58:02.000000000 +0800
+++ src.new/libgloss/arm/linux-syscalls0.S	2006-09-26 17:52:03.000000000 +0800
@@ -203,7 +203,11 @@
 	bl _socketcall
 	pop { r3 }
 	add sp, #16
+#if __thumb__
 	bx r3
+#else
+	mov pc, r3
+#endif
 	SIZE(_socketcall_tail)
 
 #define SOCKETCALL2(name, NAME) SOCKETCALL(name, NAME)

********************* Confidentiality Notice ************************
This electronic message and any attachments may contain
confidential and legally privileged information or
information which is otherwise protected from disclosure.
If you are not the intended recipient,please do not disclose
the contents, either in whole or in part, to anyone,and
immediately delete the message and any attachments from
your computer system and destroy all hard copies.
Thank you for your cooperation.
***********************************************************************



More information about the Newlib mailing list