[PATCH] eglibc: updated armv4t-interworking.patch


Martin Jansa
 

From: Martin Jansa <Martin.Jansa@...>

* Updated patch to make SYSCALL_ERROR_HANDLER interworking safe.
* Phil Blundell found and fixed another issue in eglibc armv4t builds.

Signed-off-by: Martin.Jansa <Martin.Jansa@...>
---
recipes/eglibc/eglibc_2.10.bb | 2 +-
recipes/eglibc/eglibc_2.9.bb | 2 +-
recipes/eglibc/eglibc_svn.bb | 2 +-
recipes/eglibc/files/armv4t-interworking.patch | 27 +++++++++++++++++++++++-
4 files changed, 29 insertions(+), 4 deletions(-)

diff --git a/recipes/eglibc/eglibc_2.10.bb b/recipes/eglibc/eglibc_2.10.bb
index d143b0a..2a62fe3 100644
--- a/recipes/eglibc/eglibc_2.10.bb
+++ b/recipes/eglibc/eglibc_2.10.bb
@@ -3,7 +3,7 @@ require eglibc.inc
DEPENDS += "gperf-native"
FILESPATHPKG =. "eglibc-svn:"
PV = "2.10"
-PR = "${INC_PR}.4"
+PR = "${INC_PR}.5"
SVN_REV="9124"
EGLIBC_BRANCH="eglibc-2_10"
SRC_URI = "svn://svn.eglibc.org/branches;module=eglibc-2_10;rev=${SVN_REV};proto=svn \
diff --git a/recipes/eglibc/eglibc_2.9.bb b/recipes/eglibc/eglibc_2.9.bb
index 3efcb36..7a82627 100644
--- a/recipes/eglibc/eglibc_2.9.bb
+++ b/recipes/eglibc/eglibc_2.9.bb
@@ -3,7 +3,7 @@ require eglibc.inc
DEPENDS += "gperf-native"
FILESPATHPKG =. "eglibc-svn:"
PV = "2.9"
-PR = "${INC_PR}.5"
+PR = "${INC_PR}.6"
SVN_REV="8690"
EGLIBC_BRANCH="eglibc-2_9"
SRC_URI = "svn://svn.eglibc.org/branches;module=eglibc-2_9;rev=${SVN_REV};proto=svn \
diff --git a/recipes/eglibc/eglibc_svn.bb b/recipes/eglibc/eglibc_svn.bb
index 1a91af8..3376839 100644
--- a/recipes/eglibc/eglibc_svn.bb
+++ b/recipes/eglibc/eglibc_svn.bb
@@ -5,7 +5,7 @@ SRCREV = "9170"
DEFAULT_PREFERENCE = "-1"
FILESPATHPKG =. "eglibc-svn:"
PV = "2.10+svnr${SRCREV}"
-PR = "${INC_PR}.1"
+PR = "${INC_PR}.2"
EGLIBC_BRANCH="trunk"
SRC_URI = "svn://svn.eglibc.org;module=trunk \
file://eglibc-svn-arm-lowlevellock-include-tls.patch;patch=1 \
diff --git a/recipes/eglibc/files/armv4t-interworking.patch b/recipes/eglibc/files/armv4t-interworking.patch
index 55ee856..6ab3061 100644
--- a/recipes/eglibc/files/armv4t-interworking.patch
+++ b/recipes/eglibc/files/armv4t-interworking.patch
@@ -40,7 +40,7 @@ Index: libc/ports/sysdeps/unix/sysv/linux/arm/clone.S
#endif
@ pick the function arg and call address off the stack and execute
ldr r0, [sp, #4]
-+#if defined(__ARM_ARCH_V4T__) && defined(__THUMB_INTERWORK__)
++#if defined(__ARM_ARCH_4T__) && defined(__THUMB_INTERWORK__)
+ ldr ip, [sp], #8
+ mov lr, pc
+ bx ip
@@ -51,3 +51,28 @@ Index: libc/ports/sysdeps/unix/sysv/linux/arm/clone.S

@ and we are done, passing the return value through r0
b PLTJMP(HIDDEN_JUMPTARGET(_exit))
+Index: libc/ports/sysdeps/unix/sysv/linux/arm/sysdep.h
+===================================================================
+--- libc.orig/ports/sysdeps/unix/sysv/linux/arm/sysdep.h 2009-09-16 13:58:18.000000000 +0100
++++ libc/ports/sysdeps/unix/sysv/linux/arm/sysdep.h 2009-11-03 19:17:16.000000000 +0000
+@@ -129,6 +129,11 @@
+ DO_RET(lr); \
+ 1: .word C_SYMBOL_NAME(rtld_errno) - 0b - 8;
+ # else
++#if defined(__ARM_ARCH_4T__) && defined(__THUMB_INTERWORK__)
++#define POP_PC ldr lr, [sp], #4; bx lr
++#else
++#define POP_PC ldr pc, [sp], #4
++#endif
+ # define SYSCALL_ERROR_HANDLER \
+ __local_syscall_error: \
+ str lr, [sp, #-4]!; \
+@@ -138,7 +143,7 @@
+ rsb r1, r1, #0; \
+ str r1, [r0]; \
+ mvn r0, #0; \
+- ldr pc, [sp], #4;
++ POP_PC;
+ # endif
+ #else
+ # define SYSCALL_ERROR_HANDLER /* Nothing here; code in sysdep.S is used. */
--
1.6.5.2


Martin Jansa
 

On Wed, Nov 4, 2009 at 10:03 AM, Martin.Jansa <martin.jansa@...>wrote:

From: Martin Jansa <Martin.Jansa@...>

* Updated patch to make SYSCALL_ERROR_HANDLER interworking safe.
* Phil Blundell found and fixed another issue in eglibc armv4t builds.

http://cgit.openembedded.net/cgit.cgi/openembedded/commit/?h=shr/merge&id=b7c9855c7ece03a0876c0d50922f908b65c5f095
should be also cherry-picked to replace another __ARM_ARCH_V4T__
with __ARM_ARCH_4T__. pb suggests its typo and gcc output/OE tree grep/GCC
sources grep and google are confirming it.

SHR root@gojama ~ $ echo | arm-oe-linux-gnueabi-cpp -march=armv4t -dM -E -
| grep __ARM
#define __ARMEL__ 1
#define __ARM_ARCH_4T__ 1
#define __ARM_EABI__ 1


Khem Raj
 

On Wed, Nov 4, 2009 at 1:03 AM, Martin.Jansa <martin.jansa@...> wrote:
From: Martin Jansa <Martin.Jansa@...>

* Updated patch to make SYSCALL_ERROR_HANDLER interworking safe.
* Phil Blundell found and fixed another issue in eglibc armv4t builds.

Signed-off-by: Martin.Jansa <Martin.Jansa@...>
---
 recipes/eglibc/eglibc_2.10.bb                  |    2 +-
 recipes/eglibc/eglibc_2.9.bb                   |    2 +-
 recipes/eglibc/eglibc_svn.bb                   |    2 +-
 recipes/eglibc/files/armv4t-interworking.patch |   27 +++++++++++++++++++++++-
 4 files changed, 29 insertions(+), 4 deletions(-)

diff --git a/recipes/eglibc/eglibc_2.10.bb b/recipes/eglibc/eglibc_2.10.bb
index d143b0a..2a62fe3 100644
--- a/recipes/eglibc/eglibc_2.10.bb
+++ b/recipes/eglibc/eglibc_2.10.bb
@@ -3,7 +3,7 @@ require eglibc.inc
 DEPENDS += "gperf-native"
 FILESPATHPKG =. "eglibc-svn:"
 PV = "2.10"
-PR = "${INC_PR}.4"
+PR = "${INC_PR}.5"
 SVN_REV="9124"
 EGLIBC_BRANCH="eglibc-2_10"
 SRC_URI = "svn://svn.eglibc.org/branches;module=eglibc-2_10;rev=${SVN_REV};proto=svn \
diff --git a/recipes/eglibc/eglibc_2.9.bb b/recipes/eglibc/eglibc_2.9.bb
index 3efcb36..7a82627 100644
--- a/recipes/eglibc/eglibc_2.9.bb
+++ b/recipes/eglibc/eglibc_2.9.bb
@@ -3,7 +3,7 @@ require eglibc.inc
 DEPENDS += "gperf-native"
 FILESPATHPKG =. "eglibc-svn:"
 PV = "2.9"
-PR = "${INC_PR}.5"
+PR = "${INC_PR}.6"
 SVN_REV="8690"
 EGLIBC_BRANCH="eglibc-2_9"
 SRC_URI = "svn://svn.eglibc.org/branches;module=eglibc-2_9;rev=${SVN_REV};proto=svn \
diff --git a/recipes/eglibc/eglibc_svn.bb b/recipes/eglibc/eglibc_svn.bb
index 1a91af8..3376839 100644
--- a/recipes/eglibc/eglibc_svn.bb
+++ b/recipes/eglibc/eglibc_svn.bb
@@ -5,7 +5,7 @@ SRCREV = "9170"
 DEFAULT_PREFERENCE = "-1"
 FILESPATHPKG =. "eglibc-svn:"
 PV = "2.10+svnr${SRCREV}"
-PR = "${INC_PR}.1"
+PR = "${INC_PR}.2"
 EGLIBC_BRANCH="trunk"
 SRC_URI = "svn://svn.eglibc.org;module=trunk \
           file://eglibc-svn-arm-lowlevellock-include-tls.patch;patch=1 \
diff --git a/recipes/eglibc/files/armv4t-interworking.patch b/recipes/eglibc/files/armv4t-interworking.patch
index 55ee856..6ab3061 100644
--- a/recipes/eglibc/files/armv4t-interworking.patch
+++ b/recipes/eglibc/files/armv4t-interworking.patch
@@ -40,7 +40,7 @@ Index: libc/ports/sysdeps/unix/sysv/linux/arm/clone.S
 #endif
       @ pick the function arg and call address off the stack and execute
       ldr     r0, [sp, #4]
-+#if defined(__ARM_ARCH_V4T__) && defined(__THUMB_INTERWORK__)
++#if defined(__ARM_ARCH_4T__) && defined(__THUMB_INTERWORK__)
 +      ldr     ip, [sp], #8
 +      mov     lr, pc
 +        bx      ip
@@ -51,3 +51,28 @@ Index: libc/ports/sysdeps/unix/sysv/linux/arm/clone.S

       @ and we are done, passing the return value through r0
       b       PLTJMP(HIDDEN_JUMPTARGET(_exit))
+Index: libc/ports/sysdeps/unix/sysv/linux/arm/sysdep.h
+===================================================================
+--- libc.orig/ports/sysdeps/unix/sysv/linux/arm/sysdep.h       2009-09-16 13:58:18.000000000 +0100
++++ libc/ports/sysdeps/unix/sysv/linux/arm/sysdep.h    2009-11-03 19:17:16.000000000 +0000
+@@ -129,6 +129,11 @@
+        DO_RET(lr);                                            \
+ 1:     .word C_SYMBOL_NAME(rtld_errno) - 0b - 8;
+ # else
++#if defined(__ARM_ARCH_4T__) && defined(__THUMB_INTERWORK__)
++#define POP_PC  ldr     lr, [sp], #4; bx lr
++#else
++#define POP_PC  ldr     pc, [sp], #4
++#endif
+ #  define SYSCALL_ERROR_HANDLER                                       \
+ __local_syscall_error:                                                \
+       str     lr, [sp, #-4]!;                                 \
+@@ -138,7 +143,7 @@
+       rsb     r1, r1, #0;                                     \
+       str     r1, [r0];                                       \
+       mvn     r0, #0;                                         \
+-      ldr     pc, [sp], #4;
++        POP_PC;
+ # endif
+ #else
+ # define SYSCALL_ERROR_HANDLER        /* Nothing here; code in sysdep.S is used.  */
--
1.6.5.2
there is already a define __USE_BX__ and another macro BX(reg)
I think they should be used here instead



_______________________________________________
Openembedded-devel mailing list
Openembedded-devel@...
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel


Phil Blundell <philb@...>
 

On Wed, 2009-11-04 at 10:28 -0800, Khem Raj wrote:
there is already a define __USE_BX__ and another macro BX(reg)
I think they should be used here instead
No, those macros mean something slightly different. I think the code as
written in this patch is correct.

p.