diff options
Diffstat (limited to 'libc/ports')
112 files changed, 1226 insertions, 1245 deletions
diff --git a/libc/ports/ChangeLog.alpha b/libc/ports/ChangeLog.alpha index 3094fcd21..266f42d97 100644 --- a/libc/ports/ChangeLog.alpha +++ b/libc/ports/ChangeLog.alpha @@ -1,3 +1,66 @@ +2012-08-16 Carlos O'Donell <carlos_odonell@mentor.com> + + * sysdeps/alpha/ldsodefs.h (ARCH_PLTENTER_MEMBERS) + <alpha_gnu_pltenter>: struct La_alpha_regs is not const. + +2012-08-13 Richard Henderson <rth@twiddle.net> + + * configure.in: Don't test toolchain support for TLS or GPREL. + * configure: Rebuild. + + * sysdeps/alpha/fpu/s_nearbyint.c (nearbyintl): Do compat + with GLIBC_2_1. + +2012-08-08 Joseph Myers <joseph@codesourcery.com> + + * sysdeps/unix/sysv/linux/alpha/kernel-features.h + (__ASSUME_TGKILL): Remove. + +2012-08-08 Richard Henderson <rth@twiddle.net> + + * sysdeps/unix/sysv/linux/alpha/kernel-features.h + (__ASSUME_IEEE_RAISE_EXCEPTION): Remove. + * sysdeps/unix/sysv/linux/alpha/fraiseexcpt.S: New file. + * sysdeps/unix/sysv/linux/alpha/fraiseexcpt.c: Remove. + + * sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S: Use dwarf2 + cfi markup for unwind. Adjust stack early so that the normal + syscall error path can be used. + * sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S: Likewise. + + * sysdeps/unix/sysv/linux/alpha/kernel-features.h + (__ASSUME_STAT64_SYSCALL): Remove. + * sysdeps/unix/sysv/linux/alpha/fxstat.c: Remove test + for __ASSUME_STAT64_SYSCALL. + * sysdeps/unsx/sysv/linux/alpha/fxstatat.c: Likewise. + * sysdeps/unsx/sysv/linux/alpha/lxstat.c: Likewise. + * sysdeps/unsx/sysv/linux/alpha/xstat.c: Likewise. + * sysdeps/unsx/sysv/linux/alpha/xstatconv.c: Likewise. + * sysdeps/unsx/sysv/linux/alpha/xstatconv.h: Likewise. + +2012-08-07 Joseph Myers <joseph@codesourcery.com> + + * sysdeps/unix/sysv/linux/alpha/kernel-features.h + (__ASSUME_TGKILL): Define unconditionally. + (__ASSUME_STAT64_SYSCALL): Likewise. + (__ASSUME_IEEE_RAISE_EXCEPTION): Likewise. + +2012-08-02 Roland McGrath <roland@hack.frob.com> + + * sysdeps/unix/sysv/linux/alpha/bits/dirent.h + (_DIRENT_MATCHES_DIRENT64): New macro. + +2012-08-02 Roland McGrath <roland@hack.frob.com> + + * sysdeps/unix/sysv/linux/alpha/bits/typesizes.h + (__OFF_T_MATCHES_OFF64_T): New macro. + +2012-08-03 Joseph Myers <joseph@codesourcery.com> + + * sysdeps/unix/sysv/linux/alpha/configure.in + (arch_minimum_kernel): Remove. + * sysdeps/unix/sysv/linux/alpha/configure: Regenerated. + 2012-07-26 Joseph Myers <joseph@codesourcery.com> * sysdeps/alpha/tst-audit.h (int_retval): Define. diff --git a/libc/ports/ChangeLog.am33 b/libc/ports/ChangeLog.am33 index d14f7226d..7e644caae 100644 --- a/libc/ports/ChangeLog.am33 +++ b/libc/ports/ChangeLog.am33 @@ -1,3 +1,14 @@ +2012-08-07 Joseph Myers <joseph@codesourcery.com> + + * sysdeps/unix/sysv/linux/am33/configure.in (arch_minimum_kernel): + Change to 2.6.25. + * sysdeps/unix/sysv/linux/am33/configure: Regenerated. + +2012-08-01 Roland McGrath <roland@hack.frob.com> + + [BZ #14138] + * sysdeps/unix/sysv/linux/am33/getrlimit.c: File removed. + 2012-03-09 Paul Eggert <eggert@cs.ucla.edu> [BZ #13673] diff --git a/libc/ports/ChangeLog.arm b/libc/ports/ChangeLog.arm index b921a769c..359bd0d68 100644 --- a/libc/ports/ChangeLog.arm +++ b/libc/ports/ChangeLog.arm @@ -1,3 +1,126 @@ +2012-08-15 Maxim Kuvyrkov <maxim@codesourcery.com> + + * sysdeps/arm/nptl/pthread_spin_lock.c: Use generic code. + * sysdeps/arm/nptl/pthread_spin_trylock.c: Remove, use generic version. + +2012-08-14 Roland McGrath <roland@hack.frob.com> + + * sysdeps/unix/sysv/linux/arm/nptl/bits/atomic.h: Renamed to ... + * sysdeps/unix/sysv/linux/arm/bits/atomic.h: ... this. + + * sysdeps/unix/sysv/linux/arm/nptl/bits/atomic.h + [!__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4] + (atomic_full_barrier): Renamed to ... + (__arm_assisted_full_barrier): ... this. + (__arch_compare_and_exchange_val_32_acq): Renamed to ... + (__arm_assisted_compare_and_exchange_val_32_acq): ... this. + (atomic8_t, uatomic8_t, atomic_fast8_t, uatomic_fast8_t, + atomic32_t, uatomic32_t, atomic_fast32_t, uatomic_fast32_t, + atomicptr_t, uatomicptr_t, atomic_max_t, uatomic_max_t, + atomic_full_barrier, __arch_compare_and_exchange_val_32_acq, + __arch_compare_and_exchange_val_8_acq, + __arch_compare_and_exchange_val_16_acq, + __arch_compare_and_exchange_val_64_acq): Types and macros moved to ... + * sysdeps/arm/bits/atomic.h: ... this new file. + +2012-08-12 Mike Frysinger <vapier@gentoo.org> + + * sysdeps/arm/dl-machine.h (elf_machine_rel) [R_ARM_ABS32]: Fix style. + +2012-08-12 Mike Frysinger <vapier@gentoo.org> + + * sysdeps/arm/dl-machine.h (elf_machine_rel) [R_ARM_ABS32]: Declare + a new unaligned struct. Cast reloc_addr to that when updating the + value it points to. + +2012-08-09 Roland McGrath <roland@hack.frob.com> + + * sysdeps/arm/arm-features.h: Document ARM_ASSUME_NO_IWMMXT. + * sysdeps/arm/setjmp.S: Include <arm-features.h>. + [!ARM_ASSUME_NO_IWMMXT || __SOFTFP__]: Conditionalize hwcap + fetching bits on this. + [!ARM_ASSUME_NO_IWMMXT]: Conditionalize iWMMXt register use on this. + * sysdeps/arm/__longjmp.S: Likewise. + + * sysdeps/arm/__longjmp.S: Use .Lxxx rather than Lxxx for local labels. + [__SOFTFP__]: Conditionalize HWCAP_ARM_VFP check on this. + * sysdeps/arm/setjmp.S: Likewise. + * sysdeps/unix/sysv/linux/arm/getcontext.S: Likewise. + * sysdeps/unix/sysv/linux/arm/setcontext.S: Likewise. + + * sysdeps/arm/arm-features.h: New file. + * sysdeps/unix/sysv/linux/arm/arm-features.h: New file. + * sysdeps/arm/fclrexcpt.c: Use ARM_HAVE_VFP instead of hwcap bits. + * sysdeps/arm/fedisblxcpt.c: Likewise. + * sysdeps/arm/feenablxcpt.c: Likewise. + * sysdeps/arm/fegetenv.c: Likewise. + * sysdeps/arm/fegetexcept.c: Likewise. + * sysdeps/arm/fegetround.c: Likewise. + * sysdeps/arm/feholdexcpt.c: Likewise. + * sysdeps/arm/fesetenv.c: Likewise. + * sysdeps/arm/fesetround.c: Likewise. + * sysdeps/arm/feupdateenv.c: Likewise. + * sysdeps/arm/fgetexcptflg.c: Likewise. + * sysdeps/arm/fraiseexcpt.c: Likewise. + * sysdeps/arm/fsetexcptflg.c: Likewise. + * sysdeps/arm/ftestexcept.c: Likewise. + * sysdeps/arm/setfpucw.c: Likewise. + +2012-08-08 Roland McGrath <roland@hack.frob.com> + + * sysdeps/arm/sotruss-lib.c: New file. + + * sysdeps/arm/ldsodefs.h (ARCH_PLTEXIT_MEMBERS): Use const on + `struct La_arm_regs *' parameter. + + * sysdeps/unix/sysv/linux/arm/dl-machine.h: Move #include outside of + [!dl_machine_h]. + + * sysdeps/unix/sysv/linux/arm/nptl/bits/atomic.h + [!__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4] + (__arch_compare_and_exchange_val_32_acq): Use uint32_t rather than + __typeof (...) for non-pointer variables derived from the arguments. + + * sysdeps/arm/dl-irel.h: Include <ldsodefs.h>. + + * sysdeps/arm/dl-machine.h (elf_machine_load_address): Use proper type + for __dl_start declaration. + +2012-08-07 Joseph Myers <joseph@codesourcery.com> + + * sysdeps/unix/sysv/linux/arm/configure.in (arch_minimum_kernel): + Remove. + * sysdeps/unix/sysv/linux/arm/configure: Regenerated. + * sysdeps/unix/sysv/linux/arm/kernel-features.h (__ASSUME_UTIMES): + Define unconditionally. + +2012-08-02 Joseph Myers <joseph@codesourcery.com> + + * sysdeps/arm/sysdep.h (ASM_TYPE_DIRECTIVE): Remove. + (ENTRY): Do not use ASM_TYPE_DIRECTIVE. + +2012-08-01 Joseph Myers <joseph@codesourcery.com> + + * sysdeps/unix/sysv/linux/arm/kernel-features.h + (__ASSUME_FCNTL64): Remove. + + * sysdeps/unix/sysv/linux/arm/kernel-features.h + (__ASSUME_VFORK_SYSCALL): Remove. + +2012-08-01 Roland McGrath <roland@hack.frob.com> + + * sysdeps/arm/dl-machine.h (CLEAR_CACHE): Don't define it. + Instead, #error if it's not defined. + * sysdeps/unix/sysv/linux/arm/dl-machine.h: New file. + + [BZ #14138] + * sysdeps/unix/sysv/linux/arm/getrlimit.c: File removed. + +2012-07-30 Roland McGrath <roland@hack.frob.com> + + * sysdeps/arm/preconfigure: Don't refuse configurations with + $config_os not linux-gnueabi* unless it's also linux*. + 2012-07-25 Joseph Myers <joseph@codesourcery.com> * sysdeps/unix/sysv/linux/arm/kernel-features.h diff --git a/libc/ports/ChangeLog.hppa b/libc/ports/ChangeLog.hppa index 83d298fe4..a28fbceb3 100644 --- a/libc/ports/ChangeLog.hppa +++ b/libc/ports/ChangeLog.hppa @@ -1,3 +1,25 @@ +2012-08-15 Maxim Kuvyrkov <maxim@codesourcery.com> + + * sysdeps/hppa/nptl/pthread_spin_lock.c: Use generic code. + * sysdeps/hppa/nptl/pthread_spin_trylock.c: Remove, use generic version. + +2012-08-12 Mike Frysinger <vapier@gentoo.org> + + * sysdeps/unix/sysv/linux/hppa/syscalls.list: Add prlimit64. + * sysdeps/unix/sysv/linux/hppa/Versions (GLIBC_2.17): Likewise. + +2012-08-07 Joseph Myers <joseph@codesourcery.com> + + * sysdeps/unix/sysv/linux/hppa/nptl/configure.in: Remove. + * sysdeps/unix/sysv/linux/hppa/nptl/configure: Likewise. + * sysdeps/unix/sysv/linux/hppa/kernel-features.h + (__ASSUME_LWS_CAS): Define unconditionally. + +2012-08-01 Joseph Myers <joseph@codesourcery.com> + + * sysdeps/unix/sysv/linux/hppa/kernel-features.h + (__ASSUME_FCNTL64): Remove. + 2012-07-26 Andreas Jaeger <aj@suse.de> * sysdeps/unix/sysv/linux/hppa/sys/epoll.h (EPOLLWAKEUP): Add new diff --git a/libc/ports/ChangeLog.ia64 b/libc/ports/ChangeLog.ia64 index 31d86da3e..abc246364 100644 --- a/libc/ports/ChangeLog.ia64 +++ b/libc/ports/ChangeLog.ia64 @@ -1,3 +1,53 @@ +2012-08-16 Carlos O'Donell <carlos_odonell@mentor.com> + + * sysdeps/ia64/ldsodefs.h (ARCH_PLTENTER_MEMBERS) + <ia64_gnu_pltenter>: struct La_ia64_regs is not constant. + +2012-08-14 Mike Frysinger <vapier@gentoo.org> + + * sysdeps/ia64/configure.in: Remove assembler-with-cpp debug check. + * sysdeps/ia64/configure: Regenerated. + +2012-08-14 Joseph Myers <joseph@codesourcery.com> + + * sysdeps/unix/sysv/linux/ia64/kernel-features.h + (__ASSUME_CLONE_THREAD_FLAGS): Remove. + * sysdeps/unix/sysv/linux/ia64/system.c (FORK): Define + unconditionally. + +2012-08-12 Mike Frysinger <vapier@gentoo.org> + + * sysdeps/ia64/configure.in: Remove TLS check. + * sysdeps/ia64/configure: Regenerated. + +2012-08-12 Mike Frysinger <vapier@gentoo.org> + + * sysdeps/ia64/fpu/libm-symbols.h (ASM_TYPE_DIRECTIVE): Remove. + (LOCAL_OBJECT_START): Do not use ASM_TYPE_DIRECTIVE. + (WEAK_LIBM_END): Likewise. + (GLOBAL_IEEE754_END): Likewise. + * sysdeps/ia64/fpu/libm_tan.S: Likewise. + +2012-08-10 Joseph Myers <joseph@codesourcery.com> + + * sysdeps/unix/sysv/linux/ia64/nptl/dl-sysdep.h + (_dl_discover_osversion): Do not condition on + __LINUX_KERNEL_VERSION < 0x020617. + (HAVE_DL_DISCOVER_OSVERSION): Likewise. + +2012-08-03 Mike Frysinger <vapier@gentoo.org> + + [BZ #12194] + * sysdeps/ia64/bits/byteswap-16.h (__bswap_16): Avoid -Wconversion + warning. + * sysdeps/ia64/bits/byteswap.h (__bswap_constant_16): Likewise. + +2012-08-03 Joseph Myers <joseph@codesourcery.com> + + * sysdeps/unix/sysv/linux/ia64/configure.in (arch_minimum_kernel): + Remove. + * sysdeps/unix/sysv/linux/ia64/configure: Regenerated. + 2012-07-26 Andreas Jaeger <aj@suse.de> * sysdeps/unix/sysv/linux/ia64/sys/ptrace.h (__ptrace_eventcodes): diff --git a/libc/ports/ChangeLog.linux-generic b/libc/ports/ChangeLog.linux-generic index 79d46129b..b5774de5f 100644 --- a/libc/ports/ChangeLog.linux-generic +++ b/libc/ports/ChangeLog.linux-generic @@ -1,3 +1,8 @@ +2012-08-02 Roland McGrath <roland@hack.frob.com> + + * sysdeps/unix/sysv/linux/generic/bits/typesizes.h + [__LP64__] (__OFF_T_MATCHES_OFF64_T): New macro. + 2012-05-30 Chris Metcalf <cmetcalf@tilera.com> * sysdeps/unix/sysv/linux/generic/syscalls.list: Remove diff --git a/libc/ports/ChangeLog.m68k b/libc/ports/ChangeLog.m68k index 642b13292..62a8eb3bb 100644 --- a/libc/ports/ChangeLog.m68k +++ b/libc/ports/ChangeLog.m68k @@ -1,3 +1,66 @@ +2012-08-15 Maxim Kuvyrkov <maxim@codesourcery.com> + + * sysdeps/m68k/nptl/pthread_spin_lock.c: Use generic code. + * sysdeps/m68k/nptl/pthread_spin_trylock.c: Remove, use generic version. + +2012-08-10 Andreas Schwab <schwab@linux-m68k.org> + + * sysdeps/m68k/ldsodefs.h (m68k_gnu_pltenter): Remove const on + fifth parameter. + +2012-08-08 Joseph Myers <joseph@codesourcery.com> + + * sysdeps/unix/sysv/linux/m68k/kernel-features.h + (__ASSUME_TGKILL): Remove. + +2012-08-08 Andreas Schwab <schwab@linux-m68k.org> + + * sysdeps/m68k/coldfire/fpu/bits/mathinline.h: New file. + + * sysdeps/unix/sysv/linux/m68k/coldfire/nptl/bits/atomic.h + (atomic_compare_and_exchange_val_acq) [!SHARED]: Add cast to avoid + warning. + +2012-08-07 Joseph Myers <joseph@codesourcery.com> + + * sysdeps/unix/sysv/linux/m68k/configure.in (arch_minimum_kernel): + Remove. + * sysdeps/unix/sysv/linux/m68k/configure: Regenerated. + * sysdeps/unix/sysv/linux/m68k/kernel-features.h + (__ASSUME_TGKILL): Define unconditionally. + (__ASSUME_UTIMES): Likewise. + (__ASSUME_FADVISE64_64_SYSCALL): Likewise. + +2012-08-03 Andreas Schwab <schwab@linux-m68k.org> + + * sysdeps/m68k/sysdep.h (ALIGNARG, ASM_TYPE_DIRECTIVE) + (ASM_SIZE_DIRECTIVE): Remove. + (ENTRY, END): Use .p2align. Use .type and .size instead of + ASM_TYPE_DIRECTIVE and ASM_SIZE_DIRECTIVE. + * sysdeps/m68k/asm-syntax.h (ALIGNARG, PROLOG, EPILOG, ALIGN) + (GLOBL): Remove unused macros. + +2012-08-01 Joseph Myers <joseph@codesourcery.com> + + * sysdeps/unix/sysv/linux/m68k/kernel-features.h + (__ASSUME_FCNTL64): Remove. + + * sysdeps/unix/sysv/linux/m68k/kernel-features.h + (__ASSUME_VFORK_SYSCALL): Remove. + * sysdeps/unix/sysv/linux/m68k/vfork.S (__vfork) [__NR_vfork]: + Make code unconditional. + (__vfork) [__ASSUME_VFORK_SYSCALL]: Likewise. + (__vfork) [!__ASSUME_VFORK_SYSCALL]: Remove conditional code. + +2012-08-01 Roland McGrath <roland@hack.frob.com> + + [BZ #14138] + * sysdeps/unix/sysv/linux/m68k/getrlimit.c: File removed. + +2012-08-01 Andreas Schwab <schwab@linux-m68k.org> + + * sysdeps/m68k/m680x0/fpu/libm-test-ulps: Update. + 2012-07-26 Andreas Schwab <schwab@linux-m68k.org> * sysdeps/m68k/m680x0/fpu/libm-test-ulps: Update. diff --git a/libc/ports/ChangeLog.mips b/libc/ports/ChangeLog.mips index a1b6dc588..dfab023ee 100644 --- a/libc/ports/ChangeLog.mips +++ b/libc/ports/ChangeLog.mips @@ -1,3 +1,69 @@ +2012-08-16 Carlos O'Donell <carlos_odonell@mentor.com> + + * sysdeps/mips/ldsodefs.h (ARCH_PLTENTER_MEMBERS) + <mips_o32_gnu_pltenter, mips_n32_gnu_pltenter, mips_n64_gnu_pltenter>: + struct La_mips_32_regs and struct La_mips_64_regs are not constant. + +2012-08-15 Tom de Vries <vries@codesourcery.com> + Maxim Kuvyrkov <maxim@codesourcery.com> + + * sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h (__libc_lock_lock) + (__libc_lock_trylock): Define versions optimized for MIPS. + +2012-08-15 Maxim Kuvyrkov <maxim@codesourcery.com> + + * sysdeps/mips/nptl/pthread_spin_lock.S: Remove, use generic version. + * sysdeps/mips/nptl/pthread_spin_lock.c: New file. + * sysdeps/mips/nptl/pthread_spin_trylock.S: Remove, use generic version. + +2012-08-15 Joseph Myers <joseph@codesourcery.com> + + * sysdeps/mips/dl-lookup.c: Update from generic version. + +2012-08-13 Maxim Kuvyrkov <maxim@codesourcery.com> + + [__GNUC_PREREQ (4, 8)] + (atomic_exchange_and_add): Split into ... + (atomic_exchange_and_add_acq, atomic_exchange_and_add_rel): ... these. + New atomic macros. + [!__GNUC_PREREQ (4, 8)] + (atomic_exchange_and_add): Split into ... + (atomic_exchange_and_add_acq, atomic_exchange_and_add_rel): ... these. + New atomic macros. + +2012-08-09 Joseph Myers <joseph@codesourcery.com> + + * sysdeps/unix/sysv/linux/mips/kernel-features.h + (__ASSUME_UTIMES): Define. + +2012-08-07 Joseph Myers <joseph@codesourcery.com> + + * sysdeps/unix/sysv/linux/mips/configure.in (arch_minimum_kernel): + Remove. + * sysdeps/unix/sysv/linux/mips/configure: Regenerated. + +2012-08-01 Joseph Myers <joseph@codesourcery.com> + + * sysdeps/unix/sysv/linux/mips/kernel-features.h + (__ASSUME_FCNTL64): Remove. + +2012-08-01 Steve Ellcey <sellcey@mips.com> + + * sysdeps/mips/sys/asm.h [_MIPS_ISA != _MIPS_ISA_MIPS4 && + _MIPS_ISA != _MIPS_ISA_MIPS5 && _MIPS_ISA != _MIPS_ISA_MIPS32 && + _MIPS_ISA != _MIPS_ISA_MIPS64] (PREF): Define as function-like + macro. + (PREFX): Likewise. + +2012-07-31 Joseph Myers <joseph@codesourcery.com> + + * sysdeps/unix/sysv/linux/mips/fcntl.c: Remove. + * sysdeps/unix/sysv/linux/mips/lockf64.c: Likewise. + * sysdeps/unix/sysv/linux/mips/mips32/fcntl.c: New file. + * sysdeps/unix/sysv/linux/mips/mips32/lockf64.c: Likewise. + * sysdeps/unix/sysv/linux/mips/mips64/n32/fcntl.c: Likewise. + * sysdeps/unix/sysv/linux/mips/mips64/n32/lockf64.c: Likewise. + 2012-07-27 Joseph Myers <joseph@codesourcery.com> * sysdeps/unix/sysv/linux/mips/mips64/syscalls.list (mmap): New. diff --git a/libc/ports/ChangeLog.tile b/libc/ports/ChangeLog.tile index 9ef3f99ec..53afc6987 100644 --- a/libc/ports/ChangeLog.tile +++ b/libc/ports/ChangeLog.tile @@ -1,3 +1,22 @@ +2012-08-14 Joseph Myers <joseph@codesourcery.com> + + * sysdeps/unix/sysv/linux/tile/kernel-features.h + (__ASSUME_CLONE_THREAD_FLAGS): Remove. + +2012-08-08 Joseph Myers <joseph@codesourcery.com> + + * sysdeps/unix/sysv/linux/tile/kernel-features.h + (__ASSUME_TGKILL): Remove. + +2012-08-02 Chris Metcalf <cmetcalf@tilera.com> + + * sysdeps/tile/sysdep.h: Do not define ASM_TYPE_DIRECTIVE. + +2012-08-01 Joseph Myers <joseph@codesourcery.com> + + * sysdeps/unix/sysv/linux/tile/kernel-features.h + (__ASSUME_FCNTL64): Remove. + 2012-07-26 Andreas Jaeger <aj@suse.de> * sysdeps/unix/sysv/linux/tile/sys/ptrace.h (__ptrace_eventcodes): diff --git a/libc/ports/sysdeps/alpha/configure b/libc/ports/sysdeps/alpha/configure index 1d0daf5a8..d906524bd 100644 --- a/libc/ports/sysdeps/alpha/configure +++ b/libc/ports/sysdeps/alpha/configure @@ -1,176 +1,6 @@ - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - - - as_lineno_1=$LINENO as_lineno_1a=$LINENO - as_lineno_2=$LINENO as_lineno_2a=$LINENO - eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && - test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { - # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - # This file is generated from configure.in by Autoconf. DO NOT EDIT! # Local configure fragment for sysdeps/alpha. -# Check for support of thread-local storage handling in assembler and linker. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Alpha TLS support" >&5 -$as_echo_n "checking for Alpha TLS support... " >&6; } -if ${libc_cv_alpha_tls+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat > conftest.s <<\EOF - .section ".tdata", "awT", @progbits - .globl foo -foo: .quad 1 - .section ".tbss", "awT", @nobits - .globl bar -bar: .skip 8 - .text -baz: - .set nomacro - ldq $27, __tls_get_addr($29) !literal!1 - ldq $16, a($29) !tlsgd!1 - jsr $26, ($27), __tls_get_addr !lituse_tlsgd!1 - - jsr $26, ($27), __tls_get_addr !lituse_tlsldm!2 - ldq $27, __tls_get_addr($29) !literal!2 - ldq $16, b($29) !tlsldm!2 - - ldq $16, c($29) !tlsgd - ldq $16, d($29) !tlsldm - - ldq $16, e($29) !tlsgd!3 - ldq $16, f($29) !tlsldm!4 - - ldq $16, g($29) !gotdtprel - ldah $16, h($31) !dtprelhi - lda $16, i($16) !dtprello - lda $16, j($31) !dtprel - - ldq $16, k($29) !gottprel - ldah $16, l($31) !tprelhi - lda $16, m($16) !tprello - lda $16, n($31) !tprel -EOF -if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 - (eval $ac_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - libc_cv_alpha_tls=yes -else - libc_cv_alpha_tls=no -fi -rm -f conftest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_alpha_tls" >&5 -$as_echo "$libc_cv_alpha_tls" >&6; } -if test $libc_cv_alpha_tls = no; then - as_fn_error $? "the assembler must support TLS" "$LINENO" 5 -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GP relative module local relocs" >&5 -$as_echo_n "checking for GP relative module local relocs... " >&6; } -if ${libc_cv_alpha_hidden_gprel+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat > conftest.c <<\EOF -static volatile int bar; -int baz __attribute__((visibility("hidden"))); -int f(void) { return bar + baz; } -EOF - -libc_cv_alpha_hidden_gprel=no -if { ac_try='${CC-cc} -S $CFLAGS -O2 -fpic conftest.c 1>&5' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 - (eval $ac_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - if grep -q 'bar.*!gprel' conftest.s \ - && grep -q 'baz.*!gprel' conftest.s \ - && ! grep -q 'bar.*!literal' conftest.s \ - && ! grep -q 'baz.*!literal' conftest.s; then - libc_cv_alpha_hidden_gprel=yes - fi -fi -rm -f conftest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_alpha_hidden_gprel" >&5 -$as_echo "$libc_cv_alpha_hidden_gprel" >&6; } -if test $libc_cv_alpha_hidden_gprel = yes; then - $as_echo "#define PI_STATIC_AND_HIDDEN 1" >>confdefs.h - -fi +# With required gcc+binutils, we can always access static and hidden +# symbols in a position independent way. +$as_echo "#define PI_STATIC_AND_HIDDEN 1" >>confdefs.h diff --git a/libc/ports/sysdeps/alpha/configure.in b/libc/ports/sysdeps/alpha/configure.in index bf8e92665..eadc57afe 100644 --- a/libc/ports/sysdeps/alpha/configure.in +++ b/libc/ports/sysdeps/alpha/configure.in @@ -1,71 +1,6 @@ GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. # Local configure fragment for sysdeps/alpha. -# Check for support of thread-local storage handling in assembler and linker. -AC_CACHE_CHECK(for Alpha TLS support, libc_cv_alpha_tls, [dnl -cat > conftest.s <<\EOF - .section ".tdata", "awT", @progbits - .globl foo -foo: .quad 1 - .section ".tbss", "awT", @nobits - .globl bar -bar: .skip 8 - .text -baz: - .set nomacro - ldq $27, __tls_get_addr($29) !literal!1 - ldq $16, a($29) !tlsgd!1 - jsr $26, ($27), __tls_get_addr !lituse_tlsgd!1 - - jsr $26, ($27), __tls_get_addr !lituse_tlsldm!2 - ldq $27, __tls_get_addr($29) !literal!2 - ldq $16, b($29) !tlsldm!2 - - ldq $16, c($29) !tlsgd - ldq $16, d($29) !tlsldm - - ldq $16, e($29) !tlsgd!3 - ldq $16, f($29) !tlsldm!4 - - ldq $16, g($29) !gotdtprel - ldah $16, h($31) !dtprelhi - lda $16, i($16) !dtprello - lda $16, j($31) !dtprel - - ldq $16, k($29) !gottprel - ldah $16, l($31) !tprelhi - lda $16, m($16) !tprello - lda $16, n($31) !tprel -EOF -dnl -if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then - libc_cv_alpha_tls=yes -else - libc_cv_alpha_tls=no -fi -rm -f conftest*]) -if test $libc_cv_alpha_tls = no; then - AC_MSG_ERROR([the assembler must support TLS]) -fi - -AC_CACHE_CHECK(for GP relative module local relocs, libc_cv_alpha_hidden_gprel, [dnl -cat > conftest.c <<\EOF -static volatile int bar; -int baz __attribute__((visibility("hidden"))); -int f(void) { return bar + baz; } -EOF -dnl - -libc_cv_alpha_hidden_gprel=no -if AC_TRY_COMMAND(${CC-cc} -S $CFLAGS -O2 -fpic conftest.c 1>&AS_MESSAGE_LOG_FD); then - if grep -q 'bar.*!gprel' conftest.s \ - && grep -q 'baz.*!gprel' conftest.s \ - && ! grep -q 'bar.*!literal' conftest.s \ - && ! grep -q 'baz.*!literal' conftest.s; then - libc_cv_alpha_hidden_gprel=yes - fi -fi -rm -f conftest*]) -if test $libc_cv_alpha_hidden_gprel = yes; then - AC_DEFINE(PI_STATIC_AND_HIDDEN) -fi +# With required gcc+binutils, we can always access static and hidden +# symbols in a position independent way. +AC_DEFINE(PI_STATIC_AND_HIDDEN) diff --git a/libc/ports/sysdeps/alpha/fpu/s_nearbyint.c b/libc/ports/sysdeps/alpha/fpu/s_nearbyint.c index 4589bfcc3..19ed06bb4 100644 --- a/libc/ports/sysdeps/alpha/fpu/s_nearbyint.c +++ b/libc/ports/sysdeps/alpha/fpu/s_nearbyint.c @@ -43,6 +43,6 @@ weak_alias (__nearbyint, nearbyint) strong_alias (__nearbyint, __nearbyintl) weak_alias (__nearbyint, nearbyintl) #endif -#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0) -compat_symbol (libm, __nearbyint, nearbyintl, GLIBC_2_0); +#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1) +compat_symbol (libm, __nearbyint, nearbyintl, GLIBC_2_1); #endif diff --git a/libc/ports/sysdeps/alpha/ldsodefs.h b/libc/ports/sysdeps/alpha/ldsodefs.h index 478bf237d..464e84ea3 100644 --- a/libc/ports/sysdeps/alpha/ldsodefs.h +++ b/libc/ports/sysdeps/alpha/ldsodefs.h @@ -26,7 +26,7 @@ struct La_alpha_retval; #define ARCH_PLTENTER_MEMBERS \ Elf64_Addr (*alpha_gnu_pltenter) (Elf64_Sym *, unsigned int, \ uintptr_t *, uintptr_t *, \ - const struct La_alpha_regs *, \ + struct La_alpha_regs *, \ unsigned int *, const char *name, \ long int *framesizep); diff --git a/libc/ports/sysdeps/arm/__longjmp.S b/libc/ports/sysdeps/arm/__longjmp.S index cc802c15b..b3c286083 100644 --- a/libc/ports/sysdeps/arm/__longjmp.S +++ b/libc/ports/sysdeps/arm/__longjmp.S @@ -1,6 +1,5 @@ /* longjmp for ARM. - Copyright (C) 1997, 1998, 2005, 2006, 2009, 2010 - Free Software Foundation, Inc. + Copyright (C) 1997-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -22,6 +21,7 @@ #define _ASM #include <bits/setjmp.h> #include <rtld-global-offsets.h> +#include <arm-features.h> /* __longjmp(jmpbuf, val) */ @@ -47,27 +47,35 @@ ENTRY (__longjmp) cfi_restore (sp) cfi_restore (lr) -#ifdef IS_IN_rtld - ldr a2, 1f - ldr a3, Lrtld_local_ro +#if !defined ARM_ASSUME_NO_IWMMXT || defined __SOFTFP__ +# define NEED_HWCAP 1 +#endif + +#ifdef NEED_HWCAP +# ifdef IS_IN_rtld + ldr a2, 1f + ldr a3, .Lrtld_local_ro 0: add a2, pc, a2 add a2, a2, a3 ldr a2, [a2, #RTLD_GLOBAL_RO_DL_HWCAP_OFFSET] -#else -#ifdef PIC - ldr a2, 1f - ldr a3, Lrtld_global_ro +# else +# ifdef PIC + ldr a2, 1f + ldr a3, .Lrtld_global_ro 0: add a2, pc, a2 ldr a2, [a2, a3] ldr a2, [a2, #RTLD_GLOBAL_RO_DL_HWCAP_OFFSET] -#else - ldr a2, Lhwcap +# else + ldr a2, .Lhwcap ldr a2, [a2, #0] -#endif +# endif +# endif #endif +#ifdef __SOFTFP__ tst a2, #HWCAP_ARM_VFP - beq Lno_vfp + beq .Lno_vfp +#endif /* Restore the VFP registers. */ /* Following instruction is vldmia ip!, {d8-d15}. */ @@ -76,10 +84,11 @@ ENTRY (__longjmp) ldr a3, [ip], #4 /* Following instruction is fmxr fpscr, a3. */ mcr p10, 7, a3, cr1, cr0, 0 -Lno_vfp: +.Lno_vfp: +#ifndef ARM_ASSUME_NO_IWMMXT tst a2, #HWCAP_ARM_IWMMXT - beq Lno_iwmmxt + beq .Lno_iwmmxt /* Restore the call-preserved iWMMXt registers. */ /* Following instructions are wldrd wr10, [ip], #8 (etc.) */ @@ -89,23 +98,26 @@ Lno_vfp: ldcl p1, cr13, [r12], #8 ldcl p1, cr14, [r12], #8 ldcl p1, cr15, [r12], #8 -Lno_iwmmxt: +.Lno_iwmmxt: +#endif DO_RET(lr) -#ifdef IS_IN_rtld +#ifdef NEED_HWCAP +# ifdef IS_IN_rtld 1: .long _GLOBAL_OFFSET_TABLE_ - 0b - 8 -Lrtld_local_ro: +.Lrtld_local_ro: .long C_SYMBOL_NAME(_rtld_local_ro)(GOTOFF) -#else -#ifdef PIC +# else +# ifdef PIC 1: .long _GLOBAL_OFFSET_TABLE_ - 0b - 8 -Lrtld_global_ro: +.Lrtld_global_ro: .long C_SYMBOL_NAME(_rtld_global_ro)(GOT) -#else -Lhwcap: +# else +.Lhwcap: .long C_SYMBOL_NAME(_dl_hwcap) -#endif +# endif +# endif #endif END (__longjmp) diff --git a/libc/ports/sysdeps/arm/arm-features.h b/libc/ports/sysdeps/arm/arm-features.h new file mode 100644 index 000000000..41befb57f --- /dev/null +++ b/libc/ports/sysdeps/arm/arm-features.h @@ -0,0 +1,39 @@ +/* Macros to test for CPU features on ARM. Generic ARM version. + Copyright (C) 2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + 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 _ARM_ARM_FEATURES_H +#define _ARM_ARM_FEATURES_H 1 + +/* An OS-specific arm-features.h file should define ARM_HAVE_VFP to + an appropriate expression for testing at runtime whether the VFP + hardware is present. We'll then redefine it to a constant if we + know at compile time that we can assume VFP. */ + +#ifndef __SOFTFP__ +/* The compiler is generating VFP instructions, so we're already + assuming the hardware exists. */ +# undef ARM_HAVE_VFP +# define ARM_HAVE_VFP 1 +#endif + +/* An OS-specific arm-features.h file may define ARM_ASSUME_NO_IWMMXT + to indicate at compile time that iWMMXt hardware is never present + at runtime (or that we never care about its state) and so need not + be checked for. */ + +#endif /* arm-features.h */ diff --git a/libc/ports/sysdeps/arm/bits/atomic.h b/libc/ports/sysdeps/arm/bits/atomic.h new file mode 100644 index 000000000..99842105c --- /dev/null +++ b/libc/ports/sysdeps/arm/bits/atomic.h @@ -0,0 +1,81 @@ +/* Atomic operations. Pure ARM version. + Copyright (C) 2002-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + 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/>. */ + +#include <stdint.h> + +typedef int8_t atomic8_t; +typedef uint8_t uatomic8_t; +typedef int_fast8_t atomic_fast8_t; +typedef uint_fast8_t uatomic_fast8_t; + +typedef int32_t atomic32_t; +typedef uint32_t uatomic32_t; +typedef int_fast32_t atomic_fast32_t; +typedef uint_fast32_t uatomic_fast32_t; + +typedef intptr_t atomicptr_t; +typedef uintptr_t uatomicptr_t; +typedef intmax_t atomic_max_t; +typedef uintmax_t uatomic_max_t; + +void __arm_link_error (void); + +/* Use the atomic builtins provided by GCC in case the backend provides + a pattern to do this efficiently. */ + +#ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 +# define atomic_full_barrier() __sync_synchronize () +#else +# define atomic_full_barrier() __arm_assisted_full_barrier () +#endif + +/* An OS-specific bits/atomic.h file will define this macro if + the OS can provide something. If not, we'll fail to build + with a compiler that doesn't supply the operation. */ +#ifndef __arm_assisted_full_barrier +# define __arm_assisted_full_barrier() __arm_link_error() +#endif + +/* Atomic compare and exchange. */ + +#ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 +# define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \ + __sync_val_compare_and_swap ((mem), (oldval), (newval)) +#else +# define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \ + __arm_assisted_compare_and_exchange_val_32_acq ((mem), (oldval), (newval)) +#endif + +/* We don't support atomic operations on any non-word types. + So make them link errors. */ +#define __arch_compare_and_exchange_val_8_acq(mem, newval, oldval) \ + ({ __arm_link_error (); oldval; }) + +#define __arch_compare_and_exchange_val_16_acq(mem, newval, oldval) \ + ({ __arm_link_error (); oldval; }) + +#define __arch_compare_and_exchange_val_64_acq(mem, newval, oldval) \ + ({ __arm_link_error (); oldval; }) + +/* An OS-specific bits/atomic.h file will define this macro if + the OS can provide something. If not, we'll fail to build + with a compiler that doesn't supply the operation. */ +#ifndef __arm_assisted_compare_and_exchange_val_32_acq +# define __arm_assisted_compare_and_exchange_val_32_acq(mem, newval, oldval) \ + ({ __arm_link_error (); oldval; }) +#endif diff --git a/libc/ports/sysdeps/arm/dl-irel.h b/libc/ports/sysdeps/arm/dl-irel.h index 5b1964e90..292bc1afb 100644 --- a/libc/ports/sysdeps/arm/dl-irel.h +++ b/libc/ports/sysdeps/arm/dl-irel.h @@ -1,6 +1,6 @@ /* Machine-dependent ELF indirect relocation inline functions. ARM version. - Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc. + Copyright (C) 2009-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -22,6 +22,7 @@ #include <stdio.h> #include <unistd.h> +#include <ldsodefs.h> #define ELF_MACHINE_IREL 1 diff --git a/libc/ports/sysdeps/arm/dl-machine.h b/libc/ports/sysdeps/arm/dl-machine.h index 8d905e8ad..343a83e98 100644 --- a/libc/ports/sysdeps/arm/dl-machine.h +++ b/libc/ports/sysdeps/arm/dl-machine.h @@ -1,6 +1,5 @@ /* Machine-dependent ELF dynamic relocation inline functions. ARM version. - Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005, - 2006, 2009, 2010, 2011 Free Software Foundation, Inc. + Copyright (C) 1995-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -27,8 +26,9 @@ #include <dl-tlsdesc.h> #include <dl-irel.h> -#define CLEAR_CACHE(BEG,END) \ - INTERNAL_SYSCALL_ARM (cacheflush, , 3, (BEG), (END), 0) +#ifndef CLEAR_CACHE +# error CLEAR_CACHE definition required to handle TEXTREL +#endif /* Return nonzero iff ELF header is compatible with the running host. */ static inline int __attribute__ ((unused)) @@ -70,7 +70,7 @@ elf_machine_dynamic (void) static inline Elf32_Addr __attribute__ ((unused)) elf_machine_load_address (void) { - extern void __dl_start asm ("_dl_start"); + extern Elf32_Addr internal_function __dl_start (void *) asm ("_dl_start"); Elf32_Addr got_addr = (Elf32_Addr) &__dl_start; Elf32_Addr pcrel_addr; #ifdef __thumb__ @@ -413,6 +413,10 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc, break; case R_ARM_ABS32: { + struct unaligned + { + Elf32_Addr x; + } __attribute__ ((packed, may_alias)); # ifndef RTLD_BOOTSTRAP /* This is defined in rtld.c, but nowhere in the static libc.a; make the reference weak so static programs can @@ -431,7 +435,8 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc, used while loading those libraries. */ value -= map->l_addr + refsym->st_value; # endif - *reloc_addr += value; + /* Support relocations on mis-aligned offsets. */ + ((struct unaligned *) reloc_addr)->x += value; break; } case R_ARM_TLS_DESC: diff --git a/libc/ports/sysdeps/arm/fclrexcpt.c b/libc/ports/sysdeps/arm/fclrexcpt.c index ddedc3573..23435fba7 100644 --- a/libc/ports/sysdeps/arm/fclrexcpt.c +++ b/libc/ports/sysdeps/arm/fclrexcpt.c @@ -1,5 +1,5 @@ /* Clear given exceptions in current floating-point environment. - Copyright (C) 1997,98,99,2000,01,05,11 Free Software Foundation, Inc. + Copyright (C) 1997-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -18,16 +18,13 @@ #include <fenv.h> #include <fpu_control.h> +#include <arm-features.h> -#include <unistd.h> -#include <ldsodefs.h> -#include <dl-procinfo.h> -#include <sysdep.h> int __feclearexcept (int excepts) { - if (GLRO (dl_hwcap) & HWCAP_ARM_VFP) + if (ARM_HAVE_VFP) { unsigned long int temp; diff --git a/libc/ports/sysdeps/arm/fedisblxcpt.c b/libc/ports/sysdeps/arm/fedisblxcpt.c index c9c62a48e..5b63d9a2e 100644 --- a/libc/ports/sysdeps/arm/fedisblxcpt.c +++ b/libc/ports/sysdeps/arm/fedisblxcpt.c @@ -1,5 +1,5 @@ /* Disable floating-point exceptions. - Copyright (C) 2001, 2005 Free Software Foundation, Inc. + Copyright (C) 2001-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Philip Blundell <philb@gnu.org>, 2001. @@ -19,16 +19,13 @@ #include <fenv.h> #include <fpu_control.h> +#include <arm-features.h> -#include <unistd.h> -#include <ldsodefs.h> -#include <dl-procinfo.h> -#include <sysdep.h> int fedisableexcept (int excepts) { - if (GLRO (dl_hwcap) & HWCAP_ARM_VFP) + if (ARM_HAVE_VFP) { unsigned long int new_exc, old_exc; diff --git a/libc/ports/sysdeps/arm/feenablxcpt.c b/libc/ports/sysdeps/arm/feenablxcpt.c index 3b2b934f5..c5f063006 100644 --- a/libc/ports/sysdeps/arm/feenablxcpt.c +++ b/libc/ports/sysdeps/arm/feenablxcpt.c @@ -1,5 +1,5 @@ /* Enable floating-point exceptions. - Copyright (C) 2001, 2005 Free Software Foundation, Inc. + Copyright (C) 2001-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Philip Blundell <philb@gnu.org>, 2001. @@ -19,16 +19,13 @@ #include <fenv.h> #include <fpu_control.h> +#include <arm-features.h> -#include <unistd.h> -#include <ldsodefs.h> -#include <dl-procinfo.h> -#include <sysdep.h> int feenableexcept (int excepts) { - if (GLRO (dl_hwcap) & HWCAP_ARM_VFP) + if (ARM_HAVE_VFP) { unsigned long int new_exc, old_exc; diff --git a/libc/ports/sysdeps/arm/fegetenv.c b/libc/ports/sysdeps/arm/fegetenv.c index c638635df..1e8063ca8 100644 --- a/libc/ports/sysdeps/arm/fegetenv.c +++ b/libc/ports/sysdeps/arm/fegetenv.c @@ -1,5 +1,5 @@ /* Store current floating-point environment. - Copyright (C) 1997,98,99,2000,01,05,10 Free Software Foundation, Inc. + Copyright (C) 1997-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -18,16 +18,13 @@ #include <fenv.h> #include <fpu_control.h> +#include <arm-features.h> -#include <unistd.h> -#include <ldsodefs.h> -#include <dl-procinfo.h> -#include <sysdep.h> int __fegetenv (fenv_t *envp) { - if (GLRO (dl_hwcap) & HWCAP_ARM_VFP) + if (ARM_HAVE_VFP) { unsigned long int temp; _FPU_GETCW (temp); diff --git a/libc/ports/sysdeps/arm/fegetexcept.c b/libc/ports/sysdeps/arm/fegetexcept.c index 929d6c5cf..a71e7dad6 100644 --- a/libc/ports/sysdeps/arm/fegetexcept.c +++ b/libc/ports/sysdeps/arm/fegetexcept.c @@ -1,5 +1,5 @@ /* Get floating-point exceptions. - Copyright (C) 2001, 2005 Free Software Foundation, Inc. + Copyright (C) 2001-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Philip Blundell <philb@gnu.org>, 2001 @@ -19,16 +19,13 @@ #include <fenv.h> #include <fpu_control.h> +#include <arm-features.h> -#include <unistd.h> -#include <ldsodefs.h> -#include <dl-procinfo.h> -#include <sysdep.h> int fegetexcept (void) { - if (GLRO (dl_hwcap) & HWCAP_ARM_VFP) + if (ARM_HAVE_VFP) { unsigned long temp; diff --git a/libc/ports/sysdeps/arm/fegetround.c b/libc/ports/sysdeps/arm/fegetround.c index df1049706..0ed3dc996 100644 --- a/libc/ports/sysdeps/arm/fegetround.c +++ b/libc/ports/sysdeps/arm/fegetround.c @@ -1,5 +1,5 @@ /* Return current rounding direction. - Copyright (C) 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2004-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -18,16 +18,13 @@ #include <fenv.h> #include <fpu_control.h> +#include <arm-features.h> -#include <unistd.h> -#include <ldsodefs.h> -#include <dl-procinfo.h> -#include <sysdep.h> int fegetround (void) { - if (GLRO (dl_hwcap) & HWCAP_ARM_VFP) + if (ARM_HAVE_VFP) { unsigned int temp; diff --git a/libc/ports/sysdeps/arm/feholdexcpt.c b/libc/ports/sysdeps/arm/feholdexcpt.c index 4aed48bb3..cfa11d732 100644 --- a/libc/ports/sysdeps/arm/feholdexcpt.c +++ b/libc/ports/sysdeps/arm/feholdexcpt.c @@ -1,5 +1,5 @@ /* Store current floating-point environment and clear exceptions. - Copyright (C) 1997, 1998, 1999, 2005 Free Software Foundation, Inc. + Copyright (C) 1997-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -18,16 +18,13 @@ #include <fenv.h> #include <fpu_control.h> +#include <arm-features.h> -#include <unistd.h> -#include <ldsodefs.h> -#include <dl-procinfo.h> -#include <sysdep.h> int feholdexcept (fenv_t *envp) { - if (GLRO (dl_hwcap) & HWCAP_ARM_VFP) + if (ARM_HAVE_VFP) { unsigned long int temp; diff --git a/libc/ports/sysdeps/arm/fesetenv.c b/libc/ports/sysdeps/arm/fesetenv.c index 61370325e..2fad61da1 100644 --- a/libc/ports/sysdeps/arm/fesetenv.c +++ b/libc/ports/sysdeps/arm/fesetenv.c @@ -1,5 +1,5 @@ /* Install given floating-point environment. - Copyright (C) 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2004-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -18,16 +18,13 @@ #include <fenv.h> #include <fpu_control.h> +#include <arm-features.h> -#include <unistd.h> -#include <ldsodefs.h> -#include <dl-procinfo.h> -#include <sysdep.h> int __fesetenv (const fenv_t *envp) { - if (GLRO (dl_hwcap) & HWCAP_ARM_VFP) + if (ARM_HAVE_VFP) { unsigned int temp; diff --git a/libc/ports/sysdeps/arm/fesetround.c b/libc/ports/sysdeps/arm/fesetround.c index 997bd98f5..6de1644a7 100644 --- a/libc/ports/sysdeps/arm/fesetround.c +++ b/libc/ports/sysdeps/arm/fesetround.c @@ -1,5 +1,5 @@ /* Set current rounding direction. - Copyright (C) 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2004-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -18,16 +18,13 @@ #include <fenv.h> #include <fpu_control.h> +#include <arm-features.h> -#include <unistd.h> -#include <ldsodefs.h> -#include <dl-procinfo.h> -#include <sysdep.h> int fesetround (int round) { - if (GLRO (dl_hwcap) & HWCAP_ARM_VFP) + if (ARM_HAVE_VFP) { fpu_control_t temp; diff --git a/libc/ports/sysdeps/arm/feupdateenv.c b/libc/ports/sysdeps/arm/feupdateenv.c index 98f265432..c0ed06e32 100644 --- a/libc/ports/sysdeps/arm/feupdateenv.c +++ b/libc/ports/sysdeps/arm/feupdateenv.c @@ -1,5 +1,5 @@ /* Install given floating-point environment and raise exceptions. - Copyright (C) 1997, 1999, 2000, 2008, 2010 Free Software Foundation, Inc. + Copyright (C) 1997-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. @@ -19,16 +19,13 @@ #include <fenv.h> #include <fpu_control.h> +#include <arm-features.h> -#include <unistd.h> -#include <ldsodefs.h> -#include <dl-procinfo.h> -#include <sysdep.h> int __feupdateenv (const fenv_t *envp) { - if (GLRO (dl_hwcap) & HWCAP_ARM_VFP) + if (ARM_HAVE_VFP) { unsigned int temp; diff --git a/libc/ports/sysdeps/arm/fgetexcptflg.c b/libc/ports/sysdeps/arm/fgetexcptflg.c index 41661a2e2..7b6d66961 100644 --- a/libc/ports/sysdeps/arm/fgetexcptflg.c +++ b/libc/ports/sysdeps/arm/fgetexcptflg.c @@ -1,5 +1,5 @@ /* Store current representation for exceptions. - Copyright (C) 1997, 1999, 2000, 2008 Free Software Foundation, Inc. + Copyright (C) 1997-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. @@ -19,16 +19,13 @@ #include <fenv.h> #include <fpu_control.h> +#include <arm-features.h> -#include <unistd.h> -#include <ldsodefs.h> -#include <dl-procinfo.h> -#include <sysdep.h> int __fegetexceptflag (fexcept_t *flagp, int excepts) { - if (GLRO (dl_hwcap) & HWCAP_ARM_VFP) + if (ARM_HAVE_VFP) { unsigned long temp; diff --git a/libc/ports/sysdeps/arm/fraiseexcpt.c b/libc/ports/sysdeps/arm/fraiseexcpt.c index 0a4368839..cb0f75cf9 100644 --- a/libc/ports/sysdeps/arm/fraiseexcpt.c +++ b/libc/ports/sysdeps/arm/fraiseexcpt.c @@ -1,5 +1,5 @@ /* Raise given exceptions. - Copyright (C) 2004, 2005, 2011 Free Software Foundation, Inc. + Copyright (C) 2004-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -19,16 +19,13 @@ #include <fpu_control.h> #include <fenv.h> #include <float.h> +#include <arm-features.h> -#include <unistd.h> -#include <ldsodefs.h> -#include <dl-procinfo.h> -#include <sysdep.h> int feraiseexcept (int excepts) { - if (GLRO (dl_hwcap) & HWCAP_ARM_VFP) + if (ARM_HAVE_VFP) { int fpscr; const float fp_zero = 0.0, fp_one = 1.0, fp_max = FLT_MAX, diff --git a/libc/ports/sysdeps/arm/fsetexcptflg.c b/libc/ports/sysdeps/arm/fsetexcptflg.c index bee51a96a..f26268da6 100644 --- a/libc/ports/sysdeps/arm/fsetexcptflg.c +++ b/libc/ports/sysdeps/arm/fsetexcptflg.c @@ -1,5 +1,5 @@ /* Set floating-point environment exception handling. - Copyright (C) 1997,98,99,2000,01,05,08,11 Free Software Foundation, Inc. + Copyright (C) 1997-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -19,16 +19,13 @@ #include <fenv.h> #include <math.h> #include <fpu_control.h> +#include <arm-features.h> -#include <unistd.h> -#include <ldsodefs.h> -#include <dl-procinfo.h> -#include <sysdep.h> int __fesetexceptflag (const fexcept_t *flagp, int excepts) { - if (GLRO (dl_hwcap) & HWCAP_ARM_VFP) + if (ARM_HAVE_VFP) { fexcept_t temp; diff --git a/libc/ports/sysdeps/arm/ftestexcept.c b/libc/ports/sysdeps/arm/ftestexcept.c index 06817d2fe..8e37db10b 100644 --- a/libc/ports/sysdeps/arm/ftestexcept.c +++ b/libc/ports/sysdeps/arm/ftestexcept.c @@ -1,5 +1,5 @@ /* Test exception in current environment. - Copyright (C) 1997, 1998, 2005, 2010 Free Software Foundation, Inc. + Copyright (C) 1997-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -18,16 +18,13 @@ #include <fenv.h> #include <fpu_control.h> +#include <arm-features.h> -#include <unistd.h> -#include <ldsodefs.h> -#include <dl-procinfo.h> -#include <sysdep.h> int fetestexcept (int excepts) { - if (GLRO (dl_hwcap) & HWCAP_ARM_VFP) + if (ARM_HAVE_VFP) { fexcept_t temp; diff --git a/libc/ports/sysdeps/arm/ldsodefs.h b/libc/ports/sysdeps/arm/ldsodefs.h index aa323d3ec..73375b60d 100644 --- a/libc/ports/sysdeps/arm/ldsodefs.h +++ b/libc/ports/sysdeps/arm/ldsodefs.h @@ -1,5 +1,5 @@ /* Run-time dynamic linker data structures for loaded ELF shared objects. - Copyright (C) 2005 Free Software Foundation, Inc. + Copyright (C) 2005-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -32,7 +32,7 @@ struct La_arm_retval; #define ARCH_PLTEXIT_MEMBERS \ Elf32_Addr (*arm_gnu_pltexit) (Elf32_Sym *, unsigned int, uintptr_t *, \ - uintptr_t *, struct La_arm_regs *, \ + uintptr_t *, const struct La_arm_regs *, \ struct La_arm_retval *, const char *) #include_next <ldsodefs.h> diff --git a/libc/ports/sysdeps/arm/nptl/pthread_spin_lock.c b/libc/ports/sysdeps/arm/nptl/pthread_spin_lock.c index 3a23bd31a..4f8157173 100644 --- a/libc/ports/sysdeps/arm/nptl/pthread_spin_lock.c +++ b/libc/ports/sysdeps/arm/nptl/pthread_spin_lock.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2008 Free Software Foundation, Inc. +/* Copyright (C) 2008-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -15,15 +15,9 @@ License along with the GNU C Library. If not, see <http://www.gnu.org/licenses/>. */ -#include <atomic.h> -#include "pthreadP.h" +#define SPIN_LOCK_READS_BETWEEN_CMPXCHG 1000 -int -pthread_spin_lock (pthread_spinlock_t *lock) -{ - while (atomic_compare_and_exchange_val_acq (lock, 1, 0) != 0) - while (*lock != 0) - ; - - return 0; -} +/* We can't use the normal "#include <nptl/pthread_spin_lock.c>" because + it will resolve to this very file. Using "sysdeps/.." as reference to the + top level directory does the job. */ +#include <sysdeps/../nptl/pthread_spin_lock.c> diff --git a/libc/ports/sysdeps/arm/setfpucw.c b/libc/ports/sysdeps/arm/setfpucw.c index d0cea32b9..0947e273d 100644 --- a/libc/ports/sysdeps/arm/setfpucw.c +++ b/libc/ports/sysdeps/arm/setfpucw.c @@ -1,5 +1,5 @@ /* Set the FPU control word. - Copyright (C) 1996, 1997, 1999, 2005 Free Software Foundation, Inc. + Copyright (C) 1996-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -18,16 +18,13 @@ #include <math.h> #include <fpu_control.h> +#include <arm-features.h> -#include <unistd.h> -#include <ldsodefs.h> -#include <dl-procinfo.h> -#include <sysdep.h> void __setfpucw (fpu_control_t set) { - if (GLRO (dl_hwcap) & HWCAP_ARM_VFP) + if (ARM_HAVE_VFP) { fpu_control_t cw; diff --git a/libc/ports/sysdeps/arm/setjmp.S b/libc/ports/sysdeps/arm/setjmp.S index 5e3f39cc7..dbd59dd7c 100644 --- a/libc/ports/sysdeps/arm/setjmp.S +++ b/libc/ports/sysdeps/arm/setjmp.S @@ -1,5 +1,5 @@ /* setjmp for ARM. - Copyright (C) 1997, 1998, 2005, 2006, 2008 Free Software Foundation, Inc. + Copyright (C) 1997-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -21,6 +21,7 @@ #define _ASM #include <bits/setjmp.h> #include <rtld-global-offsets.h> +#include <arm-features.h> ENTRY (__sigsetjmp) mov ip, r0 @@ -28,28 +29,36 @@ ENTRY (__sigsetjmp) /* Save registers */ stmia ip!, {v1-v6, sl, fp, sp, lr} +#if !defined ARM_ASSUME_NO_IWMMXT || defined __SOFTFP__ +# define NEED_HWCAP 1 +#endif + +#ifdef NEED_HWCAP /* Check if we have a VFP unit. */ -#ifdef IS_IN_rtld +# ifdef IS_IN_rtld ldr a3, 1f - ldr a4, Lrtld_local_ro + ldr a4, .Lrtld_local_ro 0: add a3, pc, a3 add a3, a3, a4 ldr a3, [a3, #RTLD_GLOBAL_RO_DL_HWCAP_OFFSET] -#else -#ifdef PIC +# else +# ifdef PIC ldr a3, 1f - ldr a4, Lrtld_global_ro + ldr a4, .Lrtld_global_ro 0: add a3, pc, a3 ldr a3, [a3, a4] ldr a3, [a3, #RTLD_GLOBAL_RO_DL_HWCAP_OFFSET] -#else - ldr a3, Lhwcap +# else + ldr a3, .Lhwcap ldr a3, [a3, #0] -#endif +# endif +# endif #endif +#ifdef __SOFTFP__ tst a3, #HWCAP_ARM_VFP - beq Lno_vfp + beq .Lno_vfp +#endif /* Store the VFP registers. Don't use VFP instructions directly because this code @@ -60,10 +69,11 @@ ENTRY (__sigsetjmp) /* Following instruction is vmrs a4, fpscr. */ mrc p10, 7, a4, cr1, cr0, 0 str a4, [ip], #4 -Lno_vfp: +.Lno_vfp: +#ifndef ARM_ASSUME_NO_IWMMXT tst a3, #HWCAP_ARM_IWMMXT - beq Lno_iwmmxt + beq .Lno_iwmmxt /* Save the call-preserved iWMMXt registers. */ /* Following instructions are wstrd wr10, [ip], #8 (etc.) */ @@ -73,24 +83,27 @@ Lno_vfp: stcl p1, cr13, [r12], #8 stcl p1, cr14, [r12], #8 stcl p1, cr15, [r12], #8 -Lno_iwmmxt: +.Lno_iwmmxt: +#endif /* Make a tail call to __sigjmp_save; it takes the same args. */ B PLTJMP(C_SYMBOL_NAME(__sigjmp_save)) -#ifdef IS_IN_rtld +#ifdef NEED_HWCAP +# ifdef IS_IN_rtld 1: .long _GLOBAL_OFFSET_TABLE_ - 0b - 8 -Lrtld_local_ro: +.Lrtld_local_ro: .long C_SYMBOL_NAME(_rtld_local_ro)(GOTOFF) -#else -#ifdef PIC +# else +# ifdef PIC 1: .long _GLOBAL_OFFSET_TABLE_ - 0b - 8 -Lrtld_global_ro: +.Lrtld_global_ro: .long C_SYMBOL_NAME(_rtld_global_ro)(GOT) -#else -Lhwcap: +# else +.Lhwcap: .long C_SYMBOL_NAME(_dl_hwcap) -#endif +# endif +# endif #endif END (__sigsetjmp) diff --git a/libc/ports/sysdeps/arm/sotruss-lib.c b/libc/ports/sysdeps/arm/sotruss-lib.c new file mode 100644 index 000000000..c665a4093 --- /dev/null +++ b/libc/ports/sysdeps/arm/sotruss-lib.c @@ -0,0 +1,49 @@ +/* Override generic sotruss-lib.c to define actual functions for ARM. + Copyright (C) 2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + 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/>. */ + +#define HAVE_ARCH_PLTENTER +#define HAVE_ARCH_PLTEXIT + +#include <elf/sotruss-lib.c> + +ElfW(Addr) +la_arm_gnu_pltenter (ElfW(Sym) *sym __attribute__ ((unused)), + unsigned int ndx __attribute__ ((unused)), + uintptr_t *refcook, uintptr_t *defcook, + La_arm_regs *regs, unsigned int *flags, + const char *symname, long int *framesizep) +{ + print_enter (refcook, defcook, symname, + regs->lr_reg[0], regs->lr_reg[1], regs->lr_reg[2], + *flags); + + /* No need to copy anything, we will not need the parameters in any case. */ + *framesizep = 0; + + return sym->st_value; +} + +unsigned int +la_arm_gnu_pltexit (ElfW(Sym) *sym, unsigned int ndx, uintptr_t *refcook, + uintptr_t *defcook, const struct La_arm_regs *inregs, + struct La_arm_retval *outregs, const char *symname) +{ + print_exit (refcook, defcook, symname, outregs->lrv_reg[0]); + + return 0; +} diff --git a/libc/ports/sysdeps/arm/sysdep.h b/libc/ports/sysdeps/arm/sysdep.h index cd3d70b5a..6ec2bd61c 100644 --- a/libc/ports/sysdeps/arm/sysdep.h +++ b/libc/ports/sysdeps/arm/sysdep.h @@ -30,8 +30,6 @@ /* Syntactic details of assembler. */ #define ALIGNARG(log2) log2 -/* For ELF we need the `.type' directive to make shared libs work right. */ -#define ASM_TYPE_DIRECTIVE(name,typearg) .type name,%##typearg; #define ASM_SIZE_DIRECTIVE(name) .size name,.-name #define PLTJMP(_x) _x##(PLT) @@ -63,7 +61,7 @@ /* Define an entry point visible from C. */ #define ENTRY(name) \ .globl C_SYMBOL_NAME(name); \ - ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),function) \ + .type C_SYMBOL_NAME(name),%function; \ .align ALIGNARG(4); \ C_LABEL(name) \ .cfi_sections .debug_frame; \ diff --git a/libc/ports/sysdeps/hppa/nptl/pthread_spin_lock.c b/libc/ports/sysdeps/hppa/nptl/pthread_spin_lock.c index bcf22408d..e01185313 100644 --- a/libc/ports/sysdeps/hppa/nptl/pthread_spin_lock.c +++ b/libc/ports/sysdeps/hppa/nptl/pthread_spin_lock.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2005 Free Software Foundation, Inc. +/* Copyright (C) 2005-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -15,23 +15,9 @@ License along with the GNU C Library. If not, see <http://www.gnu.org/licenses/>. */ -#include <atomic.h> -#include "pthreadP.h" +#define SPIN_LOCK_READS_BETWEEN_CMPXCHG 1000 -int -pthread_spin_lock (pthread_spinlock_t *lock) -{ -#if 0 - volatile unsigned int *addr = __ldcw_align (lock); - - while (__ldcw (addr) == 0) - while (*addr == 0) ; - - return 0; -#endif - - while (atomic_compare_and_exchange_val_acq(lock, 1, 0) == 1) - while (*lock == 1); - - return 0; -} +/* We can't use the normal "#include <nptl/pthread_spin_lock.c>" because + it will resolve to this very file. Using "sysdeps/.." as reference to the + top level directory does the job. */ +#include <sysdeps/../nptl/pthread_spin_lock.c> diff --git a/libc/ports/sysdeps/ia64/bits/byteswap-16.h b/libc/ports/sysdeps/ia64/bits/byteswap-16.h index 0a8590927..4a53ffaf6 100644 --- a/libc/ports/sysdeps/ia64/bits/byteswap-16.h +++ b/libc/ports/sysdeps/ia64/bits/byteswap-16.h @@ -23,7 +23,7 @@ #if defined __GNUC__ && __GNUC__ >= 2 # define __bswap_16(x) \ (__extension__ \ - ({ register unsigned short int __v, __x = (x); \ + ({ register unsigned short int __v, __x = (unsigned short int) (x); \ if (__builtin_constant_p (x)) \ __v = __bswap_constant_16 (__x); \ else \ diff --git a/libc/ports/sysdeps/ia64/bits/byteswap.h b/libc/ports/sysdeps/ia64/bits/byteswap.h index 68612487d..d363c3e1c 100644 --- a/libc/ports/sysdeps/ia64/bits/byteswap.h +++ b/libc/ports/sysdeps/ia64/bits/byteswap.h @@ -25,7 +25,7 @@ /* Swap bytes in 16 bit value. */ #define __bswap_constant_16(x) \ - ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8)) + ((unsigned short int)((((x) >> 8) & 0xff) | (((x) & 0xff) << 8))) /* Get __bswap_16. */ #include <bits/byteswap-16.h> diff --git a/libc/ports/sysdeps/ia64/configure b/libc/ports/sysdeps/ia64/configure index a3a113713..d73346006 100644 --- a/libc/ports/sysdeps/ia64/configure +++ b/libc/ports/sysdeps/ia64/configure @@ -72,6 +72,10 @@ $as_echo X/"$0" | chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). @@ -83,94 +87,5 @@ $as_echo X/"$0" | # This file is generated from configure.in by Autoconf. DO NOT EDIT! # Local configure fragment for sysdeps/ia64. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if -g produces usable source locations for assembler-with-cpp" >&5 -$as_echo_n "checking if -g produces usable source locations for assembler-with-cpp... " >&6; } -if ${libc_cv_cpp_asm_debuginfo+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat > conftest.S <<EOF -#include "confdefs.h" - -/* comment on - two lines */ - ${libc_cv_dot_text} - ${libc_cv_asm_global_directive} foo -foo: - /* Unfortunately this test only works for a real instruction, - not for any of the machine-independent pseudo-ops. - So we just have to assume everybody has a "nop". */ - nop.b 0;; - /* comment */ - nop.b 0;; - /* comment */ - nop.b 0;; -EOF -if { ac_try='${CC-cc} $CPPFLAGS $ASFLAGS -g -c conftest.S 1>&5' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 - (eval $ac_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; } && { - ac_pattern='conftest\.S' - { ac_try='readelf --debug-dump=line conftest.o | - grep $ac_pattern 1>&5' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 - (eval $ac_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; } - }; then - libc_cv_cpp_asm_debuginfo=yes -else - libc_cv_cpp_asm_debuginfo=no -fi -rm -f conftest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cpp_asm_debuginfo" >&5 -$as_echo "$libc_cv_cpp_asm_debuginfo" >&6; } -if test $libc_cv_cpp_asm_debuginfo = yes; then - $as_echo "#define HAVE_CPP_ASM_DEBUGINFO 1" >>confdefs.h - -fi - -# Check for support of thread-local storage handling in assembler and -# linker. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ia64 TLS support" >&5 -$as_echo_n "checking for ia64 TLS support... " >&6; } -if ${libc_cv_ia64_tls+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat > conftest.s <<\EOF - .section ".tdata","awT",@progbits -foo: data8 25 - .text - addl r16 = @ltoff(@dtpmod(foo#)), gp - addl r17 = @ltoff(@dtprel(foo#)), gp - addl r18 = @ltoff(@tprel(foo#)), gp - addl r19 = @dtprel(foo#), gp - adds r21 = @dtprel(foo#), r13 - movl r23 = @dtprel(foo#) - addl r20 = @tprel(foo#), gp - adds r22 = @tprel(foo#), r13 - movl r24 = @tprel(foo#) -EOF -if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 - (eval $ac_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - libc_cv_ia64_tls=yes -else - libc_cv_ia64_tls=no -fi -rm -f conftest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_ia64_tls" >&5 -$as_echo "$libc_cv_ia64_tls" >&6; } -if test $libc_cv_ia64_tls = no; then - as_fn_error $? "the assembler must support TLS" "$LINENO" 5 -fi - $as_echo "#define PI_STATIC_AND_HIDDEN 1" >>confdefs.h diff --git a/libc/ports/sysdeps/ia64/configure.in b/libc/ports/sysdeps/ia64/configure.in index 5f1b1123f..4ad04ff2f 100644 --- a/libc/ports/sysdeps/ia64/configure.in +++ b/libc/ports/sysdeps/ia64/configure.in @@ -1,67 +1,6 @@ GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. # Local configure fragment for sysdeps/ia64. -AC_CACHE_CHECK(if -g produces usable source locations for assembler-with-cpp, - libc_cv_cpp_asm_debuginfo, [dnl -cat > conftest.S <<EOF -#include "confdefs.h" - -/* comment on - two lines */ - ${libc_cv_dot_text} - ${libc_cv_asm_global_directive} foo -foo: - /* Unfortunately this test only works for a real instruction, - not for any of the machine-independent pseudo-ops. - So we just have to assume everybody has a "nop". */ - nop.b 0;; - /* comment */ - nop.b 0;; - /* comment */ - nop.b 0;; -EOF -if AC_TRY_COMMAND([${CC-cc} $CPPFLAGS $ASFLAGS -g -c conftest.S 1>&AS_MESSAGE_LOG_FD]) && { - ac_pattern='conftest\.S' - AC_TRY_COMMAND([readelf --debug-dump=line conftest.o | - grep $ac_pattern 1>&AS_MESSAGE_LOG_FD]) - }; then - libc_cv_cpp_asm_debuginfo=yes -else - libc_cv_cpp_asm_debuginfo=no -fi -rm -f conftest*])AC_SUBST(libc_cv_cpp_asm_debuginfo) -if test $libc_cv_cpp_asm_debuginfo = yes; then - AC_DEFINE(HAVE_CPP_ASM_DEBUGINFO) -fi - -# Check for support of thread-local storage handling in assembler and -# linker. -AC_CACHE_CHECK(for ia64 TLS support, libc_cv_ia64_tls, [dnl -cat > conftest.s <<\EOF - .section ".tdata","awT",@progbits -foo: data8 25 - .text - addl r16 = @ltoff(@dtpmod(foo#)), gp - addl r17 = @ltoff(@dtprel(foo#)), gp - addl r18 = @ltoff(@tprel(foo#)), gp - addl r19 = @dtprel(foo#), gp - adds r21 = @dtprel(foo#), r13 - movl r23 = @dtprel(foo#) - addl r20 = @tprel(foo#), gp - adds r22 = @tprel(foo#), r13 - movl r24 = @tprel(foo#) -EOF -dnl -if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then - libc_cv_ia64_tls=yes -else - libc_cv_ia64_tls=no -fi -rm -f conftest*]) -if test $libc_cv_ia64_tls = no; then - AC_MSG_ERROR([the assembler must support TLS]) -fi - dnl It is always possible to access static and hidden symbols in an dnl position independent way. AC_DEFINE(PI_STATIC_AND_HIDDEN) diff --git a/libc/ports/sysdeps/ia64/fpu/libm-symbols.h b/libc/ports/sysdeps/ia64/fpu/libm-symbols.h index 81084bd62..0df807601 100644 --- a/libc/ports/sysdeps/ia64/fpu/libm-symbols.h +++ b/libc/ports/sysdeps/ia64/fpu/libm-symbols.h @@ -4,7 +4,6 @@ /* Support for compatible assembler handling. */ #define ASM_SIZE_DIRECTIVE(name) .size name,.-name -#define ASM_TYPE_DIRECTIVE(name,T) .type name,T #define LOCAL_LIBM_ENTRY(name) \ .proc name; \ @@ -18,7 +17,7 @@ #define RODATA .rodata #define LOCAL_OBJECT_START(name) \ name:; \ - ASM_TYPE_DIRECTIVE(name, @object) + .type name, @object #define LOCAL_OBJECT_END(name) \ ASM_SIZE_DIRECTIVE(name) @@ -42,7 +41,7 @@ .hidden __##name; \ LOCAL_LIBM_END(__##name); \ ASM_SIZE_DIRECTIVE(__##name); \ - ASM_TYPE_DIRECTIVE(__##name, @function) + .type __##name, @function #define GLOBAL_IEEE754_ENTRY(name) \ WEAK_LIBM_ENTRY(name); \ @@ -52,7 +51,7 @@ #define GLOBAL_IEEE754_END(name) \ WEAK_LIBM_END(name); \ ASM_SIZE_DIRECTIVE(__ieee754_##name); \ - ASM_TYPE_DIRECTIVE(__ieee754_##name, @function) + .type __ieee754_##name, @function #if defined ASSEMBLER && !defined NOT_IN_libc # define __libm_error_support HIDDEN_JUMPTARGET(__libm_error_support) diff --git a/libc/ports/sysdeps/ia64/fpu/libm_tan.S b/libc/ports/sysdeps/ia64/fpu/libm_tan.S index 655a86455..b267f13d9 100644 --- a/libc/ports/sysdeps/ia64/fpu/libm_tan.S +++ b/libc/ports/sysdeps/ia64/fpu/libm_tan.S @@ -689,7 +689,7 @@ .align 128 TAN_BASE_CONSTANTS: -ASM_TYPE_DIRECTIVE(TAN_BASE_CONSTANTS,@object) +.type TAN_BASE_CONSTANTS, @object data4 0x4B800000, 0xCB800000, 0x38800000, 0xB8800000 // two**24, -two**24 // two**-14, -two**-14 data4 0x4E44152A, 0xA2F9836E, 0x00003FFE, 0x00000000 // two_by_pi diff --git a/libc/ports/sysdeps/ia64/ldsodefs.h b/libc/ports/sysdeps/ia64/ldsodefs.h index 269319e84..d5fde9383 100644 --- a/libc/ports/sysdeps/ia64/ldsodefs.h +++ b/libc/ports/sysdeps/ia64/ldsodefs.h @@ -26,7 +26,7 @@ struct La_ia64_retval; #define ARCH_PLTENTER_MEMBERS \ Elf64_Addr (*ia64_gnu_pltenter) (Elf64_Sym *, unsigned int, \ uintptr_t *, uintptr_t *, \ - const struct La_ia64_regs *, \ + struct La_ia64_regs *, \ unsigned int *, const char *name, \ long int *framesizep); diff --git a/libc/ports/sysdeps/m68k/asm-syntax.h b/libc/ports/sysdeps/m68k/asm-syntax.h index 53f5259b0..f011ff2de 100644 --- a/libc/ports/sysdeps/m68k/asm-syntax.h +++ b/libc/ports/sysdeps/m68k/asm-syntax.h @@ -1,5 +1,5 @@ /* Definitions for 68k syntax variations. - Copyright (C) 1992, 1994, 1996, 1997, 2012 Free Software Foundation, Inc. + Copyright (C) 1992-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Its master source is NOT part of the C library, however. The master source lives in the GNU MP Library. @@ -17,11 +17,6 @@ License along with the GNU C Library. If not, see <http://www.gnu.org/licenses/>. */ -/* ELF uses byte-counts for .align, most others use log2 of count of bytes. */ -#define ALIGNARG(log2) 1<<log2 -/* For ELF we need the `.type' directive to make shared libs work right. */ -#define PROLOG(name) .type name,@function -#define EPILOG(name) .size name,.-name /* For ELF we need to prefix register names and local labels. */ #define R_(r) %##r #define R(r) R_(r) @@ -35,8 +30,6 @@ #define MEM_PREDEC(memory_base)R(memory_base)@- #define MEM_POSTINC(memory_base)R(memory_base)@+ #define TEXT .text -#define ALIGN .even -#define GLOBL .globl /* Use variable sized opcodes. */ #define bcc jcc #define bcs jcs @@ -56,8 +49,6 @@ #define MEM_INDX1_(base,idx,size_suffix,scale)(R(base),R(idx##.##size_suffix*scale)) #define MEM_INDX1(base,idx,size_suffix,scale)MEM_INDX1_(base,idx,size_suffix,scale) #define TEXT .text -#define ALIGN .align ALIGNARG(2) -#define GLOBL .globl #define bcc jbcc #define bcs jbcs #define bls jbls diff --git a/libc/ports/sysdeps/mips/nptl/pthread_spin_lock.S b/libc/ports/sysdeps/m68k/coldfire/fpu/bits/mathinline.h index a8504f163..928b7d3e3 100644 --- a/libc/ports/sysdeps/mips/nptl/pthread_spin_lock.S +++ b/libc/ports/sysdeps/m68k/coldfire/fpu/bits/mathinline.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2005 Free Software Foundation, Inc. +/* Inline math functions for Coldfire. + Copyright (C) 2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -15,22 +16,29 @@ License along with the GNU C Library. If not, see <http://www.gnu.org/licenses/>. */ -#include <sys/asm.h> -#include <sysdep.h> -#include <sgidefs.h> +#ifndef _MATH_H +# error "Never use <bits/mathinline.h> directly; include <math.h> instead." +#endif + +#ifndef __extern_always_inline +# define __MATH_INLINE __inline +#else +# define __MATH_INLINE __extern_always_inline +#endif + +#if defined __USE_ISOC99 && defined __GNUC__ + +/* Test for negative number. Used in the signbit macro. */ +__MATH_INLINE int +__NTH (__signbitf (float __x)) +{ + return __builtin_signbitf (__x); +} + +__MATH_INLINE int +__NTH (__signbit (double __x)) +{ + return __builtin_signbit (__x); +} -ENTRY (pthread_spin_lock) - .set push -#if _MIPS_SIM == _ABIO32 - .set mips2 #endif -1: ll a2, 0(a0) - li a1, 1 - bnez a2, 1b - sc a1, 0(a0) - beqz a1, 1b - MIPS_SYNC - .set pop - li v0, 0 - ret -PSEUDO_END (pthread_spin_lock) diff --git a/libc/ports/sysdeps/m68k/ldsodefs.h b/libc/ports/sysdeps/m68k/ldsodefs.h index bc8d54099..2fe4858b4 100644 --- a/libc/ports/sysdeps/m68k/ldsodefs.h +++ b/libc/ports/sysdeps/m68k/ldsodefs.h @@ -1,5 +1,5 @@ /* Run-time dynamic linker data structures for loaded ELF shared objects. - Copyright (C) 2006 Free Software Foundation, Inc. + Copyright (C) 2006-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -26,7 +26,7 @@ struct La_m68k_retval; #define ARCH_PLTENTER_MEMBERS \ Elf32_Addr (*m68k_gnu_pltenter) (Elf32_Sym *, unsigned int, \ uintptr_t *, uintptr_t *, \ - const struct La_m68k_regs *, \ + struct La_m68k_regs *, \ unsigned int *, const char *name, \ long int *framesizep); diff --git a/libc/ports/sysdeps/m68k/m680x0/fpu/libm-test-ulps b/libc/ports/sysdeps/m68k/m680x0/fpu/libm-test-ulps index 66dc109e0..54d690990 100644 --- a/libc/ports/sysdeps/m68k/m680x0/fpu/libm-test-ulps +++ b/libc/ports/sysdeps/m68k/m680x0/fpu/libm-test-ulps @@ -169,8 +169,12 @@ float: 1 idouble: 2 ifloat: 1 Test "Imaginary part of: cacos (+0 - 0.5 i) == pi/2 + 0.4812118250596034474977589134243684231352 i": +double: 1 float: 1 +idouble: 1 ifloat: 1 +ildouble: 1 +ldouble: 1 Test "Imaginary part of: cacos (+0 - 1.0 i) == pi/2 + 0.8813735870195430252326093249797923090282 i": double: 1 float: 1 @@ -195,8 +199,12 @@ float: 1 idouble: 2 ifloat: 1 Test "Imaginary part of: cacos (-0 - 0.5 i) == pi/2 + 0.4812118250596034474977589134243684231352 i": +double: 1 float: 1 +idouble: 1 ifloat: 1 +ildouble: 1 +ldouble: 1 Test "Imaginary part of: cacos (-0 - 1.0 i) == pi/2 + 0.8813735870195430252326093249797923090282 i": double: 1 float: 1 @@ -244,8 +252,12 @@ ldouble: 1 # cacosh Test "Real part of: cacosh (+0 + 0.5 i) == 0.4812118250596034474977589134243684231352 + pi/2 i": +double: 1 float: 1 +idouble: 1 ifloat: 1 +ildouble: 1 +ldouble: 1 Test "Real part of: cacosh (+0 + 1.0 i) == 0.8813735870195430252326093249797923090282 + pi/2 i": double: 1 float: 1 @@ -255,8 +267,12 @@ Test "Real part of: cacosh (+0 + 1.5 i) == 1.19476321728710930411193082851909052 double: 1 idouble: 1 Test "Real part of: cacosh (+0 - 0.5 i) == 0.4812118250596034474977589134243684231352 - pi/2 i": +double: 1 float: 1 +idouble: 1 ifloat: 1 +ildouble: 1 +ldouble: 1 Test "Real part of: cacosh (+0 - 1.0 i) == 0.8813735870195430252326093249797923090282 - pi/2 i": double: 1 float: 1 @@ -266,8 +282,12 @@ Test "Real part of: cacosh (+0 - 1.5 i) == 1.19476321728710930411193082851909052 double: 1 idouble: 1 Test "Real part of: cacosh (-0 + 0.5 i) == 0.4812118250596034474977589134243684231352 + pi/2 i": +double: 1 float: 1 +idouble: 1 ifloat: 1 +ildouble: 1 +ldouble: 1 Test "Real part of: cacosh (-0 + 1.0 i) == 0.8813735870195430252326093249797923090282 + pi/2 i": double: 1 float: 1 @@ -277,8 +297,12 @@ Test "Real part of: cacosh (-0 + 1.5 i) == 1.19476321728710930411193082851909052 double: 1 idouble: 1 Test "Real part of: cacosh (-0 - 0.5 i) == 0.4812118250596034474977589134243684231352 - pi/2 i": +double: 1 float: 1 +idouble: 1 ifloat: 1 +ildouble: 1 +ldouble: 1 Test "Real part of: cacosh (-0 - 1.0 i) == 0.8813735870195430252326093249797923090282 - pi/2 i": double: 1 float: 1 @@ -298,11 +322,19 @@ idouble: 1 ildouble: 1 ldouble: 1 Test "Real part of: cacosh (-1.5 + +0 i) == 0.9624236501192068949955178268487368462704 + pi i": +double: 1 float: 1 +idouble: 1 ifloat: 1 +ildouble: 1 +ldouble: 1 Test "Real part of: cacosh (-1.5 - 0 i) == 0.9624236501192068949955178268487368462704 - pi i": +double: 1 float: 1 +idouble: 1 ifloat: 1 +ildouble: 1 +ldouble: 1 Test "Real part of: cacosh (-2 - 3 i) == 1.9833870299165354323470769028940395 - 2.1414491111159960199416055713254211 i": double: 1 float: 7 @@ -322,11 +354,19 @@ Test "Imaginary part of: cacosh (0.75 + 1.25 i) == 1.132393631605308195222663336 float: 1 ifloat: 1 Test "Real part of: cacosh (1.5 + +0 i) == 0.9624236501192068949955178268487368462704 + +0 i": +double: 1 float: 1 +idouble: 1 ifloat: 1 +ildouble: 1 +ldouble: 1 Test "Real part of: cacosh (1.5 - 0 i) == 0.9624236501192068949955178268487368462704 - 0 i": +double: 1 float: 1 +idouble: 1 ifloat: 1 +ildouble: 1 +ldouble: 1 # casin Test "Imaginary part of: casin (+0 + 0.5 i) == +0 + 0.4812118250596034474977589134243684231352 i": @@ -345,8 +385,12 @@ float: 1 idouble: 2 ifloat: 1 Test "Imaginary part of: casin (+0 - 0.5 i) == +0 - 0.4812118250596034474977589134243684231352 i": +double: 1 float: 1 +idouble: 1 ifloat: 1 +ildouble: 1 +ldouble: 1 Test "Imaginary part of: casin (+0 - 1.0 i) == +0 - 0.8813735870195430252326093249797923090282 i": double: 1 float: 1 @@ -371,8 +415,12 @@ float: 1 idouble: 2 ifloat: 1 Test "Imaginary part of: casin (-0 - 0.5 i) == -0 - 0.4812118250596034474977589134243684231352 i": +double: 1 float: 1 +idouble: 1 ifloat: 1 +ildouble: 1 +ldouble: 1 Test "Imaginary part of: casin (-0 - 1.0 i) == -0 - 0.8813735870195430252326093249797923090282 i": double: 1 float: 1 @@ -472,11 +520,19 @@ ifloat: 6 ildouble: 6 ldouble: 6 Test "Real part of: casinh (0.5 + +0 i) == 0.4812118250596034474977589134243684231352 + +0 i": +double: 1 float: 1 +idouble: 1 ifloat: 1 +ildouble: 1 +ldouble: 1 Test "Real part of: casinh (0.5 - 0 i) == 0.4812118250596034474977589134243684231352 - 0 i": +double: 1 float: 1 +idouble: 1 ifloat: 1 +ildouble: 1 +ldouble: 1 Test "Real part of: casinh (0.75 + 1.25 i) == 1.03171853444778027336364058631006594 + 0.911738290968487636358489564316731207 i": float: 1 ifloat: 1 @@ -605,6 +661,12 @@ ildouble: 1 ldouble: 1 # clog +Test "Real part of: clog (-0x1.0000000123456p0 + 0x1.2345678p-1000 i) == 2.649094276923003995420209214900915462737e-10 + 3.141592653589793238462643383279502884197 i": +double: 1 +idouble: 1 +Test "Real part of: clog (-0x1.0000000123456p0 + 0x1.2345678p-30 i) == 2.649094282537168795982991778475646793277e-10 + 3.141592652530155111500161671113150737892 i": +double: 1 +idouble: 1 Test "Real part of: clog (0.75 + 1.25 i) == 0.376885901188190075998919126749298416 + 1.03037682652431246378774332703115153 i": float: 1 ifloat: 1 @@ -613,6 +675,12 @@ ldouble: 1 Test "Imaginary part of: clog (0.75 + 1.25 i) == 0.376885901188190075998919126749298416 + 1.03037682652431246378774332703115153 i": ildouble: 1 ldouble: 1 +Test "Imaginary part of: clog (0x1.000566p0 + 0x1.234p-10 i) == 8.298731898331237038231468223024422855654e-5 + 1.110938609507128729312743251313024793990e-3 i": +ildouble: 1 +ldouble: 1 +Test "Real part of: clog (0x1.000566p0 + 0x1.234p-100 i) == 8.237022655933121125560939513260027133767e-5 + 8.974094312218060110948251664314290484113e-31 i": +float: 1 +ifloat: 1 Test "Real part of: clog (0x1.fp+16383 + 0x1p+16383 i) == 11356.60974243783798653123798337822335902 + 0.4764674194737066993385333770295162295856 i": ildouble: 1 ldouble: 1 @@ -630,6 +698,15 @@ ifloat: 1 Test "Imaginary part of: clog10 (-0 - inf i) == inf - pi/2*log10(e) i": float: 1 ifloat: 1 +Test "Real part of: clog10 (-0x1.0000000123456p0 + 0x1.2345678p-1000 i) == 1.150487026509145544402795327729455391948e-10 + 1.364376353841841347485783625431355770210 i": +double: 1 +idouble: 1 +Test "Real part of: clog10 (-0x1.0000000123456p0 + 0x1.2345678p-30 i) == 1.150487028947346337782682105935961875822e-10 + 1.364376353381646356131680448946397884147 i": +double: 1 +idouble: 1 +Test "Imaginary part of: clog10 (-0x1.0000000123456p0 + 0x1.2345678p-30 i) == 1.150487028947346337782682105935961875822e-10 + 1.364376353381646356131680448946397884147 i": +ildouble: 1 +ldouble: 1 Test "Imaginary part of: clog10 (-0x1.234566p-40 - 1.0 i) == 2.325249110681915353442924915876654139373e-25 - 6.821881769213700828789403802671540158935e-1 i": double: 1 idouble: 1 @@ -678,6 +755,14 @@ double: 1 idouble: 1 ildouble: 2 ldouble: 2 +Test "Imaginary part of: clog10 (0x1.000566p0 + 0x1.234p-10 i) == 3.604093470239754109961125085078190708674e-5 + 4.824745078422174667425851670822596859720e-4 i": +double: 1 +idouble: 1 +ildouble: 2 +ldouble: 2 +Test "Imaginary part of: clog10 (0x1.000566p0 + 0x1.234p-100 i) == 3.577293486783822178310971763308187385546e-5 + 3.897399639875661463735636919790792140598e-31 i": +ildouble: 1 +ldouble: 1 Test "Real part of: clog10 (0x1.234566p-30 + 1.0 i) == 2.438200411482400072282924063740535840474e-19 + 6.821881764607257184291586401763604544928e-1 i": ildouble: 1 ldouble: 1 @@ -895,6 +980,8 @@ idouble: 1 Test "Real part of: cpow (0.75 + 1.25 i, 0.0 + 1.0 i) == 0.331825439177608832276067945276730566 + 0.131338600281188544930936345230903032 i": float: 1 ifloat: 1 +ildouble: 1 +ldouble: 1 Test "Imaginary part of: cpow (0.75 + 1.25 i, 0.0 + 1.0 i) == 0.331825439177608832276067945276730566 + 0.131338600281188544930936345230903032 i": float: 1 ifloat: 1 @@ -2430,7 +2517,9 @@ ildouble: 1 ldouble: 1 Function: Real part of "clog": +double: 1 float: 1 +idouble: 1 ifloat: 1 ildouble: 1 ldouble: 1 diff --git a/libc/ports/sysdeps/m68k/nptl/pthread_spin_lock.c b/libc/ports/sysdeps/m68k/nptl/pthread_spin_lock.c index 90a8262b2..2616a7f2a 100644 --- a/libc/ports/sysdeps/m68k/nptl/pthread_spin_lock.c +++ b/libc/ports/sysdeps/m68k/nptl/pthread_spin_lock.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2010 Free Software Foundation, Inc. +/* Copyright (C) 2010-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010. @@ -16,15 +16,9 @@ License along with the GNU C Library. If not, see <http://www.gnu.org/licenses/>. */ -#include <atomic.h> -#include "pthreadP.h" +#define SPIN_LOCK_READS_BETWEEN_CMPXCHG 1000 -int -pthread_spin_lock (pthread_spinlock_t *lock) -{ - while (atomic_compare_and_exchange_val_acq(lock, 1, 0) != 0) - while (*lock != 0) - ; - - return 0; -} +/* We can't use the normal "#include <nptl/pthread_spin_lock.c>" because + it will resolve to this very file. Using "sysdeps/.." as reference to the + top level directory does the job. */ +#include <sysdeps/../nptl/pthread_spin_lock.c> diff --git a/libc/ports/sysdeps/m68k/nptl/pthread_spin_trylock.c b/libc/ports/sysdeps/m68k/nptl/pthread_spin_trylock.c deleted file mode 100644 index f4b0c0d0a..000000000 --- a/libc/ports/sysdeps/m68k/nptl/pthread_spin_trylock.c +++ /dev/null @@ -1,27 +0,0 @@ -/* Copyright (C) 2010 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010. - - 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/>. */ - -#include <errno.h> -#include <atomic.h> -#include "pthreadP.h" - -int -pthread_spin_trylock (pthread_spinlock_t *lock) -{ - return atomic_compare_and_exchange_val_acq(lock, 1, 0) ? EBUSY : 0; -} diff --git a/libc/ports/sysdeps/m68k/sysdep.h b/libc/ports/sysdeps/m68k/sysdep.h index 980cae5b8..a621830db 100644 --- a/libc/ports/sysdeps/m68k/sysdep.h +++ b/libc/ports/sysdeps/m68k/sysdep.h @@ -1,5 +1,5 @@ /* Assembler macros for m68k. - Copyright (C) 1998, 2003, 2010, 2012 Free Software Foundation, Inc. + Copyright (C) 1998-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -20,14 +20,6 @@ #ifdef __ASSEMBLER__ -/* Syntactic details of assembler. */ - -/* ELF uses byte-counts for .align, most others use log2 of count of bytes. */ -# define ALIGNARG(log2) 1<<log2 -/* For ELF we need the `.type' directive to make shared libs work right. */ -# define ASM_TYPE_DIRECTIVE(name,typearg) .type name,typearg -# define ASM_SIZE_DIRECTIVE(name) .size name,.-name - /* Define an entry point visible from C. There is currently a bug in gdb which prevents us from specifying @@ -35,8 +27,8 @@ the current source file. */ # define ENTRY(name) \ .globl C_SYMBOL_NAME(name); \ - ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function); \ - .align ALIGNARG(2); \ + .type C_SYMBOL_NAME(name),@function; \ + .p2align 2; \ C_LABEL(name) \ cfi_startproc; \ CALL_MCOUNT @@ -44,7 +36,7 @@ # undef END # define END(name) \ cfi_endproc; \ - ASM_SIZE_DIRECTIVE(name) + .size name,.-name /* If compiled for profiling, call `_mcount' at the start of each function. */ diff --git a/libc/ports/sysdeps/mips/bits/atomic.h b/libc/ports/sysdeps/mips/bits/atomic.h index b0942737d..749e16690 100644 --- a/libc/ports/sysdeps/mips/bits/atomic.h +++ b/libc/ports/sysdeps/mips/bits/atomic.h @@ -193,11 +193,13 @@ typedef uintmax_t uatomic_max_t; __atomic_fetch_add (mem, value, model) # endif -/* ??? Barrier semantics for atomic_exchange_and_add appear to be - undefined. Use full barrier for now, as that's safe. */ -# define atomic_exchange_and_add(mem, value) \ +# define atomic_exchange_and_add_acq(mem, value) \ __atomic_val_bysize (__arch_exchange_and_add, int, mem, value, \ - __ATOMIC_ACQ_REL) + __ATOMIC_ACQUIRE) + +# define atomic_exchange_and_add_rel(mem, value) \ + __atomic_val_bysize (__arch_exchange_and_add, int, mem, value, \ + __ATOMIC_RELEASE) #else /* !__GNUC_PREREQ (4, 8) */ /* This implementation using inline assembly will be removed once glibc requires GCC 4.8 or later to build. */ @@ -434,11 +436,13 @@ typedef uintmax_t uatomic_max_t; __prev; }) # endif -/* ??? Barrier semantics for atomic_exchange_and_add appear to be - undefined. Use full barrier for now, as that's safe. */ -# define atomic_exchange_and_add(mem, value) \ - __atomic_val_bysize (__arch_exchange_and_add, int, mem, value, \ - MIPS_SYNC_STR, MIPS_SYNC_STR) +# define atomic_exchange_and_add_acq(mem, value) \ + __atomic_val_bysize (__arch_exchange_and_add, int, mem, value, \ + "", MIPS_SYNC_STR) + +# define atomic_exchange_and_add_rel(mem, value) \ + __atomic_val_bysize (__arch_exchange_and_add, int, mem, value, \ + MIPS_SYNC_STR, "") #endif /* __GNUC_PREREQ (4, 8) */ /* TODO: More atomic operations could be implemented efficiently; only the diff --git a/libc/ports/sysdeps/mips/dl-lookup.c b/libc/ports/sysdeps/mips/dl-lookup.c index f7e98b7f5..e62c7d060 100644 --- a/libc/ports/sysdeps/mips/dl-lookup.c +++ b/libc/ports/sysdeps/mips/dl-lookup.c @@ -1,6 +1,6 @@ /* Look up a symbol in the loaded objects. MIPS/Linux version - special handling of non-PIC undefined symbol rules. - Copyright (C) 1995-2007, 2009, 2010, 2011 Free Software Foundation, Inc. + Copyright (C) 1995-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -28,6 +28,7 @@ #include <sysdep-cancel.h> #include <bits/libc-lock.h> #include <tls.h> +#include <atomic.h> #include <assert.h> diff --git a/libc/ports/sysdeps/mips/ldsodefs.h b/libc/ports/sysdeps/mips/ldsodefs.h index ab4e9ef1e..791e61896 100644 --- a/libc/ports/sysdeps/mips/ldsodefs.h +++ b/libc/ports/sysdeps/mips/ldsodefs.h @@ -29,17 +29,17 @@ struct La_mips_64_retval; #define ARCH_PLTENTER_MEMBERS \ Elf32_Addr (*mips_o32_gnu_pltenter) (Elf32_Sym *, unsigned int, \ uintptr_t *, uintptr_t *, \ - const struct La_mips_32_regs *, \ + struct La_mips_32_regs *, \ unsigned int *, const char *name, \ long int *framesizep); \ Elf32_Addr (*mips_n32_gnu_pltenter) (Elf32_Sym *, unsigned int, \ uintptr_t *, uintptr_t *, \ - const struct La_mips_64_regs *, \ + struct La_mips_64_regs *, \ unsigned int *, const char *name, \ long int *framesizep); \ Elf64_Addr (*mips_n64_gnu_pltenter) (Elf64_Sym *, unsigned int, \ uintptr_t *, uintptr_t *, \ - const struct La_mips_64_regs *, \ + struct La_mips_64_regs *, \ unsigned int *, const char *name, \ long int *framesizep); diff --git a/libc/ports/sysdeps/arm/nptl/pthread_spin_trylock.c b/libc/ports/sysdeps/mips/nptl/pthread_spin_lock.c index 7d3118071..f39b0182b 100644 --- a/libc/ports/sysdeps/arm/nptl/pthread_spin_trylock.c +++ b/libc/ports/sysdeps/mips/nptl/pthread_spin_lock.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2008 Free Software Foundation, Inc. +/* Copyright (C) 2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -15,12 +15,9 @@ License along with the GNU C Library. If not, see <http://www.gnu.org/licenses/>. */ -#include <errno.h> -#include <atomic.h> -#include "pthreadP.h" +#define SPIN_LOCK_READS_BETWEEN_CMPXCHG 1000 -int -pthread_spin_trylock (pthread_spinlock_t *lock) -{ - return atomic_compare_and_exchange_val_acq (lock, 1, 0) ? EBUSY : 0; -} +/* We can't use the normal "#include <nptl/pthread_spin_lock.c>" because + it will resolve to this very file. Using "sysdeps/.." as reference to the + top level directory does the job. */ +#include <sysdeps/../nptl/pthread_spin_lock.c> diff --git a/libc/ports/sysdeps/mips/sys/asm.h b/libc/ports/sysdeps/mips/sys/asm.h index 347d738f7..0f5edf924 100644 --- a/libc/ports/sysdeps/mips/sys/asm.h +++ b/libc/ports/sysdeps/mips/sys/asm.h @@ -233,8 +233,8 @@ symbol = value # define PREFX(hint,addr) \ prefx hint,addr #else -# define PREF -# define PREFX +# define PREF(hint,addr) +# define PREFX(hint,addr) #endif /* diff --git a/libc/ports/sysdeps/tile/sysdep.h b/libc/ports/sysdeps/tile/sysdep.h index 34d704659..4f27cb2be 100644 --- a/libc/ports/sysdeps/tile/sysdep.h +++ b/libc/ports/sysdeps/tile/sysdep.h @@ -24,14 +24,13 @@ #include <feedback.h> -/* Make use of .type and .size directives. */ -#define ASM_TYPE_DIRECTIVE(name,typearg) .type name,typearg; +/* Make use of .size directive. */ #define ASM_SIZE_DIRECTIVE(name) .size name,.-name; /* Define an entry point visible from C. */ #define ENTRY(name) \ .globl C_SYMBOL_NAME(name); \ - ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \ + .type C_SYMBOL_NAME(name),@function; \ .align 8; \ C_LABEL(name) \ cfi_startproc; \ diff --git a/libc/ports/sysdeps/unix/sysv/linux/alpha/bits/dirent.h b/libc/ports/sysdeps/unix/sysv/linux/alpha/bits/dirent.h index f146466e6..487ad1525 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/alpha/bits/dirent.h +++ b/libc/ports/sysdeps/unix/sysv/linux/alpha/bits/dirent.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. +/* Copyright (C) 1996-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -51,4 +51,7 @@ struct dirent64 #define _DIRENT_HAVE_D_OFF #define _DIRENT_HAVE_D_TYPE +/* Inform libc code that these two types are effectively identical. */ +#define _DIRENT_MATCHES_DIRENT64 1 + #endif /* bits/dirent.h */ diff --git a/libc/ports/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h b/libc/ports/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h index 2dbeb42a1..31258e420 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h +++ b/libc/ports/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h @@ -1,5 +1,5 @@ /* bits/typesizes.h -- underlying types for *_t. Linux/Alpha version. - Copyright (C) 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 2002-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -61,6 +61,10 @@ #define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE #define __FSWORD_T_TYPE __S32_TYPE +/* Tell the libc code that off_t and off64_t are actually the same type + for all ABI purposes, even if possibly expressed as different base types + for C type-checking purposes. */ +#define __OFF_T_MATCHES_OFF64_T 1 /* Number of descriptors that can fit in an `fd_set'. */ #define __FD_SETSIZE 1024 diff --git a/libc/ports/sysdeps/unix/sysv/linux/alpha/configure b/libc/ports/sysdeps/unix/sysv/linux/alpha/configure index c7c4feeea..b5df524c1 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/alpha/configure +++ b/libc/ports/sysdeps/unix/sysv/linux/alpha/configure @@ -1,11 +1,5 @@ # This file is generated from configure.in by Autoconf. DO NOT EDIT! # Local configure fragment for sysdeps/unix/sysv/linux/alpha -# There are several bits that no longer compile cleanly without -# realtime signal support (ver 2.2.0). Given that we also now -# require TLS (ver 2.6.0), it seems pointless to fix them. -# ??? Surely this should now be the generic default. -arch_minimum_kernel=2.6.0 - # We did historically export the unwinder from glibc. libc_cv_gcc_unwind_find_fde=yes diff --git a/libc/ports/sysdeps/unix/sysv/linux/alpha/configure.in b/libc/ports/sysdeps/unix/sysv/linux/alpha/configure.in index 5a1af6207..a8b699665 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/alpha/configure.in +++ b/libc/ports/sysdeps/unix/sysv/linux/alpha/configure.in @@ -1,11 +1,5 @@ GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. # Local configure fragment for sysdeps/unix/sysv/linux/alpha -# There are several bits that no longer compile cleanly without -# realtime signal support (ver 2.2.0). Given that we also now -# require TLS (ver 2.6.0), it seems pointless to fix them. -# ??? Surely this should now be the generic default. -arch_minimum_kernel=2.6.0 - # We did historically export the unwinder from glibc. libc_cv_gcc_unwind_find_fde=yes diff --git a/libc/ports/sysdeps/unix/sysv/linux/alpha/fraiseexcpt.S b/libc/ports/sysdeps/unix/sysv/linux/alpha/fraiseexcpt.S new file mode 100644 index 000000000..6e770ad66 --- /dev/null +++ b/libc/ports/sysdeps/unix/sysv/linux/alpha/fraiseexcpt.S @@ -0,0 +1,56 @@ +/* Copyright (C) 2004-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + 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/>. */ + +#include <sysdep.h> +#include "kernel_sysinfo.h" + + + .text + +ENTRY(__feraiseexcept) + cfi_startproc + PSEUDO_PROLOGUE + + lda sp, -16(sp) + cfi_adjust_cfa_offset(16) + + ldi v0, __NR_osf_setsysinfo + stq a0, 0(sp) + mov sp, a1 + ldi a0, SSI_IEEE_RAISE_EXCEPTION + call_pal PAL_callsys + + lda sp, 16(sp) + cfi_adjust_cfa_offset(-16) + + /* Here in libm we can't use SYSCALL_ERROR_LABEL. Nor is it clear + that we'd want to set errno anyway. All we're required to do is + return non-zero on error. Which is exactly A3. */ + mov a3, v0 + ret + +END(__feraiseexcept) + cfi_endproc + +#include <shlib-compat.h> +#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2) +strong_alias (__feraiseexcept, __old_feraiseexcept) +compat_symbol (libm, __old_feraiseexcept, feraiseexcept, GLIBC_2_1); +#endif + +libm_hidden_ver (__feraiseexcept, feraiseexcept) +versioned_symbol (libm, __feraiseexcept, feraiseexcept, GLIBC_2_2); diff --git a/libc/ports/sysdeps/unix/sysv/linux/alpha/fraiseexcpt.c b/libc/ports/sysdeps/unix/sysv/linux/alpha/fraiseexcpt.c deleted file mode 100644 index a01b2cf11..000000000 --- a/libc/ports/sysdeps/unix/sysv/linux/alpha/fraiseexcpt.c +++ /dev/null @@ -1,91 +0,0 @@ -/* Copyright (C) 2004,2006 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - 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/>. */ - -#include <fenv_libc.h> -#include <sysdep.h> -#include <float.h> -#include <kernel-features.h> -#include "kernel_sysinfo.h" - - -int -__feraiseexcept (int excepts) -{ - INTERNAL_SYSCALL_DECL (err); - unsigned long t = excepts; - long r; - - r = INTERNAL_SYSCALL (osf_setsysinfo, err, 2, SSI_IEEE_RAISE_EXCEPTION, &t); - -#ifndef __ASSUME_IEEE_RAISE_EXCEPTION - if (!INTERNAL_SYSCALL_ERROR_P (r, err)) - return 0; - - double d; - - /* If we got an error from SSI_IEEE_RAISE_EXCEPTION, assume it means that - the system call isn't actually implemented. Do the best we can. */ - - /* Invalid implemented with 0 / 0 -> NaN. */ - if (excepts & FE_INVALID) - __asm__ __volatile__ ("divs/su $f31,$f31,%0; trapb" : "=f"(d) : ); - - /* Division By Zero implemented with 1 / 0 -> NaN. */ - if (excepts & FE_DIVBYZERO) - __asm__ __volatile__ ("divs/su %1,$f31,%0; trapb" : "=&f"(d) : "f"(1.0f)); - - /* Overflow and underflow cannot be had all by themselves. We can - generate them with arithmetic, but we always get INEXACT raised - at the same time. Prepare to undo. */ - if ((excepts & (FE_OVERFLOW | FE_UNDERFLOW)) && !(excepts & FE_INEXACT)) - INTERNAL_SYSCALL (osf_getsysinfo, err, 2, GSI_IEEE_FP_CONTROL, &t); - - /* Overflow implemented with FLT_MAX + FLT_MAX -> Inf. */ - if (excepts & FE_OVERFLOW) - __asm__ __volatile__ ("adds/sui %1,%1,%0; trapb" - : "=&f"(d) : "f"(FLT_MAX)); - - /* Underflow implemented with FLT_MIN * FLT_MIN -> 0. */ - if (excepts & FE_UNDERFLOW) - __asm__ __volatile__ ("muls/sui %1,%1,%0; trapb" - : "=&f"(d) : "f"(FLT_MIN)); - - /* Inexact implemented with (long)0.5 -> 0. */ - if ((excepts & (FE_OVERFLOW | FE_UNDERFLOW | FE_INEXACT)) == FE_INEXACT) - __asm__ __volatile__ ("cvttq/svi %1,%0; trapb" : "=&f"(d) : "f"(0.5f)); - - /* If we raised inexact when not asked, and inexact was not previously - raised, then clear that exception. */ - if ((excepts & (FE_OVERFLOW | FE_UNDERFLOW)) - && !((excepts | t) & FE_INEXACT)) - { - t |= excepts & SWCR_STATUS_MASK; - INTERNAL_SYSCALL (osf_setsysinfo, err, 2, SSI_IEEE_FP_CONTROL, &t); - } -#endif /* !__ASSUME_IEEE_RAISE_EXCEPTION */ - - return 0; -} - -#include <shlib-compat.h> -#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2) -strong_alias (__feraiseexcept, __old_feraiseexcept) -compat_symbol (libm, __old_feraiseexcept, feraiseexcept, GLIBC_2_1); -#endif - -libm_hidden_ver (__feraiseexcept, feraiseexcept) -versioned_symbol (libm, __feraiseexcept, feraiseexcept, GLIBC_2_2); diff --git a/libc/ports/sysdeps/unix/sysv/linux/alpha/fxstat.c b/libc/ports/sysdeps/unix/sysv/linux/alpha/fxstat.c index e53b2da13..5648142f4 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/alpha/fxstat.c +++ b/libc/ports/sysdeps/unix/sysv/linux/alpha/fxstat.c @@ -1,5 +1,5 @@ /* fxstat using old-style Unix stat system call. - Copyright (C) 2004 Free Software Foundation, Inc. + Copyright (C) 2004-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -37,7 +37,6 @@ __fxstat (int vers, int fd, struct stat *buf) int result; struct kernel_stat kbuf; -#if __ASSUME_STAT64_SYSCALL > 0 if (vers == _STAT_VER_KERNEL64) { result = INTERNAL_SYSCALL (fstat64, err, 2, fd, buf); @@ -46,22 +45,6 @@ __fxstat (int vers, int fd, struct stat *buf) __set_errno (INTERNAL_SYSCALL_ERRNO (result, err)); return -1; } -#elif defined __NR_fstat64 - if (vers == _STAT_VER_KERNEL64 && !__libc_missing_axp_stat64) - { - int errno_out; - result = INTERNAL_SYSCALL (fstat64, err, 2, fd, buf); - if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1)) - return result; - errno_out = INTERNAL_SYSCALL_ERRNO (result, err); - if (errno_out != ENOSYS) - { - __set_errno (errno_out); - return -1; - } - __libc_missing_axp_stat64 = 1; - } -#endif result = INTERNAL_SYSCALL (fstat, err, 2, fd, &kbuf); if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1)) diff --git a/libc/ports/sysdeps/unix/sysv/linux/alpha/fxstatat.c b/libc/ports/sysdeps/unix/sysv/linux/alpha/fxstatat.c index 417f9d3ea..bd20f86f2 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/alpha/fxstatat.c +++ b/libc/ports/sysdeps/unix/sysv/linux/alpha/fxstatat.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc. +/* Copyright (C) 2005-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -32,9 +32,6 @@ #ifdef __ASSUME_ATFCTS # define __have_atfcts 1 #endif -#ifdef __ASSUME_STAT64_SYSCALL -# define __libc_missing_axp_stat64 0 -#endif /* Get information about the file NAME in BUF. */ int @@ -99,38 +96,14 @@ __fxstatat (int vers, int fd, const char *file, struct stat *st, int flag) file = buf; } -#ifdef __NR_stat64 - if (!__libc_missing_axp_stat64) - { - if (flag & AT_SYMLINK_NOFOLLOW) - result = INTERNAL_SYSCALL (lstat64, err, 2, file, st); - else - result = INTERNAL_SYSCALL (stat64, err, 2, file, st); - - if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1)) - return result; - errno_out = INTERNAL_SYSCALL_ERRNO (result, err); -# if __ASSUME_STAT64_SYSCALL == 0 - if (errno_out == ENOSYS) - __libc_missing_axp_stat64 = 1; - else -# endif - goto fail; - } -#endif /* __NR_stat64 */ - - struct kernel_stat kst; - if (flag & AT_SYMLINK_NOFOLLOW) - result = INTERNAL_SYSCALL (lstat, err, 2, file, &kst); + result = INTERNAL_SYSCALL (lstat64, err, 2, file, st); else - result = INTERNAL_SYSCALL (stat, err, 2, file, &kst); - + result = INTERNAL_SYSCALL (stat64, err, 2, file, st); if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1)) - return __xstat_conv (vers, &kst, st); - errno_out = INTERNAL_SYSCALL_ERRNO (result, err); + return result; - fail: + errno_out = INTERNAL_SYSCALL_ERRNO (result, err); __atfct_seterrno (errno_out, fd, buf); return -1; diff --git a/libc/ports/sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S b/libc/ports/sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S index ec24297b0..74ad499f6 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S +++ b/libc/ports/sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1995, 1996, 2003, 2004 Free Software Foundation, Inc. +/* Copyright (C) 1993-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by David Mosberger <davidm@azstarnet.com>, 1995. @@ -22,39 +22,29 @@ .text -LEAF(__ieee_get_fp_control, 16) -#ifdef PROF - ldgp gp, 0(pv) - lda sp, -16(sp) - .set noat - lda AT, _mcount - jsr AT, (AT), _mcount - .set at - .prologue 1 -#elif defined PIC - lda sp, -16(sp) - .prologue 0 -#else - ldgp gp, 0(pv) +ENTRY(__ieee_get_fp_control) + cfi_startproc + PSEUDO_PROLOGUE + lda sp, -16(sp) - .prologue 1 -#endif + cfi_adjust_cfa_offset(16) mov sp, a1 ldi a0, GSI_IEEE_FP_CONTROL ldi v0, __NR_osf_getsysinfo call_pal PAL_callsys - bne a3, $error - ldq v0, 0(sp) + ldq t0, 0(sp) lda sp, 16(sp) - ret + cfi_adjust_cfa_offset(-16) -$error: - lda sp, 16(sp) - SYSCALL_ERROR_HANDLER + bne a3, SYSCALL_ERROR_LABEL + + mov t0, v0 + ret - END(__ieee_get_fp_control) +PSEUDO_END(__ieee_get_fp_control) + cfi_endproc libc_hidden_def(__ieee_get_fp_control) weak_alias (__ieee_get_fp_control, ieee_get_fp_control) diff --git a/libc/ports/sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S b/libc/ports/sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S index 1d425249d..f022b4260 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S +++ b/libc/ports/sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S @@ -1,5 +1,4 @@ -/* Copyright (C) 1993, 1995, 1996, 1997, 2003, 2004 - Free Software Foundation, Inc. +/* Copyright (C) 1993-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by David Mosberger <davidm@azstarnet.com>, 1995. @@ -21,40 +20,27 @@ #include "kernel_sysinfo.h" -LEAF(__ieee_set_fp_control, 16) -#ifdef PROF - ldgp gp, 0(pv) - lda sp, -16(sp) - .set noat - lda AT, _mcount - jsr AT, (AT), _mcount - .set at - .prologue 1 -#elif defined PIC - lda sp, -16(sp) - .prologue 0 -#else - ldgp gp, 0(pv) +ENTRY(__ieee_set_fp_control) + cfi_startproc + PSEUDO_PROLOGUE + lda sp, -16(sp) - .prologue 1 -#endif + cfi_adjust_cfa_offset(16) + ldi v0, __NR_osf_setsysinfo stq a0, 0(sp) mov sp, a1 ldi a0, SSI_IEEE_FP_CONTROL - ldi v0, __NR_osf_setsysinfo call_pal PAL_callsys - bne a3, $error - lda sp, 16(sp) - ret + cfi_adjust_cfa_offset(-16) -$error: - lda sp, 16(sp) - SYSCALL_ERROR_HANDLER + bne a3, SYSCALL_ERROR_LABEL + ret - END(__ieee_set_fp_control) +PSEUDO_END(__ieee_set_fp_control) + cfi_endproc libc_hidden_def(__ieee_set_fp_control) weak_alias (__ieee_set_fp_control, ieee_set_fp_control) diff --git a/libc/ports/sysdeps/unix/sysv/linux/alpha/kernel-features.h b/libc/ports/sysdeps/unix/sysv/linux/alpha/kernel-features.h index 3eaa422b1..ee349bc93 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/alpha/kernel-features.h +++ b/libc/ports/sysdeps/unix/sysv/linux/alpha/kernel-features.h @@ -20,24 +20,8 @@ #ifndef _KERNEL_FEATURES_H #define _KERNEL_FEATURES_H 1 -/* The tgkill syscall was introduced for alpha 2.6.0-test1 which unfortunately - cannot be distinguished from 2.6.0. */ -#if __LINUX_KERNEL_VERSION >= 132609 -# define __ASSUME_TGKILL 1 -#endif - -/* Starting with version 2.6.4, the stat64 syscalls are available. */ -#if __LINUX_KERNEL_VERSION >= 0x020604 && defined __alpha__ -# define __ASSUME_STAT64_SYSCALL 1 -#endif - #define __ASSUME_UTIMES 1 -/* Starting with version 2.6.9, SSI_IEEE_RAISE_EXCEPTION exists. */ -#if __LINUX_KERNEL_VERSION >= 0x020609 -# define __ASSUME_IEEE_RAISE_EXCEPTION 1 -#endif - /* Support for the O_CLOEXEC flag was added for alpha in 2.6.23. */ #if __LINUX_KERNEL_VERSION >= 0x020617 # define __ASSUME_O_CLOEXEC 1 diff --git a/libc/ports/sysdeps/unix/sysv/linux/alpha/lxstat.c b/libc/ports/sysdeps/unix/sysv/linux/alpha/lxstat.c index b0f1e8147..4401e6a03 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/alpha/lxstat.c +++ b/libc/ports/sysdeps/unix/sysv/linux/alpha/lxstat.c @@ -1,5 +1,5 @@ /* lxstat using old-style Unix stat system call. - Copyright (C) 2004 Free Software Foundation, Inc. + Copyright (C) 2004-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -37,7 +37,6 @@ __lxstat (int vers, const char *name, struct stat *buf) int result; struct kernel_stat kbuf; -#if __ASSUME_STAT64_SYSCALL > 0 if (vers == _STAT_VER_KERNEL64) { result = INTERNAL_SYSCALL (lstat64, err, 2, name, buf); @@ -46,22 +45,6 @@ __lxstat (int vers, const char *name, struct stat *buf) __set_errno (INTERNAL_SYSCALL_ERRNO (result, err)); return -1; } -#elif defined __NR_lstat64 - if (vers == _STAT_VER_KERNEL64 && !__libc_missing_axp_stat64) - { - int errno_out; - result = INTERNAL_SYSCALL (lstat64, err, 2, name, buf); - if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1)) - return result; - errno_out = INTERNAL_SYSCALL_ERRNO (result, err); - if (errno_out != ENOSYS) - { - __set_errno (errno_out); - return -1; - } - __libc_missing_axp_stat64 = 1; - } -#endif result = INTERNAL_SYSCALL (lstat, err, 2, name, &kbuf); if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1)) diff --git a/libc/ports/sysdeps/unix/sysv/linux/alpha/xstat.c b/libc/ports/sysdeps/unix/sysv/linux/alpha/xstat.c index a25431cfc..fe11e52d5 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/alpha/xstat.c +++ b/libc/ports/sysdeps/unix/sysv/linux/alpha/xstat.c @@ -1,5 +1,5 @@ /* xstat using old-style Unix stat system call. - Copyright (C) 2004 Free Software Foundation, Inc. + Copyright (C) 2004-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -37,7 +37,6 @@ __xstat (int vers, const char *name, struct stat *buf) int result; struct kernel_stat kbuf; -#if __ASSUME_STAT64_SYSCALL > 0 if (vers == _STAT_VER_KERNEL64) { result = INTERNAL_SYSCALL (stat64, err, 2, name, buf); @@ -46,22 +45,6 @@ __xstat (int vers, const char *name, struct stat *buf) __set_errno (INTERNAL_SYSCALL_ERRNO (result, err)); return -1; } -#elif defined __NR_stat64 - if (vers == _STAT_VER_KERNEL64 && !__libc_missing_axp_stat64) - { - int errno_out; - result = INTERNAL_SYSCALL (stat64, err, 2, name, buf); - if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1)) - return result; - errno_out = INTERNAL_SYSCALL_ERRNO (result, err); - if (errno_out != ENOSYS) - { - __set_errno (errno_out); - return -1; - } - __libc_missing_axp_stat64 = 1; - } -#endif result = INTERNAL_SYSCALL (stat, err, 2, name, &kbuf); if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1)) diff --git a/libc/ports/sysdeps/unix/sysv/linux/alpha/xstatconv.c b/libc/ports/sysdeps/unix/sysv/linux/alpha/xstatconv.c index d1dc64fed..2b27a2de0 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/alpha/xstatconv.c +++ b/libc/ports/sysdeps/unix/sysv/linux/alpha/xstatconv.c @@ -1,5 +1,5 @@ /* Convert between the kernel's `struct stat' format, and libc's. - Copyright (C) 1997, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 1997-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -23,13 +23,6 @@ #include <xstatconv.h> #include <sys/syscall.h> - -#ifdef __NR_stat64 -# if __ASSUME_STAT64_SYSCALL == 0 -int __libc_missing_axp_stat64; -# endif -#endif - int __xstat_conv (int vers, struct kernel_stat *kbuf, void *ubuf) { diff --git a/libc/ports/sysdeps/unix/sysv/linux/alpha/xstatconv.h b/libc/ports/sysdeps/unix/sysv/linux/alpha/xstatconv.h index ea4cbb027..e8754f9cf 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/alpha/xstatconv.h +++ b/libc/ports/sysdeps/unix/sysv/linux/alpha/xstatconv.h @@ -1,5 +1,5 @@ /* Convert between the kernel's `struct stat' format, and libc's. - Copyright (C) 2004, 2006 Free Software Foundation, Inc. + Copyright (C) 2004-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -19,10 +19,5 @@ #include <kernel-features.h> #include <sys/syscall.h> -#ifdef __NR_stat64 -# if __ASSUME_STAT64_SYSCALL == 0 -extern int __libc_missing_axp_stat64 attribute_hidden; -# endif -#endif extern int __xstat_conv (int vers, struct kernel_stat *kbuf, void *ubuf) attribute_hidden; diff --git a/libc/ports/sysdeps/unix/sysv/linux/am33/configure b/libc/ports/sysdeps/unix/sysv/linux/am33/configure index d4490122b..870c6a792 100755 --- a/libc/ports/sysdeps/unix/sysv/linux/am33/configure +++ b/libc/ports/sysdeps/unix/sysv/linux/am33/configure @@ -1,4 +1,4 @@ # This file is generated from configure.in by Autoconf. DO NOT EDIT! # Local configure fragment for am33/sysdeps/unix/sysv/linux/am33 -arch_minimum_kernel=2.4.0 +arch_minimum_kernel=2.6.25 diff --git a/libc/ports/sysdeps/unix/sysv/linux/am33/configure.in b/libc/ports/sysdeps/unix/sysv/linux/am33/configure.in index a94c370cf..43e33f74c 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/am33/configure.in +++ b/libc/ports/sysdeps/unix/sysv/linux/am33/configure.in @@ -1,4 +1,4 @@ GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. # Local configure fragment for am33/sysdeps/unix/sysv/linux/am33 -arch_minimum_kernel=2.4.0 +arch_minimum_kernel=2.6.25 diff --git a/libc/ports/sysdeps/unix/sysv/linux/am33/getrlimit.c b/libc/ports/sysdeps/unix/sysv/linux/am33/getrlimit.c deleted file mode 100644 index fc06dbd64..000000000 --- a/libc/ports/sysdeps/unix/sysv/linux/am33/getrlimit.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/getrlimit.c> diff --git a/libc/ports/sysdeps/hppa/nptl/pthread_spin_trylock.c b/libc/ports/sysdeps/unix/sysv/linux/arm/arm-features.h index a80286101..f20a70556 100644 --- a/libc/ports/sysdeps/hppa/nptl/pthread_spin_trylock.c +++ b/libc/ports/sysdeps/unix/sysv/linux/arm/arm-features.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2005 Free Software Foundation, Inc. +/* Macros to test for CPU features on ARM. Linux version. + Copyright (C) 2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -15,19 +16,15 @@ License along with the GNU C Library. If not, see <http://www.gnu.org/licenses/>. */ -#include <errno.h> -#include <atomic.h> -#include "pthreadP.h" +#ifndef _LINUX_ARM_FEATURES_H +#define _LINUX_ARM_FEATURES_H 1 -int -pthread_spin_trylock (pthread_spinlock_t *lock) -{ -#if 0 - volatile unsigned int *a = __ldcw_align (lock); +#ifndef __ASSEMBLER__ +# include <ldsodefs.h> - return __ldcw (a) ? 0 : EBUSY; +# define ARM_HAVE_VFP (GLRO (dl_hwcap) & HWCAP_ARM_VFP) #endif - return atomic_compare_and_exchange_val_acq(lock, 1, 0) ? EBUSY : 0; +#include_next <arm-features.h> -} +#endif /* arm-features.h */ diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/bits/atomic.h b/libc/ports/sysdeps/unix/sysv/linux/arm/bits/atomic.h index 4e810a28d..337415386 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/bits/atomic.h +++ b/libc/ports/sysdeps/unix/sysv/linux/arm/bits/atomic.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. +/* Atomic operations. ARM/Linux version. + Copyright (C) 2002-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -15,41 +16,17 @@ License along with the GNU C Library. If not, see <http://www.gnu.org/licenses/>. */ -#include <stdint.h> -#include <sysdep.h> - - -typedef int8_t atomic8_t; -typedef uint8_t uatomic8_t; -typedef int_fast8_t atomic_fast8_t; -typedef uint_fast8_t uatomic_fast8_t; - -typedef int32_t atomic32_t; -typedef uint32_t uatomic32_t; -typedef int_fast32_t atomic_fast32_t; -typedef uint_fast32_t uatomic_fast32_t; - -typedef intptr_t atomicptr_t; -typedef uintptr_t uatomicptr_t; -typedef intmax_t atomic_max_t; -typedef uintmax_t uatomic_max_t; - -void __arm_link_error (void); - -/* Use the atomic builtins provided by GCC in case the backend provides - a pattern to do this efficiently. */ - -#ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 -#define atomic_full_barrier() __sync_synchronize () -#elif defined __thumb2__ -#define atomic_full_barrier() \ +/* If the compiler doesn't provide a primitive, we'll use this macro + to get assistance from the kernel. */ +#ifdef __thumb2__ +# define __arm_assisted_full_barrier() \ __asm__ __volatile__ \ ("movw\tip, #0x0fa0\n\t" \ "movt\tip, #0xffff\n\t" \ "blx\tip" \ : : : "ip", "lr", "cc", "memory"); #else -#define atomic_full_barrier() \ +# define __arm_assisted_full_barrier() \ __asm__ __volatile__ \ ("mov\tip, #0xffff0fff\n\t" \ "mov\tlr, pc\n\t" \ @@ -60,31 +37,28 @@ void __arm_link_error (void); /* Atomic compare and exchange. This sequence relies on the kernel to provide a compare and exchange operation which is atomic on the current architecture, either via cleverness on pre-ARMv6 or via - ldrex / strex on ARMv6. */ - -#define __arch_compare_and_exchange_val_8_acq(mem, newval, oldval) \ - ({ __arm_link_error (); oldval; }) - -#define __arch_compare_and_exchange_val_16_acq(mem, newval, oldval) \ - ({ __arm_link_error (); oldval; }) + ldrex / strex on ARMv6. -#ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 -#define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \ - __sync_val_compare_and_swap ((mem), (oldval), (newval)) - -/* It doesn't matter what register is used for a_oldval2, but we must + It doesn't matter what register is used for a_oldval2, but we must specify one to work around GCC PR rtl-optimization/21223. Otherwise - it may cause a_oldval or a_tmp to be moved to a different register. */ - -#elif defined __thumb2__ + it may cause a_oldval or a_tmp to be moved to a different register. + + We use the union trick rather than simply using __typeof (...) in the + declarations of A_OLDVAL et al because when NEWVAL or OLDVAL is of the + form *PTR and PTR has a 'volatile ... *' type, then __typeof (*PTR) has + a 'volatile ...' type and this triggers -Wvolatile-register-var to + complain about 'register volatile ... asm ("reg")'. */ +#ifdef __thumb2__ /* Thumb-2 has ldrex/strex. However it does not have barrier instructions, so we still need to use the kernel helper. */ -#define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \ - ({ register __typeof (oldval) a_oldval asm ("r0"); \ - register __typeof (oldval) a_newval asm ("r1") = (newval); \ +# define __arm_assisted_compare_and_exchange_val_32_acq(mem, newval, oldval) \ + ({ union { __typeof (oldval) a; uint32_t v; } oldval_arg = { .a = (oldval) };\ + union { __typeof (newval) a; uint32_t v; } newval_arg = { .a = (newval) };\ + register uint32_t a_oldval asm ("r0"); \ + register uint32_t a_newval asm ("r1") = newval_arg.v; \ register __typeof (mem) a_ptr asm ("r2") = (mem); \ - register __typeof (oldval) a_tmp asm ("r3"); \ - register __typeof (oldval) a_oldval2 asm ("r4") = (oldval); \ + register uint32_t a_tmp asm ("r3"); \ + register uint32_t a_oldval2 asm ("r4") = oldval_arg.v; \ __asm__ __volatile__ \ ("0:\tldr\t%[tmp],[%[ptr]]\n\t" \ "cmp\t%[tmp], %[old2]\n\t" \ @@ -100,14 +74,16 @@ void __arm_link_error (void); : [new] "r" (a_newval), [ptr] "r" (a_ptr), \ [old2] "r" (a_oldval2) \ : "ip", "lr", "cc", "memory"); \ - a_tmp; }) + (__typeof (oldval)) a_tmp; }) #else -#define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \ - ({ register __typeof (oldval) a_oldval asm ("r0"); \ - register __typeof (oldval) a_newval asm ("r1") = (newval); \ +# define __arm_assisted_compare_and_exchange_val_32_acq(mem, newval, oldval) \ + ({ union { __typeof (oldval) a; uint32_t v; } oldval_arg = { .a = (oldval) };\ + union { __typeof (newval) a; uint32_t v; } newval_arg = { .a = (newval) };\ + register uint32_t a_oldval asm ("r0"); \ + register uint32_t a_newval asm ("r1") = newval_arg.v; \ register __typeof (mem) a_ptr asm ("r2") = (mem); \ - register __typeof (oldval) a_tmp asm ("r3"); \ - register __typeof (oldval) a_oldval2 asm ("r4") = (oldval); \ + register uint32_t a_tmp asm ("r3"); \ + register uint32_t a_oldval2 asm ("r4") = oldval_arg.v; \ __asm__ __volatile__ \ ("0:\tldr\t%[tmp],[%[ptr]]\n\t" \ "cmp\t%[tmp], %[old2]\n\t" \ @@ -123,8 +99,7 @@ void __arm_link_error (void); : [new] "r" (a_newval), [ptr] "r" (a_ptr), \ [old2] "r" (a_oldval2) \ : "ip", "lr", "cc", "memory"); \ - a_tmp; }) + (__typeof (oldval)) a_tmp; }) #endif -#define __arch_compare_and_exchange_val_64_acq(mem, newval, oldval) \ - ({ __arm_link_error (); oldval; }) +#include <sysdeps/arm/bits/atomic.h> diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/configure b/libc/ports/sysdeps/unix/sysv/linux/arm/configure index 5b5f4c993..cb94cc5eb 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/arm/configure +++ b/libc/ports/sysdeps/unix/sysv/linux/arm/configure @@ -1,6 +1,5 @@ # This file is generated from configure.in by Autoconf. DO NOT EDIT! # Local configure fragment for sysdeps/unix/sysv/linux/arm. -arch_minimum_kernel=2.6.16 libc_cv_gcc_unwind_find_fde=no CFLAGS=${CFLAGS% -fno-unwind-tables} diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/configure.in b/libc/ports/sysdeps/unix/sysv/linux/arm/configure.in index b57c4e37b..3e67dee42 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/arm/configure.in +++ b/libc/ports/sysdeps/unix/sysv/linux/arm/configure.in @@ -1,6 +1,5 @@ GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. # Local configure fragment for sysdeps/unix/sysv/linux/arm. -arch_minimum_kernel=2.6.16 libc_cv_gcc_unwind_find_fde=no CFLAGS=${CFLAGS% -fno-unwind-tables} diff --git a/libc/ports/sysdeps/mips/nptl/pthread_spin_trylock.S b/libc/ports/sysdeps/unix/sysv/linux/arm/dl-machine.h index 95b55c3d4..68e8be9e6 100644 --- a/libc/ports/sysdeps/mips/nptl/pthread_spin_trylock.S +++ b/libc/ports/sysdeps/unix/sysv/linux/arm/dl-machine.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2005 Free Software Foundation, Inc. +/* Machine-dependent ELF dynamic relocation inline functions. ARM/Linux version + Copyright (C) 1995-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -15,26 +16,15 @@ License along with the GNU C Library. If not, see <http://www.gnu.org/licenses/>. */ -#include <sys/asm.h> -#include <sysdep.h> -#define _ERRNO_H 1 -#include <bits/errno.h> -#include <sgidefs.h> +#ifndef dl_machine_h + +/* This definition is Linux-specific. */ +#define CLEAR_CACHE(BEG,END) \ + INTERNAL_SYSCALL_ARM (cacheflush, , 3, (BEG), (END), 0) -ENTRY (pthread_spin_trylock) - .set push -#if _MIPS_SIM == _ABIO32 - .set mips2 #endif - ll a2, 0(a0) - li a1, 1 - bnez a2, 1f - sc a1, 0(a0) - beqz a1, 1f - MIPS_SYNC - .set pop - li v0, 0 - ret -1: li v0, EBUSY - ret -PSEUDO_END (pthread_spin_trylock) + +/* The rest is just machine-specific. + This #include is outside the #ifndef because the parts of + dl-machine.h used only by dynamic-link.h are outside the guard. */ +#include <sysdeps/arm/dl-machine.h> diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/getcontext.S b/libc/ports/sysdeps/unix/sysv/linux/arm/getcontext.S index 116d6e8f3..2281c9eff 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/arm/getcontext.S +++ b/libc/ports/sysdeps/unix/sysv/linux/arm/getcontext.S @@ -41,54 +41,56 @@ ENTRY(__getcontext) /* Save ucontext_t * across the next call. */ mov r4, r0 - + /* __sigprocmask(SIG_BLOCK, NULL, &(ucontext->uc_sigmask)) */ mov r0, #SIG_BLOCK mov r1, #0 add r2, r4, #UCONTEXT_SIGMASK bl PLTJMP(__sigprocmask) - + /* Store FP regs. Much of the FP code is copied from arm/setjmp.S. */ #ifdef PIC - ldr r2, 1f - ldr r1, Lrtld_global_ro + ldr r2, 1f + ldr r1, .Lrtld_global_ro 0: add r2, pc, r2 - ldr r2, [r2, r1] - ldr r2, [r2, #RTLD_GLOBAL_RO_DL_HWCAP_OFFSET] + ldr r2, [r2, r1] + ldr r2, [r2, #RTLD_GLOBAL_RO_DL_HWCAP_OFFSET] #else - ldr r2, Lhwcap - ldr r2, [r2, #0] + ldr r2, .Lhwcap + ldr r2, [r2, #0] #endif add r0, r4, #UCONTEXT_REGSPACE - tst r2, #HWCAP_ARM_VFP - beq Lno_vfp - - /* Store the VFP registers. - Don't use VFP instructions directly because this code - is used in non-VFP multilibs. */ - /* Following instruction is vstmia r0!, {d8-d15}. */ - stc p11, cr8, [r0], #64 - /* Store the floating-point status register. */ - /* Following instruction is vmrs r1, fpscr. */ - mrc p10, 7, r1, cr1, cr0, 0 - str r1, [r0], #4 -Lno_vfp: - - tst r2, #HWCAP_ARM_IWMMXT - beq Lno_iwmmxt - - /* Save the call-preserved iWMMXt registers. */ - /* Following instructions are wstrd wr10, [r0], #8 (etc.) */ - stcl p1, cr10, [r0], #8 - stcl p1, cr11, [r0], #8 - stcl p1, cr12, [r0], #8 - stcl p1, cr13, [r0], #8 - stcl p1, cr14, [r0], #8 - stcl p1, cr15, [r0], #8 -Lno_iwmmxt: +#ifdef __SOFTFP__ + tst r2, #HWCAP_ARM_VFP + beq .Lno_vfp +#endif + + /* Store the VFP registers. + Don't use VFP instructions directly because this code + is used in non-VFP multilibs. */ + /* Following instruction is vstmia r0!, {d8-d15}. */ + stc p11, cr8, [r0], #64 + /* Store the floating-point status register. */ + /* Following instruction is vmrs r1, fpscr. */ + mrc p10, 7, r1, cr1, cr0, 0 + str r1, [r0], #4 +.Lno_vfp: + + tst r2, #HWCAP_ARM_IWMMXT + beq .Lno_iwmmxt + + /* Save the call-preserved iWMMXt registers. */ + /* Following instructions are wstrd wr10, [r0], #8 (etc.) */ + stcl p1, cr10, [r0], #8 + stcl p1, cr11, [r0], #8 + stcl p1, cr12, [r0], #8 + stcl p1, cr13, [r0], #8 + stcl p1, cr14, [r0], #8 + stcl p1, cr15, [r0], #8 +.Lno_iwmmxt: /* Restore the clobbered R4 and LR. */ ldr r14, [r4, #MCONTEXT_ARM_LR] @@ -102,11 +104,11 @@ END(__getcontext) #ifdef PIC 1: .long _GLOBAL_OFFSET_TABLE_ - 0b - 8 -Lrtld_global_ro: - .long C_SYMBOL_NAME(_rtld_global_ro)(GOT) +.Lrtld_global_ro: + .long C_SYMBOL_NAME(_rtld_global_ro)(GOT) #else -Lhwcap: - .long C_SYMBOL_NAME(_dl_hwcap) +.Lhwcap: + .long C_SYMBOL_NAME(_dl_hwcap) #endif diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/getrlimit.c b/libc/ports/sysdeps/unix/sysv/linux/arm/getrlimit.c deleted file mode 100644 index fc06dbd64..000000000 --- a/libc/ports/sysdeps/unix/sysv/linux/arm/getrlimit.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/getrlimit.c> diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/kernel-features.h b/libc/ports/sysdeps/unix/sysv/linux/arm/kernel-features.h index 9092df719..b003b17b0 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/arm/kernel-features.h +++ b/libc/ports/sysdeps/unix/sysv/linux/arm/kernel-features.h @@ -18,21 +18,13 @@ <http://www.gnu.org/licenses/>. */ /* The utimes syscall was added before 2.6.1. */ -#if __LINUX_KERNEL_VERSION >= 132609 -# define __ASSUME_UTIMES 1 -#endif +#define __ASSUME_UTIMES 1 /* On ARM the mmap2/stat64/lstat64/fstat64 syscalls were introduced in 2.3.35. */ #define __ASSUME_MMAP2_SYSCALL 1 #define __ASSUME_STAT64_SYSCALL 1 -/* Arm got fcntl64 in 2.4.4. */ -#define __ASSUME_FCNTL64 1 - -/* The vfork syscall on arm was definitely available in 2.4. */ -#define __ASSUME_VFORK_SYSCALL 1 - /* The signal frame layout changed in 2.6.18. */ #if __LINUX_KERNEL_VERSION >= 132626 # define __ASSUME_SIGFRAME_V2 1 diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/setcontext.S b/libc/ports/sysdeps/unix/sysv/linux/arm/setcontext.S index d163fc4a4..64367704b 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/arm/setcontext.S +++ b/libc/ports/sysdeps/unix/sysv/linux/arm/setcontext.S @@ -29,40 +29,42 @@ ENTRY(__setcontext) mov r4, r0 add r0, r0, #UCONTEXT_REGSPACE - /* Restore the VFP registers. Copied from arm/__longjmp.S. */ + /* Restore the VFP registers. Copied from arm/__longjmp.S. */ #ifdef PIC - ldr r2, 1f - ldr r1, Lrtld_global_ro + ldr r2, 1f + ldr r1, .Lrtld_global_ro 0: add r2, pc, r2 - ldr r2, [r2, r1] - ldr r2, [r2, #RTLD_GLOBAL_RO_DL_HWCAP_OFFSET] + ldr r2, [r2, r1] + ldr r2, [r2, #RTLD_GLOBAL_RO_DL_HWCAP_OFFSET] #else - ldr r2, Lhwcap - ldr r2, [r2, #0] + ldr r2, .Lhwcap + ldr r2, [r2, #0] #endif - tst r2, #HWCAP_ARM_VFP - beq Lno_vfp_sc - - /* Following instruction is vldmia r0!, {d8-d15}. */ - ldc p11, cr8, [r0], #64 - /* Restore the floating-point status register. */ - ldr r1, [r0], #4 - /* Following instruction is fmxr fpscr, r1. */ - mcr p10, 7, r1, cr1, cr0, 0 -Lno_vfp_sc: - tst r2, #HWCAP_ARM_IWMMXT - beq Lno_iwmmxt_sc - - /* Restore the call-preserved iWMMXt registers. */ - /* Following instructions are wldrd wr10, [r0], #8 (etc.) */ - ldcl p1, cr10, [r0], #8 - ldcl p1, cr11, [r0], #8 - ldcl p1, cr12, [r0], #8 - ldcl p1, cr13, [r0], #8 - ldcl p1, cr14, [r0], #8 - ldcl p1, cr15, [r0], #8 -Lno_iwmmxt_sc: +#ifdef __SOFTFP__ + tst r2, #HWCAP_ARM_VFP + beq .Lno_vfp_sc +#endif + + /* Following instruction is vldmia r0!, {d8-d15}. */ + ldc p11, cr8, [r0], #64 + /* Restore the floating-point status register. */ + ldr r1, [r0], #4 + /* Following instruction is fmxr fpscr, r1. */ + mcr p10, 7, r1, cr1, cr0, 0 +.Lno_vfp_sc: + tst r2, #HWCAP_ARM_IWMMXT + beq .Lno_iwmmxt_sc + + /* Restore the call-preserved iWMMXt registers. */ + /* Following instructions are wldrd wr10, [r0], #8 (etc.) */ + ldcl p1, cr10, [r0], #8 + ldcl p1, cr11, [r0], #8 + ldcl p1, cr12, [r0], #8 + ldcl p1, cr13, [r0], #8 + ldcl p1, cr14, [r0], #8 + ldcl p1, cr15, [r0], #8 +.Lno_iwmmxt_sc: /* Now bring back the signal status. */ mov r0, #SIG_SETMASK @@ -70,12 +72,12 @@ Lno_iwmmxt_sc: mov r2, #0 bl PLTJMP(__sigprocmask) - /* Loading r0-r3 makes makecontext easier. */ - add r14, r4, #MCONTEXT_ARM_R0 - ldmia r14, {r0-r12} - ldr r13, [r14, #(MCONTEXT_ARM_SP - MCONTEXT_ARM_R0)] - add r14, r14, #(MCONTEXT_ARM_LR - MCONTEXT_ARM_R0) - ldmia r14, {r14, pc} + /* Loading r0-r3 makes makecontext easier. */ + add r14, r4, #MCONTEXT_ARM_R0 + ldmia r14, {r0-r12} + ldr r13, [r14, #(MCONTEXT_ARM_SP - MCONTEXT_ARM_R0)] + add r14, r14, #(MCONTEXT_ARM_LR - MCONTEXT_ARM_R0) + ldmia r14, {r14, pc} END(setcontext) weak_alias(__setcontext, setcontext) @@ -83,19 +85,18 @@ weak_alias(__setcontext, setcontext) /* Called when a makecontext() context returns. Start the context in R4 or fall through to exit(). */ ENTRY(__startcontext) - movs r0, r4 - bne PLTJMP(__setcontext) + movs r0, r4 + bne PLTJMP(__setcontext) - @ New context was 0 - exit - b PLTJMP(HIDDEN_JUMPTARGET(_exit)) + @ New context was 0 - exit + b PLTJMP(HIDDEN_JUMPTARGET(_exit)) END(__startcontext) #ifdef PIC 1: .long _GLOBAL_OFFSET_TABLE_ - 0b - 8 -Lrtld_global_ro: - .long C_SYMBOL_NAME(_rtld_global_ro)(GOT) +.Lrtld_global_ro: + .long C_SYMBOL_NAME(_rtld_global_ro)(GOT) #else -Lhwcap: - .long C_SYMBOL_NAME(_dl_hwcap) +.Lhwcap: + .long C_SYMBOL_NAME(_dl_hwcap) #endif - diff --git a/libc/ports/sysdeps/unix/sysv/linux/generic/bits/typesizes.h b/libc/ports/sysdeps/unix/sysv/linux/generic/bits/typesizes.h index 948edeb96..d7d2a5c10 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/generic/bits/typesizes.h +++ b/libc/ports/sysdeps/unix/sysv/linux/generic/bits/typesizes.h @@ -62,6 +62,16 @@ #define __SYSCALL_SLONG_TYPE __SLONGWORD_TYPE #define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE +#ifdef __LP64__ +/* Tell the libc code that off_t and off64_t are actually the same type + for all ABI purposes, even if possibly expressed as different base types + for C type-checking purposes. */ +# define __OFF_T_MATCHES_OFF64_T 1 + +/* Same for ino_t and ino64_t. */ +# define __INO_T_MATCHES_INO64_T 1 +#endif + /* Number of descriptors that can fit in an `fd_set'. */ #define __FD_SETSIZE 1024 diff --git a/libc/ports/sysdeps/unix/sysv/linux/hppa/Versions b/libc/ports/sysdeps/unix/sysv/linux/hppa/Versions index 3bff6ec4f..1e2e320c0 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/hppa/Versions +++ b/libc/ports/sysdeps/unix/sysv/linux/hppa/Versions @@ -27,6 +27,9 @@ libc { #errlist-compat 257 _sys_errlist; sys_errlist; _sys_nerr; sys_nerr; } + GLIBC_2.17 { + prlimit64; + } } librt { GLIBC_2.3 { diff --git a/libc/ports/sysdeps/unix/sysv/linux/hppa/kernel-features.h b/libc/ports/sysdeps/unix/sysv/linux/hppa/kernel-features.h index 8dcdfbfab..49ba55f7c 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/hppa/kernel-features.h +++ b/libc/ports/sysdeps/unix/sysv/linux/hppa/kernel-features.h @@ -1,6 +1,6 @@ /* Set flags signalling availability of kernel features based on given kernel version number. - Copyright (C) 2006 Free Software Foundation, Inc. + Copyright (C) 2006-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -27,12 +27,9 @@ #define __ASSUME_STAT64_SYSCALL 1 #define __ASSUME_IPC64 1 #define __ASSUME_ST_INO_64_BIT 1 -#define __ASSUME_FCNTL64 1 #define __ASSUME_GETDENTS64_SYSCALL 1 /* PA-RISC 2.6.9 kernels had the first LWS CAS support */ -#if __LINUX_KERNEL_VERSION >= 0x020609 -# define __ASSUME_LWS_CAS 1 -#endif +#define __ASSUME_LWS_CAS 1 #include_next <kernel-features.h> diff --git a/libc/ports/sysdeps/unix/sysv/linux/hppa/nptl/configure b/libc/ports/sysdeps/unix/sysv/linux/hppa/nptl/configure deleted file mode 100644 index a418c5469..000000000 --- a/libc/ports/sysdeps/unix/sysv/linux/hppa/nptl/configure +++ /dev/null @@ -1,5 +0,0 @@ -# This file is generated from configure.in by Autoconf. DO NOT EDIT! - # Local configure fragment for sysdeps/unix/sysv/linux/hppa/nptl. - -# Needed for LWS CAS -arch_minimum_kernel=2.6.9 diff --git a/libc/ports/sysdeps/unix/sysv/linux/hppa/nptl/configure.in b/libc/ports/sysdeps/unix/sysv/linux/hppa/nptl/configure.in deleted file mode 100644 index 1c7102e26..000000000 --- a/libc/ports/sysdeps/unix/sysv/linux/hppa/nptl/configure.in +++ /dev/null @@ -1,5 +0,0 @@ -GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. -# Local configure fragment for sysdeps/unix/sysv/linux/hppa/nptl. - -# Needed for LWS CAS -arch_minimum_kernel=2.6.9 diff --git a/libc/ports/sysdeps/unix/sysv/linux/hppa/syscalls.list b/libc/ports/sysdeps/unix/sysv/linux/hppa/syscalls.list index 0f7537c30..78e6568b7 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/hppa/syscalls.list +++ b/libc/ports/sysdeps/unix/sysv/linux/hppa/syscalls.list @@ -35,3 +35,4 @@ socketpair - socketpair i:iiif __socketpair socketpair setrlimit - setrlimit i:ip __setrlimit setrlimit getrlimit - getrlimit i:ip __getrlimit getrlimit +prlimit64 EXTRA prlimit64 i:iipp prlimit64 prlimit64@@GLIBC_2.17 diff --git a/libc/ports/sysdeps/unix/sysv/linux/ia64/configure b/libc/ports/sysdeps/unix/sysv/linux/ia64/configure index 3d025f9dd..71323718a 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/ia64/configure +++ b/libc/ports/sysdeps/unix/sysv/linux/ia64/configure @@ -1,10 +1,4 @@ # This file is generated from configure.in by Autoconf. DO NOT EDIT! # Local configure fragment for sysdeps/unix/sysv/linux/ia64 -# There are several bits that no longer compile cleanly without -# realtime signal support (ver 2.2.0). Given that we also now -# require TLS (ver 2.6.0), it seems pointless to fix them. -# ??? Surely this should now be the generic default. -arch_minimum_kernel=2.6.0 - ldd_rewrite_script=$dir/ldd-rewrite.sed diff --git a/libc/ports/sysdeps/unix/sysv/linux/ia64/configure.in b/libc/ports/sysdeps/unix/sysv/linux/ia64/configure.in index 99057b8bd..4fb564721 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/ia64/configure.in +++ b/libc/ports/sysdeps/unix/sysv/linux/ia64/configure.in @@ -1,10 +1,4 @@ GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. # Local configure fragment for sysdeps/unix/sysv/linux/ia64 -# There are several bits that no longer compile cleanly without -# realtime signal support (ver 2.2.0). Given that we also now -# require TLS (ver 2.6.0), it seems pointless to fix them. -# ??? Surely this should now be the generic default. -arch_minimum_kernel=2.6.0 - ldd_rewrite_script=$dir/ldd-rewrite.sed diff --git a/libc/ports/sysdeps/unix/sysv/linux/ia64/kernel-features.h b/libc/ports/sysdeps/unix/sysv/linux/ia64/kernel-features.h index f8dc4812c..bd3e37777 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/ia64/kernel-features.h +++ b/libc/ports/sysdeps/unix/sysv/linux/ia64/kernel-features.h @@ -20,12 +20,6 @@ #ifndef _KERNEL_FEATURES_H #define _KERNEL_FEATURES_H 1 -/* The late 2.5 kernels saw a lot of new CLONE_* flags. Summarize - their availability with one define. */ -#if __LINUX_KERNEL_VERSION >= 132416 -# define __ASSUME_CLONE_THREAD_FLAGS 1 -#endif - /* The utimes syscall has been available for some architectures forever. */ #define __ASSUME_UTIMES 1 diff --git a/libc/ports/sysdeps/unix/sysv/linux/ia64/nptl/dl-sysdep.h b/libc/ports/sysdeps/unix/sysv/linux/ia64/nptl/dl-sysdep.h index e30e33d2b..0962129b1 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/ia64/nptl/dl-sysdep.h +++ b/libc/ports/sysdeps/unix/sysv/linux/ia64/nptl/dl-sysdep.h @@ -1,5 +1,5 @@ /* System-specific settings for dynamic linker code. IA-64 version. - Copyright (C) 2003, 2004, 2006, 2008 Free Software Foundation, Inc. + Copyright (C) 2003-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -65,9 +65,7 @@ extern int _dl_sysinfo_break attribute_hidden; #define DL_ARGV_NOT_RELRO 1 -/* The _dl_discover_osversion function is so far only needed in sysconf - to check for kernels later than 2.6.23. */ -#if !defined __ASSEMBLER__ && __LINUX_KERNEL_VERSION < 0x020617 +#ifndef __ASSEMBLER__ /* Get version of the OS. */ extern int _dl_discover_osversion (void) attribute_hidden; # define HAVE_DL_DISCOVER_OSVERSION 1 diff --git a/libc/ports/sysdeps/unix/sysv/linux/ia64/system.c b/libc/ports/sysdeps/unix/sysv/linux/ia64/system.c index f02a99e9e..6970a1f89 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/ia64/system.c +++ b/libc/ports/sysdeps/unix/sysv/linux/ia64/system.c @@ -25,10 +25,8 @@ return. It might still be in the kernel when the cancellation request comes. Therefore we have to use the clone() calls ability to have the kernel write the PID into the user-level variable. */ -#ifdef __ASSUME_CLONE_THREAD_FLAGS -# define FORK() \ +#define FORK() \ INLINE_SYSCALL (clone2, 6, CLONE_PARENT_SETTID | SIGCHLD, NULL, 0, \ &pid, NULL, NULL) -#endif #include <sysdeps/unix/sysv/linux/system.c> diff --git a/libc/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/bits/atomic.h b/libc/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/bits/atomic.h index b088a7247..23ef447ff 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/bits/atomic.h +++ b/libc/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/bits/atomic.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2010 Free Software Foundation, Inc. +/* Copyright (C) 2010-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010. @@ -42,8 +42,8 @@ typedef uintmax_t uatomic_max_t; #ifdef SHARED # define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \ ({ \ - /* Use temporary variables to workaround call-clobberness of */ \ - /* the registers. */ \ + /* Use temporary variables to workaround call-clobberness of \ + the registers. */ \ __typeof (mem) _mem = mem; \ __typeof (oldval) _oldval = oldval; \ __typeof (newval) _newval = newval; \ @@ -65,13 +65,13 @@ typedef uintmax_t uatomic_max_t; #else # define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \ ({ \ - /* Use temporary variables to workaround call-clobberness of */ \ - /* the registers. */ \ + /* Use temporary variables to workaround call-clobberness of \ + the registers. */ \ __typeof (mem) _mem = mem; \ __typeof (oldval) _oldval = oldval; \ __typeof (newval) _newval = newval; \ register __typeof (oldval) _d0 asm ("d0") \ - = SYS_ify (atomic_cmpxchg_32); \ + = (__typeof (oldval)) SYS_ify (atomic_cmpxchg_32); \ register __typeof (mem) _a0 asm ("a0") = _mem; \ register __typeof (oldval) _d2 asm ("d2") = _oldval; \ register __typeof (newval) _d1 asm ("d1") = _newval; \ diff --git a/libc/ports/sysdeps/unix/sysv/linux/m68k/configure b/libc/ports/sysdeps/unix/sysv/linux/m68k/configure index a2fd83332..a704dacee 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/m68k/configure +++ b/libc/ports/sysdeps/unix/sysv/linux/m68k/configure @@ -1,7 +1,6 @@ # This file is generated from configure.in by Autoconf. DO NOT EDIT! case $machine in m68k/coldfire) - arch_minimum_kernel=2.6.10 ;; *) libc_cv_gcc_unwind_find_fde=yes diff --git a/libc/ports/sysdeps/unix/sysv/linux/m68k/configure.in b/libc/ports/sysdeps/unix/sysv/linux/m68k/configure.in index 6e91ef96f..c21ca9dd4 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/m68k/configure.in +++ b/libc/ports/sysdeps/unix/sysv/linux/m68k/configure.in @@ -2,7 +2,6 @@ sinclude(./aclocal.m4)dnl Autoconf lossage GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. case $machine in m68k/coldfire) - arch_minimum_kernel=2.6.10 ;; *) libc_cv_gcc_unwind_find_fde=yes diff --git a/libc/ports/sysdeps/unix/sysv/linux/m68k/getrlimit.c b/libc/ports/sysdeps/unix/sysv/linux/m68k/getrlimit.c deleted file mode 100644 index fc06dbd64..000000000 --- a/libc/ports/sysdeps/unix/sysv/linux/m68k/getrlimit.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/getrlimit.c> diff --git a/libc/ports/sysdeps/unix/sysv/linux/m68k/kernel-features.h b/libc/ports/sysdeps/unix/sysv/linux/m68k/kernel-features.h index 6fb37a616..5c68d7f1c 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/m68k/kernel-features.h +++ b/libc/ports/sysdeps/unix/sysv/linux/m68k/kernel-features.h @@ -20,15 +20,10 @@ /* These features were surely available with 2.4.12. */ #define __ASSUME_MMAP2_SYSCALL 1 #define __ASSUME_STAT64_SYSCALL 1 -#define __ASSUME_FCNTL64 1 -#define __ASSUME_VFORK_SYSCALL 1 /* Many syscalls were added in 2.6.10 for m68k. */ -#if __LINUX_KERNEL_VERSION >= 132618 -# define __ASSUME_TGKILL 1 -# define __ASSUME_UTIMES 1 -# define __ASSUME_FADVISE64_64_SYSCALL 1 -#endif +#define __ASSUME_UTIMES 1 +#define __ASSUME_FADVISE64_64_SYSCALL 1 #include_next <kernel-features.h> diff --git a/libc/ports/sysdeps/unix/sysv/linux/m68k/vfork.S b/libc/ports/sysdeps/unix/sysv/linux/m68k/vfork.S index 24e0c9037..d3e20d406 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/m68k/vfork.S +++ b/libc/ports/sysdeps/unix/sysv/linux/m68k/vfork.S @@ -36,8 +36,6 @@ ENTRY (__vfork) -#ifdef __NR_vfork - /* SAVE_PID clobbers call-clobbered registers and saves data in D1 and A1. */ @@ -66,27 +64,8 @@ ENTRY (__vfork) cfi_adjust_cfa_offset (4) cfi_rel_offset (%pc, 0) -# ifdef __ASSUME_VFORK_SYSCALL -# ifndef PIC +#ifndef PIC jbra SYSCALL_ERROR_LABEL -# endif -# else - /* Check if vfork syscall is known at all. */ - movel #-ENOSYS,%d1 - cmpl %d0,%d1 - jne SYSCALL_ERROR_LABEL - -# endif -#endif - -#ifndef __ASSUME_VFORK_SYSCALL - /* If we don't have vfork, fork is close enough. */ - - movel #SYS_ify (fork), %d0 - trap #0 - tstl %d0 - jmi SYSCALL_ERROR_LABEL - rts #endif PSEUDO_END (__vfork) diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/configure b/libc/ports/sysdeps/unix/sysv/linux/mips/configure index 099014fdc..051432df8 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/mips/configure +++ b/libc/ports/sysdeps/unix/sysv/linux/mips/configure @@ -30,7 +30,4 @@ case "$prefix" in esac esac -if test -z "$arch_minimum_kernel"; then - arch_minimum_kernel=2.6.12 - libc_cv_gcc_unwind_find_fde=yes -fi +libc_cv_gcc_unwind_find_fde=yes diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/configure.in b/libc/ports/sysdeps/unix/sysv/linux/mips/configure.in index 466a349fc..18e8bbc5c 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/mips/configure.in +++ b/libc/ports/sysdeps/unix/sysv/linux/mips/configure.in @@ -31,7 +31,4 @@ case "$prefix" in esac esac -if test -z "$arch_minimum_kernel"; then - arch_minimum_kernel=2.6.12 - libc_cv_gcc_unwind_find_fde=yes -fi +libc_cv_gcc_unwind_find_fde=yes diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/kernel-features.h b/libc/ports/sysdeps/unix/sysv/linux/mips/kernel-features.h index 70f1fc1ed..62c1604e9 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/mips/kernel-features.h +++ b/libc/ports/sysdeps/unix/sysv/linux/mips/kernel-features.h @@ -22,9 +22,8 @@ /* MIPS platforms had IPC64 all along. */ #define __ASSUME_IPC64 1 -#if _MIPS_SIM == _ABIN32 -# define __ASSUME_FCNTL64 1 -#endif +/* MIPS had the utimes syscall by 2.6.0. */ +#define __ASSUME_UTIMES 1 /* Support for the eventfd2 and signalfd4 syscalls was added in 2.6.27. */ #if __LINUX_KERNEL_VERSION >= 0x02061c diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/fcntl.c b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/fcntl.c index ea951bc4f..ea951bc4f 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/mips/fcntl.c +++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/fcntl.c diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/lockf64.c b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/lockf64.c index a88f5a784..a88f5a784 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/mips/lockf64.c +++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/lockf64.c diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/fcntl.c b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/fcntl.c new file mode 100644 index 000000000..ea951bc4f --- /dev/null +++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/fcntl.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/fcntl.c> diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/lockf64.c b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/lockf64.c new file mode 100644 index 000000000..a88f5a784 --- /dev/null +++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/lockf64.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/lockf64.c> diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h b/libc/ports/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h index 88b601ead..d368ae1b6 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h +++ b/libc/ports/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h @@ -1,5 +1,4 @@ -/* Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, - 2009 Free Software Foundation, Inc. +/* Copyright (C) 2003-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -291,4 +290,40 @@ extern int __lll_timedwait_tid (int *, const struct timespec *) __res; \ }) +/* Implement __libc_lock_lock using exchange_and_add, which expands into + a single instruction on XLP processors. We enable this for all MIPS + processors as atomic_exchange_and_add_acq and + atomic_compare_and_exchange_acq take the same time to execute. + This is a simplified expansion of ({ lll_lock (NAME, LLL_PRIVATE); 0; }). + + Note: __lll_lock_wait_private() resets lock value to '2', which prevents + unbounded increase of the lock value and [with billions of threads] + overflow. */ +#define __libc_lock_lock(NAME) \ + ({ \ + int *__futex = &(NAME); \ + if (__builtin_expect (atomic_exchange_and_add_acq (__futex, 1), 0)) \ + __lll_lock_wait_private (__futex); \ + 0; \ + }) + +#ifdef _MIPS_ARCH_XLP +/* The generic version using a single atomic_compare_and_exchange_acq takes + less time for non-XLP processors, so we use below for XLP only. */ +# define __libc_lock_trylock(NAME) \ + ({ \ + int *__futex = &(NAME); \ + int __result = atomic_exchange_and_add_acq (__futex, 1); \ + /* If __result == 0, we succeeded in acquiring the lock. \ + If __result == 1, we switched the lock to 'contended' state, which \ + will cause a [possibly unnecessary] call to lll_futex_wait. This is \ + unlikely, so we accept the possible inefficiency. \ + If __result >= 2, we need to set the lock to 'contended' state to avoid \ + unbounded increase from subsequent trylocks. */ \ + if (__result >= 2) \ + __result = atomic_exchange_acq (__futex, 2); \ + __result; \ + }) +#endif + #endif /* lowlevellock.h */ diff --git a/libc/ports/sysdeps/unix/sysv/linux/tile/kernel-features.h b/libc/ports/sysdeps/unix/sysv/linux/tile/kernel-features.h index 89929d2bc..956f14cb9 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/tile/kernel-features.h +++ b/libc/ports/sysdeps/unix/sysv/linux/tile/kernel-features.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2011 Free Software Foundation, Inc. +/* Copyright (C) 2011-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. @@ -20,9 +20,6 @@ /* TILE glibc support starts with 2.6.36, guaranteeing many kernel features. */ #define __ASSUME_MMAP2_SYSCALL 1 #define __ASSUME_STAT64_SYSCALL 1 -#define __ASSUME_FCNTL64 1 -#define __ASSUME_CLONE_THREAD_FLAGS 1 -#define __ASSUME_TGKILL 1 #define __ASSUME_UTIMES 1 #define __ASSUME_FADVISE64_64_SYSCALL 1 #define __ASSUME_O_CLOEXEC 1 |