diff options
author | Waldemar Brodkorb <wbx@openadk.org> | 2014-06-15 10:05:13 +0200 |
---|---|---|
committer | Waldemar Brodkorb <wbx@openadk.org> | 2014-06-15 10:05:46 +0200 |
commit | 47e410981184016a6ab4c58fdfc9449e2fd945e7 (patch) | |
tree | e279669cc8f7976f9e661fbebade152978e6f1c6 /toolchain/uclibc | |
parent | f7712ed524e8811fedee86d7b829c2f2e27dc38b (diff) |
add support for xtensa architecture, tested with qemu. thanks to Max Filippov for help
Diffstat (limited to 'toolchain/uclibc')
-rw-r--r-- | toolchain/uclibc/Makefile | 1 | ||||
-rw-r--r-- | toolchain/uclibc/patches/uclibc-git-20140613.patch (renamed from toolchain/uclibc/patches/uclibc-git-20140602.patch) | 241 | ||||
-rw-r--r-- | toolchain/uclibc/patches/xxx-xtensa-nptl.patch | 3515 |
3 files changed, 3725 insertions, 32 deletions
diff --git a/toolchain/uclibc/Makefile b/toolchain/uclibc/Makefile index 7184d6220..7346b965e 100644 --- a/toolchain/uclibc/Makefile +++ b/toolchain/uclibc/Makefile @@ -9,6 +9,7 @@ include Makefile.inc include ${TOPDIR}/mk/buildhlp.mk TARGET_CFLAGS:=$(filter-out -flto,$(TARGET_CFLAGS)) +TARGET_CFLAGS:=$(filter-out -mtext-section-literals,$(TARGET_CFLAGS)) ifeq (${ADK_MAKE_PARALLEL},y) UCLIBC_MAKEOPTS+= -j${ADK_MAKE_JOBS} diff --git a/toolchain/uclibc/patches/uclibc-git-20140602.patch b/toolchain/uclibc/patches/uclibc-git-20140613.patch index 28b5f0c82..725bf8cda 100644 --- a/toolchain/uclibc/patches/uclibc-git-20140602.patch +++ b/toolchain/uclibc/patches/uclibc-git-20140613.patch @@ -33284,8 +33284,16 @@ diff -Nur uClibc-0.9.33.2/ldso/ldso/arm/aeabi_read_tp.S uClibc-git/ldso/ldso/arm diff -Nur uClibc-0.9.33.2/ldso/ldso/arm/dl-startup.h uClibc-git/ldso/ldso/arm/dl-startup.h --- uClibc-0.9.33.2/ldso/ldso/arm/dl-startup.h 2012-05-15 09:20:09.000000000 +0200 -+++ uClibc-git/ldso/ldso/arm/dl-startup.h 2014-06-02 17:40:33.926711497 +0200 -@@ -14,6 +14,7 @@ ++++ uClibc-git/ldso/ldso/arm/dl-startup.h 2014-06-13 18:29:20.810293291 +0200 +@@ -7,13 +7,14 @@ + */ + + #include <features.h> +-#include <bits/arm_asm.h> ++#include <bits/arm_bx.h> + + #if !defined(__thumb__) + __asm__( " .text\n" " .globl _start\n" " .type _start,%function\n" @@ -33325,8 +33333,16 @@ diff -Nur uClibc-0.9.33.2/ldso/ldso/arm/elfinterp.c uClibc-git/ldso/ldso/arm/elf { diff -Nur uClibc-0.9.33.2/ldso/ldso/arm/resolve.S uClibc-git/ldso/ldso/arm/resolve.S --- uClibc-0.9.33.2/ldso/ldso/arm/resolve.S 2012-05-15 09:20:09.000000000 +0200 -+++ uClibc-git/ldso/ldso/arm/resolve.S 2014-06-02 17:40:33.926711497 +0200 -@@ -101,7 +101,7 @@ ++++ uClibc-git/ldso/ldso/arm/resolve.S 2014-06-13 18:29:20.834293397 +0200 +@@ -92,6 +92,7 @@ + + #include <sys/syscall.h> + #include <bits/arm_asm.h> ++#include <bits/arm_bx.h> + + #include <features.h> + +@@ -101,7 +102,7 @@ .text .align 4 @ 16 byte boundary and there are 32 bytes below (arm case) @@ -47267,10 +47283,32 @@ diff -Nur uClibc-0.9.33.2/libc/string/arc/strlen.S uClibc-git/libc/string/arc/st + sub_s.ne r1,r1,r1 +END(strlen) +libc_hidden_def(strlen) +diff -Nur uClibc-0.9.33.2/libc/string/arm/memcmp.S uClibc-git/libc/string/arm/memcmp.S +--- uClibc-0.9.33.2/libc/string/arm/memcmp.S 2012-05-15 09:20:09.000000000 +0200 ++++ uClibc-git/libc/string/arm/memcmp.S 2014-06-13 18:29:20.834293397 +0200 +@@ -31,6 +31,7 @@ + + #include <features.h> + #include <bits/arm_asm.h> ++#include <bits/arm_bx.h> + + .text + .global memcmp +diff -Nur uClibc-0.9.33.2/libc/string/arm/_memcpy.S uClibc-git/libc/string/arm/_memcpy.S +--- uClibc-0.9.33.2/libc/string/arm/_memcpy.S 2012-05-15 09:20:09.000000000 +0200 ++++ uClibc-git/libc/string/arm/_memcpy.S 2014-06-13 18:29:20.834293397 +0200 +@@ -40,6 +40,7 @@ + #include <features.h> + #include <endian.h> + #include <bits/arm_asm.h> ++#include <bits/arm_bx.h> + + #if !defined(THUMB1_ONLY) + /* diff -Nur uClibc-0.9.33.2/libc/string/arm/memset.S uClibc-git/libc/string/arm/memset.S --- uClibc-0.9.33.2/libc/string/arm/memset.S 2012-05-15 09:20:09.000000000 +0200 -+++ uClibc-git/libc/string/arm/memset.S 2014-06-02 17:40:34.182712914 +0200 -@@ -13,9 +13,8 @@ ++++ uClibc-git/libc/string/arm/memset.S 2014-06-13 18:29:20.834293397 +0200 +@@ -13,13 +13,13 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public @@ -47282,10 +47320,26 @@ diff -Nur uClibc-0.9.33.2/libc/string/arm/memset.S uClibc-git/libc/string/arm/me #include <features.h> #include <sys/syscall.h> + #include <bits/arm_asm.h> ++#include <bits/arm_bx.h> + + .text + .global memset +diff -Nur uClibc-0.9.33.2/libc/string/arm/strcmp.S uClibc-git/libc/string/arm/strcmp.S +--- uClibc-0.9.33.2/libc/string/arm/strcmp.S 2012-05-15 09:20:09.000000000 +0200 ++++ uClibc-git/libc/string/arm/strcmp.S 2014-06-13 18:29:20.838293415 +0200 +@@ -31,6 +31,7 @@ + + #include <features.h> + #include <bits/arm_asm.h> ++#include <bits/arm_bx.h> + + .text + .global strcmp diff -Nur uClibc-0.9.33.2/libc/string/arm/strlen.S uClibc-git/libc/string/arm/strlen.S --- uClibc-0.9.33.2/libc/string/arm/strlen.S 2012-05-15 09:20:09.000000000 +0200 -+++ uClibc-git/libc/string/arm/strlen.S 2014-06-02 17:40:34.182712914 +0200 -@@ -13,9 +13,8 @@ ++++ uClibc-git/libc/string/arm/strlen.S 2014-06-13 18:29:20.838293415 +0200 +@@ -13,14 +13,14 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public @@ -47297,6 +47351,12 @@ diff -Nur uClibc-0.9.33.2/libc/string/arm/strlen.S uClibc-git/libc/string/arm/st #include <features.h> #include <endian.h> + #include <sys/syscall.h> + #include <bits/arm_asm.h> ++#include <bits/arm_bx.h> + + /* size_t strlen(const char *S) + * entry: r0 -> string diff -Nur uClibc-0.9.33.2/libc/string/avr32/Makefile uClibc-git/libc/string/avr32/Makefile --- uClibc-0.9.33.2/libc/string/avr32/Makefile 2012-05-15 09:20:09.000000000 +0200 +++ uClibc-git/libc/string/avr32/Makefile 2014-06-02 17:40:34.182712914 +0200 @@ -53640,7 +53700,7 @@ diff -Nur uClibc-0.9.33.2/libc/sysdeps/linux/arm/aeabi_unwind_cpp_pr1.c uClibc-g -fexceptions, we end up with references to this personality diff -Nur uClibc-0.9.33.2/libc/sysdeps/linux/arm/bits/arm_asm.h uClibc-git/libc/sysdeps/linux/arm/bits/arm_asm.h --- uClibc-0.9.33.2/libc/sysdeps/linux/arm/bits/arm_asm.h 2012-05-15 09:20:09.000000000 +0200 -+++ uClibc-git/libc/sysdeps/linux/arm/bits/arm_asm.h 2014-06-02 17:40:34.282713468 +0200 ++++ uClibc-git/libc/sysdeps/linux/arm/bits/arm_asm.h 2014-06-13 18:29:20.838293415 +0200 @@ -3,8 +3,10 @@ #define _ARM_ASM_H @@ -53652,6 +53712,57 @@ diff -Nur uClibc-0.9.33.2/libc/sysdeps/linux/arm/bits/arm_asm.h uClibc-git/libc/ #define IT(t, cond) i##t cond #else /* XXX: This can be removed if/when we require an assembler that supports +@@ -24,12 +26,4 @@ + #define THUMB1_ONLY 1 + #endif + +-#if defined(__USE_BX__) +-# if ( defined (__ARM_ARCH_2__) || defined (__ARM_ARCH_3__) \ +- || defined (__ARM_ARCH_3M__) || defined (__ARM_ARCH_4__) \ +- ) +-# error Use of BX was requested, but is not available on the target processor. +-# endif /* ARCH level */ +-#endif /* __USE_BX__ */ +- + #endif /* _ARM_ASM_H */ +diff -Nur uClibc-0.9.33.2/libc/sysdeps/linux/arm/bits/arm_bx.h uClibc-git/libc/sysdeps/linux/arm/bits/arm_bx.h +--- uClibc-0.9.33.2/libc/sysdeps/linux/arm/bits/arm_bx.h 1970-01-01 01:00:00.000000000 +0100 ++++ uClibc-git/libc/sysdeps/linux/arm/bits/arm_bx.h 2014-06-13 18:29:20.838293415 +0200 +@@ -0,0 +1,34 @@ ++/* Copyright (C) 2013 Yann E. MORIN <yann.morin.1998@free.fr> ++ * ++ * This file is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU Lesser General Public License as ++ * published by the Free Software Foundation; either version 2.1 of ++ * the License, or (at your option) any later version. ++ * ++ * This file is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with the GNU C Library; if not, see ++ * <http://www.gnu.org/licenses/>. ++ */ ++ ++#ifndef _ARM_BX_H ++#define _ARM_BX_H ++ ++/* We need features.h first */ ++#if !defined _FEATURES_H ++#error Please include features.h first ++#endif /* features.h not yet included */ ++ ++#if defined(__USE_BX__) ++# if ( defined (__ARM_ARCH_2__) || defined (__ARM_ARCH_3__) \ ++ || defined (__ARM_ARCH_3M__) || defined (__ARM_ARCH_4__) \ ++ ) ++# error Use of BX was requested, but is not available on the target processor. ++# endif /* ARCH level */ ++#endif /* __USE_BX__ */ ++ ++#endif /* _ARM_BX_H */ diff -Nur uClibc-0.9.33.2/libc/sysdeps/linux/arm/bits/armsigctx.h uClibc-git/libc/sysdeps/linux/arm/bits/armsigctx.h --- uClibc-0.9.33.2/libc/sysdeps/linux/arm/bits/armsigctx.h 2012-05-15 09:20:09.000000000 +0200 +++ uClibc-git/libc/sysdeps/linux/arm/bits/armsigctx.h 2014-06-02 17:40:34.282713468 +0200 @@ -53947,7 +54058,7 @@ diff -Nur uClibc-0.9.33.2/libc/sysdeps/linux/arm/bsd-_setjmp.S uClibc-git/libc/s diff -Nur uClibc-0.9.33.2/libc/sysdeps/linux/arm/clone.S uClibc-git/libc/sysdeps/linux/arm/clone.S --- uClibc-0.9.33.2/libc/sysdeps/linux/arm/clone.S 2012-05-15 09:20:09.000000000 +0200 -+++ uClibc-git/libc/sysdeps/linux/arm/clone.S 2014-06-02 17:40:34.306713601 +0200 ++++ uClibc-git/libc/sysdeps/linux/arm/clone.S 2014-06-13 18:29:20.838293415 +0200 @@ -13,9 +13,8 @@ Lesser General Public License for more details. @@ -53960,11 +54071,20 @@ diff -Nur uClibc-0.9.33.2/libc/sysdeps/linux/arm/clone.S uClibc-git/libc/sysdeps /* clone() is even more special than fork() as it mucks with stacks and invokes a function in the right context after its all over. */ -@@ -111,8 +110,8 @@ +@@ -25,6 +24,7 @@ + #include <bits/errno.h> + #include <sys/syscall.h> + #include <bits/arm_asm.h> ++#include <bits/arm_bx.h> + + #if defined(__NR_clone) + /* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg); */ +@@ -111,8 +111,9 @@ ldr r4, [sp, #12] DO_CALL (clone) movs a1, a1 - blt __error ++ IT(t, ne) ldmnefd sp!, {r4} + blt __error IT(t, ne) @@ -54191,8 +54311,8 @@ diff -Nur uClibc-0.9.33.2/libc/sysdeps/linux/arm/jmpbuf-unwind.h uClibc-git/libc +#endif diff -Nur uClibc-0.9.33.2/libc/sysdeps/linux/arm/__longjmp.S uClibc-git/libc/sysdeps/linux/arm/__longjmp.S --- uClibc-0.9.33.2/libc/sysdeps/linux/arm/__longjmp.S 2012-05-15 09:20:09.000000000 +0200 -+++ uClibc-git/libc/sysdeps/linux/arm/__longjmp.S 2014-06-02 17:40:34.266713379 +0200 -@@ -13,16 +13,11 @@ ++++ uClibc-git/libc/sysdeps/linux/arm/__longjmp.S 2014-06-13 18:29:20.838293415 +0200 +@@ -13,16 +13,12 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public @@ -54208,6 +54328,7 @@ diff -Nur uClibc-0.9.33.2/libc/sysdeps/linux/arm/__longjmp.S uClibc-git/libc/sys -#define _ASM -#include <bits/setjmp.h> - ++#include <bits/arm_bx.h> .global __longjmp .type __longjmp,%function @@ -54362,8 +54483,8 @@ diff -Nur uClibc-0.9.33.2/libc/sysdeps/linux/arm/Makefile.arch uClibc-git/libc/s + ) diff -Nur uClibc-0.9.33.2/libc/sysdeps/linux/arm/mmap64.S uClibc-git/libc/sysdeps/linux/arm/mmap64.S --- uClibc-0.9.33.2/libc/sysdeps/linux/arm/mmap64.S 2012-05-15 09:20:09.000000000 +0200 -+++ uClibc-git/libc/sysdeps/linux/arm/mmap64.S 2014-06-02 17:40:34.306713601 +0200 -@@ -12,17 +12,16 @@ ++++ uClibc-git/libc/sysdeps/linux/arm/mmap64.S 2014-06-13 18:29:20.838293415 +0200 +@@ -12,17 +12,17 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public @@ -54379,6 +54500,7 @@ diff -Nur uClibc-0.9.33.2/libc/sysdeps/linux/arm/mmap64.S uClibc-git/libc/sysdep #include <bits/errno.h> #include <sys/syscall.h> #include <bits/arm_asm.h> ++#include <bits/arm_bx.h> -#if defined __UCLIBC_HAS_LFS__ && defined __NR_mmap2 +#ifdef __NR_mmap2 @@ -54873,8 +54995,8 @@ diff -Nur uClibc-0.9.33.2/libc/sysdeps/linux/arm/sys/user.h uClibc-git/libc/sysd #define _SYS_USER_H 1 diff -Nur uClibc-0.9.33.2/libc/sysdeps/linux/arm/syscall-eabi.S uClibc-git/libc/sysdeps/linux/arm/syscall-eabi.S --- uClibc-0.9.33.2/libc/sysdeps/linux/arm/syscall-eabi.S 2012-05-15 09:20:09.000000000 +0200 -+++ uClibc-git/libc/sysdeps/linux/arm/syscall-eabi.S 2014-06-02 17:40:34.310713623 +0200 -@@ -12,9 +12,8 @@ ++++ uClibc-git/libc/sysdeps/linux/arm/syscall-eabi.S 2014-06-13 18:29:20.838293415 +0200 +@@ -12,12 +12,12 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public @@ -54886,10 +55008,14 @@ diff -Nur uClibc-0.9.33.2/libc/sysdeps/linux/arm/syscall-eabi.S uClibc-git/libc/ #include <sys/syscall.h> #include <bits/arm_asm.h> ++#include <bits/arm_bx.h> + + /* In the EABI syscall interface, we don't need a special syscall to + implement syscall(). It won't work reliably with 64-bit arguments diff -Nur uClibc-0.9.33.2/libc/sysdeps/linux/arm/sysdep.h uClibc-git/libc/sysdeps/linux/arm/sysdep.h --- uClibc-0.9.33.2/libc/sysdeps/linux/arm/sysdep.h 2012-05-15 09:20:09.000000000 +0200 -+++ uClibc-git/libc/sysdeps/linux/arm/sysdep.h 2014-06-02 17:40:34.310713623 +0200 -@@ -13,9 +13,8 @@ ++++ uClibc-git/libc/sysdeps/linux/arm/sysdep.h 2014-06-13 18:29:20.838293415 +0200 +@@ -13,15 +13,14 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public @@ -54901,6 +55027,13 @@ diff -Nur uClibc-0.9.33.2/libc/sysdeps/linux/arm/sysdep.h uClibc-git/libc/sysdep #ifndef _LINUX_ARM_SYSDEP_H #define _LINUX_ARM_SYSDEP_H 1 + + #include <common/sysdep.h> +-#include <bits/arm_asm.h> ++#include <bits/arm_bx.h> + + #include <sys/syscall.h> + /* For Linux we can use the system call table in the header file @@ -157,6 +156,7 @@ #define PSEUDO_END_ERRVAL(name) \ END (name) @@ -54969,8 +55102,16 @@ diff -Nur uClibc-0.9.33.2/libc/sysdeps/linux/arm/unwind.h uClibc-git/libc/sysdep ABI defined objects, and GNU support routines. */ diff -Nur uClibc-0.9.33.2/libc/sysdeps/linux/arm/vfork.S uClibc-git/libc/sysdeps/linux/arm/vfork.S --- uClibc-0.9.33.2/libc/sysdeps/linux/arm/vfork.S 2012-05-15 09:20:09.000000000 +0200 -+++ uClibc-git/libc/sysdeps/linux/arm/vfork.S 2014-06-02 17:40:34.310713623 +0200 -@@ -104,5 +104,5 @@ ++++ uClibc-git/libc/sysdeps/linux/arm/vfork.S 2014-06-13 18:29:20.838293415 +0200 +@@ -7,6 +7,7 @@ + + #include <features.h> + #include <bits/arm_asm.h> ++#include <bits/arm_bx.h> + + #define _ERRNO_H + #include <bits/errno.h> +@@ -104,5 +105,5 @@ .size __vfork,.-__vfork weak_alias(__vfork,vfork) @@ -83209,7 +83350,7 @@ diff -Nur uClibc-0.9.33.2/libc/sysdeps/linux/x86_64/setjmp.S uClibc-git/libc/sys .type __sigsetjmp,%function diff -Nur uClibc-0.9.33.2/libc/sysdeps/linux/x86_64/sigaction.c uClibc-git/libc/sysdeps/linux/x86_64/sigaction.c --- uClibc-0.9.33.2/libc/sysdeps/linux/x86_64/sigaction.c 2012-05-15 09:20:09.000000000 +0200 -+++ uClibc-git/libc/sysdeps/linux/x86_64/sigaction.c 2014-06-02 17:40:34.686715704 +0200 ++++ uClibc-git/libc/sysdeps/linux/x86_64/sigaction.c 2014-06-13 18:29:20.838293415 +0200 @@ -13,9 +13,8 @@ Lesser General Public License for more details. @@ -83232,6 +83373,27 @@ diff -Nur uClibc-0.9.33.2/libc/sysdeps/linux/x86_64/sigaction.c uClibc-git/libc/ #ifdef __NR_rt_sigaction /* Using the hidden attribute here does not change the code but it +@@ -115,11 +111,19 @@ + signal handlers work right. Important are both the names + (__restore_rt) and the exact instruction sequence. + If you ever feel the need to make any changes, please notify the +- appropriate GDB maintainer. */ ++ appropriate GDB maintainer. ++ ++ The unwind information starts a byte before __restore_rt, so that ++ it is found when unwinding, to get an address the unwinder assumes ++ will be in the middle of a call instruction. See the Linux kernel ++ (the i386 vsyscall, in particular) for an explanation of the complex ++ unwind information used here in order to get the traditional CFA. ++ */ + + #define RESTORE(name, syscall) RESTORE2(name, syscall) + #define RESTORE2(name, syscall) \ + __asm__ ( \ ++ "nop\n" \ + ".text\n" \ + "__" #name ":\n" \ + " movq $" #syscall ", %rax\n" \ diff -Nur uClibc-0.9.33.2/libc/sysdeps/linux/x86_64/__start_context.S uClibc-git/libc/sysdeps/linux/x86_64/__start_context.S --- uClibc-0.9.33.2/libc/sysdeps/linux/x86_64/__start_context.S 1970-01-01 01:00:00.000000000 +0100 +++ uClibc-git/libc/sysdeps/linux/x86_64/__start_context.S 2014-06-02 17:40:34.682715682 +0200 @@ -101011,7 +101173,7 @@ diff -Nur uClibc-0.9.33.2/libpthread/nptl/sysdeps/unix/sysv/linux/i386/i486/pthr #include <lowlevellock.h> diff -Nur uClibc-0.9.33.2/libpthread/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S uClibc-git/libpthread/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S --- uClibc-0.9.33.2/libpthread/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S 2012-05-15 09:20:09.000000000 +0200 -+++ uClibc-git/libpthread/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S 2014-06-02 17:40:35.098717984 +0200 ++++ uClibc-git/libpthread/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S 2014-06-13 18:29:20.838293415 +0200 @@ -13,9 +13,8 @@ Lesser General Public License for more details. @@ -101024,6 +101186,14 @@ diff -Nur uClibc-0.9.33.2/libpthread/nptl/sysdeps/unix/sysv/linux/i386/i486/pthr #include <sysdep.h> #include <lowlevellock.h> +@@ -23,6 +22,7 @@ + #include <pthread-errnos.h> + #include <pthread-pi-defines.h> + #include <bits/kernel-features.h> ++#include <tcb-offsets.h> + + + .text diff -Nur uClibc-0.9.33.2/libpthread/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S uClibc-git/libpthread/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S --- uClibc-0.9.33.2/libpthread/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S 2012-05-15 09:20:09.000000000 +0200 +++ uClibc-git/libpthread/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S 2014-06-02 17:40:35.098717984 +0200 @@ -107277,7 +107447,7 @@ diff -Nur uClibc-0.9.33.2/Makefile.help uClibc-git/Makefile.help @echo ' PREFIX= - Prepended prefix' diff -Nur uClibc-0.9.33.2/Makefile.in uClibc-git/Makefile.in --- uClibc-0.9.33.2/Makefile.in 2012-05-15 09:20:09.000000000 +0200 -+++ uClibc-git/Makefile.in 2014-06-02 17:40:33.670710081 +0200 ++++ uClibc-git/Makefile.in 2014-06-13 18:29:20.642292552 +0200 @@ -8,18 +8,8 @@ #-------------------------------------------------------------- # You shouldn't need to mess with anything beyond this point... @@ -107439,7 +107609,7 @@ diff -Nur uClibc-0.9.33.2/Makefile.in uClibc-git/Makefile.in DEVEL_PREFIX=/usr/ \ HOSTCC="$(HOSTCC)" \ install -@@ -210,16 +225,27 @@ +@@ -210,21 +225,34 @@ # a "y" here means the feature is enabled and so we should *not* rm it. # if the option expands to nothing though, we can punt the headers. HEADERS_RM- := \ @@ -107467,7 +107637,14 @@ diff -Nur uClibc-0.9.33.2/Makefile.in uClibc-git/Makefile.in bits/uClibc_uintmaxtostr.h \ bits/uClibc_uwchar.h \ bits/uClibc_va_copy.h \ -@@ -259,18 +285,23 @@ + bits/sigcontextinfo.h \ + bits/stackinfo.h \ ++ atomic.h \ ++ bits/atomic.h \ + tls.h \ + rpc/des_crypt.h \ + rpc/key_prot.h \ +@@ -259,18 +287,23 @@ HEADERS_RM-$(UCLIBC_HAS_REGEX) += regex.h regexp.h HEADERS_RM-$(UCLIBC_HAS_RPC) += rpc HEADERS_RM-$(UCLIBC_HAS_SHADOW) += shadow.h @@ -107493,7 +107670,7 @@ diff -Nur uClibc-0.9.33.2/Makefile.in uClibc-git/Makefile.in bits/inotify.h \ sys/inotify.h \ sys/kdaemon.h \ -@@ -288,11 +319,13 @@ +@@ -288,11 +321,13 @@ sys/sysinfo.h \ bits/timerfd.h \ sys/timerfd.h \ @@ -107507,7 +107684,7 @@ diff -Nur uClibc-0.9.33.2/Makefile.in uClibc-git/Makefile.in ifneq ($(findstring install,$(MAKECMDGOALS)),) $(addprefix $(PREFIX)$(DEVEL_PREFIX),include $(MULTILIB_DIR)): -@@ -303,7 +336,9 @@ +@@ -303,7 +338,9 @@ $(do_mkdir) endif endif @@ -107518,7 +107695,7 @@ diff -Nur uClibc-0.9.33.2/Makefile.in uClibc-git/Makefile.in @$(call disp_install,"include -> $(PREFIX)$(DEVEL_PREFIX)include") $(Q)top_builddir=$(top_builddir) \ $(top_srcdir)extra/scripts/install_headers.sh \ -@@ -346,12 +381,7 @@ +@@ -346,12 +383,7 @@ else -$(INSTALL) -m 755 $(top_builddir)lib/libc.so $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)/ endif @@ -107532,7 +107709,7 @@ diff -Nur uClibc-0.9.33.2/Makefile.in uClibc-git/Makefile.in ifeq ($(UCLIBC_HAS_THREADS),y) ifneq ($(LINUXTHREADS_OLD),y) ifeq ($(HARDWIRED_ABSPATH),y) -@@ -422,49 +452,55 @@ +@@ -422,49 +454,55 @@ install_hostutils: hostutils $(Q)$(MAKE) CROSS_COMPILE="$(CROSS_COMPILE)" CC="$(CC)" HOSTCC="$(HOSTCC)" DOTHOST=.host -C utils utils_install @@ -107611,7 +107788,7 @@ diff -Nur uClibc-0.9.33.2/Makefile.in uClibc-git/Makefile.in menuconfig-clean-y: $(Q)$(MAKE) -C extra/config CLEAN_extra/config -@@ -484,11 +520,11 @@ +@@ -484,11 +522,11 @@ $(Q)$(RM) $(top_builddir)extra/scripts/unifdef $(Q)$(RM) -r $(LOCAL_INSTALL_PATH) @@ -107626,7 +107803,7 @@ diff -Nur uClibc-0.9.33.2/Makefile.in uClibc-git/Makefile.in dist release: $(RM) ../uClibc-$(VERSION).tar -@@ -499,7 +535,9 @@ +@@ -499,7 +537,9 @@ du -b ../uClibc-$(VERSION).tar.{bz2,xz} test check: test_compile diff --git a/toolchain/uclibc/patches/xxx-xtensa-nptl.patch b/toolchain/uclibc/patches/xxx-xtensa-nptl.patch new file mode 100644 index 000000000..16241e161 --- /dev/null +++ b/toolchain/uclibc/patches/xxx-xtensa-nptl.patch @@ -0,0 +1,3515 @@ +diff -Nur uClibc-git/include/elf.h uClibc-xtensa/include/elf.h +--- uClibc-git/include/elf.h 2014-06-02 17:40:33.826710944 +0200 ++++ uClibc-xtensa/include/elf.h 2014-06-03 16:03:19.065886532 +0200 +@@ -3072,8 +3071,11 @@ + #define R_XTENSA_SLOT12_ALT 47 + #define R_XTENSA_SLOT13_ALT 48 + #define R_XTENSA_SLOT14_ALT 49 ++#define R_XTENSA_TLSDESC_FN 50 ++#define R_XTENSA_TLSDESC_ARG 51 ++#define R_XTENSA_TLS_TPOFF 53 + /* Keep this the last entry. */ +-#define R_XTENSA_NUM 50 ++#define R_XTENSA_NUM 54 + + /* C6X specific relocs */ + #define R_C6000_NONE 0 +diff -Nur uClibc-git/include/link.h uClibc-xtensa/include/link.h +--- uClibc-git/include/link.h 2014-06-02 17:40:33.846711055 +0200 ++++ uClibc-xtensa/include/link.h 2014-06-03 15:28:27.185347373 +0200 +@@ -132,6 +132,8 @@ + size_t l_tls_modid; + /* Nonzero if _dl_init_static_tls should be called for this module */ + unsigned int l_need_tls_init:1; ++ /* Address of TLS descriptor hash table. */ ++ void *l_tlsdesc_table; + #endif + #endif + }; +diff -Nur uClibc-git/ldso/include/dl-hash.h uClibc-xtensa/ldso/include/dl-hash.h +--- uClibc-git/ldso/include/dl-hash.h 2014-06-02 17:40:33.902711365 +0200 ++++ uClibc-xtensa/ldso/include/dl-hash.h 2014-06-03 15:29:09.505536959 +0200 +@@ -70,6 +70,8 @@ + size_t l_tls_modid; + /* Nonzero if _dl_init_static_tls should be called for this module */ + unsigned int l_need_tls_init:1; ++ /* Address of TLS descriptor hash table. */ ++ void *l_tlsdesc_table; + #endif + + ElfW(Addr) mapaddr; +diff -Nur uClibc-git/ldso/include/inline-hashtab.h uClibc-xtensa/ldso/include/inline-hashtab.h +--- uClibc-git/ldso/include/inline-hashtab.h 1970-01-01 01:00:00.000000000 +0100 ++++ uClibc-xtensa/ldso/include/inline-hashtab.h 2014-06-03 11:57:42.031052092 +0200 +@@ -0,0 +1,265 @@ ++/* ++ * The hashcode handling code below is heavily inspired in libiberty's ++ * hashtab code, but with most adaptation points and support for ++ * deleting elements removed. ++ * ++ * Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. ++ * Contributed by Vladimir Makarov (vmakarov@cygnus.com). ++ */ ++ ++#ifndef INLINE_HASHTAB_H ++# define INLINE_HASHTAB_H 1 ++ ++static __always_inline unsigned long ++higher_prime_number(unsigned long n) ++{ ++ /* These are primes that are near, but slightly smaller than, a power of two. */ ++ static const unsigned long primes[] = { ++ 7, ++ 13, ++ 31, ++ 61, ++ 127, ++ 251, ++ 509, ++ 1021, ++ 2039, ++ 4093, ++ 8191, ++ 16381, ++ 32749, ++ 65521, ++ 131071, ++ 262139, ++ 524287, ++ 1048573, ++ 2097143, ++ 4194301, ++ 8388593, ++ 16777213, ++ 33554393, ++ 67108859, ++ 134217689, ++ 268435399, ++ 536870909, ++ 1073741789, ++ /* 4294967291 */ ++ ((unsigned long) 2147483647) + ((unsigned long) 2147483644), ++ }; ++ const unsigned long *low = &primes[0]; ++ const unsigned long *high = &primes[ARRAY_SIZE(primes)]; ++ ++ while (low != high) { ++ const unsigned long *mid = low + (high - low) / 2; ++ if (n > *mid) ++ low = mid + 1; ++ else ++ high = mid; ++ } ++ ++#if 0 ++ /* If we've run out of primes, abort. */ ++ if (n > *low) { ++ fprintf(stderr, "Cannot find prime bigger than %lu\n", n); ++ abort(); ++ } ++#endif ++ ++ return *low; ++} ++ ++struct funcdesc_ht ++{ ++ /* Table itself */ ++ void **entries; ++ ++ /* Current size (in entries) of the hash table */ ++ size_t size; ++ ++ /* Current number of elements */ ++ size_t n_elements; ++}; ++ ++static __always_inline struct funcdesc_ht * ++htab_create(void) ++{ ++ struct funcdesc_ht *ht = _dl_malloc(sizeof(*ht)); ++ size_t ent_size; ++ ++ if (!ht) ++ return NULL; ++ ht->size = 3; ++ ent_size = sizeof(void *) * ht->size; ++ ht->entries = _dl_malloc(ent_size); ++ if (!ht->entries) ++ return NULL; ++ ++ ht->n_elements = 0; ++ _dl_memset(ht->entries, 0, ent_size); ++ ++ return ht; ++} ++ ++/* ++ * This is only called from _dl_loadaddr_unmap, so it's safe to call ++ * _dl_free(). See the discussion below. ++ */ ++static __always_inline void ++htab_delete(struct funcdesc_ht *htab) ++{ ++ size_t i; ++ ++ for (i = htab->size - 1; i >= 0; i--) ++ if (htab->entries[i]) ++ _dl_free(htab->entries[i]); ++ ++ _dl_free(htab->entries); ++ _dl_free(htab); ++} ++ ++/* ++ * Similar to htab_find_slot, but without several unwanted side effects: ++ * - Does not call htab->eq_f when it finds an existing entry. ++ * - Does not change the count of elements/searches/collisions in the ++ * hash table. ++ * This function also assumes there are no deleted entries in the table. ++ * HASH is the hash value for the element to be inserted. ++ */ ++static __always_inline void ** ++find_empty_slot_for_expand(struct funcdesc_ht *htab, int hash) ++{ ++ size_t size = htab->size; ++ unsigned int index = hash % size; ++ void **slot = htab->entries + index; ++ int hash2; ++ ++ if (!*slot) ++ return slot; ++ ++ hash2 = 1 + hash % (size - 2); ++ for (;;) { ++ index += hash2; ++ if (index >= size) ++ index -= size; ++ ++ slot = htab->entries + index; ++ if (!*slot) ++ return slot; ++ } ++} ++ ++/* ++ * The following function changes size of memory allocated for the ++ * entries and repeatedly inserts the table elements. The occupancy ++ * of the table after the call will be about 50%. Naturally the hash ++ * table must already exist. Remember also that the place of the ++ * table entries is changed. If memory allocation failures are allowed, ++ * this function will return zero, indicating that the table could not be ++ * expanded. If all goes well, it will return a non-zero value. ++ */ ++static __always_inline int ++htab_expand(struct funcdesc_ht *htab, int (*hash_fn) (void *)) ++{ ++ void **oentries; ++ void **olimit; ++ void **p; ++ void **nentries; ++ size_t nsize; ++ ++ oentries = htab->entries; ++ olimit = oentries + htab->size; ++ ++ /* ++ * Resize only when table after removal of unused elements is either ++ * too full or too empty. ++ */ ++ if (htab->n_elements * 2 > htab->size) ++ nsize = higher_prime_number(htab->n_elements * 2); ++ else ++ nsize = htab->size; ++ ++ nentries = _dl_malloc(sizeof(*nentries) * nsize); ++ _dl_memset(nentries, 0, sizeof(*nentries) * nsize); ++ if (nentries == NULL) ++ return 0; ++ htab->entries = nentries; ++ htab->size = nsize; ++ ++ p = oentries; ++ do { ++ if (*p) ++ *find_empty_slot_for_expand(htab, hash_fn(*p)) = *p; ++ p++; ++ } while (p < olimit); ++ ++#if 0 ++ /* ++ * We can't tell whether this was allocated by the _dl_malloc() ++ * built into ld.so or malloc() in the main executable or libc, ++ * and calling free() for something that wasn't malloc()ed could ++ * do Very Bad Things (TM). Take the conservative approach ++ * here, potentially wasting as much memory as actually used by ++ * the hash table, even if multiple growths occur. That's not ++ * so bad as to require some overengineered solution that would ++ * enable us to keep track of how it was allocated. ++ */ ++ _dl_free(oentries); ++#endif ++ return 1; ++} ++ ++/* ++ * This function searches for a hash table slot containing an entry ++ * equal to the given element. To delete an entry, call this with ++ * INSERT = 0, then call htab_clear_slot on the slot returned (possibly ++ * after doing some checks). To insert an entry, call this with ++ * INSERT = 1, then write the value you want into the returned slot. ++ * When inserting an entry, NULL may be returned if memory allocation ++ * fails. ++ */ ++static __always_inline void ** ++htab_find_slot(struct funcdesc_ht *htab, void *ptr, int insert, ++ int (*hash_fn)(void *), int (*eq_fn)(void *, void *)) ++{ ++ unsigned int index; ++ int hash, hash2; ++ size_t size; ++ void **entry; ++ ++ if (htab->size * 3 <= htab->n_elements * 4 && ++ htab_expand(htab, hash_fn) == 0) ++ return NULL; ++ ++ hash = hash_fn(ptr); ++ ++ size = htab->size; ++ index = hash % size; ++ ++ entry = &htab->entries[index]; ++ if (!*entry) ++ goto empty_entry; ++ else if (eq_fn(*entry, ptr)) ++ return entry; ++ ++ hash2 = 1 + hash % (size - 2); ++ for (;;) { ++ index += hash2; ++ if (index >= size) ++ index -= size; ++ ++ entry = &htab->entries[index]; ++ if (!*entry) ++ goto empty_entry; ++ else if (eq_fn(*entry, ptr)) ++ return entry; ++ } ++ ++ empty_entry: ++ if (!insert) ++ return NULL; ++ ++ htab->n_elements++; ++ return entry; ++} ++ ++#endif +diff -Nur uClibc-git/ldso/include/ldsodefs.h uClibc-xtensa/ldso/include/ldsodefs.h +--- uClibc-git/ldso/include/ldsodefs.h 2014-06-02 17:40:33.922711475 +0200 ++++ uClibc-xtensa/ldso/include/ldsodefs.h 2014-06-03 16:10:51.175659505 +0200 +@@ -62,13 +62,18 @@ + + extern void _dl_allocate_static_tls (struct link_map *map) + internal_function attribute_hidden; ++extern int _dl_try_allocate_static_tls (struct link_map* map) ++ internal_function attribute_hidden; + + /* Taken from glibc/elf/dl-reloc.c */ + #define CHECK_STATIC_TLS(sym_map) \ + do { \ +- if (unlikely((sym_map)->l_tls_offset == NO_TLS_OFFSET)) \ ++ if (__builtin_expect ((sym_map)->l_tls_offset == NO_TLS_OFFSET, 0)) \ + _dl_allocate_static_tls (sym_map); \ + } while (0) ++#define TRY_STATIC_TLS(sym_map) \ ++ (__builtin_expect ((sym_map)->l_tls_offset != NO_TLS_OFFSET, 1) \ ++ || _dl_try_allocate_static_tls (sym_map) == 0) + + /* These are internal entry points to the two halves of _dl_allocate_tls, + only used within rtld.c itself at startup time. */ +diff -Nur uClibc-git/ldso/include/tlsdeschtab.h uClibc-xtensa/ldso/include/tlsdeschtab.h +--- uClibc-git/ldso/include/tlsdeschtab.h 1970-01-01 01:00:00.000000000 +0100 ++++ uClibc-xtensa/ldso/include/tlsdeschtab.h 2014-06-03 14:58:29.681335708 +0200 +@@ -0,0 +1,119 @@ ++/* Hash table for TLS descriptors. ++ Copyright (C) 2005-2013 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ Contributed by Alexandre Oliva <aoliva@redhat.com> ++ ++ uClibc port by Baruch Siach <baruch@tkos.co.il> ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, see ++ <http://www.gnu.org/licenses/>. */ ++ ++#ifndef TLSDESCHTAB_H ++# define TLSDESCHTAB_H 1 ++ ++# ifdef SHARED ++ ++# include <inline-hashtab.h> ++ ++inline static int ++hash_tlsdesc (void *p) ++{ ++ struct tlsdesc_dynamic_arg *td = p; ++ ++ /* We know all entries are for the same module, so ti_offset is the ++ only distinguishing entry. */ ++ return td->tlsinfo.ti_offset; ++} ++ ++inline static int ++eq_tlsdesc (void *p, void *q) ++{ ++ struct tlsdesc_dynamic_arg *tdp = p, *tdq = q; ++ ++ return tdp->tlsinfo.ti_offset == tdq->tlsinfo.ti_offset; ++} ++ ++inline static int ++map_generation (struct link_map *map) ++{ ++ size_t idx = map->l_tls_modid; ++ struct dtv_slotinfo_list *listp = GL(dl_tls_dtv_slotinfo_list); ++ ++ /* Find the place in the dtv slotinfo list. */ ++ do ++ { ++ /* Does it fit in the array of this list element? */ ++ if (idx < listp->len) ++ { ++ /* We should never get here for a module in static TLS, so ++ we can assume that, if the generation count is zero, we ++ still haven't determined the generation count for this ++ module. */ ++ if (listp->slotinfo[idx].gen) ++ return listp->slotinfo[idx].gen; ++ else ++ break; ++ } ++ idx -= listp->len; ++ listp = listp->next; ++ } ++ while (listp != NULL); ++ ++ /* If we get to this point, the module still hasn't been assigned an ++ entry in the dtv slotinfo data structures, and it will when we're ++ done with relocations. At that point, the module will get a ++ generation number that is one past the current generation, so ++ return exactly that. */ ++ return GL(dl_tls_generation) + 1; ++} ++ ++void * ++internal_function ++_dl_make_tlsdesc_dynamic (struct link_map *map, size_t ti_offset) ++{ ++ struct funcdesc_ht *ht; ++ void **entry; ++ struct tlsdesc_dynamic_arg *td, test; ++ ++ ht = map->l_tlsdesc_table; ++ if (! ht) ++ { ++ ht = htab_create (); ++ if (! ht) ++ return 0; ++ map->l_tlsdesc_table = ht; ++ } ++ ++ test.tlsinfo.ti_module = map->l_tls_modid; ++ test.tlsinfo.ti_offset = ti_offset; ++ entry = htab_find_slot (ht, &test, 1, hash_tlsdesc, eq_tlsdesc); ++ if (*entry) ++ { ++ td = *entry; ++ return td; ++ } ++ ++ *entry = td = _dl_malloc (sizeof (struct tlsdesc_dynamic_arg)); ++ /* This may be higher than the map's generation, but it doesn't ++ matter much. Worst case, we'll have one extra DTV update per ++ thread. */ ++ td->gen_count = map_generation (map); ++ td->tlsinfo = test.tlsinfo; ++ ++ return td; ++} ++ ++# endif /* SHARED */ ++ ++#endif +diff -Nur uClibc-git/ldso/ldso/dl-tls.c uClibc-xtensa/ldso/ldso/dl-tls.c +--- uClibc-git/ldso/ldso/dl-tls.c 2014-06-02 17:40:33.946711608 +0200 ++++ uClibc-xtensa/ldso/ldso/dl-tls.c 2014-06-03 16:10:28.547570023 +0200 +@@ -100,20 +100,16 @@ + * the static TLS area already allocated for each running thread. If this + * object's TLS segment is too big to fit, we fail. If it fits, + * we set MAP->l_tls_offset and return. +- * This function intentionally does not return any value but signals error +- * directly, as static TLS should be rare and code handling it should +- * not be inlined as much as possible. + */ +-void +-internal_function __attribute_noinline__ +-_dl_allocate_static_tls (struct link_map *map) ++int ++internal_function ++_dl_try_allocate_static_tls (struct link_map* map) + { + /* If the alignment requirements are too high fail. */ + if (map->l_tls_align > _dl_tls_static_align) + { + fail: +- _dl_dprintf(2, "cannot allocate memory in static TLS block"); +- _dl_exit(30); ++ return -1; + } + + # ifdef TLS_TCB_AT_TP +@@ -169,6 +165,23 @@ + } + else + map->l_need_tls_init = 1; ++ ++ return 0; ++} ++ ++/* ++ * This function intentionally does not return any valu |