Commit 43ffd946 authored by Peter Korsgaard's avatar Peter Korsgaard
Browse files

toolchain/uClibc: additional 0.9.30.2 patches



Everything on the 0_9_30 branch since the release (0.9.30.3 to be)

Signed-off-by: default avatarPeter Korsgaard <jacmet@sunsite.dk>
parent c8ff60c8
Loading
Loading
Loading
Loading
+64 −0
Original line number Diff line number Diff line
From a05c4380c5aaa6e107a4c7e1e5a139ec4cc43f0c Mon Sep 17 00:00:00 2001
From: Henning Heinold <heinold@inf.fu-berlin.de>
Date: Sun, 21 Feb 2010 11:55:32 +0100
Subject: [PATCH 14/15] LT pthread_atfork: unhide

Trying to compile perl with uClibc new linuxthreads on arm.
I run into the problem that pthread_atfork is not available.
The problem was that it was synced with the glibc version, which has
compat ifdefs we do not need in uClibc. The inital checked in version
is right and works. So either revert the commit 2 years ago
or patch it with the patch attached I made for openembedded.

Signed-off-by: Henning Heinold <heinold@inf.fu-berlin.de>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
---
 libpthread/linuxthreads/Makefile.in      |    2 +-
 libpthread/linuxthreads/pthread_atfork.c |   13 +++----------
 2 files changed, 4 insertions(+), 11 deletions(-)

