On Wed, 23 Nov 2011, Richard Henderson wrote:

> On 11/23/2011 04:00 PM, Joseph S. Myers wrote:
> > On Wed, 23 Nov 2011, Richard Henderson wrote:
> > 
> >> +  __asm volatile ("swi %1"
> >> +            : "+r"(sc_0)
> >> +            : "i"(SYS_futex), "r"(sc_1), "r"(sc_2), "r"(sc_3)
> >> +            : "memory");
> > 
> > That looks wrong.  Passing the syscall number to swi is the old-ABI 
> > approach; the EABI uses syscall number in r7. 
> 
> Interesting to know.
> 
> I took as examples both glibc ports sysdeps.h

Overridden in the eabi/ subdirectory.  Yes, as ARM glibc maintainer it's 
probably time for me to kill the old-ABI support and simplify the 
directory structure....

> and CLEAR_INSN_CACHE from linux-gas.h.  Which... I see is out of date 
> wrt libgcc lib1funcs.S clear_cache.

Again, an old-ABI-only version; I moved the EABI version to lib1funcs.S 
from linux-eabi.h to avoid a problem where building libgcc for Thumb-2 
with -O0 quietly produced broken code because of the conflict with the 
frame pointer <http://gcc.gnu.org/ml/gcc-patches/2009-05/msg01320.html>.  
Dan ended up moving Thumb-2 syscalls out-of-line in glibc for much the 
same reason (unwinding being the problem there) 
<http://sourceware.org/ml/libc-ports/2010-04/msg00001.html>.

> Perhaps I'm better off with the syscall function as libgomp uses?

That's certainly safer and avoids depending on EABI/old-ABI.

-- 
Joseph S. Myers
jos...@codesourcery.com

Reply via email to