This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Build for ARMv4 archicture


On Mon, 2006-10-02 at 21:03, Jeff Johnston wrote:
> Hello Ray,
> 
>   Thanks for noting this problem.
> 
>   I talked to Nick Clifton about this and he prepared an alternate
> patch that tests if the ARM architecture supports the insn.  His patch
> has just been checked in to the sources.  Please try it out.
> 

Except that that patch doesn't work because __ARM_ARCH__ isn't
pre-defined by the compiler and isn't defined anywhere in the source
(it's an invention used in gcc's libgcc support code).

It would be easier these days to test for the architectures that don't
have BX: Essentially that's __ARM_ARCH_2__, __ARM_ARCH_3__,
__ARM_ARCH_3M__ and __ARM_ARCH_4__.

Note: testing __thumb__ is completely wrong.

R.
> Regards,
> 
> -- Jeff J.
> 
> Ray I-Jui Sung(ååå) wrote:
> > 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.
> > ***********************************************************************
> > 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]