diff --git a/libpthread/linuxthreads/Makefile.in b/libpthread/linuxthreads/Makefile.in
index 947dea9..d53b5fa 100644
--- a/libpthread/linuxthreads/Makefile.in
+++ b/libpthread/linuxthreads/Makefile.in
@@ -45,7 +45,7 @@ pthread_sysdep_SRC := $(patsubst %,$(libpthread_DIR)/sysdeps/pthread/%.c,$(pthre
 pthread_SRC := \
 	attr barrier cancel condvar errno events join pthread \
 	lockfile manager mutex pt-machine ptcleanup \
-	ptclock_gettime ptclock_settime ptfork pthandles \
+	ptclock_gettime ptclock_settime ptfork pthandles pthread_atfork \
 	pthread_setegid pthread_seteuid pthread_setgid pthread_setregid \
 	pthread_setresgid pthread_setresuid pthread_setreuid pthread_setuid \
 	rwlock semaphore sighandler signals specific spinlock
diff --git a/libpthread/linuxthreads/pthread_atfork.c b/libpthread/linuxthreads/pthread_atfork.c
index 2464acb..4c83dd0 100644
--- a/libpthread/linuxthreads/pthread_atfork.c
+++ b/libpthread/linuxthreads/pthread_atfork.c
@@ -43,12 +43,8 @@ extern void *__dso_handle __attribute__ ((__weak__));
 
 /* Hide the symbol so that no definition but the one locally in the
    executable or DSO is used.  */
-int
-#ifndef __pthread_atfork
-/* Don't mark the compatibility function as hidden.  */
-attribute_hidden
-#endif
-__pthread_atfork (prepare, parent, child)
+
+int attribute_hidden __pthread_atfork (prepare, parent, child)
      void (*prepare) (void);
      void (*parent) (void);
      void (*child) (void);
@@ -56,8 +52,5 @@ __pthread_atfork (prepare, parent, child)
   return __register_atfork (prepare, parent, child,
 			    &__dso_handle == NULL ? NULL : __dso_handle);
 }
-#ifndef __pthread_atfork
-extern int pthread_atfork (void (*prepare) (void), void (*parent) (void),
-			   void (*child) (void)) attribute_hidden;
+
 strong_alias (__pthread_atfork, pthread_atfork)
-#endif
-- 
1.6.6.1
+87 −0
Original line number Diff line number Diff line
From 2911103dd4a03bbd3aad11eddfce524a5c9ba9b3 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 22 Jan 2010 13:00:20 +0100
Subject: [PATCH 03/15] Make use of macros from sys/asm.h in crt1.S

Needed for mips nptl to boot once again.
(cherry picked from commit 9c343fd4030dcd7a52616f365893177dded50346)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
---
 libc/sysdeps/linux/mips/crt1.S |   46 +++++++++++----------------------------
 1 files changed, 13 insertions(+), 33 deletions(-)

diff --git a/libc/sysdeps/linux/mips/crt1.S b/libc/sysdeps/linux/mips/crt1.S
index e851d52..6a80412 100644
--- a/libc/sysdeps/linux/mips/crt1.S
+++ b/libc/sysdeps/linux/mips/crt1.S
@@ -85,29 +85,10 @@
 
 __start:
 #ifdef __PIC__
-#if _MIPS_SIM == _MIPS_SIM_ABI32
-	.frame	sp, 24, sp
-        .set noreorder
-	move $0, $31		/* Save old ra.  */
-	bal 10f			/* Find addr of cpload.  */
-        nop
-10:
-	.cpload $31
-	move $31, $0
-	.set reorder
-	.cprestore 16
-#else
-	move $0, $31; /* Save old ra.  */
-	.set noreorder
-	bal 10f /* Find addr of .cpsetup.  */
-	nop
-10:
-	.set reorder
-	.cpsetup $31, $25, 10b
-	move $31, $0
-#endif
+	SETUP_GPX($0)
+	SETUP_GPX64($25,$0)
 #else
-	la $28, _gp             /* Setup GP correctly if we're non-PIC.  */
+	PTR_LA $28, _gp             /* Setup GP correctly if we're non-PIC.  */
 	move $31, $0
 #endif
 
@@ -118,18 +99,18 @@ __start:
 	/* Allocate space on the stack for seven arguments and
 	 * make sure the stack is aligned to double words (8 bytes) */
 
+	and $29, -2 * SZREG
+
 #if _MIPS_SIM == _MIPS_SIM_ABI32
-	and $29, -2 * 4
-	subu $29, 32
-	la $7, _init		/* init */
-	la $8, _fini
-	sw $8, 16($29)		/* fini */
-	sw $2, 20($29)		/* rtld_fini */
-	sw $29, 24($29)		/* stack_end */
-#else
-	and $29, -2 * PTRSIZE
+	PTR_SUBIU $29, 32
+#endif
 	PTR_LA $7, _init		/* init */
-	PTR_LA $8, _fini		/* fini */
+	PTR_LA $8, _fini
+#if _MIPS_SIM == _MIPS_SIM_ABI32
+	PTR_S $8, 16($29)		/* fini */
+	PTR_S $2, 20($29)		/* rtld_fini */
+	PTR_S $29, 24($29)		/* stack_end */
+#else
 	move $9, $2		/* rtld_fini */
 	move $10, $29		/* stack_end */
 #endif
@@ -148,4 +129,3 @@ __data_start:
 	.weak data_start
 	data_start = __data_start
 
-
-- 
1.6.6.1
+30 −0
Original line number Diff line number Diff line
From 323453d85ed29ccba7a81d884479188869cd64b7 Mon Sep 17 00:00:00 2001
From: Henning Heinold <heinold@inf.fu-berlin.de>
Date: Sat, 23 Jan 2010 21:29:42 -0800
Subject: [PATCH 13/15] Makefile.in: Make install_dev depend on install_runtime.

* Helps in parallel build.

Signed-off-by: Henning Heinold <heinold@inf.fu-berlin.de>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
---
 Makefile.in |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index ec4c28e..a889838 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -370,7 +370,7 @@ ifneq ($(UCLIBC_SUPPORT_AI_ADDRCONFIG),y)
 endif
 
 # Installs development library links.
-install_dev: install_headers all
+install_dev: install_headers install_runtime
 	$(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)lib
 	-$(INSTALL) -m 644 lib/*.[ao] $(PREFIX)$(DEVEL_PREFIX)lib/
 ifeq ($(HAVE_SHARED),y)
-- 
1.6.6.1
+42 −0
Original line number Diff line number Diff line
From 7b964170536951a260f7d552db99b428d1ea5026 Mon Sep 17 00:00:00 2001
From: Austin Foxley <austinf@cetoncorp.com>
Date: Wed, 3 Feb 2010 12:12:10 -0800
Subject: [PATCH 08/15] Unbreak build for sparc on some config's

Thanks to rob@landley.net

Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
---
 libc/sysdeps/linux/sparc/sigaction.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/libc/sysdeps/linux/sparc/sigaction.c b/libc/sysdeps/linux/sparc/sigaction.c
index a22ac40..7140fd3 100644
--- a/libc/sysdeps/linux/sparc/sigaction.c
+++ b/libc/sysdeps/linux/sparc/sigaction.c
@@ -34,7 +34,8 @@ _syscall5(int, rt_sigaction, int, a, int, b, int, c, int, d, int, e);
 static void __rt_sigreturn_stub(void);
 static void __sigreturn_stub(void);
 
-int __libc_sigaction(int sig, const struct sigaction *act, struct sigaction *oact)
+libc_hidden_proto(sigaction)
+int sigaction(int sig, const struct sigaction *act, struct sigaction *oact)
 {
 	int ret;
 	struct sigaction kact, koact;
@@ -65,10 +66,8 @@ int __libc_sigaction(int sig, const struct sigaction *act, struct sigaction *oac
 	return ret;
 }
 
-#ifndef LIBC_SIGACTION
-weak_alias(__libc_sigaction,sigaction)
-libc_hidden_weak(sigaction)
-#endif
+libc_hidden_def(sigaction)
+weak_alias(sigaction,__libc_sigaction)
 
 static void
 __rt_sigreturn_stub(void)
-- 
1.6.6.1
+74 −0
Original line number Diff line number Diff line
From 85bc04d5436ca6c8a30a1ad28862260a04b8b3d5 Mon Sep 17 00:00:00 2001
From: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
Date: Wed, 16 Dec 2009 13:16:08 +0100
Subject: [PATCH 02/15] avr32: add varargs handling of prctl syscall

prctl is defined to use varargs in the header file, hence it needs varargs
specific handling in the source. This patch properly handles the variodic
argument before the syscall is passed to the kernel for the AVR32 architecture.

Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
---
 libc/sysdeps/linux/avr32/Makefile.arch |    2 +-
 libc/sysdeps/linux/avr32/prctl.c       |   36 ++++++++++++++++++++++++++++++++
 2 files changed, 37 insertions(+), 1 deletions(-)
 create mode 100644 libc/sysdeps/linux/avr32/prctl.c

diff --git a/libc/sysdeps/linux/avr32/Makefile.arch b/libc/sysdeps/linux/avr32/Makefile.arch
index bc5f625..98b85a7 100644
--- a/libc/sysdeps/linux/avr32/Makefile.arch
+++ b/libc/sysdeps/linux/avr32/Makefile.arch
@@ -5,7 +5,7 @@
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 #
 
-CSRC	:= brk.c clone.c mmap.c sigaction.c
+CSRC	:= brk.c clone.c mmap.c prctl.c sigaction.c
 
 SSRC	:= __longjmp.S setjmp.S bsd-setjmp.S bsd-_setjmp.S	\
 		sigrestorer.S syscall.S vfork.S
diff --git a/libc/sysdeps/linux/avr32/prctl.c b/libc/sysdeps/linux/avr32/prctl.c
new file mode 100644
index 0000000..4e146e3
--- /dev/null
+++ b/libc/sysdeps/linux/avr32/prctl.c
@@ -0,0 +1,36 @@
+/*
+ * prctl syscall for AVR32 Linux.
+ *
+ * Copyright (C) 2010 Atmel Corporation
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser General
+ * Public License. See the file "COPYING.LIB" in the main directory of this
+ * archive for more details.
+ */
+#include <sys/syscall.h>
+#include <sys/prctl.h>
+#include <stdarg.h>
+
+#ifdef __NR_prctl
+#define __NR___syscall_prctl	__NR_prctl
+static inline _syscall5(int, __syscall_prctl, int, option, long, arg2,
+		long, arg3, long, arg4, long, arg5);
+
+int prctl(int __option, ...)
+{
+	long arg2;
+	long arg3;
+	long arg4;
+	long arg5;
+	va_list ap;
+
+	va_start(ap, __option);
+	arg2 = va_arg(ap, long);
+	arg3 = va_arg(ap, long);
+	arg4 = va_arg(ap, long);
+	arg5 = va_arg(ap, long);
+	va_end(ap);
+
+	return INLINE_SYSCALL(prctl, 5, __option, arg2, arg3, arg4, arg5);
+}
+#endif
-- 
1.6.6.1
Loading