This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: libgloss ARM compile error
- From: Nick Clifton <nickc at redhat dot com>
- To: Joel Sherrill <joel dot sherrill at oarcorp dot com>
- Cc: "newlib at sources dot redhat dot com" <newlib at sources dot redhat dot com>
- Date: Fri, 02 Oct 2009 11:52:25 +0100
- Subject: Re: libgloss ARM compile error
- References: <4AC4A7F4.2020404@oarcorp.com>
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 ----