summaryrefslogtreecommitdiff
path: root/toolchain
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2014-08-20 20:26:32 +0200
committerWaldemar Brodkorb <wbx@openadk.org>2014-08-20 20:27:05 +0200
commitf8035dc4dfa8a7ca0d88c1dfc3e4d7051559aaf1 (patch)
treee9e160e11fbaafbf04e12ee86ea174025a4f864c /toolchain
parent9f31eaf9da3fd7956cde0b32ecf2971bd08a8f7b (diff)
fix some uClibc sparc issues. Disable DO_XSI_MATH for now, because testsuite fails to compile, when enabled. missing bessel float implementation
Diffstat (limited to 'toolchain')
-rw-r--r--toolchain/uclibc/patches/0.9.34-git/0001-fix-for-pipe-on-sparc.patch34
-rw-r--r--toolchain/uclibc/patches/0.9.34-git/0002-Revert-sparc-use-HIDDEN_JUMPTARGET-for-errno.patch65
-rw-r--r--toolchain/uclibc/patches/0.9.34-git/0003-Revert-sparc-disable-cancellable-system-as-it-fails-.patch46
-rw-r--r--toolchain/uclibc/patches/0.9.34-git/0004-remove-unused-subdirs-variable.patch29
-rw-r--r--toolchain/uclibc/patches/0.9.34-git/0005-sparc-testsuite-compile-fix.patch44
5 files changed, 218 insertions, 0 deletions
diff --git a/toolchain/uclibc/patches/0.9.34-git/0001-fix-for-pipe-on-sparc.patch b/toolchain/uclibc/patches/0.9.34-git/0001-fix-for-pipe-on-sparc.patch
new file mode 100644
index 000000000..5b13033a3
--- /dev/null
+++ b/toolchain/uclibc/patches/0.9.34-git/0001-fix-for-pipe-on-sparc.patch
@@ -0,0 +1,34 @@
+From c8f3e4d51080814a4251021277dd64c4d22263ae Mon Sep 17 00:00:00 2001
+From: Waldemar Brodkorb <wbx@openadk.org>
+Date: Tue, 19 Aug 2014 21:02:59 +0200
+Subject: [PATCH 1/5] fix for pipe() on sparc
+
+When using something like this:
+ $ echo foo|grep foo|wc -l
+with mksh shell, you get an runtime error.
+
+Glibc and klibc does not do these extra check.
+After removing this check using double pipes work fine.
+Tested with Qemu 2.1.0.
+
+Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
+---
+ libc/sysdeps/linux/sparc/pipe.S | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/libc/sysdeps/linux/sparc/pipe.S b/libc/sysdeps/linux/sparc/pipe.S
+index 09ef322..b085faf 100644
+--- a/libc/sysdeps/linux/sparc/pipe.S
++++ b/libc/sysdeps/linux/sparc/pipe.S
+@@ -35,8 +35,6 @@ pipe:
+ /* sanity check arguments */
+ tst %i0
+ be .Lerror
+- orcc %i1,%g0,%o1
+- be .Lerror
+ mov %i2,%o0
+
+ /* Do the system call */
+--
+1.8.5.2 (Apple Git-48)
+
diff --git a/toolchain/uclibc/patches/0.9.34-git/0002-Revert-sparc-use-HIDDEN_JUMPTARGET-for-errno.patch b/toolchain/uclibc/patches/0.9.34-git/0002-Revert-sparc-use-HIDDEN_JUMPTARGET-for-errno.patch
new file mode 100644
index 000000000..3e9dbb51f
--- /dev/null
+++ b/toolchain/uclibc/patches/0.9.34-git/0002-Revert-sparc-use-HIDDEN_JUMPTARGET-for-errno.patch
@@ -0,0 +1,65 @@
+From 0212a34e5326d2954a013476d2e5b25abe90ed33 Mon Sep 17 00:00:00 2001
+From: Waldemar Brodkorb <wbx@openadk.org>
+Date: Wed, 20 Aug 2014 03:44:53 +0200
+Subject: [PATCH 2/5] Revert "sparc: use HIDDEN_JUMPTARGET for errno"
+
+This reverts commit f51fb26dbcceee9e48d10facc830bd4a549f6cc2.
+
+This fixes linking error for sparc build.
+While building a sparc system you get following linking error:
+libc/sysdeps/linux/sparc/pipe.S:54: undefined reference to `__GI___errno_location'
+
+Removing the HIDDEN_JUMPTARGET fixes the issue, while using gcc 4.8.3/binutils 2.24.
+
+The definition of __errno_location was changed recently here:
+http://git.uclibc.org/uClibc/commit/?id=8f550715c2b211036fc273add3cb5219397ed312
+
+Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
+---
+ libc/sysdeps/linux/sparc/fork.S | 2 +-
+ libc/sysdeps/linux/sparc/pipe.S | 2 +-
+ libc/sysdeps/linux/sparc/vfork.S | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/libc/sysdeps/linux/sparc/fork.S b/libc/sysdeps/linux/sparc/fork.S
+index 8e4bc22..1715911 100644
+--- a/libc/sysdeps/linux/sparc/fork.S
++++ b/libc/sysdeps/linux/sparc/fork.S
+@@ -35,7 +35,7 @@ fork:
+ bcc,a 9000f
+ nop
+ save %sp,-96,%sp
+- call HIDDEN_JUMPTARGET(__errno_location)
++ call __errno_location
+ nop
+ st %i0,[%o0]
+ jmpl %i7+8,%g0
+diff --git a/libc/sysdeps/linux/sparc/pipe.S b/libc/sysdeps/linux/sparc/pipe.S
+index b085faf..fa77f4d 100644
+--- a/libc/sysdeps/linux/sparc/pipe.S
++++ b/libc/sysdeps/linux/sparc/pipe.S
+@@ -49,7 +49,7 @@ pipe:
+ restore %g0,%g0,%o0
+
+ .Lerror:
+- call HIDDEN_JUMPTARGET(__errno_location)
++ call __errno_location
+ or %g0,EINVAL,%i0
+ st %i0,[%o0]
+ ret
+diff --git a/libc/sysdeps/linux/sparc/vfork.S b/libc/sysdeps/linux/sparc/vfork.S
+index 4b701f7..e5a3c30 100644
+--- a/libc/sysdeps/linux/sparc/vfork.S
++++ b/libc/sysdeps/linux/sparc/vfork.S
+@@ -37,7 +37,7 @@ __vfork:
+ bcc,a 9000f
+ nop
+ save %sp,-96,%sp
+- call HIDDEN_JUMPTARGET(__errno_location)
++ call __errno_location
+ nop
+ st %i0,[%o0]
+ jmpl %i7+8,%g0
+--
+1.8.5.2 (Apple Git-48)
+
diff --git a/toolchain/uclibc/patches/0.9.34-git/0003-Revert-sparc-disable-cancellable-system-as-it-fails-.patch b/toolchain/uclibc/patches/0.9.34-git/0003-Revert-sparc-disable-cancellable-system-as-it-fails-.patch
new file mode 100644
index 000000000..7629ce803
--- /dev/null
+++ b/toolchain/uclibc/patches/0.9.34-git/0003-Revert-sparc-disable-cancellable-system-as-it-fails-.patch
@@ -0,0 +1,46 @@
+From df4848120be5353a3bd1216616c6823ea6430b71 Mon Sep 17 00:00:00 2001
+From: Waldemar Brodkorb <wbx@openadk.org>
+Date: Wed, 20 Aug 2014 04:02:49 +0200
+Subject: [PATCH 3/5] Revert "sparc: disable cancellable system, as it fails in
+ strange ways right now"
+
+This reverts commit 1db4f8f8389f6a935ecd83aff7fcce5d1cf2c0f3.
+
+It is unclear how this is breaking sparc.
+With this changed added you get following linking error:
+libpthread/nptl/libpthread_so.a(pt-system.oS): In function `__libc_system':
+libc/stdlib/system.c:64: undefined reference to `__wait4_nocancel'
+
+Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
+---
+ libc/stdlib/system.c | 13 +++++++------
+ 1 file changed, 7 insertions(+), 6 deletions(-)
+
+diff --git a/libc/stdlib/system.c b/libc/stdlib/system.c
+index 151a229..8c5d25d 100644
+--- a/libc/stdlib/system.c
++++ b/libc/stdlib/system.c
+@@ -18,13 +18,14 @@
+ #include <sysdep-cancel.h>
+ #endif
+
+-extern __typeof(system) __libc_system;
+-
+-/* TODO: the cancellable version breaks on sparc currently,
+- * need to figure out why still
+- */
+-#if !defined __UCLIBC_HAS_THREADS_NATIVE__ || defined __sparc__
++#if !defined __UCLIBC_HAS_THREADS_NATIVE__
++/* uClinux-2.0 has vfork, but Linux 2.0 doesn't */
++#include <sys/syscall.h>
++#ifndef __NR_vfork
++# define vfork fork
++#endif
+
++extern __typeof(system) __libc_system;
+ int __libc_system(const char *command)
+ {
+ int wait_val, pid;
+--
+1.8.5.2 (Apple Git-48)
+
diff --git a/toolchain/uclibc/patches/0.9.34-git/0004-remove-unused-subdirs-variable.patch b/toolchain/uclibc/patches/0.9.34-git/0004-remove-unused-subdirs-variable.patch
new file mode 100644
index 000000000..b12be41a5
--- /dev/null
+++ b/toolchain/uclibc/patches/0.9.34-git/0004-remove-unused-subdirs-variable.patch
@@ -0,0 +1,29 @@
+From 914de2f0b374809d130ca6b967307b9024b828a9 Mon Sep 17 00:00:00 2001
+From: Waldemar Brodkorb <wbx@openadk.org>
+Date: Wed, 20 Aug 2014 04:31:35 +0200
+Subject: [PATCH 4/5] remove unused subdirs variable
+
+For sparc TARGET_SUBARCH is never used. And there is a typo in the
+path.
+
+Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
+---
+ libpthread/nptl/sysdeps/sparc/Makefile.arch | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/libpthread/nptl/sysdeps/sparc/Makefile.arch b/libpthread/nptl/sysdeps/sparc/Makefile.arch
+index 52ac6db..f9662c6 100644
+--- a/libpthread/nptl/sysdeps/sparc/Makefile.arch
++++ b/libpthread/nptl/sysdeps/sparc/Makefile.arch
+@@ -4,8 +4,5 @@
+ #
+ # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ #
+-subdirs += libpthread/nptl/sysdeps/$(TARGET_ARCH)/$(TARGET_SUBARCH)/sparv9
+
+ CFLAGS-pthread_spin_lock.c += -D_GNU_SOURCE
+-
+-
+--
+1.8.5.2 (Apple Git-48)
+
diff --git a/toolchain/uclibc/patches/0.9.34-git/0005-sparc-testsuite-compile-fix.patch b/toolchain/uclibc/patches/0.9.34-git/0005-sparc-testsuite-compile-fix.patch
new file mode 100644
index 000000000..05f8f68bd
--- /dev/null
+++ b/toolchain/uclibc/patches/0.9.34-git/0005-sparc-testsuite-compile-fix.patch
@@ -0,0 +1,44 @@
+From edda85b5a6c35cc2bc029d0020747167e2867a91 Mon Sep 17 00:00:00 2001
+From: Waldemar Brodkorb <wbx@openadk.org>
+Date: Wed, 20 Aug 2014 04:39:04 +0200
+Subject: [PATCH 5/5] sparc testsuite compile fix
+
+tst-spin1.c compile breaks with:
+test/nptl/tst-spin1.c:34: undefined reference to `pthread_spin_lock'
+
+pthread_spin_lock and pthread_spin_trylock is missing while
+building sparc. add the meta c files here.
+
+Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
+---
+ libpthread/nptl/sysdeps/sparc/pthread_spin_lock.c | 5 +++++
+ libpthread/nptl/sysdeps/sparc/pthread_spin_trylock.c | 5 +++++
+ 2 files changed, 10 insertions(+)
+ create mode 100644 libpthread/nptl/sysdeps/sparc/pthread_spin_lock.c
+ create mode 100644 libpthread/nptl/sysdeps/sparc/pthread_spin_trylock.c
+
+diff --git a/libpthread/nptl/sysdeps/sparc/pthread_spin_lock.c b/libpthread/nptl/sysdeps/sparc/pthread_spin_lock.c
+new file mode 100644
+index 0000000..dcc5ae2
+--- /dev/null
++++ b/libpthread/nptl/sysdeps/sparc/pthread_spin_lock.c
+@@ -0,0 +1,5 @@
++#if defined(__arch64__)
++#include "sparc64/pthread_spin_lock.c"
++#else
++#include "sparc32/pthread_spin_lock.c"
++#endif
+diff --git a/libpthread/nptl/sysdeps/sparc/pthread_spin_trylock.c b/libpthread/nptl/sysdeps/sparc/pthread_spin_trylock.c
+new file mode 100644
+index 0000000..af63eec
+--- /dev/null
++++ b/libpthread/nptl/sysdeps/sparc/pthread_spin_trylock.c
+@@ -0,0 +1,5 @@
++#if defined(__arch64__)
++#include "sparc64/pthread_spin_trylock.c"
++#else
++#include "sparc32/pthread_spin_trylock.c"
++#endif
+--
+1.8.5.2 (Apple Git-48)
+