summaryrefslogtreecommitdiff
path: root/libc/ports/sysdeps/unix/sysv/linux
diff options
context:
space:
mode:
authorjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2012-08-17 19:39:53 +0000
committerjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2012-08-17 19:39:53 +0000
commite7a9915190f0e2b940e4af9ad480cbe035a197d6 (patch)
tree1f2af18154d7414f0ac2204709a0488505bae848 /libc/ports/sysdeps/unix/sysv/linux
parentdd3105b347f432016fcdc1abd472c3717f557c9e (diff)
downloadeglibc2-e7a9915190f0e2b940e4af9ad480cbe035a197d6.tar.gz
Merge changes between r19920 and r20213 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@20214 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc/ports/sysdeps/unix/sysv/linux')
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/alpha/bits/dirent.h5
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h6
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/alpha/configure6
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/alpha/configure.in6
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/alpha/fraiseexcpt.S56
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/alpha/fraiseexcpt.c91
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/alpha/fxstat.c19
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/alpha/fxstatat.c37
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S38
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S38
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/alpha/kernel-features.h16
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/alpha/lxstat.c19
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/alpha/xstat.c19
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/alpha/xstatconv.c9
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/alpha/xstatconv.h7
-rwxr-xr-xlibc/ports/sysdeps/unix/sysv/linux/am33/configure2
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/am33/configure.in2
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/am33/getrlimit.c1
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/arm-features.h30
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/bits/atomic.h (renamed from libc/ports/sysdeps/unix/sysv/linux/arm/nptl/bits/atomic.h)93
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/configure1
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/configure.in1
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/dl-machine.h30
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/getcontext.S78
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/getrlimit.c1
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/kernel-features.h10
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/setcontext.S89
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/generic/bits/typesizes.h10
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/hppa/Versions3
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/hppa/kernel-features.h7
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/hppa/nptl/configure5
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/hppa/nptl/configure.in5
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/hppa/syscalls.list1
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/ia64/configure6
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/ia64/configure.in6
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/ia64/kernel-features.h6
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/ia64/nptl/dl-sysdep.h6
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/ia64/system.c4
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/bits/atomic.h12
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/m68k/configure1
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/m68k/configure.in1
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/m68k/getrlimit.c1
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/m68k/kernel-features.h9
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/m68k/vfork.S23
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/configure5
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/configure.in5
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/kernel-features.h5
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips32/fcntl.c (renamed from libc/ports/sysdeps/unix/sysv/linux/mips/fcntl.c)0
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips32/lockf64.c (renamed from libc/ports/sysdeps/unix/sysv/linux/mips/lockf64.c)0
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/fcntl.c1
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/lockf64.c1
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h39
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/tile/kernel-features.h5
53 files changed, 355 insertions, 522 deletions
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/unix/sysv/linux/arm/arm-features.h b/libc/ports/sysdeps/unix/sysv/linux/arm/arm-features.h
new file mode 100644
index 000000000..f20a70556
--- /dev/null
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/arm-features.h
@@ -0,0 +1,30 @@
+/* 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
+ 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 _LINUX_ARM_FEATURES_H
+#define _LINUX_ARM_FEATURES_H 1
+
+#ifndef __ASSEMBLER__
+# include <ldsodefs.h>
+
+# define ARM_HAVE_VFP (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
+#endif
+
+#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/unix/sysv/linux/arm/dl-machine.h b/libc/ports/sysdeps/unix/sysv/linux/arm/dl-machine.h
new file mode 100644
index 000000000..68e8be9e6
--- /dev/null
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/dl-machine.h
@@ -0,0 +1,30 @@
+/* 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
+ 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 dl_machine_h
+
+/* This definition is Linux-specific. */
+#define CLEAR_CACHE(BEG,END) \
+ INTERNAL_SYSCALL_ARM (cacheflush, , 3, (BEG), (END), 0)
+
+#endif
+
+/* 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