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: libgloss ARM compile error


Hi Joel,

I was trying to compile newlib cvs head for
arm-elf and got these:

../../../../../gcc-svn/libgloss/arm/linux-syscalls0.S:37: Error: missing expression -- `swi'

Weird. The thumb code appears to be completely bogus.


Please try out the attached patch and let me know how it goes.

Cheers
  Nick

Index: libgloss/arm/linux-syscalls0.S
===================================================================
RCS file: /cvs/src/src/libgloss/arm/linux-syscalls0.S,v
retrieving revision 1.5
diff -c -3 -p -r1.5 linux-syscalls0.S
*** libgloss/arm/linux-syscalls0.S	3 Oct 2006 16:33:50 -0000	1.5
--- libgloss/arm/linux-syscalls0.S	2 Oct 2009 10:51:22 -0000
***************
*** 19,65 ****
  #define GLOBAL(name) .global name; FUNC(name)
  #define SIZE(name) .size name, .-name
  
- #if __thumb__
- 
- # define SYSCALL0(name) \
- 	GLOBAL(_ ## name); \
- 	mov r12, r7; \
- 	mov r7, #SYS_ ## name; \
- 	swi; \
- 	mov r7, r12; \
- 	b _set_errno; \
- 	SIZE(_ ## name)
- 
- /* static int _syscall3(int a, int b, int c, int number); */
- FUNC(_syscall3)
- 	push { r7 }
- 	mov r7, r3
- 	swi
- 	pop { r7 }
- 	b _set_errno
- 	SIZE(_syscall3)
- 
- # define SYSCALL3(name) \
- 	GLOBAL(_ ## name); \
- 	mov r3, #SYS_ ## name; \
- 	b _syscall3; \
- 	SIZE(_ ## name)
- 
- # define SYSCALL6(name) \
- 	GLOBAL(_ ## name); \
- 	push { r4 - r5, r7 }; \
- 	ldr r4, [sp, #12]; \
- 	ldr r5, [sp, #16]; \
- 	mov r7, #SYS_ ## name; \
- 	swi; \
- 	pop { r4 - r5, r7 }; \
- 	b _set_errno; \
- 	SIZE(_ ## name)
- 
- # define SYSCALL4(name) SYSCALL6(name)
- 
- #else /* __thumb__ */
- 
  # define SYSCALL4(name) \
  	GLOBAL(_ ## name); \
  	swi #SYS_ ## name; \
--- 19,24 ----
*************** FUNC(_syscall3)
*** 78,86 ****
  
  #define SYSCALL0(name) SYSCALL3(name)
  #define SYSCALL3(name) SYSCALL4(name)
- 
- #endif /* __thumb__ */
- 
  #define SYSCALL1(name) SYSCALL3(name)
  #define SYSCALL2(name) SYSCALL3(name)
  #define SYSCALL5(name) SYSCALL6(name)
--- 37,42 ----

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