summaryrefslogtreecommitdiff
path: root/libc
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
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')
-rw-r--r--libc/ChangeLog800
-rw-r--r--libc/Makeconfig14
-rw-r--r--libc/NEWS6
-rw-r--r--libc/README25
-rw-r--r--libc/WUR-REPORT11
-rw-r--r--libc/bits/dirent.h36
-rw-r--r--libc/bits/fcntl.h77
-rw-r--r--libc/bits/libc-lock.h1
-rw-r--r--libc/bits/typesizes.h10
-rw-r--r--libc/config.h.in7
-rwxr-xr-xlibc/configure40
-rw-r--r--libc/configure.in26
-rw-r--r--libc/crypt/Makefile5
-rw-r--r--libc/crypt/md5.c9
-rw-r--r--libc/crypt/md5test-giant.c137
-rw-r--r--libc/crypt/sha512.c9
-rw-r--r--libc/debug/Makefile54
-rw-r--r--libc/dirent/alphasort.c14
-rw-r--r--libc/dirent/alphasort64.c7
-rw-r--r--libc/dirent/scandir.c15
-rw-r--r--libc/dirent/scandir64.c7
-rw-r--r--libc/dirent/scandirat.c15
-rw-r--r--libc/dirent/scandirat64.c7
-rw-r--r--libc/dirent/versionsort.c14
-rw-r--r--libc/dirent/versionsort64.c7
-rw-r--r--libc/elf/chroot_canon.c7
-rw-r--r--libc/elf/dl-close.c2
-rw-r--r--libc/elf/dl-load.c2
-rw-r--r--libc/elf/dl-lookup.c3
-rw-r--r--libc/elf/dl-open.c3
-rw-r--r--libc/elf/dl-sym.c3
-rw-r--r--libc/elf/elf.h19
-rw-r--r--libc/elf/tst-unique1mod1.c5
-rw-r--r--libc/elf/tst-unique1mod2.c5
-rw-r--r--libc/elf/tst-unique2mod1.c5
-rw-r--r--libc/elf/tst-unique2mod2.c5
-rw-r--r--libc/grp/Makefile7
-rw-r--r--libc/gshadow/Makefile6
-rw-r--r--libc/hurd/lookup-retry.c5
-rw-r--r--libc/include/atomic.h18
-rw-r--r--libc/include/dirent.h4
-rw-r--r--libc/include/libc-symbols.h53
-rw-r--r--libc/include/sys/socket.h4
-rw-r--r--libc/inet/getnetgrent_r.c45
-rw-r--r--libc/inet/netgroup.h14
-rw-r--r--libc/io/lockf.c16
-rw-r--r--libc/io/lockf64.c7
-rw-r--r--libc/io/lseek.c (renamed from libc/misc/lseek.c)0
-rw-r--r--libc/libio/Makefile6
-rw-r--r--libc/libio/fseeko.c6
-rw-r--r--libc/libio/fseeko64.c7
-rw-r--r--libc/libio/ftello.c7
-rw-r--r--libc/libio/ftello64.c6
-rw-r--r--libc/libio/genops.c4
-rw-r--r--libc/libio/iofgetpos.c20
-rw-r--r--libc/libio/iofgetpos64.c6
-rw-r--r--libc/libio/iofopen.c6
-rw-r--r--libc/libio/iofopen64.c6
-rw-r--r--libc/libio/iofsetpos.c20
-rw-r--r--libc/libio/iofsetpos64.c7
-rw-r--r--libc/libio/libioP.h14
-rw-r--r--libc/malloc/arena.c19
-rw-r--r--libc/malloc/malloc.c53
-rw-r--r--libc/manual/stdio.texi2
-rw-r--r--libc/math/libm-test.inc22
-rw-r--r--libc/math/s_clog.c7
-rw-r--r--libc/math/s_clog10.c7
-rw-r--r--libc/math/s_clog10f.c7
-rw-r--r--libc/math/s_clog10l.c14
-rw-r--r--libc/math/s_clogf.c7
-rw-r--r--libc/math/s_clogl.c14
-rw-r--r--libc/misc/Makefile1
-rw-r--r--libc/misc/mkostemp.c6
-rw-r--r--libc/misc/mkostemp64.c7
-rw-r--r--libc/misc/mkostemps.c6
-rw-r--r--libc/misc/mkostemps64.c7
-rw-r--r--libc/misc/mkstemp.c6
-rw-r--r--libc/misc/mkstemp64.c7
-rw-r--r--libc/misc/mkstemps.c6
-rw-r--r--libc/misc/mkstemps64.c7
-rw-r--r--libc/nptl/ChangeLog95
-rw-r--r--libc/nptl/Makefile6
-rw-r--r--libc/nptl/allocatestack.c12
-rw-r--r--libc/nptl/nptl-init.c12
-rw-r--r--libc/nptl/pthread_cancel.c13
-rw-r--r--libc/nptl/pthread_cond_timedwait.c22
-rw-r--r--libc/nptl/pthread_condattr_setclock.c30
-rw-r--r--libc/nptl/pthread_spin_lock.c69
-rw-r--r--libc/nptl/pthread_spin_trylock.c (renamed from libc/ports/sysdeps/arm/nptl/pthread_spin_trylock.c)7
-rw-r--r--libc/nptl/sysdeps/pthread/bits/libc-lockP.h10
-rw-r--r--libc/nptl/sysdeps/pthread/createthread.c13
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/Makefile4
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S28
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/pt-raise.c14
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/pthread_getcpuclockid.c22
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/pthread_kill.c12
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/raise.c17
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S22
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/timer_create.c340
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/timer_delete.c104
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/timer_getoverr.c56
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/timer_gettime.c56
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/timer_routines.c8
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/timer_settime.c60
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S30
-rw-r--r--libc/nss/getXXbyYY_r.c14
-rw-r--r--libc/ports/ChangeLog.alpha63
-rw-r--r--libc/ports/ChangeLog.am3311
-rw-r--r--libc/ports/ChangeLog.arm123
-rw-r--r--libc/ports/ChangeLog.hppa22
-rw-r--r--libc/ports/ChangeLog.ia6450
-rw-r--r--libc/ports/ChangeLog.linux-generic5
-rw-r--r--libc/ports/ChangeLog.m68k63
-rw-r--r--libc/ports/ChangeLog.mips66
-rw-r--r--libc/ports/ChangeLog.tile19
-rw-r--r--libc/ports/sysdeps/alpha/configure176
-rw-r--r--libc/ports/sysdeps/alpha/configure.in71
-rw-r--r--libc/ports/sysdeps/alpha/fpu/s_nearbyint.c4
-rw-r--r--libc/ports/sysdeps/alpha/ldsodefs.h2
-rw-r--r--libc/ports/sysdeps/arm/__longjmp.S60
-rw-r--r--libc/ports/sysdeps/arm/arm-features.h39
-rw-r--r--libc/ports/sysdeps/arm/bits/atomic.h81
-rw-r--r--libc/ports/sysdeps/arm/dl-irel.h3
-rw-r--r--libc/ports/sysdeps/arm/dl-machine.h17
-rw-r--r--libc/ports/sysdeps/arm/fclrexcpt.c9
-rw-r--r--libc/ports/sysdeps/arm/fedisblxcpt.c9
-rw-r--r--libc/ports/sysdeps/arm/feenablxcpt.c9
-rw-r--r--libc/ports/sysdeps/arm/fegetenv.c9
-rw-r--r--libc/ports/sysdeps/arm/fegetexcept.c9
-rw-r--r--libc/ports/sysdeps/arm/fegetround.c9
-rw-r--r--libc/ports/sysdeps/arm/feholdexcpt.c9
-rw-r--r--libc/ports/sysdeps/arm/fesetenv.c9
-rw-r--r--libc/ports/sysdeps/arm/fesetround.c9
-rw-r--r--libc/ports/sysdeps/arm/feupdateenv.c9
-rw-r--r--libc/ports/sysdeps/arm/fgetexcptflg.c9
-rw-r--r--libc/ports/sysdeps/arm/fraiseexcpt.c9
-rw-r--r--libc/ports/sysdeps/arm/fsetexcptflg.c9
-rw-r--r--libc/ports/sysdeps/arm/ftestexcept.c9
-rw-r--r--libc/ports/sysdeps/arm/ldsodefs.h4
-rw-r--r--libc/ports/sysdeps/arm/nptl/pthread_spin_lock.c18
-rw-r--r--libc/ports/sysdeps/arm/setfpucw.c9
-rw-r--r--libc/ports/sysdeps/arm/setjmp.S55
-rw-r--r--libc/ports/sysdeps/arm/sotruss-lib.c49
-rw-r--r--libc/ports/sysdeps/arm/sysdep.h4
-rw-r--r--libc/ports/sysdeps/hppa/nptl/pthread_spin_lock.c26
-rw-r--r--libc/ports/sysdeps/ia64/bits/byteswap-16.h2
-rw-r--r--libc/ports/sysdeps/ia64/bits/byteswap.h2
-rw-r--r--libc/ports/sysdeps/ia64/configure93
-rw-r--r--libc/ports/sysdeps/ia64/configure.in61
-rw-r--r--libc/ports/sysdeps/ia64/fpu/libm-symbols.h7
-rw-r--r--libc/ports/sysdeps/ia64/fpu/libm_tan.S2
-rw-r--r--libc/ports/sysdeps/ia64/ldsodefs.h2
-rw-r--r--libc/ports/sysdeps/m68k/asm-syntax.h11
-rw-r--r--libc/ports/sysdeps/m68k/coldfire/fpu/bits/mathinline.h44
-rw-r--r--libc/ports/sysdeps/m68k/ldsodefs.h4
-rw-r--r--libc/ports/sysdeps/m68k/m680x0/fpu/libm-test-ulps89
-rw-r--r--libc/ports/sysdeps/m68k/nptl/pthread_spin_lock.c18
-rw-r--r--libc/ports/sysdeps/m68k/sysdep.h16
-rw-r--r--libc/ports/sysdeps/mips/bits/atomic.h22
-rw-r--r--libc/ports/sysdeps/mips/dl-lookup.c3
-rw-r--r--libc/ports/sysdeps/mips/ldsodefs.h6
-rw-r--r--libc/ports/sysdeps/mips/nptl/pthread_spin_lock.c (renamed from libc/ports/sysdeps/mips/nptl/pthread_spin_lock.S)25
-rw-r--r--libc/ports/sysdeps/mips/sys/asm.h4
-rw-r--r--libc/ports/sysdeps/tile/sysdep.h5
-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.h (renamed from libc/ports/sysdeps/hppa/nptl/pthread_spin_trylock.c)21
-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.h (renamed from libc/ports/sysdeps/mips/nptl/pthread_spin_trylock.S)34
-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
-rw-r--r--libc/posix/regcomp.c8
-rw-r--r--libc/posix/unistd.h16
-rw-r--r--libc/pwd/Makefile4
-rw-r--r--libc/rt/clock_nanosleep.c5
-rw-r--r--libc/shadow/Makefile6
-rw-r--r--libc/socket/accept4.c1
-rw-r--r--libc/stdio-common/Makefile4
-rw-r--r--libc/stdio-common/_itoa.c14
-rw-r--r--libc/stdio-common/_itowa.c10
-rw-r--r--libc/stdio-common/isoc99_scanf.c4
-rw-r--r--libc/stdlib/Makefile6
-rw-r--r--libc/stdlib/canonicalize.c6
-rw-r--r--libc/stdlib/divmod_1.c4
-rw-r--r--libc/stdlib/gmp-impl.h5
-rw-r--r--libc/stdlib/longlong.h44
-rw-r--r--libc/stdlib/mod_1.c4
-rw-r--r--libc/stdlib/secure-getenv.c2
-rw-r--r--libc/stdlib/tst-secure-getenv.c55
-rw-r--r--libc/string/str-two-way.h7
-rw-r--r--libc/string/test-strncasecmp.c18
-rw-r--r--libc/sunrpc/rpc_main.c40
-rw-r--r--libc/sysdeps/generic/eloop-threshold.h72
-rw-r--r--libc/sysdeps/generic/siglist.h6
-rw-r--r--libc/sysdeps/generic/sys/param.h8
-rwxr-xr-xlibc/sysdeps/i386/configure51
-rw-r--r--libc/sysdeps/i386/configure.in33
-rw-r--r--libc/sysdeps/i386/fpu/e_acosh.S4
-rw-r--r--libc/sysdeps/i386/fpu/e_acoshf.S4
-rw-r--r--libc/sysdeps/i386/fpu/e_acoshl.S4
-rw-r--r--libc/sysdeps/i386/fpu/e_atanh.S8
-rw-r--r--libc/sysdeps/i386/fpu/e_atanhf.S8
-rw-r--r--libc/sysdeps/i386/fpu/e_atanhl.S8
-rw-r--r--libc/sysdeps/i386/fpu/e_expl.S10
-rw-r--r--libc/sysdeps/i386/fpu/e_log.S4
-rw-r--r--libc/sysdeps/i386/fpu/e_log10.S4
-rw-r--r--libc/sysdeps/i386/fpu/e_log10f.S4
-rw-r--r--libc/sysdeps/i386/fpu/e_log10l.S4
-rw-r--r--libc/sysdeps/i386/fpu/e_log2.S4
-rw-r--r--libc/sysdeps/i386/fpu/e_log2f.S4
-rw-r--r--libc/sysdeps/i386/fpu/e_log2l.S4
-rw-r--r--libc/sysdeps/i386/fpu/e_logf.S4
-rw-r--r--libc/sysdeps/i386/fpu/e_logl.S4
-rw-r--r--libc/sysdeps/i386/fpu/e_pow.S14
-rw-r--r--libc/sysdeps/i386/fpu/e_powf.S12
-rw-r--r--libc/sysdeps/i386/fpu/e_powl.S16
-rw-r--r--libc/sysdeps/i386/fpu/e_scalb.S2
-rw-r--r--libc/sysdeps/i386/fpu/e_scalbf.S2
-rw-r--r--libc/sysdeps/i386/fpu/e_scalbl.S2
-rw-r--r--libc/sysdeps/i386/fpu/libm-test-ulps98
-rw-r--r--libc/sysdeps/i386/fpu/s_asinh.S6
-rw-r--r--libc/sysdeps/i386/fpu/s_asinhf.S6
-rw-r--r--libc/sysdeps/i386/fpu/s_asinhl.S6
-rw-r--r--libc/sysdeps/i386/fpu/s_cbrt.S18
-rw-r--r--libc/sysdeps/i386/fpu/s_cbrtf.S10
-rw-r--r--libc/sysdeps/i386/fpu/s_cbrtl.S20
-rw-r--r--libc/sysdeps/i386/fpu/s_expm1.S6
-rw-r--r--libc/sysdeps/i386/fpu/s_expm1f.S6
-rw-r--r--libc/sysdeps/i386/fpu/s_frexp.S2
-rw-r--r--libc/sysdeps/i386/fpu/s_frexpf.S2
-rw-r--r--libc/sysdeps/i386/fpu/s_frexpl.S2
-rw-r--r--libc/sysdeps/i386/i386-mcount.S4
-rw-r--r--libc/sysdeps/i386/i686/fpu/e_logl.S4
-rw-r--r--libc/sysdeps/i386/i686/fpu/multiarch/e_expf-sse2.S26
-rw-r--r--libc/sysdeps/i386/i686/multiarch/strcmp-ssse3.S2
-rw-r--r--libc/sysdeps/i386/i686/multiarch/strstr-c.c17
-rw-r--r--libc/sysdeps/i386/i686/strtok.S4
-rw-r--r--libc/sysdeps/i386/strtok.S4
-rw-r--r--libc/sysdeps/i386/sysdep.h35
-rw-r--r--libc/sysdeps/mach/hurd/Makeconfig3
-rw-r--r--libc/sysdeps/mach/hurd/bits/local_lim.h13
-rw-r--r--libc/sysdeps/mach/hurd/configure.in3
-rw-r--r--libc/sysdeps/mach/hurd/eloop-threshold.h (renamed from libc/sysdeps/unix/sysv/linux/i386/getrlimit.c)31
-rw-r--r--libc/sysdeps/mach/hurd/renameat.c51
-rw-r--r--libc/sysdeps/mach/hurd/sys/param.h3
-rw-r--r--libc/sysdeps/mach/hurd/sysconf.c (renamed from libc/ports/sysdeps/m68k/nptl/pthread_spin_trylock.c)21
-rw-r--r--libc/sysdeps/posix/closedir.c (renamed from libc/sysdeps/unix/closedir.c)0
-rw-r--r--libc/sysdeps/posix/dirfd.c (renamed from libc/sysdeps/unix/dirfd.c)0
-rw-r--r--libc/sysdeps/posix/dirstream.h (renamed from libc/sysdeps/unix/dirstream.h)0
-rw-r--r--libc/sysdeps/posix/fdopendir.c (renamed from libc/sysdeps/unix/fdopendir.c)3
-rw-r--r--libc/sysdeps/posix/opendir.c (renamed from libc/sysdeps/unix/opendir.c)0
-rw-r--r--libc/sysdeps/posix/readdir.c (renamed from libc/sysdeps/unix/readdir.c)0
-rw-r--r--libc/sysdeps/posix/readdir_r.c (renamed from libc/sysdeps/unix/readdir_r.c)0
-rw-r--r--libc/sysdeps/posix/rewinddir.c (renamed from libc/sysdeps/unix/rewinddir.c)0
-rw-r--r--libc/sysdeps/posix/seekdir.c (renamed from libc/sysdeps/unix/seekdir.c)0
-rw-r--r--libc/sysdeps/posix/system.c6
-rw-r--r--libc/sysdeps/posix/telldir.c (renamed from libc/sysdeps/unix/telldir.c)0
-rw-r--r--libc/sysdeps/powerpc/powerpc32/sysdep.h18
-rw-r--r--libc/sysdeps/powerpc/sysdep.h2
-rw-r--r--libc/sysdeps/pthread/Makeconfig2
-rw-r--r--libc/sysdeps/pthread/configure3
-rw-r--r--libc/sysdeps/s390/s390-32/s390-mcount.S2
-rw-r--r--libc/sysdeps/s390/s390-32/sysdep.h6
-rw-r--r--libc/sysdeps/s390/s390-64/s390x-mcount.S2
-rw-r--r--libc/sysdeps/s390/s390-64/sysdep.h6
-rw-r--r--libc/sysdeps/sh/_mcount.S2
-rw-r--r--libc/sysdeps/sh/ldsodefs.h2
-rw-r--r--libc/sysdeps/sh/sysdep.h6
-rw-r--r--libc/sysdeps/sparc/fpu/libm-test-ulps63
-rw-r--r--libc/sysdeps/sparc/ldsodefs.h4
-rw-r--r--libc/sysdeps/unix/Makefile20
-rw-r--r--libc/sysdeps/unix/bsd/bsd4.4/bits/dirent.h54
-rw-r--r--libc/sysdeps/unix/bsd/bsd4.4/bits/fcntl.h112
-rw-r--r--libc/sysdeps/unix/bsd/bsd4.4/freebsd/bits/typesizes.h5
-rw-r--r--libc/sysdeps/unix/make-syscalls.sh27
-rw-r--r--libc/sysdeps/unix/sysv/linux/bits/dirent.h7
-rw-r--r--libc/sysdeps/unix/sysv/linux/clock_getcpuclockid.c46
-rw-r--r--libc/sysdeps/unix/sysv/linux/clock_getres.c88
-rw-r--r--libc/sysdeps/unix/sysv/linux/clock_gettime.c98
-rw-r--r--libc/sysdeps/unix/sysv/linux/clock_nanosleep.c43
-rw-r--r--libc/sysdeps/unix/sysv/linux/clock_settime.c74
-rw-r--r--libc/sysdeps/unix/sysv/linux/configure16
-rw-r--r--libc/sysdeps/unix/sysv/linux/configure.in16
-rw-r--r--libc/sysdeps/unix/sysv/linux/dl-execstack.c96
-rw-r--r--libc/sysdeps/unix/sysv/linux/dl-sysdep.c23
-rw-r--r--libc/sysdeps/unix/sysv/linux/getdents.c6
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/fcntl.c134
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/lockf64.c135
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/readdir64.c6
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/readdir64_r.c6
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/vfork.S23
-rw-r--r--libc/sysdeps/unix/sysv/linux/kernel-features.h163
-rw-r--r--libc/sysdeps/unix/sysv/linux/ldsodefs.h4
-rw-r--r--libc/sysdeps/unix/sysv/linux/opendir.c2
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/getrlimit.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S26
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h2
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S23
-rw-r--r--libc/sysdeps/unix/sysv/linux/readdir64.c2
-rw-r--r--libc/sysdeps/unix/sysv/linux/readdir64_r.c2
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/bits/typesizes.h10
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/system.c6
-rw-r--r--libc/sysdeps/unix/sysv/linux/sh/getrlimit.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/shm_open.c8
-rw-r--r--libc/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h10
-rw-r--r--libc/sysdeps/unix/sysv/linux/sparc/system.c6
-rw-r--r--libc/sysdeps/unix/sysv/linux/sys/fsuid.h4
-rw-r--r--libc/sysdeps/unix/sysv/linux/syscalls.list1
-rw-r--r--libc/sysdeps/unix/sysv/linux/sysconf.c12
-rw-r--r--libc/sysdeps/unix/sysv/linux/system.c4
-rw-r--r--libc/sysdeps/unix/sysv/linux/waitid.c41
-rw-r--r--libc/sysdeps/unix/sysv/linux/wordsize-64/readdir.c2
-rw-r--r--libc/sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c2
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86/bits/typesizes.h10
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/time.c19
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/alphasort.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/alphasort64.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/fseeko.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/fseeko64.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/ftello.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/ftello64.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/iofgetpos.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/iofgetpos64.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/iofopen.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/iofopen64.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/iofsetpos.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/iofsetpos64.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/lockf.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/lockf64.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/mkostemp.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/mkostemp64.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/mkstemp.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/mkstemp64.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/scandir.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/scandir64.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/scandirat.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/scandirat64.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/versionsort.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/versionsort64.c1
-rw-r--r--libc/sysdeps/wordsize-64/alphasort.c7
-rw-r--r--libc/sysdeps/wordsize-64/alphasort64.c1
-rw-r--r--libc/sysdeps/wordsize-64/fseeko.c3
-rw-r--r--libc/sysdeps/wordsize-64/fseeko64.c1
-rw-r--r--libc/sysdeps/wordsize-64/ftello.c3
-rw-r--r--libc/sysdeps/wordsize-64/ftello64.c1
-rw-r--r--libc/sysdeps/wordsize-64/iofgetpos.c12
-rw-r--r--libc/sysdeps/wordsize-64/iofgetpos64.c1
-rw-r--r--libc/sysdeps/wordsize-64/iofopen.c4
-rw-r--r--libc/sysdeps/wordsize-64/iofopen64.c1
-rw-r--r--libc/sysdeps/wordsize-64/iofsetpos.c12
-rw-r--r--libc/sysdeps/wordsize-64/iofsetpos64.c1
-rw-r--r--libc/sysdeps/wordsize-64/lockf.c3
-rw-r--r--libc/sysdeps/wordsize-64/lockf64.c1
-rw-r--r--libc/sysdeps/wordsize-64/mkostemp.c3
-rw-r--r--libc/sysdeps/wordsize-64/mkostemp64.c1
-rw-r--r--libc/sysdeps/wordsize-64/mkstemp.c3
-rw-r--r--libc/sysdeps/wordsize-64/mkstemp64.c1
-rw-r--r--libc/sysdeps/wordsize-64/scandir.c6
-rw-r--r--libc/sysdeps/wordsize-64/scandir64.c1
-rw-r--r--libc/sysdeps/wordsize-64/scandirat.c6
-rw-r--r--libc/sysdeps/wordsize-64/scandirat64.c1
-rw-r--r--libc/sysdeps/wordsize-64/versionsort.c7
-rw-r--r--libc/sysdeps/wordsize-64/versionsort64.c1
-rw-r--r--libc/sysdeps/x86_64/_mcount.S4
-rw-r--r--libc/sysdeps/x86_64/configure54
-rw-r--r--libc/sysdeps/x86_64/configure.in33
-rw-r--r--libc/sysdeps/x86_64/fpu/e_expf.S28
-rw-r--r--libc/sysdeps/x86_64/fpu/e_expl.S10
-rw-r--r--libc/sysdeps/x86_64/fpu/e_log10l.S4
-rw-r--r--libc/sysdeps/x86_64/fpu/e_log2l.S4
-rw-r--r--libc/sysdeps/x86_64/fpu/e_logl.S4
-rw-r--r--libc/sysdeps/x86_64/fpu/e_powl.S16
-rw-r--r--libc/sysdeps/x86_64/fpu/e_scalbl.S2
-rw-r--r--libc/sysdeps/x86_64/fpu/libm-test-ulps74
-rw-r--r--libc/sysdeps/x86_64/fpu/s_copysign.S4
-rw-r--r--libc/sysdeps/x86_64/fpu/s_copysignf.S2
-rw-r--r--libc/sysdeps/x86_64/multiarch/memmove.c49
-rw-r--r--libc/sysdeps/x86_64/multiarch/strstr-c.c39
-rw-r--r--libc/sysdeps/x86_64/strtok.S2
-rw-r--r--libc/sysdeps/x86_64/sysdep.h6
-rw-r--r--libc/wcsmbs/Makefile5
427 files changed, 4274 insertions, 4101 deletions
diff --git a/libc/ChangeLog b/libc/ChangeLog
index e608ac4c1..9d8543c88 100644
--- a/libc/ChangeLog
+++ b/libc/ChangeLog
@@ -1,3 +1,803 @@
+2012-08-17 Roland McGrath <roland@hack.frob.com>
+
+ * libio/genops.c (_IO_unbuffer_write): Conditionalize locking code on
+ [_IO_MTSAFE_IO].
+ * libio/libioP.h [!_IO_MTSAFE_IO && !NOT_IN_libc]
+ (_IO_acquire_lock, _IO_acquire_lock_clear_flags2, _IO_release_lock):
+ New macros.
+
+ * Makeconfig [$(libc-reentrant) = yes] (libio-mtsafe): New variable.
+ * libio/Makefile (CPPFLAGS): Append $(libio-mtsafe) unconditionally
+ rather than -D_IO_MTSAFE_IO conditionally.
+ * stdio-common/Makefile (CPPFLAGS): Likewise.
+ * wcsmbs/Makefile (CPPFLAGS): Likewise.
+ * stdlib/Makefile (CFLAGS-strfmon.c, CFLAGS-strfmon_l.c):
+ Use $(libio-mtsafe).
+ * debug/Makefile (CFLAGS-sprintf_chk.c): Use $(libio-mtsafe) instead
+ of -D_IO_MTSAFE_IO.
+ (CFLAGS-snprintf_chk.c, CFLAGS-vsprintf_chk.c): Likewise.
+ (CFLAGS-vsnprintf_chk.c, CFLAGS-asprintf_chk.c): Likewise.
+ (CFLAGS-vasprintf_chk.c, CFLAGS-obprintf_chk.c): Likewise.
+ (CFLAGS-dprintf_chk.c, CFLAGS-vdprintf_chk.c): Likewise.
+ (CFLAGS-printf_chk.c, CFLAGS-fprintf_chk.c): Likewise.
+ (CFLAGS-vprintf_chk.c, CFLAGS-vfprintf_chk.c): Likewise.
+ (CFLAGS-gets_chk.c, CFLAGS-fgets_chk.c): Likewise.
+ (CFLAGS-fgets_u_chk.c, CFLAGS-fread_chk.c): Likewise.
+ (CFLAGS-fread_u_chk.c): Likewise.
+ (CFLAGS-swprintf_chk.c, CFLAGS-vswprintf_chk.c): Likewise.
+ (CFLAGS-wprintf_chk.c, CFLAGS-fwprintf_chk.c): Likewise.
+ (CFLAGS-vwprintf_chk.c, CFLAGS-vfwprintf_chk.c): Likewise.
+ (CFLAGS-fgetws_chk.c, CFLAGS-fgetws_u_chk.c): Likewise.
+ * grp/Makefile (CFLAGS-fgetgrent_r.c, CFLAGS-putgrent.c): Likewise.
+ * gshadow/Makefile (CFLAGS-fgetsgent_r.c, CFLAGS-putsgent.c): Likewise.
+ * misc/Makefile (CFLAGS-mntent_r.c): Likewise.
+ * pwd/Makefile (CFLAGS-fgetpwent_r.c): Likewise.
+ * shadow/Makefile (CFLAGS-fgetspent_r.c, CFLAGS-putspent.c): Likewise.
+
+ * libio/Makefile: Test [$(libc-reentrant) = yes]
+ instead of [$(filter %REENTRANT, $(defines)) nonempty].
+
+ * Makeconfig
+ [$(libc-reentrant) = yes] (defines): Append -D_LIBC_REENTRANT.
+ * sysdeps/pthread/configure: File removed.
+ * sysdeps/pthread/Makeconfig: New file.
+ * sysdeps/mach/hurd/Makeconfig (libc-reentrant): New variable.
+ * sysdeps/mach/hurd/configure.in: Don't touch DEFINES here.
+
+2012-08-16 Gary Benson <gbenson@redhat.com>
+
+ * elf/dl-close.c (_dl_close_worker): Also set r->r_map when
+ unmapping the first object in a namespace.
+
+2012-08-16 Roland McGrath <roland@hack.frob.com>
+
+ * inet/getnetgrent_r.c (internal_setnetgrent): Renamed to ...
+ (__internal_setnetgrent): ... this. Add internal_function to
+ definition. Add libc_hidden_def.
+ (setnetgrent): Update caller.
+ (internal_endnetgrent): Renamed to ...
+ (__internal_endnetgrent): ... this. Add internal_function to
+ definition. Add libc_hidden_def.
+ (endnetgrent): Update caller.
+ (internal_getnetgrent_r): Renamed to ...
+ (__internal_getnetgrent_r): ... this. Add internal_function to
+ definition. Add libc_hidden_def.
+ (__getnetgrent_r): Update caller.
+ * inet/netgroup.h: Update declarations. Add libc_hidden_proto uses.
+
+2012-08-16 Joseph Myers <joseph@codesourcery.com>
+
+ * stdlib/longlong.h: Update from GCC.
+
+2012-08-16 Roland McGrath <roland@hack.frob.com>
+
+ * stdlib/gmp-impl.h (udiv_qrnnd_preinv): Use __attribute__ ((unused))
+ on _QL, which is set by umul_ppmm but never used.
+ * stdio-common/_itoa.c (_itoa): Use __attribute__ ((unused)) on DUMMY
+ variables, which are set by GMP macros but never used.
+ * stdio-common/_itowa.c (_itowa): Likewise.
+ * stdlib/divmod_1.c (mpn_divmod_1): Likewise.
+ * stdlib/mod_1.c (mpn_mod_1): Likewise.
+
+2012-08-16 Carlos O'Donell <carlos_odonell@mentor.com>
+
+ * sysdeps/sh/ldsodefs.h (ARCH_PLTENTER_MEMBERS) <sh_gnu_pltenter>:
+ struct La_sh_regs is not constant.
+ * sysdeps/sparc/ldsodefs.h (ARCH_PLTENTER_MEMBERS)
+ <sparc32_gnu_pltenter, sparc64_gnu_pltenter>: struct La_sparc32_regs
+ and struct La_sparc64_regs are not constant.
+
+2012-08-16 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/kernel-features.h
+ (__ASSUME_POSIX_TIMERS): Remove.
+ * sysdeps/unix/sysv/linux/clock_getcpuclockid.c
+ [!__ASSUME_POSIX_TIMERS]: Remove conditional code.
+ * sysdeps/unix/sysv/linux/clock_getres.c [__ASSUME_POSIX_TIMERS]:
+ Make code unconditional.
+ [!__ASSUME_POSIX_TIMERS]: Remove conditional code.
+ * sysdeps/unix/sysv/linux/clock_gettime.c [__ASSUME_POSIX_TIMERS]:
+ Make code unconditional.
+ [!__ASSUME_POSIX_TIMERS]: Remove conditional code.
+ * sysdeps/unix/sysv/linux/clock_nanosleep.c
+ [__ASSUME_POSIX_TIMERS]: Make code unconditional.
+ [!__ASSUME_POSIX_TIMERS]: Remove conditional code.
+ * sysdeps/unix/sysv/linux/clock_settime.c [__ASSUME_POSIX_TIMERS]:
+ Make code unconditional.
+ [!__ASSUME_POSIX_TIMERS]: Remove conditional code.
+ [__ASSUME_POSIX_CPU_TIMERS <= 0 && __NR_clock_settime]
+ (__libc_missing_posix_timers): Remove.
+
+2012-08-15 Roland McGrath <roland@hack.frob.com>
+
+ * elf/dl-load.c (_dl_map_object_from_fd) [SHARED]: Conditionalize
+ check of GL(dl_error_catch_tsd) on [_LIBC_REENTRANT].
+
+ * bits/libc-lock.h (__rtld_lock_initialize): New macro.
+
+ * elf/dl-sym.c: Include <stdlib.h>.
+
+ * posix/regcomp.c (init_word_char): Use temporaries to hold the 64-bit
+ constants, which avoids warnings in 32-bit builds.
+
+ * bits/fcntl.h [__USE_POSIX199309 || __USE_UNIX98]:
+ (O_DSYNC, O_RSYNC): New macros (with NetBSD values).
+
+ * misc/lseek.c: File moved to ...
+ * io/lseek.c: ... here.
+
+ * rt/clock_nanosleep.c: Include <time.h>, not <sys/time.h>.
+
+ * crypt/sha512.c (sha512_process_block) [!USE_TOTAL128]: Avoid
+ shifting LEN more than 31 bits at once.
+
+2012-08-15 Liubov Dmitrieva <liubov.dmitrieva@gmail.com>
+
+ [BZ #14195]
+ * sysdeps/i386/i686/multiarch/strcmp-sssse3.S: Fix
+ segmentation fault for a case of two empty input strings.
+ * string/test-strncasecmp.c (check1): Renamed to...
+ (bz12205): ...this.
+ (bz14195): Add new testcase for two empty input strings and N > 0.
+ (test_main): Call new testcase, adapt for renamed function.
+
+2012-08-15 Andreas Jaeger <aj@suse.de>
+
+ [BZ #14090]
+ * crypt/md5test2.c: New test, based on test supplied by Serge
+ Belyshev <belyshev@depni.sinp.msu.ru>.
+ * crypt/Makefile (xtests): Add md5test-giant..
+ * crypt/Makefile ($(objpfx)md5test-giant): Add.
+
+2012-08-15 Paul Eggert <eggert@cs.ucla.edu>
+
+ [BZ #14090]
+ * crypt/md5.c (md5_process_block): Don't assume the buffer
+ length is less than 2**32.
+ * crypt/sha512.c (sha512_process_block): Don't assume the buffer
+ length is less than 2**64.
+
+2012-08-15 Roland McGrath <roland@hack.frob.com>
+
+ * string/str-two-way.h: Include <sys/param.h>.
+ (MAX): Macro removed.
+
+ * sysdeps/x86_64/multiarch/strstr-c.c: Add copyright header.
+ Move #define and #undef of memmove to just before and after
+ including <string.h>.
+
+ * sysdeps/x86_64/multiarch/memmove.c: Don't include <stddef.h>.
+ [!NOT_IN_libc]: Move #define and #undef of memmove to just before
+ and after including <string.h>. Move declarations of
+ __memmove_sse2, __memmove_ssse3, and __memmove_ssse3_back
+ to before #include "string/memmove.c".
+
+ * include/dirent.h: Declare __getdirentries.
+
+ * sysdeps/posix/system.c (do_system): Cast SUB_REF () to void when not
+ using its value, to avoid warnings in the [!_LIBC_REENTRANT] case.
+
+2012-08-14 Mike Frysinger <vapier@gentoo.org>
+
+ * config.h.in (HAVE_CPP_ASM_DEBUGINFO): Delete.
+ * sysdeps/i386/configure.in: Remove assembler-with-cpp debug check.
+ * sysdeps/i386/configure: Regenerated.
+ * sysdeps/i386/sysdep.h (ENTRY): Remove calls to STABS_CURRENT_FILE1,
+ STABS_CURRENT_FILE, and STABS_FUN.
+ (END): Remove call to STABS_FUN_END.
+ (STABS_CURRENT_FILE1): Delete.
+ (STABS_CURRENT_FILE): Likewise.
+ (STABS_FUN): Likewise.
+ (STABS_FUN_END): Likewise.
+ (STABS_FUN2): Likewise.
+ * sysdeps/x86_64/configure.in: Remove assembler-with-cpp debug check.
+ * sysdeps/x86_64/configure: Regenerated.
+
+2012-08-14 Roland McGrath <roland@hack.frob.com>
+
+ * elf/dl-open.c: Include <atomic.h>.
+ * elf/dl-lookup.c: Likewise.
+
+2012-08-14 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/kernel-features.h
+ (__ASSUME_CLONE_THREAD_FLAGS): Remove.
+ * sysdeps/unix/sysv/linux/s390/system.c (FORK): Define
+ unconditionally.
+ * sysdeps/unix/sysv/linux/sparc/system.c (FORK): Define
+ unconditionally.
+ * sysdeps/unix/sysv/linux/system.c [!FORK] (FORK): Do not
+ condition on __ASSUME_CLONE_THREAD_FLAGS.
+
+2012-08-14 Andreas Jaeger <aj@suse.de>
+
+ * sysdeps/i386/fpu/libm-test-ulps: Update.
+
+2012-08-13 Maxim Kuvyrkov <maxim@codesourcery.com>
+
+ * include/atomic.h (atomic_exchange_and_add): Split into ...
+ (atomic_exchange_and_add_acq, atomic_exchange_and_add_rel): ... these.
+ New atomic macros.
+
+2012-08-13 Markus Trippelsdorf <markus@trippelsdorf.de>
+
+ * sysdeps/x86_64/fpu/libm-test-ulps: Update.
+
+2012-08-13 Jeff Law <law@redhat.com>
+
+ * manual/stdio.texi (snprintf): Clarify handling of the trailing
+ null byte in the output string.
+
+2012-08-10 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/kernel-features.h
+ (__LINUX_ARG_MAX_STACK_BASED_MIN_KERNEL): Define.
+ [__LINUX_KERNEL_VERSION >= __LINUX_ARG_MAX_STACK_BASED_MIN_KERNEL]
+ (__ASSUME_ARG_MAX_STACK_BASED): Define.
+ * sysdeps/unix/sysv/linux/sysconf.c (__sysconf)
+ [__LINUX_KERNEL_VERSION < 0x020617]: Change condition to
+ !__ASSUME_ARG_MAX_STACK_BASED. Compare version with
+ __LINUX_ARG_MAX_STACK_BASED_MIN_KERNEL.
+
+2012-08-09 Jeff Law <law@redhat.com>
+
+ [BZ #13939]
+ * malloc.c/arena.c (reused_arena): New parameter, avoid_arena.
+ When avoid_arena is set, don't retry in the that arena. Pick the
+ next one, whatever it might be.
+ (arena_get2): New parameter avoid_arena, pass through to reused_arena.
+ (arena_lock): Pass in new parameter to arena_get2.
+ * malloc/malloc.c (__libc_memalign): Pass in new parameter to
+ arena_get2.
+ (__libc_malloc): Unify retrying after main arena failure with
+ __libc_memalign version.
+ (__libc_valloc, __libc_pvalloc, __libc_calloc): Likewise.
+
+2012-08-09 H.J. Lu <hongjiu.lu@intel.com>
+
+ [BZ #14166]
+ * sysdeps/i386/i686/multiarch/strstr-c.c (strstr): Redefined
+ to __redirect_strstr.
+ (__strstr_sse42): Use typeof __redirect_strstr.
+ (__strstr_ia32): Likewise.
+ (__libc_strstr): New prototype.
+ (strstr): Renamed to ...
+ (__libc_strstr): This.
+ (strstr): New strong alias of __libc_strstr.
+ * sysdeps/x86_64/multiarch/strstr-c.c: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/time.c (time): Redefined to
+ __redirect_time.
+ Include <time.h>.
+ (__libc_time): New prototype.
+ (time_ifunc): Replace time with __libc_time.
+ (time): New strong alias and hidden definition of __libc_time.
+ (__GI_time): Remove strong alias.
+ * sysdeps/x86_64/multiarch/memmove.c: Don't include <string.h>.
+ Include <stddef.h>.
+ (memmove): Redefined to __redirect_memmove.
+ (__memmove_sse2): Use typeof __redirect_memmove.
+ (__memmove_ssse3): Likewise.
+ (__memmove_ssse3_back): Likewise.
+ (__libc_memmove): New prototype.
+ (memmove): Renamed to ...
+ (__libc_memmove): This.
+ (memmove): New strong alias of __libc_memmove.
+
+2012-08-08 Mark Salter <msalter@redhat.com>
+
+ * elf/elf.h
+ (R_MN10300_TLS_GD): Define.
+ (R_MN10300_TLS_LD): Likewise.
+ (R_MN10300_TLS_LDO): Likewise.
+ (R_MN10300_TLS_GOTIE): Likewise.
+ (R_MN10300_TLS_IE): Likewise.
+ (R_MN10300_TLS_LE): Likewise.
+ (R_MN10300_TLS_DTPMOD): Likewise.
+ (R_MN10300_TLS_DTPOFF): Likewise.
+ (R_MN10300_TLS_TPOFF): Likewise.
+ (R_MN10300_SYM_DIFF): Likewise.
+ (R_MN10300_ALIGN): Likewise.
+ (R_MN10300_NUM): Update.
+
+2012-08-08 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_TGKILL):
+ Remove.
+
+2012-08-08 Roland McGrath <roland@hack.frob.com>
+
+ * sysdeps/posix/fdopendir.c: Include <stddef.h>.
+
+ * sysdeps/unix/sysv/linux/readdir64_r.c: Update #include for
+ sysdeps/unix -> sysdeps/posix move.
+ * sysdeps/unix/sysv/linux/i386/readdir64_r.c: Likewise.
+
+2012-08-07 Allan McRae <allan@archlinux.org>
+
+ [BZ #14303]
+ * sunrpc/rpc_main.c (SVR4_CPP): Remove.
+ (SUNOS_CPP): Likewise.
+ (find_cpp): Fall back to selecting system cpp when /lib/cpp is
+ not found.
+ (open_input): Call CPP using execvp.
+
+2012-08-07 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/kernel-features.h
+ (__ASSUME_PROT_GROWSUPDOWN): Remove.
+ (__ASSUME_NO_CLONE_DETACHED): Likewise.
+ (__ASSUME_GETDENTS32_D_TYPE): Likewise.
+ (__ASSUME_WAITID_SYSCALL): Likewise.
+ * sysdeps/unix/sysv/linux/dl-execstack.c
+ (_dl_make_stack_executable) [PROT_GROWSDOWN || PROT_GROWSUP]: Make
+ code unconditional.
+ (_dl_make_stack_executable) [!__ASSUME_PROT_GROWSUPDOWN]: Remove
+ conditional code.
+ * sysdeps/unix/sysv/linux/getdents.c (__GETDENTS)
+ [__ASSUME_GETDENTS32_D_TYPE]: Make code unconditional.
+ (__GETDENTS) [!__ASSUME_GETDENTS32_D_TYPE]: Remove conditional
+ code.
+ * sysdeps/unix/sysv/linux/waitid.c [__NR_waitid]: Make code
+ unconditional.
+ [__ASSUME_WAITID_SYSCALL]: Likewise.
+ [!__ASSUME_WAITID_SYSCALL]: Remove conditional code.
+
+2012-08-07 Roland McGrath <roland@hack.frob.com>
+
+ * sysdeps/unix/closedir.c: Renamed to ...
+ * sysdeps/posix/closedir.c: ... here.
+ * sysdeps/unix/dirfd.c: Renamed to ...
+ * sysdeps/posix/dirfd.c: ... here.
+ * sysdeps/unix/dirstream.h: Renamed to ...
+ * sysdeps/posix/dirstream.h: ... here.
+ * sysdeps/unix/fdopendir.c: Renamed to ...
+ * sysdeps/posix/fdopendir.c: ... here.
+ * sysdeps/unix/opendir.c: Renamed to ...
+ * sysdeps/posix/opendir.c: ... here.
+ * sysdeps/unix/readdir.c: Renamed to ...
+ * sysdeps/posix/readdir.c: ... here.
+ * sysdeps/unix/readdir_r.c: Renamed to ...
+ * sysdeps/posix/readdir_r.c: ... here.
+ * sysdeps/unix/rewinddir.c: Renamed to ...
+ * sysdeps/posix/rewinddir.c: ... here.
+ * sysdeps/unix/seekdir.c: Renamed to ...
+ * sysdeps/posix/seekdir.c: ... here.
+ * sysdeps/unix/telldir.c: Renamed to ...
+ * sysdeps/posix/telldir.c: ... here.
+ * sysdeps/unix/sysv/linux/opendir.c: Update #include.
+ * sysdeps/unix/sysv/linux/readdir64.c: Likewise.
+ * sysdeps/unix/sysv/linux/i386/readdir64.c: Likewise.
+ * sysdeps/unix/sysv/linux/wordsize-64/readdir.c: Likewise.
+
+ * sysdeps/unix/bsd/bsd4.4/bits/fcntl.h: Renamed to ...
+ * bits/fcntl.h: ... here.
+
+ * sysdeps/unix/bsd/bsd4.4/bits/fcntl.h (O_NOCTTY): Define to 0x8000,
+ not 0.
+ (O_ASYNC, O_FSYNC, O_SYNC): Move outside [__USE_MISC].
+ [__USE_XOPEN2K8] (O_DIRECTORY, O_NOFOLLOW, O_CLOEXEC): New macros.
+ (FCREAT, FEXCL, FTRUNC, FNOCTTY, FNONBLOCK): Macros removed.
+ (struct flock): Move l_start, l_len to the beginning.
+ Use __pid_t for l_pid.
+ [__USE_XOPEN2K] (POSIX_FADV_NORMAL, POSIX_FADV_RANDOM): New macros.
+ [__USE_XOPEN2K] (POSIX_FADV_SEQUENTIAL, POSIX_FADV_WILLNEED): Likewise.
+ [__USE_XOPEN2K] (POSIX_FADV_DONTNEED, POSIX_FADV_NOREUSE): Likewise.
+ (F_GETLK64, F_SETLK64, F_SETLKW64): New macros.
+ [__USE_XOPEN2K8] (F_DUPFD_CLOEXEC): New macro.
+ [__USE_LARGEFILE64] (struct flock64): New type.
+ (F_GETOWN, F_SETOWN): Also define for [__USE_XOPEN2K8].
+
+ * sysdeps/unix/bsd/bsd4.4/bits/dirent.h: Renamed to ...
+ * bits/dirent.h: ... here.
+
+ * sysdeps/unix/bsd/bsd4.4/bits/dirent.h
+ [__INO_T_MATCHES_INO64_T] (_DIRENT_MATCHES_DIRENT64): New macro.
+
+2012-08-07 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/configure.in (arch_minimum_kernel):
+ Change from 2.6.0 to 2.6.16.
+ * sysdeps/unix/sysv/linux/configure: Regenerated.
+ * sysdeps/unix/sysv/linux/kernel-features.h
+ (__ASSUME_POSIX_CPU_TIMERS): Define unconditionally.
+ (__ASSUME_TGKILL): Define conditional on architectures, not kernel
+ version.
+ (__ASSUME_UTIMES): Likewise.
+ (__ASSUME_CLONE_STOPPED): Remove.
+ (__ASSUME_FADVISE64_64_SYSCALL): Define conditional on
+ architectures, not kernel version.
+ (__ASSUME_PROT_GROWSUPDOWN): Define unconditionally.
+ (__ASSUME_NO_CLONE_DETACHED): Likewise.
+ (__ASSUME_GETDENTS32_D_TYPE): Likewise.
+ (__ASSUME_WAITID_SYSCALL): Likewise.
+ [__sparc__ && __arch64__] (__ASSUME_STAT64_SYSCALL): Do not
+ condition definition on __LINUX_KERNEL_VERSION >= 0x02060c.
+ * README: State 2.6.16 as minimum Linux kernel version. Do not
+ refer to older versions.
+
+2012-08-06 Roland McGrath <roland@hack.frob.com>
+
+ * dirent/alphasort.c [_DIRENT_MATCHES_DIRENT64]:
+ Define alphasort64 as an alias.
+ * dirent/versionsort.c [_DIRENT_MATCHES_DIRENT64]:
+ Define versionsort64 as an alias.
+ * dirent/scandir.c [_DIRENT_MATCHES_DIRENT64]:
+ Define scandir64 as an alias.
+ * dirent/scandirat.c [_DIRENT_MATCHES_DIRENT64]:
+ Define scandirat64 as an alias.
+ * dirent/alphasort64.c (alphasort64):
+ Conditionalize on [!_DIRENT_MATCHES_DIRENT64].
+ * dirent/versionsort64.c: Likewise.
+ * dirent/scandir64.c: Likewise.
+ * dirent/scandirat64.c: Likewise.
+ * sysdeps/wordsize-64/alphasort.c: File removed.
+ * sysdeps/wordsize-64/alphasort64.c: File removed.
+ * sysdeps/wordsize-64/scandir.c: File removed.
+ * sysdeps/wordsize-64/scandir64.c: File removed.
+ * sysdeps/wordsize-64/scandirat.c: File removed.
+ * sysdeps/wordsize-64/scandirat64.c: File removed.
+ * sysdeps/wordsize-64/versionsort.c: File removed.
+ * sysdeps/wordsize-64/versionsort64.c: File removed.
+ * sysdeps/unix/sysv/linux/x86_64/x32/alphasort.c: File removed.
+ * sysdeps/unix/sysv/linux/x86_64/x32/alphasort64.c: File removed.
+ * sysdeps/unix/sysv/linux/x86_64/x32/scandir.c: File removed.
+ * sysdeps/unix/sysv/linux/x86_64/x32/scandir64.c: File removed.
+ * sysdeps/unix/sysv/linux/x86_64/x32/scandirat.c: File removed.
+ * sysdeps/unix/sysv/linux/x86_64/x32/scandirat64.c: File removed.
+ * sysdeps/unix/sysv/linux/x86_64/x32/versionsort.c: File removed.
+ * sysdeps/unix/sysv/linux/x86_64/x32/versionsort64.c: File removed.
+
+ * bits/typesizes.h [__LP64__] (__INO_T_MATCHES_INO64_T): New macros.
+ * sysdeps/unix/sysv/linux/s390/bits/typesizes.h:
+ [__s390x__] (__INO_T_MATCHES_INO64_T): New macro.
+ * sysdeps/unix/sysv/linux/sparc/bits/typesizes.h
+ [defined __arch64__ || defined __sparcv9]
+ (__INO_T_MATCHES_INO64_T): New macro.
+ * sysdeps/unix/sysv/linux/x86/bits/typesizes.h
+ [__x86_64__] (__INO_T_MATCHES_INO64_T): New macro.
+ * bits/dirent.h (_DIRENT_MATCHES_DIRENT64): New macro.
+ * sysdeps/unix/sysv/linux/bits/dirent.h
+ [defined __OFF_T_MATCHES_OFF64_T && defined __INO_T_MATCHES_INO64_T]
+ (_DIRENT_MATCHES_DIRENT64): New macro.
+
+ * io/lockf.c [__OFF_T_MATCHES_OFF64_T]:
+ Define lockf64 as an alias.
+ * libio/fseeko.c [__OFF_T_MATCHES_OFF64_T]:
+ Define fseeko64 as an alias.
+ * libio/ftello.c [__OFF_T_MATCHES_OFF64_T]:
+ Define ftello64 as an alias.
+ * libio/iofgetpos.c [__OFF_T_MATCHES_OFF64_T]:
+ Define _IO_fgetpos64 and fgetpos64 as aliases.
+ * libio/iofsetpos.c [__OFF_T_MATCHES_OFF64_T]:
+ Define _IO_fsetpos64 and fsetpos64 as aliases.
+ * io/lockf64.c [!__OFF_T_MATCHES_OFF64_T]:
+ Conditionalize body on this.
+ * libio/fseeko64.c: Likewise.
+ * libio/ftello64.c: Likewise.
+ * libio/iofgetpos64.c: Likewise.
+ * libio/iofsetpos64.c: Likewise.
+ * sysdeps/wordsize-64/lockf.c: File removed.
+ * sysdeps/wordsize-64/lockf64.c: File removed.
+ * sysdeps/wordsize-64/fseeko.c: File removed.
+ * sysdeps/wordsize-64/fseeko64.c: File removed.
+ * sysdeps/wordsize-64/ftello.c: File removed.
+ * sysdeps/wordsize-64/ftello64.c: File removed.
+ * sysdeps/wordsize-64/iofgetpos.c: File removed.
+ * sysdeps/wordsize-64/iofgetpos64.c: File removed.
+ * sysdeps/wordsize-64/iofsetpos.c: File removed.
+ * sysdeps/wordsize-64/iofsetpos64.c: File removed.
+ * sysdeps/unix/sysv/linux/x86_64/x32/lockf.c: File removed.
+ * sysdeps/unix/sysv/linux/x86_64/x32/lockf64.c: File removed.
+ * sysdeps/unix/sysv/linux/x86_64/x32/fseeko.c: File removed.
+ * sysdeps/unix/sysv/linux/x86_64/x32/fseeko64.c: File removed.
+ * sysdeps/unix/sysv/linux/x86_64/x32/ftello.c: File removed.
+ * sysdeps/unix/sysv/linux/x86_64/x32/ftello64.c: File removed.
+ * sysdeps/unix/sysv/linux/x86_64/x32/iofgetpos.c: File removed.
+ * sysdeps/unix/sysv/linux/x86_64/x32/iofgetpos64.c: File removed.
+ * sysdeps/unix/sysv/linux/x86_64/x32/iofsetpos.c: File removed.
+ * sysdeps/unix/sysv/linux/x86_64/x32/iofsetpos64.c: File removed.
+
+ * bits/typesizes.h [__LP64__] (__OFF_T_MATCHES_OFF64_T): New macro.
+ * sysdeps/unix/sysv/linux/s390/bits/typesizes.h:
+ [__s390x__] (__OFF_T_MATCHES_OFF64_T): New macro.
+ * sysdeps/unix/sysv/linux/sparc/bits/typesizes.h
+ [defined __arch64__ || defined __sparcv9]
+ (__OFF_T_MATCHES_OFF64_T): New macro.
+ * sysdeps/unix/sysv/linux/x86/bits/typesizes.h
+ [__x86_64__] (__OFF_T_MATCHES_OFF64_T): New macro.
+ * sysdeps/unix/bsd/bsd4.4/freebsd/bits/typesizes.h
+ (__OFF_T_MATCHES_OFF64_T): New macro.
+
+2012-08-06 H.J. Lu <hongjiu.lu@intel.com>
+
+ * stdlib/secure-getenv.c (__secure_getenv): Replace
+ GLIBC_2_16 with GLIBC_2_17.
+
+2012-08-06 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/unix/sysv/linux/x86_64/x32/iofopen.c: Removed.
+ * sysdeps/unix/sysv/linux/x86_64/x32/iofopen64.c: Likewise.
+
+2012-08-03 David S. Miller <davem@davemloft.net>
+
+ * sysdeps/sparc/fpu/libm-test-ulps: Update.
+
+2012-08-03 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_AT_SECURE):
+ Remove.
+ (__ASSUME_CORRECT_SI_PID): Likewise.
+ (__ASSUME_BRK_PAGE_ROUNDED): Likewise.
+ (__ASSUME_TMPFS_NAME): Likewise.
+ * sysdeps/unix/sysv/linux/dl-sysdep.c (frob_brk)
+ [!__ASSUME_BRK_PAGE_ROUNDED]: Remove conditional code.
+ * sysdeps/unix/sysv/linux/ldsodefs.h [__ASSUME_AT_SECURE]
+ (HAVE_AUX_SECURE): Make definition unconditional.
+ * sysdeps/unix/sysv/linux/shm_open.c (where_is_shmfs)
+ [!__ASSUME_TMPFS_NAME]: Remove conditional code.
+
+2012-08-03 Roland McGrath <roland@hack.frob.com>
+
+ * sysdeps/mach/hurd/sys/param.h (MAXSYMLINKS): Macro removed.
+ * sysdeps/mach/hurd/bits/local_lim.h (SYMLOOP_MAX): Macro removed.
+ * sysdeps/mach/hurd/eloop-threshold.h: New file.
+ * hurd/lookup-retry.c (__hurd_file_name_lookup_retry): Use
+ __eloop_threshold instead of SYMLOOP_MAX.
+
+ * sysdeps/generic/eloop-threshold.h: New file.
+ * stdlib/canonicalize.c (__realpath): Use __eloop_threshold instead
+ of MAXSYMLINKS.
+ * elf/chroot_canon.c (chroot_canon): Likewise.
+
+2012-08-03 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13717]
+ * sysdeps/unix/sysv/linux/configure.in (arch_minimum_kernel):
+ Change to 2.6.0 everywhere.
+ * sysdeps/unix/sysv/linux/configure: Regenerated.
+ * sysdeps/unix/sysv/linux/kernel-features.h
+ (__ASSUME_SET_THREAD_AREA_SYSCALL): Remove.
+ (__ASSUME_CLONE_THREAD_FLAGS): Condition on architectures, not
+ kernel versions.
+ (__ASSUME_POSIX_TIMERS): Define unconditionally.
+ (__ASSUME_FUTEX_REQUEUE): Remove.
+ (__ASSUME_STATFS64): Define unconditionally.
+ (__ASSUME_AT_SECURE): Likewise.
+ (__ASSUME_CORRECT_SI_PID): Likewise.
+ (__ASSUME_TGKILL): Define without depending on kernel version for
+ i386.
+ (__ASSUME_UTIMES): Likewise.
+ (__ASSUME_SWAPCONTEXT_SYSCALL): Condition on architecture, not
+ kernel version.
+ (__ASSUME_BRK_PAGE_ROUNDED): Define unconditionally.
+ (__ASSUME_TMPFS_NAME): Likewise.
+ * README: Update reference to Linux kernel versions.
+
+2012-08-02 Marek Polacek <polacek@redhat.com>
+
+ [BZ#14150]
+ * configure.in (libc_cv_asm_type_prefix): Remove test. Replace
+ libc_cv_asm_type_prefix with %.
+ * configure: Regenerated.
+ * include/libc-symbols.h: Remove comment about
+ ASM_TYPE_DIRECTIVE_PREFIX. Replace ASM_TYPE_DIRECTIVE_PREFIX with %.
+ (declare_symbol_alias_1_paste) [__ASSEMBLER__]: Do not define.
+ (declare_symbol_alias_1_paste_1) [__ASSEMBLER__]: Likewise.
+ (declare_symbol_alias_1_stringify) [!__ASSEMBLER__]: Likewise.
+ (declare_symbol_alias_1_stringify_1) [!__ASSEMBLER__]: Likewise.
+ * elf/tst-unique2mod2.c: Replace ASM_TYPE_DIRECTIVE_PREFIX with %.
+ [HAVE_ASM_UNIQUE_OBJECT]: Do not define S.
+ [HAVE_ASM_UNIQUE_OBJECT]: Do not define _S.
+ * elf/tst-unique2mod1.c: Likewise.
+ * elf/tst-unique1mod2.c: Likewise.
+ * elf/tst-unique1mod1.c: Likewise.
+ * config.h.in: Do not undef ASM_TYPE_DIRECTIVE_PREFIX.
+ * sysdeps/s390/s390-32/sysdep.h: Do not define ASM_TYPE_DIRECTIVE.
+ Replace ASM_TYPE_DIRECTIVE with .type.
+ * sysdeps/s390/s390-64/sysdep.h: Likewise.
+ * sysdeps/i386/sysdep.h: Likewise.
+ * sysdeps/x86_64/sysdep.h: Likewise.
+ * sysdeps/sh/sysdep.h: Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h:
+ Do not define ASM_TYPE_DIRECTIVE.
+ * sysdeps/powerpc/sysdep.h: Likewise.
+ * sysdeps/powerpc/powerpc32/sysdep.h:
+ Replace ASM_TYPE_DIRECTIVE with .type.
+ * sysdeps/s390/s390-32/s390-mcount.S: Likewise.
+ * sysdeps/s390/s390-64/s390x-mcount.S: Likewise.
+ * sysdeps/i386/fpu/e_powf.S: Likewise.
+ * sysdeps/i386/fpu/e_expl.S: Likewise.
+ * sysdeps/i386/fpu/e_atanhf.S: Likewise.
+ * sysdeps/i386/fpu/e_acosh.S: Likewise.
+ * sysdeps/i386/fpu/e_pow.S: Likewise.
+ * sysdeps/i386/fpu/s_asinhl.S: Likewise.
+ * sysdeps/i386/fpu/e_acoshl.S: Likewise.
+ * sysdeps/i386/fpu/s_expm1.S: Likewise.
+ * sysdeps/i386/fpu/s_frexpf.S: Likewise.
+ * sysdeps/i386/fpu/e_log2.S: Likewise.
+ * sysdeps/i386/fpu/e_log2l.S: Likewise.
+ * sysdeps/i386/fpu/e_scalb.S: Likewise.
+ * sysdeps/i386/fpu/e_powl.S: Likewise.
+ * sysdeps/i386/fpu/e_log10f.S: Likewise.
+ * sysdeps/i386/fpu/s_cbrtf.S: Likewise.
+ * sysdeps/i386/fpu/e_logl.S: Likewise.
+ * sysdeps/i386/fpu/s_cbrt.S: Likewise.
+ * sysdeps/i386/fpu/s_frexpl.S: Likewise.
+ * sysdeps/i386/fpu/s_expm1f.S: Likewise.
+ * sysdeps/i386/fpu/e_log2f.S: Likewise.
+ * sysdeps/i386/fpu/e_acoshf.S: Likewise.
+ * sysdeps/i386/fpu/e_log.S: Likewise.
+ * sysdeps/i386/fpu/e_scalbf.S: Likewise.
+ * sysdeps/i386/fpu/e_logf.S: Likewise.
+ * sysdeps/i386/fpu/e_log10l.S: Likewise.
+ * sysdeps/i386/fpu/e_atanh.S: Likewise.
+ * sysdeps/i386/fpu/s_asinhf.S: Likewise.
+ * sysdeps/i386/fpu/e_log10.S: Likewise.
+ * sysdeps/i386/fpu/s_frexp.S: Likewise.
+ * sysdeps/i386/fpu/e_atanhl.S: Likewise.
+ * sysdeps/i386/fpu/s_asinh.S: Likewise.
+ * sysdeps/i386/fpu/s_cbrtl.S: Likewise.
+ * sysdeps/i386/fpu/e_scalbl.S: Likewise.
+ * sysdeps/i386/i686/fpu/multiarch/e_expf-sse2.S: Likewise.
+ * sysdeps/i386/i686/fpu/e_logl.S: Likewise.
+ * sysdeps/i386/i686/strtok.S: Likewise.
+ * sysdeps/i386/i386-mcount.S: Likewise.
+ * sysdeps/i386/strtok.S: Likewise.
+ * sysdeps/x86_64/fpu/e_expl.S: Likewise.
+ * sysdeps/x86_64/fpu/e_log2l.S: Likewise.
+ * sysdeps/x86_64/fpu/e_powl.S: Likewise.
+ * sysdeps/x86_64/fpu/e_logl.S: Likewise.
+ * sysdeps/x86_64/fpu/e_expf.S: Likewise.
+ * sysdeps/x86_64/fpu/e_log10l.S: Likewise.
+ * sysdeps/x86_64/fpu/s_copysignf.S: Likewise.
+ * sysdeps/x86_64/fpu/s_copysign.S: Likewise.
+ * sysdeps/x86_64/fpu/e_scalbl.S: Likewise.
+ * sysdeps/x86_64/_mcount.S: Likewise.
+ * sysdeps/x86_64/strtok.S: Likewise.
+ * sysdeps/sh/_mcount.S: Likewise.
+
+2012-08-01 Roland McGrath <roland@hack.frob.com>
+
+ * libio/iofopen.c: Include <fcntl.h>.
+ [_LIBC] [!defined O_LARGEFILE || O_LARGEFILE == 0]
+ (_IO_fopen64, fopen64): Define as aliases.
+ * libio/iofopen64.c: Include <fcntl.h>.
+ [!defined _LIBC || (defined O_LARGEFILE && O_LARGEFILE != 0)]:
+ Conditionalize body on this.
+ * sysdeps/wordsize-64/iofopen.c: File removed.
+ * sysdeps/wordsize-64/iofopen64.c: File removed.
+
+2012-08-01 Marek Polacek <polacek@redhat.com>
+
+ * libc/Makeconfig: Use elf in place of binfmt-subdir.
+ Use dlfcn directly instead of a variable.
+ (binfmt-subdir): Do not define.
+ (dlfcn): Likewise.
+
+2012-08-01 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_FCNTL64):
+ Remove all definitions.
+ * sysdeps/unix/sysv/linux/i386/fcntl.c: Do not include
+ <kernel-features.h>.
+ [!__ASSUME_FCNTL64] (__have_no_fcntl64): Remove.
+ (miss_F_GETOWN_EX): Remove all definitions.
+ [NO_CANCELLATION && !__ASSUME_FCNTL64] (__fcntl_nocancel): Remove
+ macro definition.
+ [!__ASSUME_FCNTL64]: Remove conditional code.
+ [__ASSUME_FCNTL64]: Make code unconditional.
+ * sysdeps/unix/sysv/linux/i386/lockf64.c: Do not include
+ <kernel-features.h>.
+ [__NR_fcntl64 && !__ASSUME_FCNTL64] (__have_no_fcntl64): Remove.
+ (lockf64) [!__ASSUME_FCNTL64]: Remove conditional code.
+ (lockf64) [__NR_fcntl64]: Make code unconditional.
+ (lockf64) [__ASSUME_FCNTL64]: Likewise.
+
+ * sysdeps/unix/sysv/linux/kernel-features.h
+ (__ASSUME_VFORK_SYSCALL): Remove all definitions.
+ * sysdeps/unix/sysv/linux/i386/vfork.S (__vfork) [__NR_vfork]:
+ Make code unconditional.
+ (__vfork) [__ASSUME_VFORK_SYSCALL]: Likewise.
+ (__vfork) [!__ASSUME_VFORK_SYSCALL]: Remove conditional code.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S (__vfork)
+ [__NR_vfork]: Make code unconditional.
+ (__vfork) [__ASSUME_VFORK_SYSCALL]: Likewise.
+ (__vfork) [!__ASSUME_VFORK_SYSCALL]: Remove conditional code.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc64/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>
+
+ * sysdeps/generic/sys/param.h (NGROUPS): Define only if [NGROUPS_MAX].
+ (MAXSYMLINKS): Define only if [SYMLOOP_MAX].
+
+ * misc/mkstemp.c [!defined O_LARGEFILE || O_LARGEFILE == 0]:
+ Define mkstemp64 as an alias.
+ * misc/mkstemps.c [!defined O_LARGEFILE || O_LARGEFILE == 0]:
+ Define mkstemps64 as an alias.
+ * misc/mkostemp.c [!defined O_LARGEFILE || O_LARGEFILE == 0]:
+ Define mkostemp64 as an alias.
+ * misc/mkostemps.c [!defined O_LARGEFILE || O_LARGEFILE == 0]:
+ Define mkostemps64 as an alias.
+ * misc/mkstemp64.c [defined O_LARGEFILE && O_LARGEFILE != 0]:
+ Conditionalize body on this.
+ * misc/mkostemp64.c: Likewise.
+ * misc/mkostemps64.c: Likewise.
+ * misc/mkstemps64.c: Likewise.
+ * sysdeps/wordsize-64/mkstemp64.c: File removed.
+ * sysdeps/wordsize-64/mkostemp64.c: File removed.
+ * sysdeps/wordsize-64/mkostemp.c: File removed.
+ * sysdeps/wordsize-64/mkstemp.c: File removed.
+ * sysdeps/unix/sysv/linux/x86_64/x32/mkstemp64.c: File removed.
+ * sysdeps/unix/sysv/linux/x86_64/x32/mkostemp64.c: File removed.
+ * sysdeps/unix/sysv/linux/x86_64/x32/mkostemp.c: File removed.
+ * sysdeps/unix/sysv/linux/x86_64/x32/mkstemp.c: File removed.
+
+ [BZ #14138]
+ * sysdeps/unix/sysv/linux/syscalls.list: Add getrlimit/ugetrlimit line.
+ * sysdeps/unix/sysv/linux/i386/getrlimit.c: File removed.
+ * sysdeps/unix/sysv/linux/powerpc/getrlimit.c: File removed.
+ * sysdeps/unix/sysv/linux/sh/getrlimit.c: File removed.
+
+ * sysdeps/unix/make-syscalls.sh: Emit uses of the versioned_symbol and
+ compat_symbol macros from <shlib-compat.h> rather than the underlying
+ default_symbol_version and symbol_version macros, so that DEFAULT
+ lines in shlib-versions are respected.
+ * sysdeps/unix/Makefile ($(objpfx)stub-syscalls.c): Likewise.
+
+2012-08-01 Florian Weimer <fweimer@redhat.com>
+
+ * posix/unistd.h (setuid, setreuid, seteuid, setresuid):
+ Declare with warn_unused_result.
+ (setgid, setregid, setegid, setresgid): Likewise.
+ * sysdeps/unix/sysv/linux/sys/fsuid.h (setfsuid, setfsgid):
+ Likewise.
+ * WUR-REPORT: Remove set*id functions.
+
+2012-07-31 Pino Toscano <toscano.pino@tiscali.it>
+
+ * sysdeps/mach/hurd/renameat.c: New file, mostly copied from rename.c.
+
+2012-07-31 Roland McGrath <roland@hack.frob.com>
+
+ * include/sys/socket.h (__libc_accept, __libc_accept4):
+ Add attribute_hidden.
+ * socket/accept4.c (__libc_accept4): Remove libc_hidden_def.
+
+ * nss/getXXbyYY_r.c (INTERNAL (REENTRANT_NAME)): Conditionalize
+ use of PTR_MANGLE.
+ * inet/getnetgrent_r.c (setup): Likewise.
+
+ * sysdeps/generic/siglist.h: Put SIGWINCH under #ifdef.
+
+2012-07-31 David S. Miller <davem@davemloft.net>
+
+ * sysdeps/sparc/fpu/libm-test-ulps: Update.
+
+2012-07-31 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13629]
+ * math/s_clog.c (__clog): Use __log1p if larger part has absolute
+ value between 1.0 and 2.0 and smaller part has absolute value less
+ than 1.0.
+ * math/s_clog10.c (__clog10): Likewise.
+ * math/s_clog10f.c (__clog10f): Likewise.
+ * math/s_clog10l.c (__clog10l): Likewise.
+ * math/s_clogf.c (__clogf): Likewise.
+ * math/s_clogl.c (__clogl): Likewise.
+ * math/libm-test.inc (clog_test): Add more tests.
+ (clog10_test): Likewise.
+ * sysdeps/i386/fpu/libm-test-ulps: Update.
+ * sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
+
+2012-07-31 Florian Weimer <fweimer@redhat.com>
+
+ * stdlib/tst-secure-getenv.c: Use printf for error reporting.
+ Exit with zero in case no suitable GID is found, and write a
+ message to standard error.
+
2012-07-30 Roland McGrath <roland@hack.frob.com>
* sysdeps/generic/sys/param.h (MAXSYMLINKS): Define to SYMLOOP_MAX
diff --git a/libc/Makeconfig b/libc/Makeconfig
index c89fab0bc..e02680c09 100644
--- a/libc/Makeconfig
+++ b/libc/Makeconfig
@@ -89,10 +89,6 @@ uses-callbacks = $(exceptions)
# What flags to give to tests which test stack alignment
stack-align-test-flags =
-# We have a special subdir for each binary format.
-# For now, only ELF is fully supported.
-binfmt-subdir = elf
-
# Complete path to sysdep dirs.
# `configure' writes a definition of `config-sysdirs' in `config.make'.
sysdirs := $(foreach D,$(config-sysdirs),$(firstword $(filter /%,$D) $(..)$D))
@@ -963,7 +959,6 @@ endif
endif # build-shared
-dlfcn = dlfcn
ifeq ($(build-shared),yes)
libdl = $(common-objpfx)dlfcn/libdl.so$(libdl.so-version)
else
@@ -1002,7 +997,7 @@ all-subdirs = csu assert ctype locale intl catgets math setjmp signal \
grp pwd posix io termios resource misc socket sysvipc gmon \
gnulib iconv iconvdata wctype manual shadow gshadow po argp \
crypt nss localedata timezone rt conform debug \
- $(add-on-subdirs) $(dlfcn) $(binfmt-subdir)
+ $(add-on-subdirs) dlfcn elf
ifndef avoid-generated
all-Depend-files := $(wildcard $(foreach dir,$(all-subdirs),\
@@ -1036,6 +1031,13 @@ endif
sysd-rules-targets := $(sort $(foreach p,$(sysd-rules-patterns),\
$(firstword $(subst :, ,$p))))
+# A sysdeps Makeconfig fragment may set libc-reentrant to yes.
+ifeq (yes,$(libc-reentrant))
+defines += -D_LIBC_REENTRANT
+
+libio-mtsafe = -D_IO_MTSAFE_IO
+endif
+
endif # Makeconfig not yet included
# Local Variables:
diff --git a/libc/NEWS b/libc/NEWS
index 3c12922fa..de9580d52 100644
--- a/libc/NEWS
+++ b/libc/NEWS
@@ -9,7 +9,8 @@ Version 2.17
* The following bugs are resolved with this release:
- 6778, 6808, 14042, 14151, 14154, 14157, 14173, 14283, 14298, 14328, 14331,
+ 6778, 6808, 13717, 13939, 14042, 14090, 14166, 14150, 14151, 14154, 14157,
+ 14166, 14173, 14195, 14283, 14298, 14303, 14307, 14328, 14331, 14336,
14337, 14347, 14349
* Support for STT_GNU_IFUNC symbols added for s390 and s390x.
@@ -24,6 +25,9 @@ Version 2.17
* SystemTap static probes have been added into the dynamic linker.
Implemented by Gary Benson.
+* The minimum Linux kernel version that this version of the GNU C Library
+ can be used with is 2.6.16.
+
Version 2.16
diff --git a/libc/README b/libc/README
index b6ab77067..6a91c5cea 100644
--- a/libc/README
+++ b/libc/README
@@ -44,19 +44,8 @@ GNU/Hurd system, using configurations i[34567]86-*-gnu. The current
GNU/Hurd support requires out-of-tree patches that will eventually be
incorporated into an official GNU C Library release.
-When working with Linux kernels, the GNU C Library version from
-version 2.4 on is intended primarily for use with Linux kernel version
-2.6.0 and later. We only support using the NPTL implementation of
-pthreads, which is now the default configuration. The library is
-unlikely to build without NPTL, or to work on Linux kernels prior to
-2.6. The old LinuxThreads add-on implementation of pthreads for older
-Linux kernels is no longer supported, and we are not distributing it
-with this release.
-
-All Linux kernel versions prior to 2.6.16 are known to have some bugs that
-may cause some of the tests related to pthreads in "make check" to fail.
-If you see such problems, please try the test suite on the most recent
-Linux kernel version that you can use, before pursuing those bugs further.
+When working with Linux kernels, this version of the GNU C Library
+requires Linux kernel version 2.6.16 or later.
Also note that the shared version of the libgcc_s library must be
installed for the pthread library to work correctly.
@@ -69,7 +58,7 @@ The GNU C Library supports these configurations for using Linux kernels:
powerpc64-*-linux-gnu
s390-*-linux-gnu
s390x-*-linux-gnu
- sh[34]-*-linux-gnu Requires Linux 2.6.11 or newer
+ sh[34]-*-linux-gnu
sparc*-*-linux-gnu
sparc64*-*-linux-gnu
@@ -79,14 +68,14 @@ add-on. You can find glibc-ports-VERSION distributed separately in the
same place where you got the main glibc distribution files.
Currently these configurations have code in the `ports' add-on:
- alpha*-*-linux-gnu Requires Linux 2.6.9 or newer for NPTL
+ alpha*-*-linux-gnu
am33*-*-linux-gnu Not currently functional
- arm-*-linux-gnueabi Requires Linux 2.6.16-rc1 or newer for NPTL
+ arm-*-linux-gnueabi
hppa-*-linux-gnu Not currently functional without patches.
ia64-*-linux-gnu
m68k-*-linux-gnu
- mips-*-linux-gnu Requires Linux 2.6.12 or newer for NPTL
- mips64-*-linux-gnu Requires Linux 2.6.12 or newer for NPTL
+ mips-*-linux-gnu
+ mips64-*-linux-gnu
powerpc-*-linux-gnu Software floating point (--without-fp)
tilegx-*-linux-gnu
tilepro-*-linux-gnu
diff --git a/libc/WUR-REPORT b/libc/WUR-REPORT
index ef407cfdb..d997bd039 100644
--- a/libc/WUR-REPORT
+++ b/libc/WUR-REPORT
@@ -4,17 +4,6 @@ lssek: Probably should be __wur but lseek(fd,SEEK_SET,0) will succeed if
the descriptor is fine.
lseek64: same
-setuid: will always succeed given correct privileges, so there might
- be places which don't check for it.
-setreuid: same
-seteuid: same
-setgid: same
-setregid: same
-setegid: same
-setresuid: same
-setresgid: same
-
-
<stdio.h>:
setvbuf: if stream and buffer are fine and other parameters constant,
diff --git a/libc/bits/dirent.h b/libc/bits/dirent.h
index ac1928d3d..948510c06 100644
--- a/libc/bits/dirent.h
+++ b/libc/bits/dirent.h
@@ -1,5 +1,5 @@
-/* Directory entry structure `struct dirent'. Stub version.
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+/* Directory entry structure `struct dirent'. 4.4BSD/Generic version.
+ 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
@@ -22,14 +22,38 @@
struct dirent
{
- char d_name[1]; /* Variable length. */
- int d_fileno;
+#ifndef __USE_FILE_OFFSET64
+ __ino_t d_ino; /* File serial number. */
+#else
+ __ino64_t d_ino;
+#endif
+ unsigned short int d_reclen; /* Length of the whole `struct dirent'. */
+ unsigned char d_type; /* File type, possibly unknown. */
+ unsigned char d_namlen; /* Length of the file name. */
+
+ /* Only this member is in the POSIX standard. */
+ char d_name[1]; /* File name (actually longer). */
};
#ifdef __USE_LARGEFILE64
struct dirent64
{
- char d_name[1]; /* Variable length. */
- int d_fileno;
+ __ino64_t d_ino;
+ unsigned short int d_reclen;
+ unsigned char d_type;
+ unsigned char d_namlen;
+
+ char d_name[1];
};
#endif
+
+#define d_fileno d_ino /* Backwards compatibility. */
+
+#define _DIRENT_HAVE_D_RECLEN 1
+#define _DIRENT_HAVE_D_NAMLEN 1
+#define _DIRENT_HAVE_D_TYPE 1
+
+#ifdef __INO_T_MATCHES_INO64_T
+/* Inform libc code that these two types are effectively identical. */
+# define _DIRENT_MATCHES_DIRENT64 1
+#endif
diff --git a/libc/bits/fcntl.h b/libc/bits/fcntl.h
index ba5de0071..65b366ab7 100644
--- a/libc/bits/fcntl.h
+++ b/libc/bits/fcntl.h
@@ -1,5 +1,5 @@
-/* O_*, F_*, FD_* bit values for stub configuration.
- Copyright (C) 1991, 1992, 1997, 2000, 2004 Free Software Foundation, Inc.
+/* O_*, F_*, FD_* bit values. 4.4BSD/Generic version.
+ Copyright (C) 1991-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
@@ -16,10 +16,8 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-/* These values should be changed as appropriate for your system. */
-
#ifndef _FCNTL_H
-# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
+#error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
#endif
@@ -33,7 +31,28 @@
#define O_CREAT 0x0200 /* Create file if it doesn't exist. */
#define O_EXCL 0x0800 /* Fail if file already exists. */
#define O_TRUNC 0x0400 /* Truncate file to zero length. */
-#define O_NOCTTY 0x0100 /* Don't assign a controlling terminal. */
+#define O_NOCTTY 0x8000 /* Don't assign a controlling terminal. */
+#define O_ASYNC 0x0040 /* Send SIGIO to owner when data is ready. */
+#define O_FSYNC 0x0080 /* Synchronous writes. */
+#define O_SYNC O_FSYNC
+#ifdef __USE_MISC
+#define O_SHLOCK 0x0010 /* Open with shared file lock. */
+#define O_EXLOCK 0x0020 /* Open with shared exclusive lock. */
+#endif
+#ifdef __USE_XOPEN2K8
+# define O_DIRECTORY 0x00200000 /* Must be a directory. */
+# define O_NOFOLLOW 0x00000100 /* Do not follow links. */
+# define O_CLOEXEC 0x00400000 /* Set close_on_exec. */
+#endif
+#if defined __USE_POSIX199309 || defined __USE_UNIX98
+# define O_DSYNC 0x00010000 /* Synchronize data. */
+# define O_RSYNC 0x00020000 /* Synchronize read operations. */
+#endif
+
+/* All opens support large file sizes, so there is no flag bit for this. */
+#ifdef __USE_LARGEFILE64
+# define O_LARGEFILE 0
+#endif
/* File status flags for `open' and `fcntl'. */
#define O_APPEND 0x0008 /* Writes append to the file. */
@@ -43,6 +62,22 @@
# define O_NDELAY O_NONBLOCK
#endif
+#ifdef __USE_BSD
+/* Bits in the file status flags returned by F_GETFL.
+ These are all the O_* flags, plus FREAD and FWRITE, which are
+ independent bits set by which of O_RDONLY, O_WRONLY, and O_RDWR, was
+ given to `open'. */
+# define FREAD 1
+# define FWRITE 2
+
+/* Traditional BSD names the O_* bits. */
+# define FASYNC O_ASYNC
+# define FFSYNC O_FSYNC
+# define FSYNC O_SYNC
+# define FAPPEND O_APPEND
+# define FNDELAY O_NDELAY
+#endif
+
/* Mask for file access modes. This is system-dependent in case
some system ever wants to define some other flavor of access. */
#define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR)
@@ -53,13 +88,21 @@
#define F_SETFD 2 /* Set file descriptor flags. */
#define F_GETFL 3 /* Get file status flags. */
#define F_SETFL 4 /* Set file status flags. */
-#if defined __USE_BSD || defined __USE_UNIX98
-# define F_GETOWN 5 /* Get owner (receiver of SIGIO). */
-# define F_SETOWN 6 /* Set owner (receiver of SIGIO). */
+#if defined __USE_BSD || defined __USE_UNIX98 || defined __USE_XOPEN2K8
+#define F_GETOWN 5 /* Get owner (receiver of SIGIO). */
+#define F_SETOWN 6 /* Set owner (receiver of SIGIO). */
#endif
#define F_GETLK 7 /* Get record locking info. */
-#define F_SETLK 8 /* Set record locking info. */
-#define F_SETLKW 9 /* Set record locking info, wait. */
+#define F_SETLK 8 /* Set record locking info (non-blocking). */
+#define F_SETLKW 9 /* Set record locking info (blocking). */
+/* Not necessary, we always have 64-bit offsets. */
+#define F_GETLK64 F_GETLK /* Get record locking info. */
+#define F_SETLK64 F_SETLK /* Set record locking info (non-blocking). */
+#define F_SETLKW64 F_SETLKW/* Set record locking info (blocking). */
+#ifdef __USE_XOPEN2K8
+# define F_DUPFD_CLOEXEC 12 /* Duplicate file descriptor with
+ close-on-exit set. */
+#endif
/* File descriptor flags used with F_GETFD and F_SETFD. */
#define FD_CLOEXEC 1 /* Close on exec. */
@@ -71,12 +114,24 @@
argument to `fcntl' for the F_GETLK, F_SETLK, and F_SETLKW requests. */
struct flock
{
+ __off_t l_start; /* Offset where the lock begins. */
+ __off_t l_len; /* Size of the locked area; zero means until EOF. */
+ __pid_t l_pid; /* Process holding the lock. */
short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */
short int l_whence; /* Where `l_start' is relative to (like `lseek'). */
+ };
+
+#ifdef __USE_LARGEFILE64
+/* Note this matches struct flock exactly. */
+struct flock64
+ {
__off_t l_start; /* Offset where the lock begins. */
__off_t l_len; /* Size of the locked area; zero means until EOF. */
__pid_t l_pid; /* Process holding the lock. */
+ short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */
+ short int l_whence; /* Where `l_start' is relative to (like `lseek'). */
};
+#endif
/* Values for the `l_type' field of a `struct flock'. */
#define F_RDLCK 1 /* Read lock. */
diff --git a/libc/bits/libc-lock.h b/libc/bits/libc-lock.h
index 87948d5b5..6b215c575 100644
--- a/libc/bits/libc-lock.h
+++ b/libc/bits/libc-lock.h
@@ -44,6 +44,7 @@
/* Initialize the named lock variable, leaving it in a consistent, unlocked
state. */
#define __libc_lock_init(NAME)
+#define __rtld_lock_initialize(NAME)
#define __libc_rwlock_init(NAME)
/* Same as last but this time we initialize a recursive mutex. */
diff --git a/libc/bits/typesizes.h b/libc/bits/typesizes.h
index 3fd4a2e06..c3debd0dd 100644
--- a/libc/bits/typesizes.h
+++ b/libc/bits/typesizes.h
@@ -61,6 +61,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/config.h.in b/libc/config.h.in
index 6858469c5..6b251ec38 100644
--- a/libc/config.h.in
+++ b/libc/config.h.in
@@ -37,10 +37,6 @@
/* Define if the assembler supports the `.set' directive. */
#undef HAVE_ASM_SET_DIRECTIVE
-/* Define to the prefix before `object' or `function' in the
- assembler's `.type' directive, if it has one. */
-#undef ASM_TYPE_DIRECTIVE_PREFIX
-
/* Define if the assembler supports the gnu_unique_object symbol type. */
#undef HAVE_ASM_UNIQUE_OBJECT
@@ -50,9 +46,6 @@
/* On powerpc64, use overlapping .opd entries. */
#undef USE_PPC64_OVERLAPPING_OPD
-/* Define if the assembler generates debugging information directly. */
-#undef HAVE_CPP_ASM_DEBUGINFO
-
/* Define if _Unwind_Find_FDE should be exported from glibc. */
#undef EXPORT_UNWIND_FIND_FDE
diff --git a/libc/configure b/libc/configure
index 21c758a3e..2cab13f98 100755
--- a/libc/configure
+++ b/libc/configure
@@ -4142,43 +4142,7 @@ else
$as_echo "yes" >&6; }
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for assembler .type directive prefix" >&5
-$as_echo_n "checking for assembler .type directive prefix... " >&6; }
-if ${libc_cv_asm_type_prefix+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- libc_cv_asm_type_prefix=no
-for ac_try_prefix in '@' '%' '#'; do
- cat > conftest.s <<EOF
- ${libc_cv_dot_text}
- .globl foo
- .type foo, ${ac_try_prefix}object
- .size foo, 1
-foo:
- .byte 1
-EOF
- if { ac_try='${CC-cc} $ASFLAGS -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; }; }; then
- libc_cv_asm_type_prefix=${ac_try_prefix}
- fi
- rm -f conftest*
- test "x$libc_cv_asm_type_prefix" != xno && break
-done
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_asm_type_prefix" >&5
-$as_echo "$libc_cv_asm_type_prefix" >&6; }
-if test "x$libc_cv_asm_type_prefix" != xno; then
- cat >>confdefs.h <<_ACEOF
-#define ASM_TYPE_DIRECTIVE_PREFIX ${libc_cv_asm_type_prefix}
-_ACEOF
-
-fi
-
-if test x"$libc_cv_asm_gnu_indirect_function" != xyes -o x"$libc_cv_asm_type_prefix" = xno; then
+if test x"$libc_cv_asm_gnu_indirect_function" != xyes; then
if test x"$multi_arch" = xyes; then
as_fn_error $? "--enable-multi-arch support requires assembler and linker support" "$LINENO" 5
else
@@ -5823,7 +5787,7 @@ else
cat > conftest.s <<EOF
${libc_cv_dot_text}
_sym:
-.type _sym, ${libc_cv_asm_type_prefix}gnu_unique_object
+.type _sym, %gnu_unique_object
EOF
if ${CC-cc} -c $ASFLAGS conftest.s 1>&5 2>&5; then
libc_cv_asm_unique_object=yes
diff --git a/libc/configure.in b/libc/configure.in
index 276151d9f..0d34ea484 100644
--- a/libc/configure.in
+++ b/libc/configure.in
@@ -586,29 +586,7 @@ else
AC_MSG_RESULT(yes)
fi
-AC_CACHE_CHECK(for assembler .type directive prefix,
- libc_cv_asm_type_prefix, [dnl
-libc_cv_asm_type_prefix=no
-for ac_try_prefix in '@' '%' '#'; do
- cat > conftest.s <<EOF
- ${libc_cv_dot_text}
- .globl foo
- .type foo, ${ac_try_prefix}object
- .size foo, 1
-foo:
- .byte 1
-EOF
- if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
- libc_cv_asm_type_prefix=${ac_try_prefix}
- fi
- rm -f conftest*
- test "x$libc_cv_asm_type_prefix" != xno && break
-done])
-if test "x$libc_cv_asm_type_prefix" != xno; then
- AC_DEFINE_UNQUOTED(ASM_TYPE_DIRECTIVE_PREFIX, ${libc_cv_asm_type_prefix})
-fi
-
-if test x"$libc_cv_asm_gnu_indirect_function" != xyes -o x"$libc_cv_asm_type_prefix" = xno; then
+if test x"$libc_cv_asm_gnu_indirect_function" != xyes; then
if test x"$multi_arch" = xyes; then
AC_MSG_ERROR([--enable-multi-arch support requires assembler and linker support])
else
@@ -1158,7 +1136,7 @@ AC_CACHE_CHECK(for assembler gnu_unique_object symbol type,
cat > conftest.s <<EOF
${libc_cv_dot_text}
_sym:
-.type _sym, ${libc_cv_asm_type_prefix}gnu_unique_object
+.type _sym, %gnu_unique_object
EOF
if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
libc_cv_asm_unique_object=yes
diff --git a/libc/crypt/Makefile b/libc/crypt/Makefile
index 1184810b6..1da12e5b4 100644
--- a/libc/crypt/Makefile
+++ b/libc/crypt/Makefile
@@ -50,7 +50,12 @@ libcrypt-routines += md5 sha256 sha512
tests-$(OPTION_EGLIBC_CRYPT) += md5test sha256test sha512test
+# The test md5test-giant uses up to 400 MB of RSS and runs on a fast
+# machine over a minute.
+xtests = md5test-giant
+
$(objpfx)md5test: $(objpfx)md5.o
+$(objpfx)md5test-giant: $(objpfx)md5.o
$(objpfx)sha256test: $(objpfx)sha256.o
$(objpfx)sha512test: $(objpfx)sha512.o
endif
diff --git a/libc/crypt/md5.c b/libc/crypt/md5.c
index 292bee184..3d2e79b90 100644
--- a/libc/crypt/md5.c
+++ b/libc/crypt/md5.c
@@ -1,7 +1,6 @@
/* Functions to compute MD5 message digest of files or memory blocks.
according to the definition of MD5 in RFC 1321 from April 1992.
- Copyright (C) 1995,1996,1997,1999,2000,2001,2005,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
@@ -312,13 +311,13 @@ md5_process_block (buffer, len, ctx)
md5_uint32 B = ctx->B;
md5_uint32 C = ctx->C;
md5_uint32 D = ctx->D;
+ md5_uint32 lolen = len;
/* First increment the byte count. RFC 1321 specifies the possible
length of the file up to 2^64 bits. Here we only compute the
number of bytes. Do a double word increment. */
- ctx->total[0] += len;
- if (ctx->total[0] < len)
- ++ctx->total[1];
+ ctx->total[0] += lolen;
+ ctx->total[1] += (len >> 31 >> 1) + (ctx->total[0] < lolen);
/* Process all bytes in the buffer with 64 bytes in each round of
the loop. */
diff --git a/libc/crypt/md5test-giant.c b/libc/crypt/md5test-giant.c
new file mode 100644
index 000000000..6751a2a4f
--- /dev/null
+++ b/libc/crypt/md5test-giant.c
@@ -0,0 +1,137 @@
+/* Testcase for http://sourceware.org/bugzilla/show_bug.cgi?id=14090.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published
+ by the Free Software Foundation; version 2 of the License, or
+ (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/mman.h>
+
+#include "md5.h"
+
+/* This test will not work with 32-bit size_t, so let it succeed
+ there. */
+#if SIZE_MAX <= UINT32_MAX
+static int
+do_test (void)
+{
+ return 0;
+}
+#else
+
+# define CONST_2G 0x080000000
+# define CONST_10G 0x280000000
+
+/* MD5 sum values of zero-filled blocks of specified sizes. */
+static const struct test_data_s
+{
+ const char ref[16];
+ size_t len;
+} test_data[] =
+ {
+ { "\xd4\x1d\x8c\xd9\x8f\x00\xb2\x04\xe9\x80\x09\x98\xec\xf8\x42\x7e",
+ 0x000000000 },
+ { "\xa9\x81\x13\x0c\xf2\xb7\xe0\x9f\x46\x86\xdc\x27\x3c\xf7\x18\x7e",
+ 0x080000000 },
+ { "\xc9\xa5\xa6\x87\x8d\x97\xb4\x8c\xc9\x65\xc1\xe4\x18\x59\xf0\x34",
+ 0x100000000 },
+ { "\x58\xcf\x63\x8a\x73\x3f\x91\x90\x07\xb4\x28\x7c\xf5\x39\x6d\x0c",
+ 0x180000000 },
+ { "\xb7\x70\x35\x1f\xad\xae\x5a\x96\xbb\xaf\x97\x02\xed\x97\xd2\x8d",
+ 0x200000000 },
+ { "\x2d\xd2\x6c\x4d\x47\x99\xeb\xd2\x9f\xa3\x1e\x48\xd4\x9e\x8e\x53",
+ 0x280000000 },
+};
+
+static int
+report (const char *id, const char *md5, size_t len, const char *ref)
+{
+ if (memcmp (md5, ref, 16))
+ {
+ printf ("test %s with size %zd failed\n", id, len);
+ return 1;
+ }
+ return 0;
+}
+
+/* Test md5 in a single md5_process_bytes call. */
+static int
+test_single (void *buf, size_t len, const char *ref)
+{
+ char sum[16];
+ struct md5_ctx ctx;
+
+ __md5_init_ctx (&ctx);
+ __md5_process_bytes (buf, len, &ctx);
+ __md5_finish_ctx (&ctx, sum);
+
+ return report ("single", sum, len, ref);
+}
+
+/* Test md5 with two md5_process_bytes calls to trigger a
+ different path in md5_process_block for sizes > 2 GB. */
+static int
+test_double (void *buf, size_t len, const char *ref)
+{
+ char sum[16];
+ struct md5_ctx ctx;
+
+ __md5_init_ctx (&ctx);
+ if (len >= CONST_2G)
+ {
+ __md5_process_bytes (buf, CONST_2G, &ctx);
+ __md5_process_bytes (buf + CONST_2G, len - CONST_2G, &ctx);
+ }
+ else
+ __md5_process_bytes (buf, len, &ctx);
+
+ __md5_finish_ctx (&ctx, sum);
+
+ return report ("double", sum, len, ref);
+}
+
+
+static int
+do_test (void)
+{
+ void *buf;
+ unsigned int j;
+ int result = 0;
+
+ buf = mmap64 (0, CONST_10G, PROT_READ, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
+ if (buf == MAP_FAILED)
+ {
+ puts ("Could not allocate 10 GB via mmap, skipping test.");
+ return 0;
+ }
+
+ for (j = 0; j < sizeof (test_data) / sizeof (struct test_data_s); j++)
+ {
+ if (test_single (buf, test_data[j].len, test_data[j].ref))
+ result = 1;
+ if (test_double (buf, test_data[j].len, test_data[j].ref))
+ result = 1;
+ }
+
+ return result;
+}
+#endif
+
+/* This needs on a fast machine 90s. */
+#define TIMEOUT 180
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/libc/crypt/sha512.c b/libc/crypt/sha512.c
index 6e531c58e..0675c948c 100644
--- a/libc/crypt/sha512.c
+++ b/libc/crypt/sha512.c
@@ -1,6 +1,6 @@
/* Functions to compute SHA512 message digest of files or memory blocks.
according to the definition of SHA512 in FIPS 180-2.
- Copyright (C) 2007, 2011 Free Software Foundation, Inc.
+ Copyright (C) 2007-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
@@ -123,9 +123,10 @@ sha512_process_block (const void *buffer, size_t len, struct sha512_ctx *ctx)
#ifdef USE_TOTAL128
ctx->total128 += len;
#else
- ctx->total[TOTAL128_low] += len;
- if (ctx->total[TOTAL128_low] < len)
- ++ctx->total[TOTAL128_high];
+ uint64_t lolen = len;
+ ctx->total[TOTAL128_low] += lolen;
+ ctx->total[TOTAL128_high] += ((len >> 31 >> 31 >> 2)
+ + (ctx->total[TOTAL128_low] < lolen));
#endif
/* Process all bytes in the buffer with 128 bytes in each round of
diff --git a/libc/debug/Makefile b/libc/debug/Makefile
index a097057ce..106d61ff2 100644
--- a/libc/debug/Makefile
+++ b/libc/debug/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 1998-2001,2004-2008, 2009, 2011, 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
@@ -58,32 +58,32 @@ routines-$(OPTION_POSIX_C_LANG_WIDE_CHAR) \
static-only-routines := warning-nop stack_chk_fail_local
CFLAGS-backtrace.c = -fno-omit-frame-pointer
-CFLAGS-sprintf_chk.c = -D_IO_MTSAFE_IO
-CFLAGS-snprintf_chk.c = -D_IO_MTSAFE_IO
-CFLAGS-vsprintf_chk.c = -D_IO_MTSAFE_IO
-CFLAGS-vsnprintf_chk.c = -D_IO_MTSAFE_IO
-CFLAGS-asprintf_chk.c = -D_IO_MTSAFE_IO
-CFLAGS-vasprintf_chk.c = -D_IO_MTSAFE_IO
-CFLAGS-obprintf_chk.c = -D_IO_MTSAFE_IO
-CFLAGS-dprintf_chk.c = -D_IO_MTSAFE_IO $(exceptions)
-CFLAGS-vdprintf_chk.c = -D_IO_MTSAFE_IO $(exceptions)
-CFLAGS-printf_chk.c = -D_IO_MTSAFE_IO $(exceptions)
-CFLAGS-fprintf_chk.c = -D_IO_MTSAFE_IO $(exceptions)
-CFLAGS-vprintf_chk.c = -D_IO_MTSAFE_IO $(exceptions)
-CFLAGS-vfprintf_chk.c = -D_IO_MTSAFE_IO $(exceptions)
-CFLAGS-gets_chk.c = -D_IO_MTSAFE_IO $(exceptions)
-CFLAGS-fgets_chk.c = -D_IO_MTSAFE_IO $(exceptions)
-CFLAGS-fgets_u_chk.c = -D_IO_MTSAFE_IO $(exceptions)
-CFLAGS-fread_chk.c = -D_IO_MTSAFE_IO $(exceptions)
-CFLAGS-fread_u_chk.c = -D_IO_MTSAFE_IO $(exceptions)
-CFLAGS-swprintf_chk.c = -D_IO_MTSAFE_IO
-CFLAGS-vswprintf_chk.c = -D_IO_MTSAFE_IO
-CFLAGS-wprintf_chk.c = -D_IO_MTSAFE_IO $(exceptions)
-CFLAGS-fwprintf_chk.c = -D_IO_MTSAFE_IO $(exceptions)
-CFLAGS-vwprintf_chk.c = -D_IO_MTSAFE_IO $(exceptions)
-CFLAGS-vfwprintf_chk.c = -D_IO_MTSAFE_IO $(exceptions)
-CFLAGS-fgetws_chk.c = -D_IO_MTSAFE_IO $(exceptions)
-CFLAGS-fgetws_u_chk.c = -D_IO_MTSAFE_IO $(exceptions)
+CFLAGS-sprintf_chk.c = $(libio-mtsafe)
+CFLAGS-snprintf_chk.c = $(libio-mtsafe)
+CFLAGS-vsprintf_chk.c = $(libio-mtsafe)
+CFLAGS-vsnprintf_chk.c = $(libio-mtsafe)
+CFLAGS-asprintf_chk.c = $(libio-mtsafe)
+CFLAGS-vasprintf_chk.c = $(libio-mtsafe)
+CFLAGS-obprintf_chk.c = $(libio-mtsafe)
+CFLAGS-dprintf_chk.c = $(libio-mtsafe) $(exceptions)
+CFLAGS-vdprintf_chk.c = $(libio-mtsafe) $(exceptions)
+CFLAGS-printf_chk.c = $(libio-mtsafe) $(exceptions)
+CFLAGS-fprintf_chk.c = $(libio-mtsafe) $(exceptions)
+CFLAGS-vprintf_chk.c = $(libio-mtsafe) $(exceptions)
+CFLAGS-vfprintf_chk.c = $(libio-mtsafe) $(exceptions)
+CFLAGS-gets_chk.c = $(libio-mtsafe) $(exceptions)
+CFLAGS-fgets_chk.c = $(libio-mtsafe) $(exceptions)
+CFLAGS-fgets_u_chk.c = $(libio-mtsafe) $(exceptions)
+CFLAGS-fread_chk.c = $(libio-mtsafe) $(exceptions)
+CFLAGS-fread_u_chk.c = $(libio-mtsafe) $(exceptions)
+CFLAGS-swprintf_chk.c = $(libio-mtsafe)
+CFLAGS-vswprintf_chk.c = $(libio-mtsafe)
+CFLAGS-wprintf_chk.c = $(libio-mtsafe) $(exceptions)
+CFLAGS-fwprintf_chk.c = $(libio-mtsafe) $(exceptions)
+CFLAGS-vwprintf_chk.c = $(libio-mtsafe) $(exceptions)
+CFLAGS-vfwprintf_chk.c = $(libio-mtsafe) $(exceptions)
+CFLAGS-fgetws_chk.c = $(libio-mtsafe) $(exceptions)
+CFLAGS-fgetws_u_chk.c = $(libio-mtsafe) $(exceptions)
CFLAGS-read_chk.c = -fexceptions -fasynchronous-unwind-tables
CFLAGS-pread_chk.c = -fexceptions -fasynchronous-unwind-tables
CFLAGS-pread64_chk.c = -fexceptions -fasynchronous-unwind-tables
diff --git a/libc/dirent/alphasort.c b/libc/dirent/alphasort.c
index 5939322ab..6fab7f89b 100644
--- a/libc/dirent/alphasort.c
+++ b/libc/dirent/alphasort.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1997, 1998, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 1992-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,7 +15,15 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+/* We need to avoid the header declaration of alphasort64, because
+ the types don't match alphasort and then the compiler will
+ complain about the mismatch when we do the alias below. */
+#define alphasort64 __renamed_alphasort64
+
#include <dirent.h>
+
+#undef alphasort64
+
#include <string.h>
int
@@ -23,3 +31,7 @@ alphasort (const struct dirent **a, const struct dirent **b)
{
return strcoll ((*a)->d_name, (*b)->d_name);
}
+
+#ifdef _DIRENT_MATCHES_DIRENT64
+weak_alias (alphasort, alphasort64)
+#endif
diff --git a/libc/dirent/alphasort64.c b/libc/dirent/alphasort64.c
index 4f5c1ddc3..a4d37abba 100644
--- a/libc/dirent/alphasort64.c
+++ b/libc/dirent/alphasort64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1997, 1998, 2000, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 1992-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,8 +18,13 @@
#include <dirent.h>
#include <string.h>
+/* alphasort.c defines alphasort64 as an alias if _DIRENT_MATCHES_DIRENT64. */
+#ifndef _DIRENT_MATCHES_DIRENT64
+
int
alphasort64 (const struct dirent64 **a, const struct dirent64 **b)
{
return strcoll ((*a)->d_name, (*b)->d_name);
}
+
+#endif
diff --git a/libc/dirent/scandir.c b/libc/dirent/scandir.c
index 8b0a87ba0..6dce54d64 100644
--- a/libc/dirent/scandir.c
+++ b/libc/dirent/scandir.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1992-1998,2000,2002,2003,2009,2011
- Free Software Foundation, Inc.
+/* Copyright (C) 1992-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
@@ -16,7 +15,15 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+/* We need to avoid the header declaration of scandir64, because
+ the types don't match scandir and then the compiler will
+ complain about the mismatch when we do the alias below. */
+#define scandir64 __renamed_scandir64
+
#include <dirent.h>
+
+#undef scandir64
+
#include <fcntl.h>
#ifndef SCANDIR
@@ -35,3 +42,7 @@ SCANDIR (dir, namelist, select, cmp)
{
return SCANDIRAT (AT_FDCWD, dir, namelist, select, cmp);
}
+
+#ifdef _DIRENT_MATCHES_DIRENT64
+weak_alias (scandir, scandir64)
+#endif
diff --git a/libc/dirent/scandir64.c b/libc/dirent/scandir64.c
index 78ac570a1..bba302f01 100644
--- a/libc/dirent/scandir64.c
+++ b/libc/dirent/scandir64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2009, 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2000-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
@@ -17,8 +17,13 @@
#include <dirent.h>
+/* scandir.c defines scandir64 as an alias if _DIRENT_MATCHES_DIRENT64. */
+#ifndef _DIRENT_MATCHES_DIRENT64
+
#define SCANDIR scandir64
#define SCANDIRAT scandirat64
#define DIRENT_TYPE struct dirent64
#include <dirent/scandir.c>
+
+#endif
diff --git a/libc/dirent/scandirat.c b/libc/dirent/scandirat.c
index 13bd57416..c2704baa8 100644
--- a/libc/dirent/scandirat.c
+++ b/libc/dirent/scandirat.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1992-1998,2000,2002,2003,2009,2011
- Free Software Foundation, Inc.
+/* Copyright (C) 1992-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
@@ -16,7 +15,15 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+/* We need to avoid the header declaration of scandir64, because
+ the types don't match scandir and then the compiler will
+ complain about the mismatch when we do the alias below. */
+#define scandirat64 __renamed_scandirat64
+
#include <dirent.h>
+
+#undef scandirat64
+
#include <stdlib.h>
#include <string.h>
#include <errno.h>
@@ -141,3 +148,7 @@ SCANDIRAT (dfd, dir, namelist, select, cmp)
return c.cnt;
}
libc_hidden_def (SCANDIRAT)
+
+#ifdef _DIRENT_MATCHES_DIRENT64
+weak_alias (scandirat, scandirat64)
+#endif
diff --git a/libc/dirent/scandirat64.c b/libc/dirent/scandirat64.c
index a816ee9e8..608ca33ac 100644
--- a/libc/dirent/scandirat64.c
+++ b/libc/dirent/scandirat64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2009, 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2000-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
@@ -17,9 +17,14 @@
#include <dirent.h>
+/* scandirat.c defines scandirat64 as an alias if _DIRENT_MATCHES_DIRENT64. */
+#ifndef _DIRENT_MATCHES_DIRENT64
+
#define SCANDIRAT scandirat64
#define READDIR __readdir64
#define DIRENT_TYPE struct dirent64
#define SKIP_SCANDIR_CANCEL 1
#include "scandirat.c"
+
+#endif
diff --git a/libc/dirent/versionsort.c b/libc/dirent/versionsort.c
index 47bda040d..ee3465904 100644
--- a/libc/dirent/versionsort.c
+++ b/libc/dirent/versionsort.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1997, 1998, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 1992-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,7 +15,15 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+/* We need to avoid the header declaration of versionsort64, because
+ the types don't match versionsort and then the compiler will
+ complain about the mismatch when we do the alias below. */
+#define versionsort64 __renamed_versionsort64
+
#include <dirent.h>
+
+#undef versionsort64
+
#include <string.h>
int
@@ -23,3 +31,7 @@ versionsort (const struct dirent **a, const struct dirent **b)
{
return __strverscmp ((*a)->d_name, (*b)->d_name);
}
+
+#ifdef _DIRENT_MATCHES_DIRENT64
+weak_alias (versionsort, versionsort64)
+#endif
diff --git a/libc/dirent/versionsort64.c b/libc/dirent/versionsort64.c
index 5b40e10bd..dca72e8d1 100644
--- a/libc/dirent/versionsort64.c
+++ b/libc/dirent/versionsort64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1997, 1998, 2000, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 1992-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,8 +18,13 @@
#include <dirent.h>
#include <string.h>
+/* versionsort.c defines a versionsort64 alias if _DIRENT_MATCHES_DIRENT64. */
+#ifndef _DIRENT_MATCHES_DIRENT64
+
int
versionsort64 (const struct dirent64 **a, const struct dirent64 **b)
{
return __strverscmp ((*a)->d_name, (*b)->d_name);
}
+
+#endif
diff --git a/libc/elf/chroot_canon.c b/libc/elf/chroot_canon.c
index a7a7d9b22..397125fe6 100644
--- a/libc/elf/chroot_canon.c
+++ b/libc/elf/chroot_canon.c
@@ -1,6 +1,5 @@
/* Return the canonical absolute name of a given file inside chroot.
- Copyright (C) 1996,1997,1998,1999,2000,2001,2004,2005,2010,2011
- Free Software Foundation, Inc.
+ Copyright (C) 1996-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
This program is free software; you can redistribute it and/or modify
@@ -20,12 +19,12 @@
#include <string.h>
#include <unistd.h>
#include <limits.h>
-#include <sys/param.h>
#include <sys/stat.h>
#include <errno.h>
#include <stddef.h>
#include <stdint.h>
+#include <eloop-threshold.h>
#include <ldconfig.h>
#ifndef PATH_MAX
@@ -127,7 +126,7 @@ chroot_canon (const char *chroot, const char *name)
char *buf = alloca (PATH_MAX);
size_t len;
- if (++num_links > MAXSYMLINKS)
+ if (++num_links > __eloop_threshold ())
{
__set_errno (ELOOP);
goto error;
diff --git a/libc/elf/dl-close.c b/libc/elf/dl-close.c
index 8fb3a742b..64dec36fb 100644
--- a/libc/elf/dl-close.c
+++ b/libc/elf/dl-close.c
@@ -641,7 +641,7 @@ _dl_close_worker (struct link_map *map)
#ifdef SHARED
assert (nsid != LM_ID_BASE);
#endif
- ns->_ns_loaded = imap->l_next;
+ r->r_map = ns->_ns_loaded = imap->l_next;
}
--ns->_ns_nloaded;
diff --git a/libc/elf/dl-load.c b/libc/elf/dl-load.c
index bc969e9e3..4d708bc5d 100644
--- a/libc/elf/dl-load.c
+++ b/libc/elf/dl-load.c
@@ -1194,9 +1194,11 @@ _dl_map_object_from_fd (const char *name, int fd, struct filebuf *fbp,
was executed directly. The setup will happen later. */
break;
+# ifdef _LIBC_REENTRANT
/* In a static binary there is no way to tell if we dynamically
loaded libpthread. */
if (GL(dl_error_catch_tsd) == &_dl_initial_error_catch_tsd)
+# endif
#endif
{
/* We have not yet loaded libpthread.
diff --git a/libc/elf/dl-lookup.c b/libc/elf/dl-lookup.c
index d8580bccb..c245b5694 100644
--- a/libc/elf/dl-lookup.c
+++ b/libc/elf/dl-lookup.c
@@ -1,5 +1,5 @@
/* Look up a symbol in the loaded objects.
- 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
@@ -27,6 +27,7 @@
#include <sysdep-cancel.h>
#include <bits/libc-lock.h>
#include <tls.h>
+#include <atomic.h>
#include <assert.h>
diff --git a/libc/elf/dl-open.c b/libc/elf/dl-open.c
index 8538f87a1..903bdf13f 100644
--- a/libc/elf/dl-open.c
+++ b/libc/elf/dl-open.c
@@ -1,5 +1,5 @@
/* Load a shared object at runtime, relocate it, and run its initializer.
- Copyright (C) 1996-2007, 2009-2012 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
@@ -33,6 +33,7 @@
#include <sysdep-cancel.h>
#include <tls.h>
#include <stap-probe.h>
+#include <atomic.h>
#include <dl-dst.h>
diff --git a/libc/elf/dl-sym.c b/libc/elf/dl-sym.c
index 1e7ad2258..6480f2359 100644
--- a/libc/elf/dl-sym.c
+++ b/libc/elf/dl-sym.c
@@ -1,5 +1,5 @@
/* Look up a symbol in a shared object loaded by `dlopen'.
- Copyright (C) 1999-2002,2004,2006,2007,2009 Free Software Foundation, Inc.
+ Copyright (C) 1999-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,6 +19,7 @@
#include <assert.h>
#include <stddef.h>
#include <setjmp.h>
+#include <stdlib.h>
#include <libintl.h>
#include <dlfcn.h>
diff --git a/libc/elf/elf.h b/libc/elf/elf.h
index 71cfdb818..1e67ef5ef 100644
--- a/libc/elf/elf.h
+++ b/libc/elf/elf.h
@@ -2734,8 +2734,23 @@ typedef Elf32_Addr Elf32_Conflict;
#define R_MN10300_GLOB_DAT 21 /* Create GOT entry. */
#define R_MN10300_JMP_SLOT 22 /* Create PLT entry. */
#define R_MN10300_RELATIVE 23 /* Adjust by program base. */
-
-#define R_MN10300_NUM 24
+#define R_MN10300_TLS_GD 24 /* 32-bit offset for global dynamic. */
+#define R_MN10300_TLS_LD 25 /* 32-bit offset for local dynamic. */
+#define R_MN10300_TLS_LDO 26 /* Module-relative offset. */
+#define R_MN10300_TLS_GOTIE 27 /* GOT offset for static TLS block
+ offset. */
+#define R_MN10300_TLS_IE 28 /* GOT address for static TLS block
+ offset. */
+#define R_MN10300_TLS_LE 29 /* Offset relative to static TLS
+ block. */
+#define R_MN10300_TLS_DTPMOD 30 /* ID of module containing symbol. */
+#define R_MN10300_TLS_DTPOFF 31 /* Offset in module TLS block. */
+#define R_MN10300_TLS_TPOFF 32 /* Offset in static TLS block. */
+#define R_MN10300_SYM_DIFF 33 /* Adjustment for next reloc as needed
+ by linker relaxation. */
+#define R_MN10300_ALIGN 34 /* Alignment requirement for linker
+ relaxation. */
+#define R_MN10300_NUM 35
/* M32R relocs. */
diff --git a/libc/elf/tst-unique1mod1.c b/libc/elf/tst-unique1mod1.c
index ccc74fae3..f59029d05 100644
--- a/libc/elf/tst-unique1mod1.c
+++ b/libc/elf/tst-unique1mod1.c
@@ -1,12 +1,9 @@
#include <config.h>
#ifdef HAVE_ASM_UNIQUE_OBJECT
-# define S(s) _S (s)
-# define _S(s) #s
-
asm (".data;"
".globl var\n"
- ".type var, " S (ASM_TYPE_DIRECTIVE_PREFIX) "gnu_unique_object\n"
+ ".type var, %gnu_unique_object\n"
".size var, 4\n"
"var:.zero 4\n"
".previous");
diff --git a/libc/elf/tst-unique1mod2.c b/libc/elf/tst-unique1mod2.c
index 4f1fec008..aa28f29ba 100644
--- a/libc/elf/tst-unique1mod2.c
+++ b/libc/elf/tst-unique1mod2.c
@@ -1,12 +1,9 @@
#include <config.h>
#ifdef HAVE_ASM_UNIQUE_OBJECT
-# define S(s) _S (s)
-# define _S(s) #s
-
asm (".data;"
".globl var\n"
- ".type var, " S (ASM_TYPE_DIRECTIVE_PREFIX) "gnu_unique_object\n"
+ ".type var, %gnu_unique_object\n"
".size var, 4\n"
"var:.zero 4\n"
".previous");
diff --git a/libc/elf/tst-unique2mod1.c b/libc/elf/tst-unique2mod1.c
index 18b14db43..b7e491b2e 100644
--- a/libc/elf/tst-unique2mod1.c
+++ b/libc/elf/tst-unique2mod1.c
@@ -1,12 +1,9 @@
#include <config.h>
#ifdef HAVE_ASM_UNIQUE_OBJECT
-# define S(s) _S (s)
-# define _S(s) #s
-
asm (".data;"
".globl var\n"
- ".type var, " S (ASM_TYPE_DIRECTIVE_PREFIX) "gnu_unique_object\n"
+ ".type var, %gnu_unique_object\n"
".size var, 4\n"
"var:.zero 4\n"
".previous");
diff --git a/libc/elf/tst-unique2mod2.c b/libc/elf/tst-unique2mod2.c
index 4f1fec008..aa28f29ba 100644
--- a/libc/elf/tst-unique2mod2.c
+++ b/libc/elf/tst-unique2mod2.c
@@ -1,12 +1,9 @@
#include <config.h>
#ifdef HAVE_ASM_UNIQUE_OBJECT
-# define S(s) _S (s)
-# define _S(s) #s
-
asm (".data;"
".globl var\n"
- ".type var, " S (ASM_TYPE_DIRECTIVE_PREFIX) "gnu_unique_object\n"
+ ".type var, %gnu_unique_object\n"
".size var, 4\n"
"var:.zero 4\n"
".previous");
diff --git a/libc/grp/Makefile b/libc/grp/Makefile
index d5625a90e..d45c95143 100644
--- a/libc/grp/Makefile
+++ b/libc/grp/Makefile
@@ -1,5 +1,4 @@
-# Copyright (C) 1991,1992,1996-2000,2003,2004,2012
-# Free Software Foundation, Inc.
+# Copyright (C) 1991-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,8 +50,8 @@ CFLAGS-getgrnam_r.c = $(OPTION_EGLIBC_INET-CFLAGS-y) -fexceptions
CFLAGS-getgrent_r.c = -fexceptions
CFLAGS-getgrent.c = -fexceptions
CFLAGS-fgetgrent.c = -fexceptions
-CFLAGS-fgetgrent_r.c = -fexceptions -D_IO_MTSAFE_IO
-CFLAGS-putgrent.c = -fexceptions -D_IO_MTSAFE_IO
+CFLAGS-fgetgrent_r.c = -fexceptions $(libio-mtsafe)
+CFLAGS-putgrent.c = -fexceptions $(libio-mtsafe)
CFLAGS-initgroups.c = $(OPTION_EGLIBC_INET-CFLAGS-y) -fexceptions
CFLAGS-getgrgid.c = -fexceptions
diff --git a/libc/gshadow/Makefile b/libc/gshadow/Makefile
index a482c5d70..2cb714fde 100644
--- a/libc/gshadow/Makefile
+++ b/libc/gshadow/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 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
@@ -29,8 +29,8 @@ tests = tst-gshadow
CFLAGS-getsgent_r.c = -fexceptions
CFLAGS-getsgent.c = -fexceptions
CFLAGS-fgetsgent.c = -fexceptions
-CFLAGS-fgetsgent_r.c = -fexceptions -D_IO_MTSAFE_IO
-CFLAGS-putsgent.c = -fexceptions -D_IO_MTSAFE_IO
+CFLAGS-fgetsgent_r.c = -fexceptions $(libio-mtsafe)
+CFLAGS-putsgent.c = -fexceptions $(libio-mtsafe)
CFLAGS-getsgnam.c = -fexceptions
CFLAGS-getsgnam_r.c = -fexceptions
diff --git a/libc/hurd/lookup-retry.c b/libc/hurd/lookup-retry.c
index 4fa2a2199..c95ca0f64 100644
--- a/libc/hurd/lookup-retry.c
+++ b/libc/hurd/lookup-retry.c
@@ -24,6 +24,7 @@
#include <fcntl.h>
#include <string.h>
#include <_itoa.h>
+#include <eloop-threshold.h>
/* Translate the error from dir_lookup into the error the user sees. */
static inline error_t
@@ -103,7 +104,7 @@ __hurd_file_name_lookup_retry (error_t (*use_init_port)
/* Fall through. */
case FS_RETRY_NORMAL:
- if (nloops++ >= SYMLOOP_MAX)
+ if (nloops++ >= __eloop_threshold ())
{
__mach_port_deallocate (__mach_task_self (), *result);
return ELOOP;
@@ -180,7 +181,7 @@ __hurd_file_name_lookup_retry (error_t (*use_init_port)
dirport = INIT_PORT_CRDIR;
if (*result != MACH_PORT_NULL)
__mach_port_deallocate (__mach_task_self (), *result);
- if (nloops++ >= SYMLOOP_MAX)
+ if (nloops++ >= __eloop_threshold ())
return ELOOP;
file_name = &retryname[1];
break;
diff --git a/libc/include/atomic.h b/libc/include/atomic.h
index 3ccb46d9e..bc20772f2 100644
--- a/libc/include/atomic.h
+++ b/libc/include/atomic.h
@@ -198,8 +198,12 @@
/* Add VALUE to *MEM and return the old value of *MEM. */
-#ifndef atomic_exchange_and_add
-# define atomic_exchange_and_add(mem, value) \
+#ifndef atomic_exchange_and_add_acq
+# ifdef atomic_exchange_and_add
+# define atomic_exchange_and_add_acq(mem, value) \
+ atomic_exchange_and_add (mem, value)
+# else
+# define atomic_exchange_and_add_acq(mem, value) \
({ __typeof (*(mem)) __atg6_oldval; \
__typeof (mem) __atg6_memp = (mem); \
__typeof (*(mem)) __atg6_value = (value); \
@@ -213,8 +217,18 @@
__atg6_oldval), 0)); \
\
__atg6_oldval; })
+# endif
#endif
+#ifndef atomic_exchange_and_add_rel
+# define atomic_exchange_and_add_rel(mem, value) \
+ atomic_exchange_and_add_acq(mem, value)
+#endif
+
+#ifndef atomic_exchange_and_add
+# define atomic_exchange_and_add(mem, value) \
+ atomic_exchange_and_add_acq(mem, value)
+#endif
#ifndef catomic_exchange_and_add
# define catomic_exchange_and_add(mem, value) \
diff --git a/libc/include/dirent.h b/libc/include/dirent.h
index 8e4823ce7..096a9771a 100644
--- a/libc/include/dirent.h
+++ b/libc/include/dirent.h
@@ -30,6 +30,10 @@ extern int __scandir64 (const char * __dir,
int (*__selector) (const struct dirent64 *),
int (*__cmp) (const struct dirent64 **,
const struct dirent64 **));
+extern __ssize_t __getdirentries (int __fd, char *__restrict __buf,
+ size_t __nbytes,
+ __off_t *__restrict __basep)
+ __THROW __nonnull ((2, 4));
extern __ssize_t __getdents (int __fd, char *__buf, size_t __nbytes)
internal_function;
extern __ssize_t __getdents64 (int __fd, char *__buf, size_t __nbytes)
diff --git a/libc/include/libc-symbols.h b/libc/include/libc-symbols.h
index 482148913..a288f0232 100644
--- a/libc/include/libc-symbols.h
+++ b/libc/include/libc-symbols.h
@@ -27,8 +27,6 @@
It should define for us the following symbols:
* HAVE_ASM_SET_DIRECTIVE if we have `.set B, A' instead of `A = B'.
- * ASM_TYPE_DIRECTIVE_PREFIX with `@' or `#' or whatever for .type,
- or leave it undefined if there is no .type directive.
* HAVE_ASM_WEAK_DIRECTIVE if we have weak symbols using `.weak'.
* HAVE_ASM_WEAKEXT_DIRECTIVE if we have weak symbols using `.weakext'.
@@ -252,37 +250,26 @@ for linking")
thinks it is. */
#define declare_symbol_alias(symbol, original, type, size) \
declare_symbol_alias_1 (symbol, original, type, size)
-#ifdef ASM_TYPE_DIRECTIVE_PREFIX
-# ifdef __ASSEMBLER__
-# define declare_symbol_alias_1(symbol, original, type, size) \
- strong_alias (original, symbol); \
- .type C_SYMBOL_NAME (symbol), \
- declare_symbol_alias_1_paste (ASM_TYPE_DIRECTIVE_PREFIX, type); \
- .size C_SYMBOL_NAME (symbol), size
-# define declare_symbol_alias_1_paste(a, b) \
- declare_symbol_alias_1_paste_1 (a,b)
-# define declare_symbol_alias_1_paste_1(a,b) a##b
-# else /* Not __ASSEMBLER__. */
-# define declare_symbol_alias_1(symbol, original, type, size) \
- asm (".globl " __SYMBOL_PREFIX #symbol \
- "\n\t" declare_symbol_alias_1_alias (symbol, original) \
- "\n\t.type " __SYMBOL_PREFIX #symbol ", " \
- declare_symbol_alias_1_stringify (ASM_TYPE_DIRECTIVE_PREFIX) #type \
- "\n\t.size " __SYMBOL_PREFIX #symbol ", " #size);
-# define declare_symbol_alias_1_stringify(x) \
- declare_symbol_alias_1_stringify_1 (x)
-# define declare_symbol_alias_1_stringify_1(x) #x
-# ifdef HAVE_ASM_SET_DIRECTIVE
-# define declare_symbol_alias_1_alias(symbol, original) \
- ".set " __SYMBOL_PREFIX #symbol ", " __SYMBOL_PREFIX #original
-# else
-# define declare_symbol_alias_1_alias(symbol, original) \
- __SYMBOL_PREFIX #symbol " = " __SYMBOL_PREFIX #original
-# endif /* HAVE_ASM_SET_DIRECTIVE */
-# endif /* __ASSEMBLER__ */
-#else
-# define declare_symbol_1(symbol, type, size) /* Nothing. */
-#endif
+#ifdef __ASSEMBLER__
+# define declare_symbol_alias_1(symbol, original, type, size) \
+ strong_alias (original, symbol); \
+ .type C_SYMBOL_NAME (symbol), %##type; \
+ .size C_SYMBOL_NAME (symbol), size
+#else /* Not __ASSEMBLER__. */
+# define declare_symbol_alias_1(symbol, original, type, size) \
+ asm (".globl " __SYMBOL_PREFIX #symbol \
+ "\n\t" declare_symbol_alias_1_alias (symbol, original) \
+ "\n\t.type " __SYMBOL_PREFIX #symbol ", " \
+ "%" #type \
+ "\n\t.size " __SYMBOL_PREFIX #symbol ", " #size);
+# ifdef HAVE_ASM_SET_DIRECTIVE
+# define declare_symbol_alias_1_alias(symbol, original) \
+ ".set " __SYMBOL_PREFIX #symbol ", " __SYMBOL_PREFIX #original
+# else
+# define declare_symbol_alias_1_alias(symbol, original) \
+ __SYMBOL_PREFIX #symbol " = " __SYMBOL_PREFIX #original
+# endif /* HAVE_ASM_SET_DIRECTIVE */
+#endif /* __ASSEMBLER__ */
/*
diff --git a/libc/include/sys/socket.h b/libc/include/sys/socket.h
index e356b75b9..50e6bb3a7 100644
--- a/libc/include/sys/socket.h
+++ b/libc/include/sys/socket.h
@@ -132,11 +132,11 @@ extern int __listen (int __fd, int __n) attribute_hidden;
new socket's descriptor, or -1 for errors. */
extern int __libc_accept (int __fd, __SOCKADDR_ARG __addr,
socklen_t *__restrict __addr_len)
- __THROW;
+ __THROW attribute_hidden;
libc_hidden_proto (accept)
extern int __libc_accept4 (int __fd, __SOCKADDR_ARG __addr,
socklen_t *__restrict __addr_len, int __flags)
- __THROW;
+ __THROW attribute_hidden;
/* Return the length of a `sockaddr' structure. */
#ifdef _HAVE_SA_LEN
diff --git a/libc/inet/getnetgrent_r.c b/libc/inet/getnetgrent_r.c
index 2e280e7e6..c57e7de17 100644
--- a/libc/inet/getnetgrent_r.c
+++ b/libc/inet/getnetgrent_r.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1996,1997,1998,1999,2002,2004,2005,2007,2011
- 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
@@ -57,14 +56,18 @@ setup (void **fctp, service_user **nipp)
same result every time. So we need no locking. */
no_more = __nss_netgroup_lookup (nipp, "setnetgrent", fctp);
startp = no_more ? (service_user *) -1 : *nipp;
+#ifdef PTR_MANGLE
PTR_MANGLE (startp);
+#endif
atomic_write_barrier ();
startp_initialized = true;
}
else
{
service_user *nip = startp;
+#ifdef PTR_DEMANGLE
PTR_DEMANGLE (nip);
+#endif
if (nip == (service_user *) -1)
/* No services at all. */
return 1;
@@ -168,19 +171,16 @@ __internal_setnetgrent_reuse (const char *group, struct __netgrent *datap,
return status == NSS_STATUS_SUCCESS;
}
-int internal_setnetgrent (const char *group, struct __netgrent *datap);
-libc_hidden_proto (internal_setnetgrent)
-
int
-internal_setnetgrent (const char *group, struct __netgrent *datap)
+internal_function
+__internal_setnetgrent (const char *group, struct __netgrent *datap)
{
/* Free list of all netgroup names from last run. */
free_memory (datap);
return __internal_setnetgrent_reuse (group, datap, &errno);
}
-libc_hidden_def (internal_setnetgrent)
-strong_alias (internal_setnetgrent, __internal_setnetgrent)
+libc_hidden_def (__internal_setnetgrent)
int
setnetgrent (const char *group)
@@ -201,7 +201,7 @@ setnetgrent (const char *group)
goto out;
}
- result = internal_setnetgrent (group, &dataset);
+ result = __internal_setnetgrent (group, &dataset);
out:
__libc_lock_unlock (lock);
@@ -209,18 +209,15 @@ setnetgrent (const char *group)
return result;
}
-void internal_endnetgrent (struct __netgrent *datap);
-libc_hidden_proto (internal_endnetgrent)
-
void
-internal_endnetgrent (struct __netgrent *datap)
+internal_function
+__internal_endnetgrent (struct __netgrent *datap)
{
endnetgrent_hook (datap);
/* Now free list of all netgroup names from last run. */
free_memory (datap);
}
-libc_hidden_def (internal_endnetgrent)
-strong_alias (internal_endnetgrent, __internal_endnetgrent)
+libc_hidden_def (__internal_endnetgrent)
void
@@ -228,18 +225,12 @@ endnetgrent (void)
{
__libc_lock_lock (lock);
- internal_endnetgrent (&dataset);
+ __internal_endnetgrent (&dataset);
__libc_lock_unlock (lock);
}
-int internal_getnetgrent_r (char **hostp, char **userp, char **domainp,
- struct __netgrent *datap,
- char *buffer, size_t buflen, int *errnop);
-libc_hidden_proto (internal_getnetgrent_r)
-
-
static enum nss_status
nscd_getnetgrent (struct __netgrent *datap, char *buffer, size_t buflen,
int *errnop)
@@ -260,7 +251,8 @@ nscd_getnetgrent (struct __netgrent *datap, char *buffer, size_t buflen,
int
-internal_getnetgrent_r (char **hostp, char **userp, char **domainp,
+internal_function
+__internal_getnetgrent_r (char **hostp, char **userp, char **domainp,
struct __netgrent *datap,
char *buffer, size_t buflen, int *errnop)
{
@@ -358,8 +350,7 @@ internal_getnetgrent_r (char **hostp, char **userp, char **domainp,
return status == NSS_STATUS_SUCCESS ? 1 : 0;
}
-libc_hidden_def (internal_getnetgrent_r)
-strong_alias (internal_getnetgrent_r, __internal_getnetgrent_r)
+libc_hidden_def (__internal_getnetgrent_r)
/* The real entry point. */
int
@@ -370,8 +361,8 @@ __getnetgrent_r (char **hostp, char **userp, char **domainp,
__libc_lock_lock (lock);
- status = internal_getnetgrent_r (hostp, userp, domainp, &dataset,
- buffer, buflen, &errno);
+ status = __internal_getnetgrent_r (hostp, userp, domainp, &dataset,
+ buffer, buflen, &errno);
__libc_lock_unlock (lock);
diff --git a/libc/inet/netgroup.h b/libc/inet/netgroup.h
index 2c0d1a483..f3797a698 100644
--- a/libc/inet/netgroup.h
+++ b/libc/inet/netgroup.h
@@ -1,5 +1,5 @@
/* Internal header for netgroup related functions.
- Copyright (C) 1996, 1997, 2004 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
@@ -70,10 +70,16 @@ struct __netgrent
/* The internal netgroup handling functions might be called from outside. */
extern int __internal_setnetgrent (const char *group,
- struct __netgrent *datap);
-extern void __internal_endnetgrent (struct __netgrent *datap);
+ struct __netgrent *datap)
+ internal_function;
+libc_hidden_proto (__internal_setnetgrent)
+extern void __internal_endnetgrent (struct __netgrent *datap)
+ internal_function;
+libc_hidden_proto (__internal_endnetgrent)
extern int __internal_getnetgrent_r (char **hostp, char **userp,
char **domainp, struct __netgrent *datap,
- char *buffer, size_t buflen, int *errnop);
+ char *buffer, size_t buflen, int *errnop)
+ internal_function;
+libc_hidden_proto (__internal_getnetgrent_r)
#endif /* netgroup.h */
diff --git a/libc/io/lockf.c b/libc/io/lockf.c
index 42232d076..1ee95114d 100644
--- a/libc/io/lockf.c
+++ b/libc/io/lockf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994,1996,1997,1998,2000,2003 Free Software Foundation, Inc.
+/* Copyright (C) 1994-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,9 +15,17 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+/* We need to avoid the header declaration of lockf64, because
+ the types don't match lockf and then the compiler will
+ complain about the mismatch when we do the alias below. */
+#define lockf64 __renamed_lockf64
+
+#include <fcntl.h>
+
+#undef lockf64
+
#include <sys/types.h>
#include <unistd.h>
-#include <fcntl.h>
#include <errno.h>
#include <string.h>
@@ -71,3 +79,7 @@ lockf (int fd, int cmd, off_t len)
the fcntl() function will take care of it. */
return __fcntl (fd, cmd, &fl);
}
+
+#ifdef __OFF_T_MATCHES_OFF64_T
+weak_alias (lockf, lockf64)
+#endif
diff --git a/libc/io/lockf64.c b/libc/io/lockf64.c
index 80ca151c1..60516ebaa 100644
--- a/libc/io/lockf64.c
+++ b/libc/io/lockf64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994,96,97,98,99,2000 Free Software Foundation, Inc.
+/* Copyright (C) 1994-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,9 @@
#include <errno.h>
#include <string.h>
+/* lockf.c defines lockf64 as an lias if __OFF_T_MATCHES_OFF64_T. */
+#ifndef __OFF_T_MATCHES_OFF64_T
+
/* lockf is a simplified interface to fcntl's locking facilities. */
int
@@ -76,3 +79,5 @@ lockf64 (int fd, int cmd, off64_t len64)
return __fcntl (fd, cmd, &fl);
}
+
+#endif
diff --git a/libc/misc/lseek.c b/libc/io/lseek.c
index 0729cb66e..0729cb66e 100644
--- a/libc/misc/lseek.c
+++ b/libc/io/lseek.c
diff --git a/libc/libio/Makefile b/libc/libio/Makefile
index 67f30aea0..ba2466076 100644
--- a/libc/libio/Makefile
+++ b/libc/libio/Makefile
@@ -92,14 +92,14 @@ routines += oldiofopen oldiofdopen oldiofclose oldiopopen oldpclose \
oldiofsetpos64
endif
-ifneq (,$(filter %REENTRANT, $(defines)))
+ifeq (yes,$(libc-reentrant))
routines += clearerr_u feof_u ferror_u fputc_u getc_u getchar_u \
iofflush_u putc_u putchar_u peekc iofread_u iofwrite_u iofgets_u \
iofputs_u
-
-CPPFLAGS += -D_IO_MTSAFE_IO
endif
+CPPFLAGS += $(libio-mtsafe)
+
# Support for exception handling.
CFLAGS-fileops.c = $(exceptions)
CFLAGS-fputc.c = $(exceptions)
diff --git a/libc/libio/fseeko.c b/libc/libio/fseeko.c
index 7a70636e5..6d37aeaab 100644
--- a/libc/libio/fseeko.c
+++ b/libc/libio/fseeko.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993,1995,1996,1997,1998,2003 Free Software Foundation, Inc.
+/* Copyright (C) 1993-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
@@ -40,3 +40,7 @@ fseeko (fp, offset, whence)
_IO_release_lock (fp);
return result;
}
+
+#ifdef __OFF_T_MATCHES_OFF64_T
+weak_alias (fseeko, fseeko64)
+#endif
diff --git a/libc/libio/fseeko64.c b/libc/libio/fseeko64.c
index 2291f6148..9fbe308c5 100644
--- a/libc/libio/fseeko64.c
+++ b/libc/libio/fseeko64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993,1995,1996,1997,1998,2003 Free Software Foundation, Inc.
+/* Copyright (C) 1993-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,9 @@
#include "libioP.h"
#include "stdio.h"
+/* fseeko.c defines this as an alias if __OFF_T_MATCHES_OFF64_T. */
+#ifndef __OFF_T_MATCHES_OFF64_T
+
int
fseeko64 (fp, offset, whence)
_IO_FILE* fp;
@@ -46,3 +49,5 @@ fseeko64 (fp, offset, whence)
return -1;
#endif
}
+
+#endif
diff --git a/libc/libio/ftello.c b/libc/libio/ftello.c
index 1d85bc6e4..90522769e 100644
--- a/libc/libio/ftello.c
+++ b/libc/libio/ftello.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1993, 1995-2001, 2002, 2003, 2004, 2007
- Free Software Foundation, Inc.
+/* Copyright (C) 1993-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
@@ -63,3 +62,7 @@ ftello (fp)
return pos;
}
libc_hidden_def (ftello)
+
+#ifdef __OFF_T_MATCHES_OFF64_T
+weak_alias (ftello, ftello64)
+#endif
diff --git a/libc/libio/ftello64.c b/libc/libio/ftello64.c
index 0f70c6630..852ef71eb 100644
--- a/libc/libio/ftello64.c
+++ b/libc/libio/ftello64.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1993, 1995-2001, 2002, 2003, 2004
- Free Software Foundation, Inc.
+/* Copyright (C) 1993-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
@@ -30,6 +29,7 @@
#include <libioP.h>
#include <errno.h>
+#ifndef __OFF_T_MATCHES_OFF64_T
off64_t
ftello64 (fp)
@@ -60,3 +60,5 @@ ftello64 (fp)
return -1;
#endif
}
+
+#endif
diff --git a/libc/libio/genops.c b/libc/libio/genops.c
index c8297ff12..0a81a5d10 100644
--- a/libc/libio/genops.c
+++ b/libc/libio/genops.c
@@ -952,6 +952,7 @@ _IO_unbuffer_write (void)
/* Iff stream is un-orientated, it wasn't used. */
&& fp->_mode != 0)
{
+#ifdef _IO_MTSAFE_IO
int cnt;
#define MAXTRIES 2
for (cnt = 0; cnt < MAXTRIES; ++cnt)
@@ -961,6 +962,7 @@ _IO_unbuffer_write (void)
/* Give the other thread time to finish up its use of the
stream. */
__sched_yield ();
+#endif
if (! dealloc_buffers && !(fp->_flags & _IO_USER_BUF))
{
@@ -974,8 +976,10 @@ _IO_unbuffer_write (void)
_IO_SETBUF (fp, NULL, 0);
+#ifdef _IO_MTSAFE_IO
if (cnt < MAXTRIES && fp->_lock != NULL)
_IO_lock_unlock (*fp->_lock);
+#endif
}
/* Make sure that never again the wide char functions can be
diff --git a/libc/libio/iofgetpos.c b/libc/libio/iofgetpos.c
index 4338b5097..a1d6bb693 100644
--- a/libc/libio/iofgetpos.c
+++ b/libc/libio/iofgetpos.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1993, 1995-2001, 2002, 2003, 2004
- Free Software Foundation, Inc.
+/* Copyright (C) 1993-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
@@ -25,7 +24,17 @@
This exception applies to code released by its copyright holders
in files containing the exception. */
+/* We need to avoid the header declarations of these, because
+ the types don't match _IO_fgetpos and then the compiler will
+ complain about the mismatch when we do the alias below. */
+#define _IO_new_fgetpos64 __renamed__IO_new_fgetpos64
+#define _IO_fgetpos64 __renamed__IO_fgetpos64
+
#include "libioP.h"
+
+#undef _IO_new_fgetpos64
+#undef _IO_fgetpos64
+
#include <errno.h>
#include <stdlib.h>
#include <shlib-compat.h>
@@ -78,3 +87,10 @@ _IO_new_fgetpos (fp, posp)
strong_alias (_IO_new_fgetpos, __new_fgetpos)
versioned_symbol (libc, _IO_new_fgetpos, _IO_fgetpos, GLIBC_2_2);
versioned_symbol (libc, __new_fgetpos, fgetpos, GLIBC_2_2);
+
+#ifdef __OFF_T_MATCHES_OFF64_T
+strong_alias (_IO_new_fgetpos, _IO_new_fgetpos64)
+strong_alias (_IO_new_fgetpos64, __new_fgetpos64)
+versioned_symbol (libc, _IO_new_fgetpos64, _IO_fgetpos64, GLIBC_2_2);
+versioned_symbol (libc, __new_fgetpos64, fgetpos64, GLIBC_2_2);
+#endif
diff --git a/libc/libio/iofgetpos64.c b/libc/libio/iofgetpos64.c
index 0cb141b14..9755c3273 100644
--- a/libc/libio/iofgetpos64.c
+++ b/libc/libio/iofgetpos64.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1993, 1995-2001, 2002, 2003, 2004
- Free Software Foundation, Inc.
+/* Copyright (C) 1993-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
@@ -29,6 +28,7 @@
#include <errno.h>
#include <shlib-compat.h>
+#ifndef __OFF_T_MATCHES_OFF64_T
int
_IO_new_fgetpos64 (fp, posp)
@@ -75,3 +75,5 @@ _IO_new_fgetpos64 (fp, posp)
strong_alias (_IO_new_fgetpos64, __new_fgetpos64)
versioned_symbol (libc, _IO_new_fgetpos64, _IO_fgetpos64, GLIBC_2_2);
versioned_symbol (libc, __new_fgetpos64, fgetpos64, GLIBC_2_2);
+
+#endif
diff --git a/libc/libio/iofopen.c b/libc/libio/iofopen.c
index 8edd32ebd..a7e69e4f5 100644
--- a/libc/libio/iofopen.c
+++ b/libc/libio/iofopen.c
@@ -25,6 +25,7 @@
in files containing the exception. */
#include "libioP.h"
+#include <fcntl.h>
#include <stdlib.h>
#include <stddef.h>
#ifdef _LIBC
@@ -106,4 +107,9 @@ _IO_new_fopen (filename, mode)
strong_alias (_IO_new_fopen, __new_fopen)
versioned_symbol (libc, _IO_new_fopen, _IO_fopen, GLIBC_2_1);
versioned_symbol (libc, __new_fopen, fopen, GLIBC_2_1);
+
+# if !defined O_LARGEFILE || O_LARGEFILE == 0
+weak_alias (_IO_new_fopen, _IO_fopen64)
+weak_alias (_IO_new_fopen, fopen64)
+# endif
#endif
diff --git a/libc/libio/iofopen64.c b/libc/libio/iofopen64.c
index 1b1a4877d..25c79c9b3 100644
--- a/libc/libio/iofopen64.c
+++ b/libc/libio/iofopen64.c
@@ -25,8 +25,12 @@
in files containing the exception. */
#include "libioP.h"
+#include <fcntl.h>
#include <stdlib.h>
+/* iofopen.c defines _IO_fopen64/fopen64 as aliases if O_LARGEFILE==0. */
+#if !defined _LIBC || (defined O_LARGEFILE && O_LARGEFILE != 0)
+
_IO_FILE *
_IO_fopen64 (filename, mode)
const char *filename;
@@ -43,3 +47,5 @@ _IO_fopen64 (filename, mode)
#ifdef weak_alias
weak_alias (_IO_fopen64, fopen64)
#endif
+
+#endif
diff --git a/libc/libio/iofsetpos.c b/libc/libio/iofsetpos.c
index 19bea3b08..5e8d444d2 100644
--- a/libc/libio/iofsetpos.c
+++ b/libc/libio/iofsetpos.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1993, 1995, 1997, 1998, 1999, 2000, 2002, 2003
- Free Software Foundation, Inc.
+/* Copyright (C) 1993-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
@@ -25,7 +24,17 @@
This exception applies to code released by its copyright holders
in files containing the exception. */
+/* We need to avoid the header declarations of these, because
+ the types don't match _IO_fsetpos and then the compiler will
+ complain about the mismatch when we do the alias below. */
+#define _IO_new_fsetpos64 __renamed__IO_new_fsetpos64
+#define _IO_fsetpos64 __renamed__IO_fsetpos64
+
#include <libioP.h>
+
+#undef _IO_new_fsetpos64
+#undef _IO_fsetpos64
+
#include <errno.h>
#include <shlib-compat.h>
@@ -63,3 +72,10 @@ _IO_new_fsetpos (fp, posp)
strong_alias (_IO_new_fsetpos, __new_fsetpos)
versioned_symbol (libc, _IO_new_fsetpos, _IO_fsetpos, GLIBC_2_2);
versioned_symbol (libc, __new_fsetpos, fsetpos, GLIBC_2_2);
+
+#ifdef __OFF_T_MATCHES_OFF64_T
+strong_alias (_IO_new_fsetpos, _IO_new_fsetpos64)
+strong_alias (_IO_new_fsetpos64, __new_fsetpos64)
+versioned_symbol (libc, __new_fsetpos64, fsetpos64, GLIBC_2_2);
+versioned_symbol (libc, _IO_new_fsetpos64, _IO_fsetpos64, GLIBC_2_2);
+#endif
diff --git a/libc/libio/iofsetpos64.c b/libc/libio/iofsetpos64.c
index 9835c127c..20edd8dd6 100644
--- a/libc/libio/iofsetpos64.c
+++ b/libc/libio/iofsetpos64.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1993, 1995, 1997, 1998, 1999, 2000, 2002, 2003
- Free Software Foundation, Inc.
+/* Copyright (C) 1993-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
@@ -29,6 +28,8 @@
#include <errno.h>
#include <shlib-compat.h>
+#ifndef __OFF_T_MATCHES_OFF64_T
+
int
_IO_new_fsetpos64 (fp, posp)
_IO_FILE *fp;
@@ -68,3 +69,5 @@ _IO_new_fsetpos64 (fp, posp)
strong_alias (_IO_new_fsetpos64, __new_fsetpos64)
versioned_symbol (libc, __new_fsetpos64, fsetpos64, GLIBC_2_2);
versioned_symbol (libc, _IO_new_fsetpos64, _IO_fsetpos64, GLIBC_2_2);
+
+#endif
diff --git a/libc/libio/libioP.h b/libc/libio/libioP.h
index 4138e2aff..f55a84ba2 100644
--- a/libc/libio/libioP.h
+++ b/libc/libio/libioP.h
@@ -949,3 +949,17 @@ _IO_acquire_lock_clear_flags2_fct (_IO_FILE **p)
if ((fp->_flags & _IO_USER_LOCK) == 0)
_IO_funlockfile (fp);
}
+
+#if !defined _IO_MTSAFE_IO && !defined NOT_IN_libc
+# define _IO_acquire_lock(_fp) \
+ do { \
+ _IO_FILE *_IO_acquire_lock_file = NULL
+# define _IO_acquire_lock_clear_flags2(_fp) \
+ do { \
+ _IO_FILE *_IO_acquire_lock_file = (_fp)
+# define _IO_release_lock(_fp) \
+ if (_IO_acquire_lock_file != NULL) \
+ _IO_acquire_lock_file->_flags2 &= ~(_IO_FLAGS2_FORTIFY \
+ | _IO_FLAGS2_SCANF_STD); \
+ } while (0)
+#endif
diff --git a/libc/malloc/arena.c b/libc/malloc/arena.c
index 33c4ff37a..06bdd77d2 100644
--- a/libc/malloc/arena.c
+++ b/libc/malloc/arena.c
@@ -120,14 +120,14 @@ int __malloc_initialized = -1;
if(ptr) \
(void)mutex_lock(&ptr->mutex); \
else \
- ptr = arena_get2(ptr, (size)); \
+ ptr = arena_get2(ptr, (size), NULL); \
} while(0)
#else
# define arena_lock(ptr, size) do { \
if(ptr && !mutex_trylock(&ptr->mutex)) { \
THREAD_STAT(++(ptr->stat_lock_direct)); \
} else \
- ptr = arena_get2(ptr, (size)); \
+ ptr = arena_get2(ptr, (size), NULL); \
} while(0)
#endif
@@ -778,9 +778,11 @@ get_free_list (void)
return result;
}
-
+/* Lock and return an arena that can be reused for memory allocation.
+ Avoid AVOID_ARENA as we have already failed to allocate memory in
+ it and it is currently locked. */
static mstate
-reused_arena (void)
+reused_arena (mstate avoid_arena)
{
mstate result;
static mstate next_to_use;
@@ -797,6 +799,11 @@ reused_arena (void)
}
while (result != next_to_use);
+ /* Avoid AVOID_ARENA as we have already failed to allocate memory
+ in that arena and it is currently locked. */
+ if (result == avoid_arena)
+ result = result->next;
+
/* No arena available. Wait for the next in line. */
(void)mutex_lock(&result->mutex);
@@ -811,7 +818,7 @@ reused_arena (void)
static mstate
internal_function
-arena_get2(mstate a_tsd, size_t size)
+arena_get2(mstate a_tsd, size_t size, mstate avoid_arena)
{
mstate a;
@@ -856,7 +863,7 @@ arena_get2(mstate a_tsd, size_t size)
catomic_decrement (&narenas);
}
else
- a = reused_arena ();
+ a = reused_arena (avoid_arena);
}
#else
if(!a_tsd)
diff --git a/libc/malloc/malloc.c b/libc/malloc/malloc.c
index 28039b472..373e063fc 100644
--- a/libc/malloc/malloc.c
+++ b/libc/malloc/malloc.c
@@ -2865,9 +2865,11 @@ __libc_malloc(size_t bytes)
victim = _int_malloc(ar_ptr, bytes);
(void)mutex_unlock(&ar_ptr->mutex);
} else {
- /* ... or sbrk() has failed and there is still a chance to mmap() */
- ar_ptr = arena_get2(ar_ptr->next ? ar_ptr : 0, bytes);
- (void)mutex_unlock(&main_arena.mutex);
+ /* ... or sbrk() has failed and there is still a chance to mmap()
+ Grab ar_ptr->next prior to releasing its lock. */
+ mstate prev = ar_ptr->next ? ar_ptr : 0;
+ (void)mutex_unlock(&ar_ptr->mutex);
+ ar_ptr = arena_get2(prev, bytes, ar_ptr);
if(ar_ptr) {
victim = _int_malloc(ar_ptr, bytes);
(void)mutex_unlock(&ar_ptr->mutex);
@@ -3043,10 +3045,11 @@ __libc_memalign(size_t alignment, size_t bytes)
p = _int_memalign(ar_ptr, alignment, bytes);
(void)mutex_unlock(&ar_ptr->mutex);
} else {
- /* ... or sbrk() has failed and there is still a chance to mmap() */
+ /* ... or sbrk() has failed and there is still a chance to mmap()
+ Grab ar_ptr->next prior to releasing its lock. */
mstate prev = ar_ptr->next ? ar_ptr : 0;
(void)mutex_unlock(&ar_ptr->mutex);
- ar_ptr = arena_get2(prev, bytes);
+ ar_ptr = arena_get2(prev, bytes, ar_ptr);
if(ar_ptr) {
p = _int_memalign(ar_ptr, alignment, bytes);
(void)mutex_unlock(&ar_ptr->mutex);
@@ -3083,23 +3086,27 @@ __libc_valloc(size_t bytes)
if(!ar_ptr)
return 0;
p = _int_valloc(ar_ptr, bytes);
- (void)mutex_unlock(&ar_ptr->mutex);
if(!p) {
/* Maybe the failure is due to running out of mmapped areas. */
if(ar_ptr != &main_arena) {
+ (void)mutex_unlock(&ar_ptr->mutex);
ar_ptr = &main_arena;
(void)mutex_lock(&ar_ptr->mutex);
p = _int_memalign(ar_ptr, pagesz, bytes);
(void)mutex_unlock(&ar_ptr->mutex);
} else {
- /* ... or sbrk() has failed and there is still a chance to mmap() */
- ar_ptr = arena_get2(ar_ptr->next ? ar_ptr : 0, bytes);
+ /* ... or sbrk() has failed and there is still a chance to mmap()
+ Grab ar_ptr->next prior to releasing its lock. */
+ mstate prev = ar_ptr->next ? ar_ptr : 0;
+ (void)mutex_unlock(&ar_ptr->mutex);
+ ar_ptr = arena_get2(prev, bytes, ar_ptr);
if(ar_ptr) {
p = _int_memalign(ar_ptr, pagesz, bytes);
(void)mutex_unlock(&ar_ptr->mutex);
}
}
- }
+ } else
+ (void)mutex_unlock (&ar_ptr->mutex);
assert(!p || chunk_is_mmapped(mem2chunk(p)) ||
ar_ptr == arena_for_chunk(mem2chunk(p)));
@@ -3127,24 +3134,27 @@ __libc_pvalloc(size_t bytes)
arena_get(ar_ptr, bytes + 2*pagesz + MINSIZE);
p = _int_pvalloc(ar_ptr, bytes);
- (void)mutex_unlock(&ar_ptr->mutex);
if(!p) {
/* Maybe the failure is due to running out of mmapped areas. */
if(ar_ptr != &main_arena) {
+ (void)mutex_unlock(&ar_ptr->mutex);
ar_ptr = &main_arena;
(void)mutex_lock(&ar_ptr->mutex);
p = _int_memalign(ar_ptr, pagesz, rounded_bytes);
(void)mutex_unlock(&ar_ptr->mutex);
} else {
- /* ... or sbrk() has failed and there is still a chance to mmap() */
- ar_ptr = arena_get2(ar_ptr->next ? ar_ptr : 0,
- bytes + 2*pagesz + MINSIZE);
+ /* ... or sbrk() has failed and there is still a chance to mmap()
+ Grab ar_ptr->next prior to releasing its lock. */
+ mstate prev = ar_ptr->next ? ar_ptr : 0;
+ (void)mutex_unlock(&ar_ptr->mutex);
+ ar_ptr = arena_get2(prev, bytes + 2*pagesz + MINSIZE, ar_ptr);
if(ar_ptr) {
p = _int_memalign(ar_ptr, pagesz, rounded_bytes);
(void)mutex_unlock(&ar_ptr->mutex);
}
}
- }
+ } else
+ (void)mutex_unlock(&ar_ptr->mutex);
assert(!p || chunk_is_mmapped(mem2chunk(p)) ||
ar_ptr == arena_for_chunk(mem2chunk(p)));
@@ -3209,8 +3219,6 @@ __libc_calloc(size_t n, size_t elem_size)
#endif
mem = _int_malloc(av, sz);
- /* Only clearing follows, so we can unlock early. */
- (void)mutex_unlock(&av->mutex);
assert(!mem || chunk_is_mmapped(mem2chunk(mem)) ||
av == arena_for_chunk(mem2chunk(mem)));
@@ -3218,21 +3226,24 @@ __libc_calloc(size_t n, size_t elem_size)
if (mem == 0) {
/* Maybe the failure is due to running out of mmapped areas. */
if(av != &main_arena) {
+ (void)mutex_unlock(&av->mutex);
(void)mutex_lock(&main_arena.mutex);
mem = _int_malloc(&main_arena, sz);
(void)mutex_unlock(&main_arena.mutex);
} else {
- /* ... or sbrk() has failed and there is still a chance to mmap() */
- (void)mutex_lock(&main_arena.mutex);
- av = arena_get2(av->next ? av : 0, sz);
- (void)mutex_unlock(&main_arena.mutex);
+ /* ... or sbrk() has failed and there is still a chance to mmap()
+ Grab av->next prior to releasing its lock. */
+ mstate prev = av->next ? av : 0;
+ (void)mutex_unlock(&av->mutex);
+ av = arena_get2(prev, sz, av);
if(av) {
mem = _int_malloc(av, sz);
(void)mutex_unlock(&av->mutex);
}
}
if (mem == 0) return 0;
- }
+ } else
+ (void)mutex_unlock(&av->mutex);
p = mem2chunk(mem);
/* Two optional cases in which clearing not necessary */
diff --git a/libc/manual/stdio.texi b/libc/manual/stdio.texi
index c58ca22b2..be769a538 100644
--- a/libc/manual/stdio.texi
+++ b/libc/manual/stdio.texi
@@ -2341,6 +2341,8 @@ The @code{snprintf} function is similar to @code{sprintf}, except that
the @var{size} argument specifies the maximum number of characters to
produce. The trailing null character is counted towards this limit, so
you should allocate at least @var{size} characters for the string @var{s}.
+If @var{size} is zero, nothing, not even the null byte, shall be written and
+@var{s} may be a null pointer.
The return value is the number of characters which would be generated
for the given input, excluding the trailing null. If this value is
diff --git a/libc/math/libm-test.inc b/libc/math/libm-test.inc
index 53022babf..5609903fe 100644
--- a/libc/math/libm-test.inc
+++ b/libc/math/libm-test.inc
@@ -2492,6 +2492,17 @@ clog_test (void)
TEST_c_c (clog, 0x1p-8192L, 1.0L, 4.202628928890116882828347271652190753248e-4933L, 1.570796326794896619231321691639751442099L, UNDERFLOW_EXCEPTION);
#endif
+ TEST_c_c (clog, 0x1.000566p0L, 0x1.234p-10L, 8.298731898331237038231468223024422855654e-5L, 1.110938609507128729312743251313024793990e-3L);
+ TEST_c_c (clog, 0x1.000566p0L, 0x1.234p-100L, 8.237022655933121125560939513260027133767e-5L, 8.974094312218060110948251664314290484113e-31L);
+#ifndef TEST_FLOAT
+ TEST_c_c (clog, -0x1.0000000123456p0L, 0x1.2345678p-30L, 2.649094282537168795982991778475646793277e-10L, 3.141592652530155111500161671113150737892L);
+ TEST_c_c (clog, -0x1.0000000123456p0L, 0x1.2345678p-1000L, 2.649094276923003995420209214900915462737e-10L, 3.141592653589793238462643383279502884197L);
+#endif
+#if defined TEST_LDOUBLE && LDBL_MANT_DIG >= 106
+ TEST_c_c (clog, 0x1.00000000000000123456789abcp0L, 0x1.23456789p-60L, 9.868649107778739757272772275265050767867e-19L, 9.868649106423871142816660980898339912137e-19L);
+ TEST_c_c (clog, 0x1.00000000000000123456789abcp0L, 0x1.23456789p-1000L, 9.868649107778739752403260515979017248596e-19L, 1.061846605795612822522063052130030717368e-301L);
+#endif
+
END (clog, complex);
}
@@ -2641,6 +2652,17 @@ clog10_test (void)
TEST_c_c (clog10, 0x1p-8191L, 1.0L, 7.300714213215805914467117112656302312931e-4933L, 6.821881769209206737428918127156778851051e-1L, UNDERFLOW_EXCEPTION);
#endif
+ TEST_c_c (clog10, 0x1.000566p0L, 0x1.234p-10L, 3.604093470239754109961125085078190708674e-5L, 4.824745078422174667425851670822596859720e-4L);
+ TEST_c_c (clog10, 0x1.000566p0L, 0x1.234p-100L, 3.577293486783822178310971763308187385546e-5L, 3.897399639875661463735636919790792140598e-31L);
+#ifndef TEST_FLOAT
+ TEST_c_c (clog10, -0x1.0000000123456p0L, 0x1.2345678p-30L, 1.150487028947346337782682105935961875822e-10L, 1.364376353381646356131680448946397884147L);
+ TEST_c_c (clog10, -0x1.0000000123456p0L, 0x1.2345678p-1000L, 1.150487026509145544402795327729455391948e-10L, 1.364376353841841347485783625431355770210L);
+#endif
+#if defined TEST_LDOUBLE && LDBL_MANT_DIG >= 106
+ TEST_c_c (clog10, 0x1.00000000000000123456789abcp0L, 0x1.23456789p-60L, 4.285899851347756188767674032946882584784e-19L, 4.285899850759344225805480528847018395861e-19L);
+ TEST_c_c (clog10, 0x1.00000000000000123456789abcp0L, 0x1.23456789p-1000L, 4.285899851347756186652871946325962330640e-19L, 4.611541215247321502041995872887317363241e-302L);
+#endif
+
END (clog10, complex);
}
diff --git a/libc/math/s_clog.c b/libc/math/s_clog.c
index e28aa5157..259306600 100644
--- a/libc/math/s_clog.c
+++ b/libc/math/s_clog.c
@@ -78,6 +78,13 @@ __clog (__complex__ double x)
else
__real__ result = __log1p (absy2) / 2.0;
}
+ else if (absx > 1.0 && absx < 2.0 && absy < 1.0 && scale == 0)
+ {
+ double d2m1 = (absx - 1.0) * (absx + 1.0);
+ if (absy >= DBL_EPSILON)
+ d2m1 += absy * absy;
+ __real__ result = __log1p (d2m1) / 2.0;
+ }
else
{
double d = __ieee754_hypot (absx, absy);
diff --git a/libc/math/s_clog10.c b/libc/math/s_clog10.c
index b733b048b..ef997ee76 100644
--- a/libc/math/s_clog10.c
+++ b/libc/math/s_clog10.c
@@ -81,6 +81,13 @@ __clog10 (__complex__ double x)
else
__real__ result = __log1p (absy2) * (M_LOG10E / 2.0);
}
+ else if (absx > 1.0 && absx < 2.0 && absy < 1.0 && scale == 0)
+ {
+ double d2m1 = (absx - 1.0) * (absx + 1.0);
+ if (absy >= DBL_EPSILON)
+ d2m1 += absy * absy;
+ __real__ result = __log1p (d2m1) * (M_LOG10E / 2.0);
+ }
else
{
double d = __ieee754_hypot (absx, absy);
diff --git a/libc/math/s_clog10f.c b/libc/math/s_clog10f.c
index eb1b895ae..c61e8af8c 100644
--- a/libc/math/s_clog10f.c
+++ b/libc/math/s_clog10f.c
@@ -83,6 +83,13 @@ __clog10f (__complex__ float x)
else
__real__ result = __log1pf (absy2) * ((float) M_LOG10E / 2.0f);
}
+ else if (absx > 1.0f && absx < 2.0f && absy < 1.0f && scale == 0)
+ {
+ float d2m1 = (absx - 1.0f) * (absx + 1.0f);
+ if (absy >= FLT_EPSILON)
+ d2m1 += absy * absy;
+ __real__ result = __log1pf (d2m1) * ((float) M_LOG10E / 2.0f);
+ }
else
{
float d = __ieee754_hypotf (absx, absy);
diff --git a/libc/math/s_clog10l.c b/libc/math/s_clog10l.c
index 2a380f6f3..d50f61657 100644
--- a/libc/math/s_clog10l.c
+++ b/libc/math/s_clog10l.c
@@ -22,6 +22,13 @@
#include <math_private.h>
#include <float.h>
+/* To avoid spurious underflows, use this definition to treat IBM long
+ double as approximating an IEEE-style format. */
+#if LDBL_MANT_DIG == 106
+# undef LDBL_EPSILON
+# define LDBL_EPSILON 0x1p-106L
+#endif
+
/* log_10 (2). */
#define M_LOG10_2l 0.3010299956639811952137388947244930267682L
@@ -75,6 +82,13 @@ __clog10l (__complex__ long double x)
else
__real__ result = __log1pl (absy2) * (M_LOG10El / 2.0L);
}
+ else if (absx > 1.0L && absx < 2.0L && absy < 1.0L && scale == 0)
+ {
+ long double d2m1 = (absx - 1.0L) * (absx + 1.0L);
+ if (absy >= LDBL_EPSILON)
+ d2m1 += absy * absy;
+ __real__ result = __log1pl (d2m1) * (M_LOG10El / 2.0L);
+ }
else
{
long double d = __ieee754_hypotl (absx, absy);
diff --git a/libc/math/s_clogf.c b/libc/math/s_clogf.c
index 088730cfd..92f782c47 100644
--- a/libc/math/s_clogf.c
+++ b/libc/math/s_clogf.c
@@ -78,6 +78,13 @@ __clogf (__complex__ float x)
else
__real__ result = __log1pf (absy2) / 2.0f;
}
+ else if (absx > 1.0f && absx < 2.0f && absy < 1.0f && scale == 0)
+ {
+ float d2m1 = (absx - 1.0f) * (absx + 1.0f);
+ if (absy >= FLT_EPSILON)
+ d2m1 += absy * absy;
+ __real__ result = __log1pf (d2m1) / 2.0f;
+ }
else
{
float d = __ieee754_hypotf (absx, absy);
diff --git a/libc/math/s_clogl.c b/libc/math/s_clogl.c
index d98a3c02c..eaba572ce 100644
--- a/libc/math/s_clogl.c
+++ b/libc/math/s_clogl.c
@@ -22,6 +22,13 @@
#include <math_private.h>
#include <float.h>
+/* To avoid spurious underflows, use this definition to treat IBM long
+ double as approximating an IEEE-style format. */
+#if LDBL_MANT_DIG == 106
+# undef LDBL_EPSILON
+# define LDBL_EPSILON 0x1p-106L
+#endif
+
__complex__ long double
__clogl (__complex__ long double x)
{
@@ -71,6 +78,13 @@ __clogl (__complex__ long double x)
else
__real__ result = __log1pl (absy2) / 2.0L;
}
+ else if (absx > 1.0L && absx < 2.0L && absy < 1.0L && scale == 0)
+ {
+ long double d2m1 = (absx - 1.0L) * (absx + 1.0L);
+ if (absy >= LDBL_EPSILON)
+ d2m1 += absy * absy;
+ __real__ result = __log1pl (d2m1) / 2.0L;
+ }
else
{
long double d = __ieee754_hypotl (absx, absy);
diff --git a/libc/misc/Makefile b/libc/misc/Makefile
index a814ecd09..07a0c3840 100644
--- a/libc/misc/Makefile
+++ b/libc/misc/Makefile
@@ -106,7 +106,6 @@ CFLAGS-getsysstats.c = -fexceptions
CFLAGS-getusershell.c = -fexceptions
CFLAGS-err.c = -fexceptions
CFLAGS-tst-tsearch.c = $(stack-align-test-flags)
-CFLAGS-mntent_r.c = -D_IO_MTSAFE_IO
include ../Rules
diff --git a/libc/misc/mkostemp.c b/libc/misc/mkostemp.c
index b78554bd0..2c5b27253 100644
--- a/libc/misc/mkostemp.c
+++ b/libc/misc/mkostemp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 1999, 2001, 2007, 2009 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
@@ -33,3 +33,7 @@ mkostemp (template, flags)
{
return __gen_tempname (template, 0, flags, __GT_FILE);
}
+
+#if !defined O_LARGEFILE || O_LARGEFILE == 0
+weak_alias (mkostemp, mkostemp64)
+#endif
diff --git a/libc/misc/mkostemp64.c b/libc/misc/mkostemp64.c
index b7a803a93..104e6d98a 100644
--- a/libc/misc/mkostemp64.c
+++ b/libc/misc/mkostemp64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2007, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2000-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,6 +19,9 @@
#include <stdio.h>
#include <stdlib.h>
+/* If O_LARGEFILE is zero, mkostemp.c defines mkostemp64 as an alias. */
+#if defined O_LARGEFILE && O_LARGEFILE != 0
+
/* Generate a unique temporary file name from TEMPLATE.
The last six characters of TEMPLATE must be "XXXXXX";
they are replaced with a string that makes the filename unique.
@@ -30,3 +33,5 @@ mkostemp64 (template, flags)
{
return __gen_tempname (template, 0, flags | O_LARGEFILE, __GT_FILE);
}
+
+#endif
diff --git a/libc/misc/mkostemps.c b/libc/misc/mkostemps.c
index 64dd477fd..aca487dca 100644
--- a/libc/misc/mkostemps.c
+++ b/libc/misc/mkostemps.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009 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
@@ -41,3 +41,7 @@ mkostemps (template, suffixlen, flags)
return __gen_tempname (template, suffixlen, flags, __GT_FILE);
}
+
+#if !defined O_LARGEFILE || O_LARGEFILE == 0
+weak_alias (mkostemps, mkostemps64)
+#endif
diff --git a/libc/misc/mkostemps64.c b/libc/misc/mkostemps64.c
index 17cbdaf1a..88d1460f3 100644
--- a/libc/misc/mkostemps64.c
+++ b/libc/misc/mkostemps64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2007, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2000-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,6 +20,9 @@
#include <stdio.h>
#include <stdlib.h>
+/* If O_LARGEFILE is zero, mkostemps.c defines mkostemps64 as an alias. */
+#if defined O_LARGEFILE && O_LARGEFILE != 0
+
/* Generate a unique temporary file name from TEMPLATE. The last six
characters before a suffix of length SUFFIXLEN of TEMPLATE must be
"XXXXXX"; they are replaced with a string that makes the filename
@@ -38,3 +41,5 @@ mkostemps64 (template, suffixlen, flags)
return __gen_tempname (template, suffixlen, flags | O_LARGEFILE, __GT_FILE);
}
+
+#endif
diff --git a/libc/misc/mkstemp.c b/libc/misc/mkstemp.c
index c03516bb7..c10bdd9af 100644
--- a/libc/misc/mkstemp.c
+++ b/libc/misc/mkstemp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 1999, 2001, 2007, 2009 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
@@ -32,3 +32,7 @@ mkstemp (template)
{
return __gen_tempname (template, 0, 0, __GT_FILE);
}
+
+#if !defined O_LARGEFILE || O_LARGEFILE == 0
+weak_alias (mkstemp, mkstemp64)
+#endif
diff --git a/libc/misc/mkstemp64.c b/libc/misc/mkstemp64.c
index ba4a6e28f..3667c4b95 100644
--- a/libc/misc/mkstemp64.c
+++ b/libc/misc/mkstemp64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2007, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2000-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,6 +19,9 @@
#include <stdio.h>
#include <stdlib.h>
+/* If O_LARGEFILE is zero, mkstemp.c defines mkstemp64 as an alias. */
+#if defined O_LARGEFILE && O_LARGEFILE != 0
+
/* Generate a unique temporary file name from TEMPLATE.
The last six characters of TEMPLATE must be "XXXXXX";
they are replaced with a string that makes the filename unique.
@@ -29,3 +32,5 @@ mkstemp64 (template)
{
return __gen_tempname (template, 0, O_LARGEFILE, __GT_FILE);
}
+
+#endif
diff --git a/libc/misc/mkstemps.c b/libc/misc/mkstemps.c
index 26205dc1b..79418c58d 100644
--- a/libc/misc/mkstemps.c
+++ b/libc/misc/mkstemps.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009 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
@@ -40,3 +40,7 @@ mkstemps (template, suffixlen)
return __gen_tempname (template, suffixlen, 0, __GT_FILE);
}
+
+#if !defined O_LARGEFILE || O_LARGEFILE == 0
+weak_alias (mkstemps, mkstemps64)
+#endif
diff --git a/libc/misc/mkstemps64.c b/libc/misc/mkstemps64.c
index b4af7ca40..8393a516d 100644
--- a/libc/misc/mkstemps64.c
+++ b/libc/misc/mkstemps64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2007, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2000-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,6 +20,9 @@
#include <stdio.h>
#include <stdlib.h>
+/* If O_LARGEFILE is zero, mkstemps.c defines mkstemps64 as an alias. */
+#if defined O_LARGEFILE && O_LARGEFILE != 0
+
/* Generate a unique temporary file name from TEMPLATE. The last six
characters before a suffix of length SUFFIXLEN of TEMPLATE must be
"XXXXXX"; they are replaced with a string that makes the filename
@@ -37,3 +40,5 @@ mkstemps64 (template, suffixlen)
return __gen_tempname (template, suffixlen, O_LARGEFILE, __GT_FILE);
}
+
+#endif
diff --git a/libc/nptl/ChangeLog b/libc/nptl/ChangeLog
index 6969fd256..eb8486358 100644
--- a/libc/nptl/ChangeLog
+++ b/libc/nptl/ChangeLog
@@ -1,3 +1,98 @@
+2012-08-15 Roland McGrath <roland@hack.frob.com>
+
+2012-08-15 Roland McGrath <roland@hack.frob.com>
+
+2012-08-15 Roland McGrath <roland@hack.frob.com>
+
+ * Makefile (CFLAGS-flockfile.c): Use $(libio-mtsafe) instead
+ of -D_IO_MTSAFE_IO.
+ (CFLAGS-ftrylockfile.c, CFLAGS-funlockfile.c): Likewise.
+ * sysdeps/unix/sysv/linux/Makefile (CFLAGS-fork.c): Likewise.
+
+2012-08-16 Joseph Myers <joseph@codesourcery.com>
+
+ * pthread_cond_timedwait.c (__pthread_cond_timedwait)
+ [!__ASSUME_POSIX_TIMERS]: Remove conditional code.
+ * pthread_condattr_setclock.c (pthread_condattr_setclock)
+ [!__ASSUME_POSIX_TIMERS]: Likewise.
+ * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
+ (__pthread_cond_timedwait) [!__ASSUME_POSIX_TIMERS]: Likewise.
+ * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c
+ [!__ASSUME_POSIX_TIMERS]: Likewise.
+ * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
+ (__pthread_cond_timedwait) [!__ASSUME_POSIX_TIMERS]: Likewise.
+ * sysdeps/unix/sysv/linux/timer_create.c [__NR_timer_create]: Make
+ code unconditional.
+ [!__NR-timer_create]: Remove conditional code.
+ (timer_create) [!__ASSUME_POSIX_TIMERS]: Likewise.
+ * sysdeps/unix/sysv/linux/timer_delete.c [__NR_timer_delete]: Make
+ code unconditional.
+ [!__NR_timer_delete]: Remove conditional code.
+ (timer_delete) [!__ASSUME_POSIX_TIMERS]: Likewise.
+ * sysdeps/unix/sysv/linux/timer_getoverr.c
+ [__NR_timer_getoverrun]: Make code unconditional.
+ [!__NR_timer_getoverrun]: Remove conditional code.
+ (timer_getoverrun) [!__ASSUME_POSIX_TIMERS]: Likewise.
+ * sysdeps/unix/sysv/linux/timer_gettime.c [__NR_timer_gettime]:
+ Make code unconditional.
+ [!__NR_timer_gettime]: Remove conditional code.
+ (timer_gettime) [!__ASSUME_POSIX_TIMERS]: Likewise.
+ * sysdeps/unix/sysv/linux/timer_routines.c [__NR_timer_create]:
+ Make code unconditional.
+ [!__ASSUME_POSIX_TIMERS]: Remove conditional code.
+ * sysdeps/unix/sysv/linux/timer_settime.c [__NR_timer_settime]:
+ Make code unconditional.
+ [!__NR_timer_settime]: Remove conditional code.
+ (timer_settime) [!__ASSUME_POSIX_TIMERS]: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
+ (__pthread_cond_timedwait) [!__ASSUME_POSIX_TIMERS]: Remove
+ conditional code.
+
+2012-08-15 Tom de Vries <vries@codesourcery.com>
+ Maxim Kuvyrkov <maxim@codesourcery.com>
+
+ * sysdeps/pthread/bits/libc-lockP.h (__libc_lock_lock)
+ (__libc_lock_trylock): Allow pre-existing definitions.
+
+2012-08-15 Maxim Kuvyrkov <maxim@codesourcery.com>
+
+ * pthread_spin_lock.c: New file.
+ * pthread_spin_trylock.c: New file.
+
+2012-08-08 Joseph Myers <joseph@codesourcery.com>
+
+ * allocatestack.c (setxid_signal_thread) [__ASSUME_TGKILL]: Make
+ code unconditional.
+ (setxid_signal_thread) [!__ASSUME_TGKILL]: Remove conditional code.
+ * pthread_cancel.c (pthread_cancel) [__ASSUME_TGKILL]: Make code
+ unconditional.
+ (pthread_cancel) [!__ASSUME_TGKILL]: Remove conditional code.
+ * sysdeps/pthread/createthread.c (do_clone) [__ASSUME_TGKILL]:
+ Make code unconditional.
+ (do_clone) [!__ASSUME_TGKILL]: Remove conditional code.
+ * sysdeps/unix/sysv/linux/pt-raise.c (raise) [__ASSUME_TGKILL ||
+ __NR_tgkill]: Make code unconditional.
+ (raise) [__ASSUME_TGKILL]: Likewise.
+ (raise) [!__ASSUME_TGKILL]: Remove conditional code.
+ * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill)
+ [__ASSUME_TGKILL]: Make code unconditional.
+ (__pthread_kill) [!__ASSUME_TGKILL]: Remove conditional code.
+ * sysdeps/unix/sysv/linux/raise.c (raise) [__ASSUME_TGKILL ||
+ __NR_tgkill]: Make code unconditional.
+ (raise) [__ASSUME_TGKILL]: Likewise.
+ (raise) [!__ASSUME_TGKILL]: Remove conditional code.
+
+2012-08-07 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/pthread/createthread.c (create_thread)
+ [!__ASSUME_NO_CLONE_DETACHED]: Remove conditional code.
+
+2012-08-03 Joseph Myers <joseph@codesourcery.com>
+
+ * nptl-init.c (sigcancel_handler) [__ASSUME_CORRECT_SI_PID]: Make
+ code unconditional.
+ (sighandler_setxid) [__ASSUME_CORRECT_SI_PID]: Likewise.
+
2012-07-28 Siddhesh Poyarekar <siddhesh@redhat.com>
* tst-pthread-getattr.c (MAX_STACK_SIZE): New macro.
diff --git a/libc/nptl/Makefile b/libc/nptl/Makefile
index e8ca09188..deb83170c 100644
--- a/libc/nptl/Makefile
+++ b/libc/nptl/Makefile
@@ -360,9 +360,9 @@ extra-objs += $(crti-objs) $(crtn-objs)
extra-objs += pt-crti.o
endif
-CFLAGS-flockfile.c = -D_IO_MTSAFE_IO
-CFLAGS-ftrylockfile.c = -D_IO_MTSAFE_IO
-CFLAGS-funlockfile.c = -D_IO_MTSAFE_IO
+CFLAGS-flockfile.c = $(libio-mtsafe)
+CFLAGS-ftrylockfile.c = $(libio-mtsafe)
+CFLAGS-funlockfile.c = $(libio-mtsafe)
link-libc-static := $(common-objpfx)libc.a $(static-gnulib) \
$(common-objpfx)libc.a
diff --git a/libc/nptl/allocatestack.c b/libc/nptl/allocatestack.c
index 79c4531c3..799dbe3d0 100644
--- a/libc/nptl/allocatestack.c
+++ b/libc/nptl/allocatestack.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2007, 2009, 2010, 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -1037,18 +1037,8 @@ setxid_signal_thread (struct xid_command *cmdp, struct pthread *t)
int val;
INTERNAL_SYSCALL_DECL (err);
-#if __ASSUME_TGKILL
val = INTERNAL_SYSCALL (tgkill, err, 3, THREAD_GETMEM (THREAD_SELF, pid),
t->tid, SIGSETXID);
-#else
-# ifdef __NR_tgkill
- val = INTERNAL_SYSCALL (tgkill, err, 3, THREAD_GETMEM (THREAD_SELF, pid),
- t->tid, SIGSETXID);
- if (INTERNAL_SYSCALL_ERROR_P (val, err)
- && INTERNAL_SYSCALL_ERRNO (val, err) == ENOSYS)
-# endif
- val = INTERNAL_SYSCALL (tkill, err, 2, t->tid, SIGSETXID);
-#endif
/* If this failed, it must have had not started yet or else exited. */
if (!INTERNAL_SYSCALL_ERROR_P (val, err))
diff --git a/libc/nptl/nptl-init.c b/libc/nptl/nptl-init.c
index 5216ce1f5..6a18dbe1b 100644
--- a/libc/nptl/nptl-init.c
+++ b/libc/nptl/nptl-init.c
@@ -172,24 +172,18 @@ __nptl_set_robust (struct pthread *self)
static void
sigcancel_handler (int sig, siginfo_t *si, void *ctx)
{
-#ifdef __ASSUME_CORRECT_SI_PID
/* Determine the process ID. It might be negative if the thread is
in the middle of a fork() call. */
pid_t pid = THREAD_GETMEM (THREAD_SELF, pid);
if (__builtin_expect (pid < 0, 0))
pid = -pid;
-#endif
/* Safety check. It would be possible to call this function for
other signals and send a signal from another process. This is not
correct and might even be a security problem. Try to catch as
many incorrect invocations as possible. */
if (sig != SIGCANCEL
-#ifdef __ASSUME_CORRECT_SI_PID
- /* Kernels before 2.5.75 stored the thread ID and not the process
- ID in si_pid so we skip this test. */
|| si->si_pid != pid
-#endif
|| si->si_code != SI_TKILL)
return;
@@ -235,24 +229,18 @@ struct xid_command *__xidcmd attribute_hidden;
static void
sighandler_setxid (int sig, siginfo_t *si, void *ctx)
{
-#ifdef __ASSUME_CORRECT_SI_PID
/* Determine the process ID. It might be negative if the thread is
in the middle of a fork() call. */
pid_t pid = THREAD_GETMEM (THREAD_SELF, pid);
if (__builtin_expect (pid < 0, 0))
pid = -pid;
-#endif
/* Safety check. It would be possible to call this function for
other signals and send a signal from another process. This is not
correct and might even be a security problem. Try to catch as
many incorrect invocations as possible. */
if (sig != SIGSETXID
-#ifdef __ASSUME_CORRECT_SI_PID
- /* Kernels before 2.5.75 stored the thread ID and not the process
- ID in si_pid so we skip this test. */
|| si->si_pid != pid
-#endif
|| si->si_code != SI_TKILL)
return;
diff --git a/libc/nptl/pthread_cancel.c b/libc/nptl/pthread_cancel.c
index 1bfca6358..cf6e48b41 100644
--- a/libc/nptl/pthread_cancel.c
+++ b/libc/nptl/pthread_cancel.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -75,20 +75,9 @@ pthread_cancel (th)
a signal handler. But this is no allowed, pthread_cancel
is not guaranteed to be async-safe. */
int val;
-#if __ASSUME_TGKILL
val = INTERNAL_SYSCALL (tgkill, err, 3,
THREAD_GETMEM (THREAD_SELF, pid), pd->tid,
SIGCANCEL);
-#else
-# ifdef __NR_tgkill
- val = INTERNAL_SYSCALL (tgkill, err, 3,
- THREAD_GETMEM (THREAD_SELF, pid), pd->tid,
- SIGCANCEL);
- if (INTERNAL_SYSCALL_ERROR_P (val, err)
- && INTERNAL_SYSCALL_ERRNO (val, err) == ENOSYS)
-# endif
- val = INTERNAL_SYSCALL (tkill, err, 2, pd->tid, SIGCANCEL);
-#endif
if (INTERNAL_SYSCALL_ERROR_P (val, err))
result = INTERNAL_SYSCALL_ERRNO (val, err);
diff --git a/libc/nptl/pthread_cond_timedwait.c b/libc/nptl/pthread_cond_timedwait.c
index 9605cd74c..51a34ba4f 100644
--- a/libc/nptl/pthread_cond_timedwait.c
+++ b/libc/nptl/pthread_cond_timedwait.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003,2004,2007,2010,2011 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003.
@@ -113,23 +113,9 @@ __pthread_cond_timedwait (cond, mutex, abstime)
(cond->__data.__nwaiters
& ((1 << COND_NWAITERS_SHIFT) - 1)),
&rt);
-# ifndef __ASSUME_POSIX_TIMERS
- if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (ret, err), 0))
- {
- struct timeval tv;
- (void) gettimeofday (&tv, NULL);
-
- /* Convert the absolute timeout value to a relative timeout. */
- rt.tv_sec = abstime->tv_sec - tv.tv_sec;
- rt.tv_nsec = abstime->tv_nsec - tv.tv_usec * 1000;
- }
- else
-# endif
- {
- /* Convert the absolute timeout value to a relative timeout. */
- rt.tv_sec = abstime->tv_sec - rt.tv_sec;
- rt.tv_nsec = abstime->tv_nsec - rt.tv_nsec;
- }
+ /* Convert the absolute timeout value to a relative timeout. */
+ rt.tv_sec = abstime->tv_sec - rt.tv_sec;
+ rt.tv_nsec = abstime->tv_nsec - rt.tv_nsec;
#else
/* Get the current time. So far we support only one clock. */
struct timeval tv;
diff --git a/libc/nptl/pthread_condattr_setclock.c b/libc/nptl/pthread_condattr_setclock.c
index a3030e227..8b05dc84e 100644
--- a/libc/nptl/pthread_condattr_setclock.c
+++ b/libc/nptl/pthread_condattr_setclock.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004, 2007, 2008 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
@@ -30,32 +30,8 @@ pthread_condattr_setclock (attr, clock_id)
pthread_condattr_t *attr;
clockid_t clock_id;
{
- /* Only a few clocks are allowed. CLOCK_REALTIME is always allowed.
- CLOCK_MONOTONIC only if the kernel has the necessary support. */
- if (clock_id == CLOCK_MONOTONIC)
- {
-#ifndef __ASSUME_POSIX_TIMERS
-# ifdef __NR_clock_getres
- /* Check whether the clock is available. */
- static int avail;
-
- if (avail == 0)
- {
- struct timespec ts;
-
- INTERNAL_SYSCALL_DECL (err);
- int val;
- val = INTERNAL_SYSCALL (clock_getres, err, 2, CLOCK_MONOTONIC, &ts);
- avail = INTERNAL_SYSCALL_ERROR_P (val, err) ? -1 : 1;
- }
-
- if (avail < 0)
-# endif
- /* Not available. */
- return EINVAL;
-#endif
- }
- else if (clock_id != CLOCK_REALTIME)
+ /* Only a few clocks are allowed. */
+ if (clock_id != CLOCK_MONOTONIC && clock_id != CLOCK_REALTIME)
/* If more clocks are allowed some day the storing of the clock ID
in the pthread_cond_t structure needs to be adjusted. */
return EINVAL;
diff --git a/libc/nptl/pthread_spin_lock.c b/libc/nptl/pthread_spin_lock.c
new file mode 100644
index 000000000..91733fb7f
--- /dev/null
+++ b/libc/nptl/pthread_spin_lock.c
@@ -0,0 +1,69 @@
+/* pthread_spin_lock -- lock a spin lock. Generic 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/>. */
+
+#include <atomic.h>
+#include "pthreadP.h"
+
+/* A machine-specific version can define SPIN_LOCK_READS_BETWEEN_CMPXCHG
+ to the number of plain reads that it's optimal to spin on between uses
+ of atomic_compare_and_exchange_val_acq. If spinning forever is optimal
+ then use -1. If no plain reads here would ever be optimal, use 0. */
+#ifndef SPIN_LOCK_READS_BETWEEN_CMPXCHG
+# warning machine-dependent file should define SPIN_LOCK_READS_BETWEEN_CMPXCHG
+# define SPIN_LOCK_READS_BETWEEN_CMPXCHG 1000
+#endif
+
+int
+pthread_spin_lock (pthread_spinlock_t *lock)
+{
+ /* atomic_exchange usually takes less instructions than
+ atomic_compare_and_exchange. On the other hand,
+ atomic_compare_and_exchange potentially generates less bus traffic
+ when the lock is locked.
+ We assume that the first try mostly will be successful, and we use
+ atomic_exchange. For the subsequent tries we use
+ atomic_compare_and_exchange. */
+ if (atomic_exchange_acq (lock, 1) == 0)
+ return 0;
+
+ do
+ {
+ /* The lock is contended and we need to wait. Going straight back
+ to cmpxchg is not a good idea on many targets as that will force
+ expensive memory synchronizations among processors and penalize other
+ running threads.
+ On the other hand, we do want to update memory state on the local core
+ once in a while to avoid spinning indefinitely until some event that
+ will happen to update local memory as a side-effect. */
+ if (SPIN_LOCK_READS_BETWEEN_CMPXCHG >= 0)
+ {
+ int wait = SPIN_LOCK_READS_BETWEEN_CMPXCHG;
+
+ while (*lock != 0 && wait > 0)
+ --wait;
+ }
+ else
+ {
+ while (*lock != 0)
+ ;
+ }
+ }
+ while (atomic_compare_and_exchange_val_acq (lock, 1, 0) != 0);
+
+ return 0;
+}
diff --git a/libc/ports/sysdeps/arm/nptl/pthread_spin_trylock.c b/libc/nptl/pthread_spin_trylock.c
index 7d3118071..db9372cb5 100644
--- a/libc/ports/sysdeps/arm/nptl/pthread_spin_trylock.c
+++ b/libc/nptl/pthread_spin_trylock.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2008 Free Software Foundation, Inc.
+/* pthread_spin_trylock -- trylock a spin lock. Generic 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
@@ -12,7 +13,7 @@
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
+ License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#include <errno.h>
@@ -22,5 +23,5 @@
int
pthread_spin_trylock (pthread_spinlock_t *lock)
{
- return atomic_compare_and_exchange_val_acq (lock, 1, 0) ? EBUSY : 0;
+ return atomic_exchange_acq (lock, 1) ? EBUSY : 0;
}
diff --git a/libc/nptl/sysdeps/pthread/bits/libc-lockP.h b/libc/nptl/sysdeps/pthread/bits/libc-lockP.h
index f50111cc9..9175f719c 100644
--- a/libc/nptl/sysdeps/pthread/bits/libc-lockP.h
+++ b/libc/nptl/sysdeps/pthread/bits/libc-lockP.h
@@ -186,13 +186,16 @@ extern void __libc_lock_lock_fn (__libc_lock_t *);
libc_hidden_proto (__libc_lock_lock_fn);
# endif /* __OPTION_EGLIBC_BIG_MACROS != 1 */
# if __OPTION_EGLIBC_BIG_MACROS
-# define __libc_lock_lock(NAME) \
+# ifndef __libc_lock_lock
+# define __libc_lock_lock(NAME) \
({ lll_lock (NAME, LLL_PRIVATE); 0; })
+# endif
# else
# define __libc_lock_lock(NAME) \
__libc_lock_lock_fn (&(NAME))
# endif /* __OPTION_EGLIBC_BIG_MACROS */
#else
+# undef __libc_lock_lock
# define __libc_lock_lock(NAME) \
__libc_maybe_call (__pthread_mutex_lock, (&(NAME)), 0)
#endif
@@ -211,13 +214,16 @@ extern int __libc_lock_trylock_fn (__libc_lock_t *);
libc_hidden_proto (__libc_lock_trylock_fn);
# endif /* __OPTION_EGLIBC_BIG_MACROS != 1 */
# if __OPTION_EGLIBC_BIG_MACROS
-# define __libc_lock_trylock(NAME) \
+# ifndef __libc_lock_trylock
+# define __libc_lock_trylock(NAME) \
lll_trylock (NAME)
+# endif
# else
# define __libc_lock_trylock(NAME) \
__libc_lock_trylock_fn (&(NAME))
# endif /* __OPTION_EGLIBC_BIG_MACROS */
#else
+# undef __libc_lock_trylock
# define __libc_lock_trylock(NAME) \
__libc_maybe_call (__pthread_mutex_trylock, (&(NAME)), 0)
#endif
diff --git a/libc/nptl/sysdeps/pthread/createthread.c b/libc/nptl/sysdeps/pthread/createthread.c
index 3ead82535..e8e10dcf7 100644
--- a/libc/nptl/sysdeps/pthread/createthread.c
+++ b/libc/nptl/sysdeps/pthread/createthread.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2007, 2008, 2010 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -109,13 +109,9 @@ do_clone (struct pthread *pd, const struct pthread_attr *attr,
send it the cancellation signal. */
INTERNAL_SYSCALL_DECL (err2);
err_out:
-#if __ASSUME_TGKILL
(void) INTERNAL_SYSCALL (tgkill, err2, 3,
THREAD_GETMEM (THREAD_SELF, pid),
pd->tid, SIGCANCEL);
-#else
- (void) INTERNAL_SYSCALL (tkill, err2, 2, pd->tid, SIGCANCEL);
-#endif
/* We do not free the stack here because the canceled thread
itself will do this. */
@@ -179,18 +175,11 @@ create_thread (struct pthread *pd, const struct pthread_attr *attr,
sys_exit() in the location pointed to by the seventh parameter
to CLONE.
- CLONE_DETACHED
- No signal is generated if the thread exists and it is
- automatically reaped.
-
The termination signal is chosen to be zero which means no signal
is sent. */
int clone_flags = (CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGNAL
| CLONE_SETTLS | CLONE_PARENT_SETTID
| CLONE_CHILD_CLEARTID | CLONE_SYSVSEM
-#if __ASSUME_NO_CLONE_DETACHED == 0
- | CLONE_DETACHED
-#endif
| 0);
if (__builtin_expect (THREAD_GETMEM (THREAD_SELF, report_events), 0))
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/Makefile b/libc/nptl/sysdeps/unix/sysv/linux/Makefile
index 64a3f4f0d..d24a9bc7a 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/Makefile
+++ b/libc/nptl/sysdeps/unix/sysv/linux/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 2002,2003,2004,2005,2006,2007 Free Software Foundation, Inc.
+# Copyright (C) 2002-2012 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -29,7 +29,7 @@ gen-as-const-headers += lowlevelcond.sym lowlevelrwlock.sym \
endif
ifeq ($(subdir),posix)
-CFLAGS-fork.c = -D_IO_MTSAFE_IO
+CFLAGS-fork.c = $(libio-mtsafe)
CFLAGS-getpid.o = -fomit-frame-pointer
CFLAGS-getpid.os = -fomit-frame-pointer
endif
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S b/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
index 8170ab321..5f1fd5ddc 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
+++ b/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
@@ -122,10 +122,6 @@ __pthread_cond_timedwait:
leal 4(%esp), %ecx
movl $__NR_clock_gettime, %eax
ENTER_KERNEL
-# ifndef __ASSUME_POSIX_TIMERS
- cmpl $-ENOSYS, %eax
- je 19f
-# endif
movl %edx, %ebx
/* Compute relative timeout. */
@@ -482,30 +478,6 @@ __pthread_cond_timedwait:
call __lll_unlock_wake
jmp 11b
-#if defined __NR_clock_gettime && !defined __ASSUME_POSIX_TIMERS
- /* clock_gettime not available. */
-19: leal 4(%esp), %ebx
- xorl %ecx, %ecx
- movl $__NR_gettimeofday, %eax
- ENTER_KERNEL
- movl %edx, %ebx
-
- /* Compute relative timeout. */
- movl 8(%esp), %eax
- movl $1000, %edx
- mul %edx /* Milli seconds to nano seconds. */
- movl (%ebp), %ecx
- movl 4(%ebp), %edx
- subl 4(%esp), %ecx
- subl %eax, %edx
- jns 20f
- addl $1000000000, %edx
- subl $1, %ecx
-20: testl %ecx, %ecx
- movl $-ETIMEDOUT, %esi
- js 6b
- jmp 21b
-#endif
.size __pthread_cond_timedwait, .-__pthread_cond_timedwait
versioned_symbol (libpthread, __pthread_cond_timedwait, pthread_cond_timedwait,
GLIBC_2_3_2)
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/pt-raise.c b/libc/nptl/sysdeps/unix/sysv/linux/pt-raise.c
index 39ba5d309..71face45a 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/pt-raise.c
+++ b/libc/nptl/sysdeps/unix/sysv/linux/pt-raise.c
@@ -1,4 +1,4 @@
-/* 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.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -27,25 +27,13 @@ int
raise (sig)
int sig;
{
-#if __ASSUME_TGKILL || defined __NR_tgkill
/* raise is an async-safe function. It could be called while the
fork function temporarily invalidated the PID field. Adjust for
that. */
pid_t pid = THREAD_GETMEM (THREAD_SELF, pid);
if (__builtin_expect (pid < 0, 0))
pid = -pid;
-#endif
-#if __ASSUME_TGKILL
return INLINE_SYSCALL (tgkill, 3, pid, THREAD_GETMEM (THREAD_SELF, tid),
sig);
-#else
-# ifdef __NR_tgkill
- int res = INLINE_SYSCALL (tgkill, 3, pid, THREAD_GETMEM (THREAD_SELF, tid),
- sig);
- if (res != -1 || errno != ENOSYS)
- return res;
-# endif
- return INLINE_SYSCALL (tkill, 2, THREAD_GETMEM (THREAD_SELF, tid), sig);
-#endif
}
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/pthread_getcpuclockid.c b/libc/nptl/sysdeps/unix/sysv/linux/pthread_getcpuclockid.c
index 909f4686c..7d7287b4b 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/pthread_getcpuclockid.c
+++ b/libc/nptl/sysdeps/unix/sysv/linux/pthread_getcpuclockid.c
@@ -1,5 +1,5 @@
/* pthread_getcpuclockid -- Get POSIX clockid_t for a pthread_t. Linux version
- Copyright (C) 2000,2001,2002,2003,2004,2005 Free Software Foundation, Inc.
+ Copyright (C) 2000-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,9 +27,6 @@
#if !(__ASSUME_POSIX_CPU_TIMERS > 0)
int __libc_missing_posix_cpu_timers attribute_hidden;
#endif
-#if !(__ASSUME_POSIX_TIMERS > 0)
-int __libc_missing_posix_timers attribute_hidden;
-#endif
int
pthread_getcpuclockid (threadid, clockid)
@@ -51,10 +48,6 @@ pthread_getcpuclockid (threadid, clockid)
const clockid_t tidclock = MAKE_THREAD_CPUCLOCK (pd->tid, CPUCLOCK_SCHED);
# if !(__ASSUME_POSIX_CPU_TIMERS > 0)
-# if !(__ASSUME_POSIX_TIMERS > 0)
- if (__libc_missing_posix_timers && !__libc_missing_posix_cpu_timers)
- __libc_missing_posix_cpu_timers = 1;
-# endif
if (!__libc_missing_posix_cpu_timers)
{
INTERNAL_SYSCALL_DECL (err);
@@ -67,21 +60,12 @@ pthread_getcpuclockid (threadid, clockid)
}
# if !(__ASSUME_POSIX_CPU_TIMERS > 0)
-# if !(__ASSUME_POSIX_TIMERS > 0)
- if (INTERNAL_SYSCALL_ERRNO (r, err) == ENOSYS)
+ if (INTERNAL_SYSCALL_ERRNO (r, err) == EINVAL)
{
- /* The kernel doesn't support these calls at all. */
- __libc_missing_posix_timers = 1;
+ /* The kernel doesn't support these clocks at all. */
__libc_missing_posix_cpu_timers = 1;
}
else
-# endif
- if (INTERNAL_SYSCALL_ERRNO (r, err) == EINVAL)
- {
- /* The kernel doesn't support these clocks at all. */
- __libc_missing_posix_cpu_timers = 1;
- }
- else
return INTERNAL_SYSCALL_ERRNO (r, err);
}
# endif
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/pthread_kill.c b/libc/nptl/sysdeps/unix/sysv/linux/pthread_kill.c
index b2a14228e..6804bf283 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/pthread_kill.c
+++ b/libc/nptl/sysdeps/unix/sysv/linux/pthread_kill.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004, 2006, 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -58,18 +58,8 @@ __pthread_kill (threadid, signo)
fork, it would have to happen in a signal handler. But this is
no allowed, pthread_kill is not guaranteed to be async-safe. */
int val;
-#if __ASSUME_TGKILL
val = INTERNAL_SYSCALL (tgkill, err, 3, THREAD_GETMEM (THREAD_SELF, pid),
tid, signo);
-#else
-# ifdef __NR_tgkill
- val = INTERNAL_SYSCALL (tgkill, err, 3, THREAD_GETMEM (THREAD_SELF, pid),
- tid, signo);
- if (INTERNAL_SYSCALL_ERROR_P (val, err)
- && INTERNAL_SYSCALL_ERRNO (val, err) == ENOSYS)
-# endif
- val = INTERNAL_SYSCALL (tkill, err, 2, tid, signo);
-#endif
return (INTERNAL_SYSCALL_ERROR_P (val, err)
? INTERNAL_SYSCALL_ERRNO (val, err) : 0);
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/raise.c b/libc/nptl/sysdeps/unix/sysv/linux/raise.c
index 066427899..268ab46d3 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/raise.c
+++ b/libc/nptl/sysdeps/unix/sysv/linux/raise.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -29,9 +29,7 @@ raise (sig)
int sig;
{
struct pthread *pd = THREAD_SELF;
-#if __ASSUME_TGKILL || defined __NR_tgkill
pid_t pid = THREAD_GETMEM (pd, pid);
-#endif
pid_t selftid = THREAD_GETMEM (pd, tid);
if (selftid == 0)
{
@@ -44,31 +42,18 @@ raise (sig)
#endif
THREAD_SETMEM (pd, tid, selftid);
-#if __ASSUME_TGKILL || defined __NR_tgkill
/* We do not set the PID field in the TID here since we might be
called from a signal handler while the thread executes fork. */
pid = selftid;
-#endif
}
-#if __ASSUME_TGKILL || defined __NR_tgkill
else
/* raise is an async-safe function. It could be called while the
fork/vfork function temporarily invalidated the PID field. Adjust for
that. */
if (__builtin_expect (pid <= 0, 0))
pid = (pid & INT_MAX) == 0 ? selftid : -pid;
-#endif
-#if __ASSUME_TGKILL
return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig);
-#else
-# ifdef __NR_tgkill
- int res = INLINE_SYSCALL (tgkill, 3, pid, selftid, sig);
- if (res != -1 || errno != ENOSYS)
- return res;
-# endif
- return INLINE_SYSCALL (tkill, 2, selftid, sig);
-#endif
}
libc_hidden_def (raise)
weak_alias (raise, gsignal)
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S b/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
index 0937d6c23..a0ccacc8e 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
+++ b/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
@@ -158,10 +158,6 @@ __pthread_cond_timedwait:
mov.w .L__NR_clock_gettime, r3
trapa #0x12
SYSCALL_INST_PAD
-# ifndef __ASSUME_POSIX_TIMERS
- cmp/eq #-ENOSYS, r0
- bt 19f
-# endif
/* Compute relative timeout. */
mov.l @r13, r2
@@ -172,24 +168,6 @@ __pthread_cond_timedwait:
.L__NR_clock_gettime:
.word __NR_clock_gettime
-# ifndef __ASSUME_POSIX_TIMERS
-19:
- mov r15, r4
- add #16, r4
- mov #0, r5
- mov #__NR_gettimeofday, r3
- trapa #0x12
- SYSCALL_INST_PAD
-
- /* Compute relative timeout. */
- mov.l @(20,r15), r0
- mov.w .L1k, r1
- dmulu.l r0, r1 /* Micro seconds to nano seconds. */
- mov.l @r13, r2
- mov.l @(4,r13), r3
- mov.l @(16,r15), r0
- sts macl, r1
-#endif
0:
#else
mov r15, r4
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/timer_create.c b/libc/nptl/sysdeps/unix/sysv/linux/timer_create.c
index 8d365eb9a..c2865fb4f 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/timer_create.c
+++ b/libc/nptl/sysdeps/unix/sysv/linux/timer_create.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003,2004, 2007, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
@@ -30,21 +30,9 @@
#include "kernel-posix-cpu-timers.h"
-#ifdef __NR_timer_create
-# ifndef __ASSUME_POSIX_TIMERS
-static int compat_timer_create (clockid_t clock_id, struct sigevent *evp,
- timer_t *timerid);
-# define timer_create static compat_timer_create
-# include <nptl/sysdeps/pthread/timer_create.c>
-# undef timer_create
-
-/* Nonzero if the system calls are not available. */
-int __no_posix_timers attribute_hidden;
-# endif
-
-# ifdef timer_create_alias
-# define timer_create timer_create_alias
-# endif
+#ifdef timer_create_alias
+# define timer_create timer_create_alias
+#endif
int
@@ -53,190 +41,140 @@ timer_create (clock_id, evp, timerid)
struct sigevent *evp;
timer_t *timerid;
{
-# undef timer_create
-# ifndef __ASSUME_POSIX_TIMERS
- if (__no_posix_timers >= 0)
-# endif
- {
- clockid_t syscall_clockid = (clock_id == CLOCK_PROCESS_CPUTIME_ID
- ? MAKE_PROCESS_CPUCLOCK (0, CPUCLOCK_SCHED)
- : clock_id == CLOCK_THREAD_CPUTIME_ID
- ? MAKE_THREAD_CPUCLOCK (0, CPUCLOCK_SCHED)
- : clock_id);
-
- /* If the user wants notification via a thread we need to handle
- this special. */
- if (evp == NULL
- || __builtin_expect (evp->sigev_notify != SIGEV_THREAD, 1))
- {
- struct sigevent local_evp;
-
- /* We avoid allocating too much memory by basically
- using struct timer as a derived class with the
- first two elements being in the superclass. We only
- need these two elements here. */
- struct timer *newp = (struct timer *) malloc (offsetof (struct timer,
- thrfunc));
- if (newp == NULL)
- /* No more memory. */
+#undef timer_create
+ {
+ clockid_t syscall_clockid = (clock_id == CLOCK_PROCESS_CPUTIME_ID
+ ? MAKE_PROCESS_CPUCLOCK (0, CPUCLOCK_SCHED)
+ : clock_id == CLOCK_THREAD_CPUTIME_ID
+ ? MAKE_THREAD_CPUCLOCK (0, CPUCLOCK_SCHED)
+ : clock_id);
+
+ /* If the user wants notification via a thread we need to handle
+ this special. */
+ if (evp == NULL
+ || __builtin_expect (evp->sigev_notify != SIGEV_THREAD, 1))
+ {
+ struct sigevent local_evp;
+
+ /* We avoid allocating too much memory by basically
+ using struct timer as a derived class with the
+ first two elements being in the superclass. We only
+ need these two elements here. */
+ struct timer *newp = (struct timer *) malloc (offsetof (struct timer,
+ thrfunc));
+ if (newp == NULL)
+ /* No more memory. */
+ return -1;
+
+ if (evp == NULL)
+ {
+ /* The kernel has to pass up the timer ID which is a
+ userlevel object. Therefore we cannot leave it up to
+ the kernel to determine it. */
+ local_evp.sigev_notify = SIGEV_SIGNAL;
+ local_evp.sigev_signo = SIGALRM;
+ local_evp.sigev_value.sival_ptr = newp;
+
+ evp = &local_evp;
+ }
+
+ kernel_timer_t ktimerid;
+ int retval = INLINE_SYSCALL (timer_create, 3, syscall_clockid, evp,
+ &ktimerid);
+
+ if (retval != -1)
+ {
+ newp->sigev_notify = (evp != NULL
+ ? evp->sigev_notify : SIGEV_SIGNAL);
+ newp->ktimerid = ktimerid;
+
+ *timerid = (timer_t) newp;
+ }
+ else
+ {
+ /* Cannot allocate the timer, fail. */
+ free (newp);
+ retval = -1;
+ }
+
+ return retval;
+ }
+ else
+ {
+ /* Create the helper thread. */
+ pthread_once (&__helper_once, __start_helper_thread);
+ if (__helper_tid == 0)
+ {
+ /* No resources to start the helper thread. */
+ __set_errno (EAGAIN);
return -1;
-
- if (evp == NULL)
- {
- /* The kernel has to pass up the timer ID which is a
- userlevel object. Therefore we cannot leave it up to
- the kernel to determine it. */
- local_evp.sigev_notify = SIGEV_SIGNAL;
- local_evp.sigev_signo = SIGALRM;
- local_evp.sigev_value.sival_ptr = newp;
-
- evp = &local_evp;
- }
-
- kernel_timer_t ktimerid;
- int retval = INLINE_SYSCALL (timer_create, 3, syscall_clockid, evp,
- &ktimerid);
-
-# ifndef __ASSUME_POSIX_TIMERS
- if (retval != -1 || errno != ENOSYS)
-# endif
- {
-# ifndef __ASSUME_POSIX_TIMERS
- __no_posix_timers = 1;
-# endif
-
- if (retval != -1)
- {
- newp->sigev_notify = (evp != NULL
- ? evp->sigev_notify : SIGEV_SIGNAL);
- newp->ktimerid = ktimerid;
-
- *timerid = (timer_t) newp;
- }
- else
- {
- /* Cannot allocate the timer, fail. */
- free (newp);
- retval = -1;
- }
-
- return retval;
- }
-
- free (newp);
-
-# ifndef __ASSUME_POSIX_TIMERS
- /* When we come here the syscall does not exist. Make sure we
- do not try to use it again. */
- __no_posix_timers = -1;
-# endif
- }
- else
- {
-# ifndef __ASSUME_POSIX_TIMERS
- /* Make sure we have the necessary kernel support. */
- if (__no_posix_timers == 0)
- {
- INTERNAL_SYSCALL_DECL (err);
- struct timespec ts;
- int res;
- res = INTERNAL_SYSCALL (clock_getres, err, 2,
- CLOCK_REALTIME, &ts);
- __no_posix_timers = (INTERNAL_SYSCALL_ERROR_P (res, err)
- ? -1 : 1);
- }
-
- if (__no_posix_timers > 0)
-# endif
- {
- /* Create the helper thread. */
- pthread_once (&__helper_once, __start_helper_thread);
- if (__helper_tid == 0)
- {
- /* No resources to start the helper thread. */
- __set_errno (EAGAIN);
- return -1;
- }
-
- struct timer *newp;
- newp = (struct timer *) malloc (sizeof (struct timer));
- if (newp == NULL)
- return -1;
-
- /* Copy the thread parameters the user provided. */
- newp->sival = evp->sigev_value;
- newp->thrfunc = evp->sigev_notify_function;
- newp->sigev_notify = SIGEV_THREAD;
-
- /* We cannot simply copy the thread attributes since the
- implementation might keep internal information for
- each instance. */
- (void) pthread_attr_init (&newp->attr);
- if (evp->sigev_notify_attributes != NULL)
- {
- struct pthread_attr *nattr;
- struct pthread_attr *oattr;
-
- nattr = (struct pthread_attr *) &newp->attr;
- oattr = (struct pthread_attr *) evp->sigev_notify_attributes;
-
- nattr->schedparam = oattr->schedparam;
- nattr->schedpolicy = oattr->schedpolicy;
- nattr->flags = oattr->flags;
- nattr->guardsize = oattr->guardsize;
- nattr->stackaddr = oattr->stackaddr;
- nattr->stacksize = oattr->stacksize;
- }
-
- /* In any case set the detach flag. */
- (void) pthread_attr_setdetachstate (&newp->attr,
- PTHREAD_CREATE_DETACHED);
-
- /* Create the event structure for the kernel timer. */
- struct sigevent sev =
- { .sigev_value.sival_ptr = newp,
- .sigev_signo = SIGTIMER,
- .sigev_notify = SIGEV_SIGNAL | SIGEV_THREAD_ID,
- ._sigev_un = { ._pad = { [0] = __helper_tid } } };
-
- /* Create the timer. */
- INTERNAL_SYSCALL_DECL (err);
- int res;
- res = INTERNAL_SYSCALL (timer_create, err, 3,
- syscall_clockid, &sev, &newp->ktimerid);
- if (! INTERNAL_SYSCALL_ERROR_P (res, err))
- {
- /* Add to the queue of active timers with thread
- delivery. */
- pthread_mutex_lock (&__active_timer_sigev_thread_lock);
- newp->next = __active_timer_sigev_thread;
- __active_timer_sigev_thread = newp;
- pthread_mutex_unlock (&__active_timer_sigev_thread_lock);
-
- *timerid = (timer_t) newp;
- return 0;
- }
-
- /* Free the resources. */
- free (newp);
-
- __set_errno (INTERNAL_SYSCALL_ERRNO (res, err));
-
- return -1;
- }
- }
- }
-
-# ifndef __ASSUME_POSIX_TIMERS
- /* Compatibility code. */
- return compat_timer_create (clock_id, evp, timerid);
-# endif
+ }
+
+ struct timer *newp;
+ newp = (struct timer *) malloc (sizeof (struct timer));
+ if (newp == NULL)
+ return -1;
+
+ /* Copy the thread parameters the user provided. */
+ newp->sival = evp->sigev_value;
+ newp->thrfunc = evp->sigev_notify_function;
+ newp->sigev_notify = SIGEV_THREAD;
+
+ /* We cannot simply copy the thread attributes since the
+ implementation might keep internal information for
+ each instance. */
+ (void) pthread_attr_init (&newp->attr);
+ if (evp->sigev_notify_attributes != NULL)
+ {
+ struct pthread_attr *nattr;
+ struct pthread_attr *oattr;
+
+ nattr = (struct pthread_attr *) &newp->attr;
+ oattr = (struct pthread_attr *) evp->sigev_notify_attributes;
+
+ nattr->schedparam = oattr->schedparam;
+ nattr->schedpolicy = oattr->schedpolicy;
+ nattr->flags = oattr->flags;
+ nattr->guardsize = oattr->guardsize;
+ nattr->stackaddr = oattr->stackaddr;
+ nattr->stacksize = oattr->stacksize;
+ }
+
+ /* In any case set the detach flag. */
+ (void) pthread_attr_setdetachstate (&newp->attr,
+ PTHREAD_CREATE_DETACHED);
+
+ /* Create the event structure for the kernel timer. */
+ struct sigevent sev =
+ { .sigev_value.sival_ptr = newp,
+ .sigev_signo = SIGTIMER,
+ .sigev_notify = SIGEV_SIGNAL | SIGEV_THREAD_ID,
+ ._sigev_un = { ._pad = { [0] = __helper_tid } } };
+
+ /* Create the timer. */
+ INTERNAL_SYSCALL_DECL (err);
+ int res;
+ res = INTERNAL_SYSCALL (timer_create, err, 3,
+ syscall_clockid, &sev, &newp->ktimerid);
+ if (! INTERNAL_SYSCALL_ERROR_P (res, err))
+ {
+ /* Add to the queue of active timers with thread
+ delivery. */
+ pthread_mutex_lock (&__active_timer_sigev_thread_lock);
+ newp->next = __active_timer_sigev_thread;
+ __active_timer_sigev_thread = newp;
+ pthread_mutex_unlock (&__active_timer_sigev_thread_lock);
+
+ *timerid = (timer_t) newp;
+ return 0;
+ }
+
+ /* Free the resources. */
+ free (newp);
+
+ __set_errno (INTERNAL_SYSCALL_ERRNO (res, err));
+
+ return -1;
+ }
+ }
}
-#else
-# ifdef timer_create_alias
-# define timer_create timer_create_alias
-# endif
-/* The new system calls are not available. Use the userlevel
- implementation. */
-# include <nptl/sysdeps/pthread/timer_create.c>
-#endif
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/timer_delete.c b/libc/nptl/sysdeps/unix/sysv/linux/timer_delete.c
index 98f68e9c2..598be8343 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/timer_delete.c
+++ b/libc/nptl/sysdeps/unix/sysv/linux/timer_delete.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
@@ -24,91 +24,51 @@
#include "kernel-posix-timers.h"
-#ifdef __NR_timer_delete
-# ifndef __ASSUME_POSIX_TIMERS
-static int compat_timer_delete (timer_t timerid);
-# define timer_delete static compat_timer_delete
-# include <nptl/sysdeps/pthread/timer_delete.c>
-# undef timer_delete
-# endif
-
-# ifdef timer_delete_alias
-# define timer_delete timer_delete_alias
-# endif
+#ifdef timer_delete_alias
+# define timer_delete timer_delete_alias
+#endif
int
timer_delete (timerid)
timer_t timerid;
{
-# undef timer_delete
-# ifndef __ASSUME_POSIX_TIMERS
- if (__no_posix_timers >= 0)
-# endif
- {
- struct timer *kt = (struct timer *) timerid;
+#undef timer_delete
+ struct timer *kt = (struct timer *) timerid;
- /* Delete the kernel timer object. */
- int res = INLINE_SYSCALL (timer_delete, 1, kt->ktimerid);
+ /* Delete the kernel timer object. */
+ int res = INLINE_SYSCALL (timer_delete, 1, kt->ktimerid);
- if (res == 0)
+ if (res == 0)
+ {
+ if (kt->sigev_notify == SIGEV_THREAD)
{
- if (kt->sigev_notify == SIGEV_THREAD)
+ /* Remove the timer from the list. */
+ pthread_mutex_lock (&__active_timer_sigev_thread_lock);
+ if (__active_timer_sigev_thread == kt)
+ __active_timer_sigev_thread = kt->next;
+ else
{
- /* Remove the timer from the list. */
- pthread_mutex_lock (&__active_timer_sigev_thread_lock);
- if (__active_timer_sigev_thread == kt)
- __active_timer_sigev_thread = kt->next;
- else
- {
- struct timer *prevp = __active_timer_sigev_thread;
- while (prevp->next != NULL)
- if (prevp->next == kt)
- {
- prevp->next = kt->next;
- break;
- }
- else
- prevp = prevp->next;
- }
- pthread_mutex_unlock (&__active_timer_sigev_thread_lock);
+ struct timer *prevp = __active_timer_sigev_thread;
+ while (prevp->next != NULL)
+ if (prevp->next == kt)
+ {
+ prevp->next = kt->next;
+ break;
+ }
+ else
+ prevp = prevp->next;
}
-
-# ifndef __ASSUME_POSIX_TIMERS
- /* We know the syscall support is available. */
- __no_posix_timers = 1;
-# endif
-
- /* Free the memory. */
- (void) free (kt);
-
- return 0;
+ pthread_mutex_unlock (&__active_timer_sigev_thread_lock);
}
- /* The kernel timer is not known or something else bad happened.
- Return the error. */
-# ifndef __ASSUME_POSIX_TIMERS
- if (errno != ENOSYS)
- {
- __no_posix_timers = 1;
-# endif
- return -1;
-# ifndef __ASSUME_POSIX_TIMERS
- }
+ /* Free the memory. */
+ (void) free (kt);
- __no_posix_timers = -1;
-# endif
+ return 0;
}
-# ifndef __ASSUME_POSIX_TIMERS
- return compat_timer_delete (timerid);
-# endif
+ /* The kernel timer is not known or something else bad happened.
+ Return the error. */
+ return -1;
}
-#else
-# ifdef timer_delete_alias
-# define timer_delete timer_delete_alias
-# endif
-/* The new system calls are not available. Use the userlevel
- implementation. */
-# include <nptl/sysdeps/pthread/timer_delete.c>
-#endif
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/timer_getoverr.c b/libc/nptl/sysdeps/unix/sysv/linux/timer_getoverr.c
index a87309122..6d48d4c14 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/timer_getoverr.c
+++ b/libc/nptl/sysdeps/unix/sysv/linux/timer_getoverr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
@@ -23,58 +23,20 @@
#include "kernel-posix-timers.h"
-#ifdef __NR_timer_getoverrun
-# ifndef __ASSUME_POSIX_TIMERS
-static int compat_timer_getoverrun (timer_t timerid);
-# define timer_getoverrun static compat_timer_getoverrun
-# include <nptl/sysdeps/pthread/timer_getoverr.c>
-# undef timer_getoverrun
-# endif
-
-# ifdef timer_getoverrun_alias
-# define timer_getoverrun timer_getoverrun_alias
-# endif
+#ifdef timer_getoverrun_alias
+# define timer_getoverrun timer_getoverrun_alias
+#endif
int
timer_getoverrun (timerid)
timer_t timerid;
{
-# undef timer_getoverrun
-# ifndef __ASSUME_POSIX_TIMERS
- if (__no_posix_timers >= 0)
-# endif
- {
- struct timer *kt = (struct timer *) timerid;
-
- /* Get the information from the kernel. */
- int res = INLINE_SYSCALL (timer_getoverrun, 1, kt->ktimerid);
+#undef timer_getoverrun
+ struct timer *kt = (struct timer *) timerid;
-# ifndef __ASSUME_POSIX_TIMERS
- if (res != -1 || errno != ENOSYS)
- {
- /* We know the syscall support is available. */
- __no_posix_timers = 1;
-# endif
- return res;
-# ifndef __ASSUME_POSIX_TIMERS
- }
-# endif
+ /* Get the information from the kernel. */
+ int res = INLINE_SYSCALL (timer_getoverrun, 1, kt->ktimerid);
-# ifndef __ASSUME_POSIX_TIMERS
- __no_posix_timers = -1;
-# endif
- }
-
-# ifndef __ASSUME_POSIX_TIMERS
- return compat_timer_getoverrun (timerid);
-# endif
+ return res;
}
-#else
-# ifdef timer_getoverrun_alias
-# define timer_getoverrun timer_getoverrun_alias
-# endif
-/* The new system calls are not available. Use the userlevel
- implementation. */
-# include <nptl/sysdeps/pthread/timer_getoverr.c>
-#endif
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/timer_gettime.c b/libc/nptl/sysdeps/unix/sysv/linux/timer_gettime.c
index 1efe2cc91..6d9933a99 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/timer_gettime.c
+++ b/libc/nptl/sysdeps/unix/sysv/linux/timer_gettime.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
@@ -24,17 +24,9 @@
#include "kernel-posix-timers.h"
-#ifdef __NR_timer_gettime
-# ifndef __ASSUME_POSIX_TIMERS
-static int compat_timer_gettime (timer_t timerid, struct itimerspec *value);
-# define timer_gettime static compat_timer_gettime
-# include <nptl/sysdeps/pthread/timer_gettime.c>
-# undef timer_gettime
-# endif
-
-# ifdef timer_gettime_alias
-# define timer_gettime timer_gettime_alias
-# endif
+#ifdef timer_gettime_alias
+# define timer_gettime timer_gettime_alias
+#endif
int
@@ -42,41 +34,11 @@ timer_gettime (timerid, value)
timer_t timerid;
struct itimerspec *value;
{
-# undef timer_gettime
-# ifndef __ASSUME_POSIX_TIMERS
- if (__no_posix_timers >= 0)
-# endif
- {
- struct timer *kt = (struct timer *) timerid;
-
- /* Delete the kernel timer object. */
- int res = INLINE_SYSCALL (timer_gettime, 2, kt->ktimerid, value);
+#undef timer_gettime
+ struct timer *kt = (struct timer *) timerid;
-# ifndef __ASSUME_POSIX_TIMERS
- if (res != -1 || errno != ENOSYS)
- {
- /* We know the syscall support is available. */
- __no_posix_timers = 1;
-# endif
- return res;
-# ifndef __ASSUME_POSIX_TIMERS
- }
-# endif
+ /* Delete the kernel timer object. */
+ int res = INLINE_SYSCALL (timer_gettime, 2, kt->ktimerid, value);
-# ifndef __ASSUME_POSIX_TIMERS
- __no_posix_timers = -1;
-# endif
- }
-
-# ifndef __ASSUME_POSIX_TIMERS
- return compat_timer_gettime (timerid, value);
-# endif
+ return res;
}
-#else
-# ifdef timer_gettime_alias
-# define timer_gettime timer_gettime_alias
-# endif
-/* The new system calls are not available. Use the userlevel
- implementation. */
-# include <nptl/sysdeps/pthread/timer_gettime.c>
-#endif
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/timer_routines.c b/libc/nptl/sysdeps/unix/sysv/linux/timer_routines.c
index aea3c8f51..b7e36bb59 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/timer_routines.c
+++ b/libc/nptl/sysdeps/unix/sysv/linux/timer_routines.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2007, 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
@@ -39,7 +39,6 @@ struct thread_start_data
};
-#ifdef __NR_timer_create
/* Helper thread to call the user-provided function. */
static void *
timer_sigev_thread (void *arg)
@@ -196,8 +195,3 @@ __start_helper_thread (void)
be created. */
pthread_atfork (NULL, NULL, reset_helper_control);
}
-#endif
-
-#ifndef __ASSUME_POSIX_TIMERS
-# include <nptl/sysdeps/pthread/timer_routines.c>
-#endif
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/timer_settime.c b/libc/nptl/sysdeps/unix/sysv/linux/timer_settime.c
index 14846967d..5b522ec75 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/timer_settime.c
+++ b/libc/nptl/sysdeps/unix/sysv/linux/timer_settime.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
@@ -24,19 +24,9 @@
#include "kernel-posix-timers.h"
-#ifdef __NR_timer_settime
-# ifndef __ASSUME_POSIX_TIMERS
-static int compat_timer_settime (timer_t timerid, int flags,
- const struct itimerspec *value,
- struct itimerspec *ovalue);
-# define timer_settime static compat_timer_settime
-# include <nptl/sysdeps/pthread/timer_settime.c>
-# undef timer_settime
-# endif
-
-# ifdef timer_settime_alias
-# define timer_settime timer_settime_alias
-# endif
+#ifdef timer_settime_alias
+# define timer_settime timer_settime_alias
+#endif
int
@@ -46,42 +36,12 @@ timer_settime (timerid, flags, value, ovalue)
const struct itimerspec *value;
struct itimerspec *ovalue;
{
-# undef timer_settime
-# ifndef __ASSUME_POSIX_TIMERS
- if (__no_posix_timers >= 0)
-# endif
- {
- struct timer *kt = (struct timer *) timerid;
-
- /* Delete the kernel timer object. */
- int res = INLINE_SYSCALL (timer_settime, 4, kt->ktimerid, flags,
- value, ovalue);
+#undef timer_settime
+ struct timer *kt = (struct timer *) timerid;
-# ifndef __ASSUME_POSIX_TIMERS
- if (res != -1 || errno != ENOSYS)
- {
- /* We know the syscall support is available. */
- __no_posix_timers = 1;
-# endif
- return res;
-# ifndef __ASSUME_POSIX_TIMERS
- }
-# endif
+ /* Delete the kernel timer object. */
+ int res = INLINE_SYSCALL (timer_settime, 4, kt->ktimerid, flags,
+ value, ovalue);
-# ifndef __ASSUME_POSIX_TIMERS
- __no_posix_timers = -1;
-# endif
- }
-
-# ifndef __ASSUME_POSIX_TIMERS
- return compat_timer_settime (timerid, flags, value, ovalue);
-# endif
+ return res;
}
-#else
-# ifdef timer_settime_alias
-# define timer_settime timer_settime_alias
-# endif
-/* The new system calls are not available. Use the userlevel
- implementation. */
-# include <nptl/sysdeps/pthread/timer_settime.c>
-#endif
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
index 50e1ffd55..a1c8ca87b 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
+++ b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
@@ -457,10 +457,6 @@ __pthread_cond_timedwait:
movl $__NR_clock_gettime, %eax
syscall
# endif
-# ifndef __ASSUME_POSIX_TIMERS
- cmpq $-ENOSYS, %rax
- je 19f
-# endif
/* Compute relative timeout. */
movq (%r13), %rcx
@@ -604,32 +600,6 @@ __pthread_cond_timedwait:
subq $cond_lock, %rdi
# endif
jmp 6b
-
-# if defined __NR_clock_gettime && !defined __ASSUME_POSIX_TIMERS
- /* clock_gettime not available. */
-19: leaq 32(%rsp), %rdi
- xorl %esi, %esi
- /* This call works because we directly jump to a system call entry
- which preserves all the registers. */
- call JUMPTARGET(__gettimeofday)
-
- /* Compute relative timeout. */
- movq 40(%rsp), %rax
- movl $1000, %edx
- mul %rdx /* Milli seconds to nano seconds. */
- movq (%r13), %rcx
- movq 8(%r13), %rdx
- subq 32(%rsp), %rcx
- subq %rax, %rdx
- jns 20f
- addq $1000000000, %rdx
- decq %rcx
-20: testq %rcx, %rcx
- movq 8(%rsp), %rdi
- movq $-ETIMEDOUT, %r14
- js 6b
- jmp 21b
-# endif
#endif
.size __pthread_cond_timedwait, .-__pthread_cond_timedwait
versioned_symbol (libpthread, __pthread_cond_timedwait, pthread_cond_timedwait,
diff --git a/libc/nss/getXXbyYY_r.c b/libc/nss/getXXbyYY_r.c
index d197c9be1..f296ed1f4 100644
--- a/libc/nss/getXXbyYY_r.c
+++ b/libc/nss/getXXbyYY_r.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2004,2006,2007,2009,2010 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
@@ -51,7 +51,7 @@
|* *|
|* EXTRA_VARIABLES - names of optional parameter *|
|* *|
-|* FUNCTION_NAME - alternative name of the non-reentrant function *|
+|* FUNCTION2_NAME - alternative name of the non-reentrant function *|
|* *|
|* NEED_H_ERRNO - an extra parameter will be passed to point to *|
|* the global `h_errno' variable. *|
@@ -204,7 +204,9 @@ INTERNAL (REENTRANT_NAME) (ADD_PARAMS, LOOKUP_TYPE *resbuf, char *buffer,
if (no_more)
{
void *tmp_ptr = (service_user *) -1l;
+#ifdef PTR_MANGLE
PTR_MANGLE (tmp_ptr);
+#endif
startp = tmp_ptr;
}
else
@@ -225,10 +227,14 @@ INTERNAL (REENTRANT_NAME) (ADD_PARAMS, LOOKUP_TYPE *resbuf, char *buffer,
#endif /* need _res_hconf */
void *tmp_ptr = fct.l;
+#ifdef PTR_MANGLE
PTR_MANGLE (tmp_ptr);
+#endif
start_fct = tmp_ptr;
tmp_ptr = nip;
+#ifdef PTR_MANGLE
PTR_MANGLE (tmp_ptr);
+#endif
startp = tmp_ptr;
}
@@ -240,9 +246,11 @@ INTERNAL (REENTRANT_NAME) (ADD_PARAMS, LOOKUP_TYPE *resbuf, char *buffer,
else
{
fct.l = start_fct;
- PTR_DEMANGLE (fct.l);
nip = startp;
+#ifdef PTR_DEMANGLE
+ PTR_DEMANGLE (fct.l);
PTR_DEMANGLE (nip);
+#endif
no_more = nip == (service_user *) -1l;
}
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/m68k/coldfire/fpu/bits/mathinline.h b/libc/ports/sysdeps/m68k/coldfire/fpu/bits/mathinline.h
new file mode 100644
index 000000000..928b7d3e3
--- /dev/null
+++ b/libc/ports/sysdeps/m68k/coldfire/fpu/bits/mathinline.h
@@ -0,0 +1,44 @@
+/* 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
+ 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 _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);
+}
+
+#endif
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/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/mips/nptl/pthread_spin_lock.S b/libc/ports/sysdeps/mips/nptl/pthread_spin_lock.c
index a8504f163..f39b0182b 100644
--- a/libc/ports/sysdeps/mips/nptl/pthread_spin_lock.S
+++ b/libc/ports/sysdeps/mips/nptl/pthread_spin_lock.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005 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,22 +15,9 @@
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>
+#define SPIN_LOCK_READS_BETWEEN_CMPXCHG 1000
-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)
+/* 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
diff --git a/libc/posix/regcomp.c b/libc/posix/regcomp.c
index a8240ec2a..77f38ffc4 100644
--- a/libc/posix/regcomp.c
+++ b/libc/posix/regcomp.c
@@ -942,8 +942,12 @@ init_word_char (re_dfa_t *dfa)
{
if (sizeof (dfa->word_char[0]) == 8)
{
- dfa->word_char[0] = UINT64_C (0x03ff000000000000);
- dfa->word_char[1] = UINT64_C (0x07fffffe87fffffe);
+ /* The extra temporaries here avoid "implicitly truncated"
+ warnings in the case when this is dead code, i.e. 32-bit. */
+ const uint64_t wc0 = UINT64_C (0x03ff000000000000);
+ const uint64_t wc1 = UINT64_C (0x07fffffe87fffffe);
+ dfa->word_char[0] = wc0;
+ dfa->word_char[1] = wc1;
i = 2;
}
else if (sizeof (dfa->word_char[0]) == 4)
diff --git a/libc/posix/unistd.h b/libc/posix/unistd.h
index 535dc78c8..d55a0de89 100644
--- a/libc/posix/unistd.h
+++ b/libc/posix/unistd.h
@@ -719,34 +719,34 @@ extern int group_member (__gid_t __gid) __THROW;
If the calling process is the super-user, set the real
and effective user IDs, and the saved set-user-ID to UID;
if not, the effective user ID is set to UID. */
-extern int setuid (__uid_t __uid) __THROW;
+extern int setuid (__uid_t __uid) __THROW __wur;
#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
/* Set the real user ID of the calling process to RUID,
and the effective user ID of the calling process to EUID. */
-extern int setreuid (__uid_t __ruid, __uid_t __euid) __THROW;
+extern int setreuid (__uid_t __ruid, __uid_t __euid) __THROW __wur;
#endif
#if defined __USE_BSD || defined __USE_XOPEN2K
/* Set the effective user ID of the calling process to UID. */
-extern int seteuid (__uid_t __uid) __THROW;
+extern int seteuid (__uid_t __uid) __THROW __wur;
#endif /* Use BSD. */
/* Set the group ID of the calling process to GID.
If the calling process is the super-user, set the real
and effective group IDs, and the saved set-group-ID to GID;
if not, the effective group ID is set to GID. */
-extern int setgid (__gid_t __gid) __THROW;
+extern int setgid (__gid_t __gid) __THROW __wur;
#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
/* Set the real group ID of the calling process to RGID,
and the effective group ID of the calling process to EGID. */
-extern int setregid (__gid_t __rgid, __gid_t __egid) __THROW;
+extern int setregid (__gid_t __rgid, __gid_t __egid) __THROW __wur;
#endif
#if defined __USE_BSD || defined __USE_XOPEN2K
/* Set the effective group ID of the calling process to GID. */
-extern int setegid (__gid_t __gid) __THROW;
+extern int setegid (__gid_t __gid) __THROW __wur;
#endif /* Use BSD. */
#ifdef __USE_GNU
@@ -763,12 +763,12 @@ extern int getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid)
/* Set the real user ID, effective user ID, and saved-set user ID,
of the calling process to RUID, EUID, and SUID, respectively. */
extern int setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid)
- __THROW;
+ __THROW __wur;
/* Set the real group ID, effective group ID, and saved-set group ID,
of the calling process to RGID, EGID, and SGID, respectively. */
extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid)
- __THROW;
+ __THROW __wur;
#endif
diff --git a/libc/pwd/Makefile b/libc/pwd/Makefile
index f5f67aabd..42fa75149 100644
--- a/libc/pwd/Makefile
+++ b/libc/pwd/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 1991,1996-1999,2003,2004 Free Software Foundation, Inc.
+# Copyright (C) 1991-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
@@ -40,6 +40,6 @@ CFLAGS-getpwnam_r.c = $(OPTION_EGLIBC_INET-CFLAGS-y)
CFLAGS-getpwent_r.c = -fexceptions
CFLAGS-getpwent.c = -fexceptions
CFLAGS-getpw.c = -fexceptions
-CFLAGS-fgetpwent_r.c = -D_IO_MTSAFE_IO
+CFLAGS-fgetpwent_r.c = $(libio-mtsafe)
endif
diff --git a/libc/rt/clock_nanosleep.c b/libc/rt/clock_nanosleep.c
index 954a61501..0b16ad2d4 100644
--- a/libc/rt/clock_nanosleep.c
+++ b/libc/rt/clock_nanosleep.c
@@ -1,5 +1,5 @@
/* High-resolution sleep with the specified clock. Stub version.
- Copyright (C) 2000 Free Software Foundation, Inc.
+ Copyright (C) 2000-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
@@ -17,8 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <errno.h>
-#include <sys/time.h>
-
+#include <time.h>
int
clock_nanosleep (clockid_t clock_id, int flags, const struct timespec *req,
diff --git a/libc/shadow/Makefile b/libc/shadow/Makefile
index 7c17a7f9b..4b17b29d1 100644
--- a/libc/shadow/Makefile
+++ b/libc/shadow/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 1996, 2003, 2004, 2009 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
@@ -30,8 +30,8 @@ tests = tst-shadow
CFLAGS-getspent_r.c = -fexceptions
CFLAGS-getspent.c = -fexceptions
CFLAGS-fgetspent.c = -fexceptions
-CFLAGS-fgetspent_r.c = -fexceptions -D_IO_MTSAFE_IO
-CFLAGS-putspent.c = -fexceptions -D_IO_MTSAFE_IO
+CFLAGS-fgetspent_r.c = -fexceptions $(libio-mtsafe)
+CFLAGS-putspent.c = -fexceptions $(libio-mtsafe)
CFLAGS-getspnam.c = -fexceptions
CFLAGS-getspnam_r.c = -fexceptions
diff --git a/libc/socket/accept4.c b/libc/socket/accept4.c
index 7ad125968..fad2cc696 100644
--- a/libc/socket/accept4.c
+++ b/libc/socket/accept4.c
@@ -34,7 +34,6 @@ __libc_accept4 (fd, addr, addr_len, flags)
__set_errno (ENOSYS);
return -1;
}
-libc_hidden_def (__libc_accept4)
weak_alias (__libc_accept4, accept4)
diff --git a/libc/stdio-common/Makefile b/libc/stdio-common/Makefile
index 03d78b801..bef5db9db 100644
--- a/libc/stdio-common/Makefile
+++ b/libc/stdio-common/Makefile
@@ -135,9 +135,7 @@ scanf13-ENV = LOCPATH=$(common-objpfx)localedata
bug14-ENV = LOCPATH=$(common-objpfx)localedata
tst-grouping-ENV = LOCPATH=$(common-objpfx)localedata
-ifneq (,$(filter %REENTRANT, $(defines)))
-CPPFLAGS += -D_IO_MTSAFE_IO
-endif
+CPPFLAGS += $(libio-mtsafe)
$(objpfx)tst-setvbuf1.out: tst-setvbuf1.expect $(objpfx)tst-setvbuf1
$(built-program-cmd) > $@ 2>&1
diff --git a/libc/stdio-common/_itoa.c b/libc/stdio-common/_itoa.c
index ebb3e857c..4c588d989 100644
--- a/libc/stdio-common/_itoa.c
+++ b/libc/stdio-common/_itoa.c
@@ -206,7 +206,7 @@ _itoa (value, buflim, base, upper_case)
{
# define RUN_2N(BITS) \
do \
- { \
+ { \
/* `unsigned long long int' always has 64 bits. */ \
mp_limb_t work_hi = value >> (64 - BITS_PER_MP_LIMB); \
\
@@ -264,7 +264,8 @@ _itoa (value, buflim, base, upper_case)
if (brec->flag)
while (value != 0)
{
- mp_limb_t quo, rem, x, dummy;
+ mp_limb_t quo, rem, x;
+ mp_limb_t __attribute__ ((unused));
umul_ppmm (x, dummy, value, base_multiplier);
quo = (x + ((value - x) >> 1)) >> (brec->post_shift - 1);
@@ -275,7 +276,8 @@ _itoa (value, buflim, base, upper_case)
else
while (value != 0)
{
- mp_limb_t quo, rem, x, dummy;
+ mp_limb_t quo, rem, x;
+ mp_limb_t __attribute__ ((unused));
umul_ppmm (x, dummy, value, base_multiplier);
quo = x >> brec->post_shift;
@@ -401,7 +403,8 @@ _itoa (value, buflim, base, upper_case)
if (brec->flag)
while (ti != 0)
{
- mp_limb_t quo, rem, x, dummy;
+ mp_limb_t quo, rem, x;
+ mp_limb_t dummy __attribute__ ((unused));
umul_ppmm (x, dummy, ti, base_multiplier);
quo = (x + ((ti - x) >> 1)) >> (brec->post_shift - 1);
@@ -413,7 +416,8 @@ _itoa (value, buflim, base, upper_case)
else
while (ti != 0)
{
- mp_limb_t quo, rem, x, dummy;
+ mp_limb_t quo, rem, x;
+ mp_limb_t dummy __attribute__ ((unused));
umul_ppmm (x, dummy, ti, base_multiplier);
quo = x >> brec->post_shift;
diff --git a/libc/stdio-common/_itowa.c b/libc/stdio-common/_itowa.c
index 9381d33b6..6561ee158 100644
--- a/libc/stdio-common/_itowa.c
+++ b/libc/stdio-common/_itowa.c
@@ -1,5 +1,5 @@
/* Internal function for converting integers to ASCII.
- Copyright (C) 1994-1996,1999,2000,2002,2007 Free Software Foundation, Inc.
+ Copyright (C) 1994-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Torbjorn Granlund <tege@matematik.su.se>
and Ulrich Drepper <drepper@gnu.org>.
@@ -102,7 +102,7 @@ _itowa (value, buflim, base, upper_case)
{
# define RUN_2N(BITS) \
do \
- { \
+ { \
/* `unsigned long long int' always has 64 bits. */ \
mp_limb_t work_hi = value >> (64 - BITS_PER_MP_LIMB); \
\
@@ -296,7 +296,8 @@ _itowa (value, buflim, base, upper_case)
if (brec->flag)
while (ti != 0)
{
- mp_limb_t quo, rem, x, dummy;
+ mp_limb_t quo, rem, x;
+ mp_limb_t dummy __attribute__ ((unused));
umul_ppmm (x, dummy, ti, base_multiplier);
quo = (x + ((ti - x) >> 1)) >> (brec->post_shift - 1);
@@ -308,7 +309,8 @@ _itowa (value, buflim, base, upper_case)
else
while (ti != 0)
{
- mp_limb_t quo, rem, x, dummy;
+ mp_limb_t quo, rem, x;
+ mp_limb_t dummy __attribute__ ((unused));
umul_ppmm (x, dummy, ti, base_multiplier);
quo = x >> brec->post_shift;
diff --git a/libc/stdio-common/isoc99_scanf.c b/libc/stdio-common/isoc99_scanf.c
index 2e04e700e..2bd1e512c 100644
--- a/libc/stdio-common/isoc99_scanf.c
+++ b/libc/stdio-common/isoc99_scanf.c
@@ -28,13 +28,17 @@ __isoc99_scanf (const char *format, ...)
va_list arg;
int done;
+#ifdef _IO_MTSAFE_IO
_IO_acquire_lock_clear_flags2 (stdin);
+#endif
stdin->_flags2 |= _IO_FLAGS2_SCANF_STD;
va_start (arg, format);
done = _IO_vfscanf (stdin, format, arg, NULL);
va_end (arg);
+#ifdef _IO_MTSAFE_IO
_IO_release_lock (stdin);
+#endif
return done;
}
diff --git a/libc/stdlib/Makefile b/libc/stdlib/Makefile
index f7e97e9c4..aeb3d25c4 100644
--- a/libc/stdlib/Makefile
+++ b/libc/stdlib/Makefile
@@ -112,10 +112,8 @@ CFLAGS-system.c = -fexceptions
CFLAGS-system.os = -fomit-frame-pointer
CFLAGS-fmtmsg.c = -fexceptions
-ifneq (,$(filter %REENTRANT, $(defines)))
-CFLAGS-strfmon.c = -D_IO_MTSAFE_IO
-CFLAGS-strfmon_l.c = -D_IO_MTSAFE_IO
-endif
+CFLAGS-strfmon.c = $(libio-mtsafe)
+CFLAGS-strfmon_l.c = $(libio-mtsafe)
CFLAGS-tst-bsearch.c = $(stack-align-test-flags)
CFLAGS-tst-qsort.c = $(stack-align-test-flags)
diff --git a/libc/stdlib/canonicalize.c b/libc/stdlib/canonicalize.c
index 876b482cf..aeff804c1 100644
--- a/libc/stdlib/canonicalize.c
+++ b/libc/stdlib/canonicalize.c
@@ -1,5 +1,5 @@
/* Return the canonical absolute name of a given file.
- Copyright (C) 1996-2002,2004,2005,2006,2008 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
@@ -21,11 +21,11 @@
#include <string.h>
#include <unistd.h>
#include <limits.h>
-#include <sys/param.h>
#include <sys/stat.h>
#include <errno.h>
#include <stddef.h>
+#include <eloop-threshold.h>
#include <shlib-compat.h>
/* Return the canonical absolute name of file NAME. A canonical name
@@ -166,7 +166,7 @@ __realpath (const char *name, char *resolved)
char *buf = __alloca (path_max);
size_t len;
- if (++num_links > MAXSYMLINKS)
+ if (++num_links > __eloop_threshold ())
{
__set_errno (ELOOP);
goto error;
diff --git a/libc/stdlib/divmod_1.c b/libc/stdlib/divmod_1.c
index b11fd7bf8..4e6966bc9 100644
--- a/libc/stdlib/divmod_1.c
+++ b/libc/stdlib/divmod_1.c
@@ -6,7 +6,7 @@
QUOT_PTR and DIVIDEND_PTR might point to the same limb.
-Copyright (C) 1991, 1993, 1994, 1996 Free Software Foundation, Inc.
+Copyright (C) 1991-2012 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -54,7 +54,7 @@ mpn_divmod_1 (quot_ptr, dividend_ptr, dividend_size, divisor_limb)
{
mp_size_t i;
mp_limb_t n1, n0, r;
- mp_limb_t dummy;
+ mp_limb_t dummy __attribute__ ((unused));
/* ??? Should this be handled at all? Rely on callers? */
if (dividend_size == 0)
diff --git a/libc/stdlib/gmp-impl.h b/libc/stdlib/gmp-impl.h
index f6454ee2d..7e9462485 100644
--- a/libc/stdlib/gmp-impl.h
+++ b/libc/stdlib/gmp-impl.h
@@ -1,6 +1,6 @@
/* Include file for internal GNU MP types and definitions.
-Copyright (C) 1991, 1993, 1994, 1995, 1996, 2011 Free Software Foundation, Inc.
+Copyright (C) 1991-2012 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -216,7 +216,8 @@ extern mp_size_t __gmp_default_fp_limb_precision;
has to be set. Put the quotient in Q and the remainder in R. */
#define udiv_qrnnd_preinv(q, r, nh, nl, d, di) \
do { \
- mp_limb_t _q, _ql, _r; \
+ mp_limb_t _ql __attribute__ ((unused)); \
+ mp_limb_t _q, _r; \
mp_limb_t _xh, _xl; \
umul_ppmm (_q, _ql, (nh), (di)); \
_q += (nh); /* DI is 2**BITS_PER_MP_LIMB too small */\
diff --git a/libc/stdlib/longlong.h b/libc/stdlib/longlong.h
index 042771839..30e638ca1 100644
--- a/libc/stdlib/longlong.h
+++ b/libc/stdlib/longlong.h
@@ -850,8 +850,6 @@ UDItype __umulsidi3 (USItype, USItype);
FIXME: What's needed for gcc PowerPC VxWorks? __vxworks__ is not good
enough, since that hits ARM and m68k too. */
#if (defined (_ARCH_PPC) /* AIX */ \
- || defined (_ARCH_PWR) /* AIX */ \
- || defined (_ARCH_COM) /* AIX */ \
|| defined (__powerpc__) /* gcc */ \
|| defined (__POWERPC__) /* BEOS */ \
|| defined (__ppc__) /* Darwin */ \
@@ -862,37 +860,37 @@ UDItype __umulsidi3 (USItype, USItype);
#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
do { \
if (__builtin_constant_p (bh) && (bh) == 0) \
- __asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{aze|addze} %0,%2" \
+ __asm__ ("add%I4c %1,%3,%4\n\taddze %0,%2" \
: "=r" (sh), "=&r" (sl) : "r" (ah), "%r" (al), "rI" (bl));\
else if (__builtin_constant_p (bh) && (bh) == ~(USItype) 0) \
- __asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{ame|addme} %0,%2" \
+ __asm__ ("add%I4c %1,%3,%4\n\taddme %0,%2" \
: "=r" (sh), "=&r" (sl) : "r" (ah), "%r" (al), "rI" (bl));\
else \
- __asm__ ("{a%I5|add%I5c} %1,%4,%5\n\t{ae|adde} %0,%2,%3" \
+ __asm__ ("add%I5c %1,%4,%5\n\tadde %0,%2,%3" \
: "=r" (sh), "=&r" (sl) \
: "%r" (ah), "r" (bh), "%r" (al), "rI" (bl)); \
} while (0)
#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
do { \
if (__builtin_constant_p (ah) && (ah) == 0) \
- __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{sfze|subfze} %0,%2" \
+ __asm__ ("subf%I3c %1,%4,%3\n\tsubfze %0,%2" \
: "=r" (sh), "=&r" (sl) : "r" (bh), "rI" (al), "r" (bl));\
else if (__builtin_constant_p (ah) && (ah) == ~(USItype) 0) \
- __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{sfme|subfme} %0,%2" \
+ __asm__ ("subf%I3c %1,%4,%3\n\tsubfme %0,%2" \
: "=r" (sh), "=&r" (sl) : "r" (bh), "rI" (al), "r" (bl));\
else if (__builtin_constant_p (bh) && (bh) == 0) \
- __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{ame|addme} %0,%2" \
+ __asm__ ("subf%I3c %1,%4,%3\n\taddme %0,%2" \
: "=r" (sh), "=&r" (sl) : "r" (ah), "rI" (al), "r" (bl));\
else if (__builtin_constant_p (bh) && (bh) == ~(USItype) 0) \
- __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{aze|addze} %0,%2" \
+ __asm__ ("subf%I3c %1,%4,%3\n\taddze %0,%2" \
: "=r" (sh), "=&r" (sl) : "r" (ah), "rI" (al), "r" (bl));\
else \
- __asm__ ("{sf%I4|subf%I4c} %1,%5,%4\n\t{sfe|subfe} %0,%3,%2" \
+ __asm__ ("subf%I4c %1,%5,%4\n\tsubfe %0,%3,%2" \
: "=r" (sh), "=&r" (sl) \
: "r" (ah), "r" (bh), "rI" (al), "r" (bl)); \
} while (0)
#define count_leading_zeros(count, x) \
- __asm__ ("{cntlz|cntlzw} %0,%1" : "=r" (count) : "r" (x))
+ __asm__ ("cntlzw %0,%1" : "=r" (count) : "r" (x))
#define COUNT_LEADING_ZEROS_0 32
#if defined (_ARCH_PPC) || defined (__powerpc__) || defined (__POWERPC__) \
|| defined (__ppc__) \
@@ -914,14 +912,6 @@ UDItype __umulsidi3 (USItype, USItype);
} while (0)
#define SMUL_TIME 14
#define UDIV_TIME 120
-#elif defined (_ARCH_PWR)
-#define UMUL_TIME 8
-#define smul_ppmm(xh, xl, m0, m1) \
- __asm__ ("mul %0,%2,%3" : "=r" (xh), "=q" (xl) : "r" (m0), "r" (m1))
-#define SMUL_TIME 4
-#define sdiv_qrnnd(q, r, nh, nl, d) \
- __asm__ ("div %0,%2,%4" : "=r" (q), "=q" (r) : "r" (nh), "1" (nl), "r" (d))
-#define UDIV_TIME 100
#endif
#endif /* 32-bit POWER architecture variants. */
@@ -931,32 +921,32 @@ UDItype __umulsidi3 (USItype, USItype);
#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
do { \
if (__builtin_constant_p (bh) && (bh) == 0) \
- __asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{aze|addze} %0,%2" \
+ __asm__ ("add%I4c %1,%3,%4\n\taddze %0,%2" \
: "=r" (sh), "=&r" (sl) : "r" (ah), "%r" (al), "rI" (bl));\
else if (__builtin_constant_p (bh) && (bh) == ~(UDItype) 0) \
- __asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{ame|addme} %0,%2" \
+ __asm__ ("add%I4c %1,%3,%4\n\taddme %0,%2" \
: "=r" (sh), "=&r" (sl) : "r" (ah), "%r" (al), "rI" (bl));\
else \
- __asm__ ("{a%I5|add%I5c} %1,%4,%5\n\t{ae|adde} %0,%2,%3" \
+ __asm__ ("add%I5c %1,%4,%5\n\tadde %0,%2,%3" \
: "=r" (sh), "=&r" (sl) \
: "%r" (ah), "r" (bh), "%r" (al), "rI" (bl)); \
} while (0)
#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
do { \
if (__builtin_constant_p (ah) && (ah) == 0) \
- __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{sfze|subfze} %0,%2" \
+ __asm__ ("subf%I3c %1,%4,%3\n\tsubfze %0,%2" \
: "=r" (sh), "=&r" (sl) : "r" (bh), "rI" (al), "r" (bl));\
else if (__builtin_constant_p (ah) && (ah) == ~(UDItype) 0) \
- __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{sfme|subfme} %0,%2" \
+ __asm__ ("subf%I3c %1,%4,%3\n\tsubfme %0,%2" \
: "=r" (sh), "=&r" (sl) : "r" (bh), "rI" (al), "r" (bl));\
else if (__builtin_constant_p (bh) && (bh) == 0) \
- __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{ame|addme} %0,%2" \
+ __asm__ ("subf%I3c %1,%4,%3\n\taddme %0,%2" \
: "=r" (sh), "=&r" (sl) : "r" (ah), "rI" (al), "r" (bl));\
else if (__builtin_constant_p (bh) && (bh) == ~(UDItype) 0) \
- __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{aze|addze} %0,%2" \
+ __asm__ ("subf%I3c %1,%4,%3\n\taddze %0,%2" \
: "=r" (sh), "=&r" (sl) : "r" (ah), "rI" (al), "r" (bl));\
else \
- __asm__ ("{sf%I4|subf%I4c} %1,%5,%4\n\t{sfe|subfe} %0,%3,%2" \
+ __asm__ ("subf%I4c %1,%5,%4\n\tsubfe %0,%3,%2" \
: "=r" (sh), "=&r" (sl) \
: "r" (ah), "r" (bh), "rI" (al), "r" (bl)); \
} while (0)
diff --git a/libc/stdlib/mod_1.c b/libc/stdlib/mod_1.c
index 00f338baf..d325a931a 100644
--- a/libc/stdlib/mod_1.c
+++ b/libc/stdlib/mod_1.c
@@ -3,7 +3,7 @@
Return the single-limb remainder.
There are no constraints on the value of the divisor.
-Copyright (C) 1991, 1993, 1994, Free Software Foundation, Inc.
+Copyright (C) 1991-2012 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -49,7 +49,7 @@ mpn_mod_1 (dividend_ptr, dividend_size, divisor_limb)
{
mp_size_t i;
mp_limb_t n1, n0, r;
- mp_limb_t dummy;
+ mp_limb_t dummy __attribute__ ((unused));
/* Botch: Should this be handled at all? Rely on callers? */
if (dividend_size == 0)
diff --git a/libc/stdlib/secure-getenv.c b/libc/stdlib/secure-getenv.c
index 2e696e90f..7634faea8 100644
--- a/libc/stdlib/secure-getenv.c
+++ b/libc/stdlib/secure-getenv.c
@@ -32,6 +32,6 @@ __libc_secure_getenv (name)
weak_alias (__libc_secure_getenv, secure_getenv)
libc_hidden_weak (__libc_secure_getenv)
-#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_16)
+#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_17)
compat_symbol (libc, __libc_secure_getenv, __secure_getenv, GLIBC_2_0);
#endif
diff --git a/libc/stdlib/tst-secure-getenv.c b/libc/stdlib/tst-secure-getenv.c
index 76d8de6ed..276b0aff7 100644
--- a/libc/stdlib/tst-secure-getenv.c
+++ b/libc/stdlib/tst-secure-getenv.c
@@ -45,7 +45,7 @@ choose_gid (void)
int ret = getgroups (count, groups);
if (ret < 0)
{
- perror ("getgroups");
+ printf ("getgroups: %m\n");
exit (1);
}
gid_t current = getgid ();
@@ -72,29 +72,29 @@ run_executable_sgid (gid_t target)
if (asprintf (&dirname, "%s/secure-getenv.%jd",
test_dir, (intmax_t) getpid ()) < 0)
{
- perror ("asprintf");
+ printf ("asprintf: %m\n");
goto err;
}
if (mkdir (dirname, 0700) < 0)
{
- perror ("mkdir");
+ printf ("mkdir: %m\n");
goto err;
}
if (asprintf (&execname, "%s/bin", dirname) < 0)
{
- perror ("asprintf");
+ printf ("asprintf: %m\n");
goto err;
}
infd = open ("/proc/self/exe", O_RDONLY);
if (infd < 0)
{
- perror ("open");
+ printf ("open (/proc/self/exe): %m\n");
goto err;
}
outfd = open (execname, O_WRONLY | O_CREAT | O_EXCL, 0700);
if (outfd < 0)
{
- perror ("open");
+ printf ("open (%s): %m\n", execname);
goto err;
}
char buf[4096];
@@ -103,7 +103,7 @@ run_executable_sgid (gid_t target)
ssize_t rdcount = read (infd, buf, sizeof (buf));
if (rdcount < 0)
{
- perror ("read");
+ printf ("read: %m\n");
goto err;
}
if (rdcount == 0)
@@ -117,7 +117,7 @@ run_executable_sgid (gid_t target)
errno = ENOSPC;
if (wrcount <= 0)
{
- perror ("write");
+ printf ("write: %m\n");
goto err;
}
p += wrcount;
@@ -125,29 +125,29 @@ run_executable_sgid (gid_t target)
}
if (fchown (outfd, getuid (), target) < 0)
{
- perror ("fchown");
+ printf ("fchown (%s): %m\n", execname);
goto err;
}
if (fchmod (outfd, 02750) < 0)
{
- perror ("fchmod");
+ printf ("fchmod (%s): %m\n", execname);
goto err;
}
if (close (outfd) < 0)
{
- perror ("close");
+ printf ("close (outfd): %m\n");
goto err;
}
if (close (infd) < 0)
{
- perror ("close");
+ printf ("close (infd): %m\n");
goto err;
}
int kid = fork ();
if (kid < 0)
{
- perror ("fork");
+ printf ("fork: %m\n");
goto err;
}
if (kid == 0)
@@ -155,19 +155,19 @@ run_executable_sgid (gid_t target)
/* Child process. */
char *args[] = { execname, MAGIC_ARGUMENT, NULL };
execve (execname, args, environ);
- perror ("execve");
+ printf ("execve (%s): %m\n", execname);
_exit (1);
}
int status;
if (waitpid (kid, &status, 0) < 0)
{
- perror ("waitpid");
+ printf ("waitpid: %m\n");
goto err;
}
if (!WIFEXITED (status) || WEXITSTATUS (status) != MAGIC_STATUS)
{
- fprintf (stderr, "Unexpected exit status %d from child process\n",
- status);
+ printf ("Unexpected exit status %d from child process\n",
+ status);
goto err;
}
ret = 0;
@@ -195,27 +195,28 @@ do_test (void)
{
if (getenv ("PATH") == NULL)
{
- fprintf (stderr, "PATH not set\n");
+ printf ("PATH not set\n");
exit (1);
}
if (secure_getenv ("PATH") == NULL)
{
- fprintf (stderr, "PATH not set according to secure_getenv\n");
+ printf ("PATH not set according to secure_getenv\n");
exit (1);
}
if (strcmp (getenv ("PATH"), secure_getenv ("PATH")) != 0)
{
- fprintf (stderr, "PATH mismatch (%s, %s)\n",
- getenv ("PATH"), secure_getenv ("PATH"));
+ printf ("PATH mismatch (%s, %s)\n",
+ getenv ("PATH"), secure_getenv ("PATH"));
exit (1);
}
gid_t target = choose_gid ();
if (target == 0)
{
- fprintf (stderr, "Could not find a suitable GID user %jd\n",
+ fprintf (stderr,
+ "Could not find a suitable GID for user %jd, skipping test\n",
(intmax_t) getuid ());
- exit (1);
+ exit (0);
}
return run_executable_sgid (target);
}
@@ -227,18 +228,18 @@ alternative_main (int argc, char **argv)
{
if (getgid () == getegid ())
{
- fprintf (stderr, "SGID failed: GID and EGID match (%jd)\n",
- (intmax_t) getgid ());
+ printf ("SGID failed: GID and EGID match (%jd)\n",
+ (intmax_t) getgid ());
exit (2);
}
if (getenv ("PATH") == NULL)
{
- fprintf (stderr, "PATH variable not present\n");
+ printf ("PATH variable not present\n");
exit (3);
}
if (secure_getenv ("PATH") != NULL)
{
- fprintf (stderr, "PATH variable not filtered out\n");
+ printf ("PATH variable not filtered out\n");
exit (4);
}
exit (MAGIC_STATUS);
diff --git a/libc/string/str-two-way.h b/libc/string/str-two-way.h
index 1b2a8bd54..22e75393d 100644
--- a/libc/string/str-two-way.h
+++ b/libc/string/str-two-way.h
@@ -1,5 +1,5 @@
/* Byte-wise substring search, using the Two-Way algorithm.
- Copyright (C) 2008, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2008-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Eric Blake <ebb9@byu.net>, 2008.
@@ -43,6 +43,7 @@
#include <limits.h>
#include <stdint.h>
+#include <sys/param.h> /* Defines MAX. */
/* We use the Two-Way string matching algorithm, which guarantees
linear complexity with constant space. Additionally, for long
@@ -67,10 +68,6 @@
# define LONG_NEEDLE_THRESHOLD SIZE_MAX
#endif
-#ifndef MAX
-# define MAX(a, b) ((a < b) ? (b) : (a))
-#endif
-
#ifndef CANON_ELEMENT
# define CANON_ELEMENT(c) c
#endif
diff --git a/libc/string/test-strncasecmp.c b/libc/string/test-strncasecmp.c
index 6c1753040..acfe668ca 100644
--- a/libc/string/test-strncasecmp.c
+++ b/libc/string/test-strncasecmp.c
@@ -1,5 +1,5 @@
/* Test and measure strncasecmp functions.
- Copyright (C) 1999, 2002, 2003, 2005, 2010 Free Software Foundation, Inc.
+ Copyright (C) 1999-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Jakub Jelinek <jakub@redhat.com>, 1999.
@@ -251,9 +251,9 @@ do_random_tests (void)
}
}
-
+/* Regression test for BZ #12205 */
static void
-check1 (void)
+bz12205 (void)
{
static char cp [4096+16] __attribute__ ((aligned(4096)));
static char gotrel[4096] __attribute__ ((aligned(4096)));
@@ -270,6 +270,15 @@ check1 (void)
check_result (impl, s1, s2, n, exp_result);
}
+/* Regression test for BZ #14195 */
+static void
+bz14195 (void)
+{
+ const char *empty_string = "";
+ FOR_EACH_IMPL (impl, 0)
+ check_result (impl, empty_string, "", 5, 0);
+}
+
int
test_main (void)
{
@@ -277,7 +286,8 @@ test_main (void)
test_init ();
- check1 ();
+ bz12205 ();
+ bz14195 ();
printf ("%23s", "");
FOR_EACH_IMPL (impl, 0)
diff --git a/libc/sunrpc/rpc_main.c b/libc/sunrpc/rpc_main.c
index 0ea2603f1..0eb868684 100644
--- a/libc/sunrpc/rpc_main.c
+++ b/libc/sunrpc/rpc_main.c
@@ -75,12 +75,9 @@ struct commandline
static const char *cmdname;
-#define SVR4_CPP "/usr/ccs/lib/cpp"
-#define SUNOS_CPP "/lib/cpp"
-
static const char *svcclosetime = "120";
static int cppDefined; /* explicit path for C preprocessor */
-static const char *CPP = SUNOS_CPP;
+static const char *CPP = "/lib/cpp";
static const char CPPFLAGS[] = "-C";
static char *pathbuf;
static int cpp_pid;
@@ -327,23 +324,17 @@ find_cpp (void)
{
struct stat buf;
- if (stat (CPP, &buf) < 0)
- { /* /lib/cpp or explicit cpp does not exist */
- if (cppDefined)
- {
- fprintf (stderr, _ ("cannot find C preprocessor: %s \n"), CPP);
- crash ();
- }
- else
- { /* try the other one */
- CPP = SVR4_CPP;
- if (stat (CPP, &buf) < 0)
- { /* can't find any cpp */
- fputs (_ ("cannot find any C preprocessor (cpp)\n"), stdout);
- crash ();
- }
- }
+ if (stat (CPP, &buf) == 0)
+ return;
+
+ if (cppDefined) /* user specified cpp but it does not exist */
+ {
+ fprintf (stderr, _ ("cannot find C preprocessor: %s\n"), CPP);
+ crash ();
}
+
+ /* fall back to system CPP */
+ CPP = "cpp";
}
/*
@@ -374,8 +365,13 @@ open_input (const char *infile, const char *define)
close (1);
dup2 (pd[1], 1);
close (pd[0]);
- execv (arglist[0], (char **) arglist);
- perror ("execv");
+ execvp (arglist[0], (char **) arglist);
+ if (errno == ENOENT)
+ {
+ fprintf (stderr, _ ("cannot find C preprocessor: %s\n"), CPP);
+ exit (1);
+ }
+ perror ("execvp");
exit (1);
case -1:
perror ("fork");
diff --git a/libc/sysdeps/generic/eloop-threshold.h b/libc/sysdeps/generic/eloop-threshold.h
new file mode 100644
index 000000000..2342d29a2
--- /dev/null
+++ b/libc/sysdeps/generic/eloop-threshold.h
@@ -0,0 +1,72 @@
+/* Threshold at which to diagnose ELOOP. Generic 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 _ELOOP_THRESHOLD_H
+#define _ELOOP_THRESHOLD_H 1
+
+#include <limits.h>
+#include <sys/param.h>
+
+/* POSIX specifies SYMLOOP_MAX as the "Maximum number of symbolic
+ links that can be reliably traversed in the resolution of a
+ pathname in the absence of a loop." This makes it a minimum that
+ we should certainly accept. But it leaves open the possibility
+ that more might sometimes work--just not "reliably".
+
+ For example, Linux implements a complex policy whereby there is a
+ small limit on the number of direct symlink traversals (a symlink
+ to a symlink to a symlink), but larger limit on the total number of
+ symlink traversals overall. Hence the SYMLOOP_MAX number should be
+ the small one, but the limit library functions enforce on users
+ should be the larger one.
+
+ So, we use the larger of the reported SYMLOOP_MAX (if any) and our
+ own constant MIN_ELOOP_THRESHOLD, below. This constant should be
+ large enough that it never rules out a file name and directory tree
+ that the underlying system (i.e. calls to 'open' et al) would
+ resolve successfully. It should be small enough that actual loops
+ are detected without a huge number of iterations. */
+
+#ifndef MIN_ELOOP_THRESHOLD
+# define MIN_ELOOP_THRESHOLD 40
+#endif
+
+/* Return the maximum number of symlink traversals to permit
+ before diagnosing ELOOP. */
+static inline unsigned int __attribute__ ((const))
+__eloop_threshold (void)
+{
+#ifdef SYMLOOP_MAX
+ const int symloop_max = SYMLOOP_MAX;
+#else
+ /* The function is marked 'const' even though we use memory and
+ call a function, because sysconf is required to return the
+ same value in every call and so it must always be safe to
+ call __eloop_threshold exactly once and reuse the value. */
+ static long int sysconf_symloop_max;
+ if (sysconf_symloop_max == 0)
+ sysconf_symloop_max = __sysconf (_SC_SYMLOOP_MAX);
+ const unsigned int symloop_max = (sysconf_symloop_max <= 0
+ ? _POSIX_SYMLOOP_MAX
+ : sysconf_symloop_max);
+#endif
+
+ return MAX (symloop_max, MIN_ELOOP_THRESHOLD);
+}
+
+#endif /* eloop-threshold.h */
diff --git a/libc/sysdeps/generic/siglist.h b/libc/sysdeps/generic/siglist.h
index d2ad1db36..7ecb8ab18 100644
--- a/libc/sysdeps/generic/siglist.h
+++ b/libc/sysdeps/generic/siglist.h
@@ -1,5 +1,5 @@
/* Canonical list of all signal names.
- Copyright (C) 1996,97,98,99 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
@@ -50,7 +50,6 @@
init_sig (SIGXFSZ, "XFSZ", N_("File size limit exceeded"))
init_sig (SIGVTALRM, "VTALRM", N_("Virtual timer expired"))
init_sig (SIGPROF, "PROF", N_("Profiling timer expired"))
- init_sig (SIGWINCH, "WINCH", N_("Window changed"))
init_sig (SIGUSR1, "USR1", N_("User defined signal 1"))
init_sig (SIGUSR2, "USR2", N_("User defined signal 2"))
@@ -72,3 +71,6 @@
#ifdef SIGLOST
init_sig (SIGLOST, "LOST", N_("Resource lost"))
#endif
+#ifdef SIGWINCH
+ init_sig (SIGWINCH, "WINCH", N_("Window changed"))
+#endif
diff --git a/libc/sysdeps/generic/sys/param.h b/libc/sysdeps/generic/sys/param.h
index f6e9f431d..c829e9767 100644
--- a/libc/sysdeps/generic/sys/param.h
+++ b/libc/sysdeps/generic/sys/param.h
@@ -35,8 +35,12 @@
for the values which are not statically limited, such as NOFILE. */
#define NBBY CHAR_BIT
-#define NGROUPS NGROUPS_MAX
-#define MAXSYMLINKS SYMLOOP_MAX
+#ifdef NGROUPS_MAX
+# define NGROUPS NGROUPS_MAX
+#endif
+#ifdef SYMLOOP_MAX
+# define MAXSYMLINKS SYMLOOP_MAX
+#endif
#define CANBSIZ MAX_CANON /* XXX ? */
/* ARG_MAX is unlimited, but we define NCARGS for BSD programs that want to
diff --git a/libc/sysdeps/i386/configure b/libc/sysdeps/i386/configure
index 44bdb20b3..608ff29bc 100755
--- a/libc/sysdeps/i386/configure
+++ b/libc/sysdeps/i386/configure
@@ -162,57 +162,6 @@ else
fi
-
-{ $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}
- .globl 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
- /* comment */
- nop
- /* comment */
- nop
-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
-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSE4 support" >&5
$as_echo_n "checking for SSE4 support... " >&6; }
if ${libc_cv_cc_sse4+:} false; then :
diff --git a/libc/sysdeps/i386/configure.in b/libc/sysdeps/i386/configure.in
index 399f737ef..36cb3e46e 100644
--- a/libc/sysdeps/i386/configure.in
+++ b/libc/sysdeps/i386/configure.in
@@ -5,39 +5,6 @@ AC_CHECK_HEADER([cpuid.h], ,
[AC_MSG_ERROR([gcc must provide the <cpuid.h> header])],
[/* No default includes. */])
-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}
- .globl 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
- /* comment */
- nop
- /* comment */
- nop
-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
-
dnl Check if -msse4 works.
AC_CACHE_CHECK(for SSE4 support, libc_cv_cc_sse4, [dnl
LIBC_TRY_CC_OPTION([-msse4], [libc_cv_cc_sse4=yes], [libc_cv_cc_sse4=no])
diff --git a/libc/sysdeps/i386/fpu/e_acosh.S b/libc/sysdeps/i386/fpu/e_acosh.S
index f1970f611..474f5c935 100644
--- a/libc/sysdeps/i386/fpu/e_acosh.S
+++ b/libc/sysdeps/i386/fpu/e_acosh.S
@@ -22,10 +22,10 @@
.section .rodata.cst8,"aM",@progbits,8
.p2align 3
- ASM_TYPE_DIRECTIVE(one,@object)
+ .type one,@object
one: .double 1.0
ASM_SIZE_DIRECTIVE(one)
- ASM_TYPE_DIRECTIVE(limit,@object)
+ .type limit,@object
limit: .double 0.29
ASM_SIZE_DIRECTIVE(limit)
diff --git a/libc/sysdeps/i386/fpu/e_acoshf.S b/libc/sysdeps/i386/fpu/e_acoshf.S
index 5c17e345a..456fe4699 100644
--- a/libc/sysdeps/i386/fpu/e_acoshf.S
+++ b/libc/sysdeps/i386/fpu/e_acoshf.S
@@ -22,10 +22,10 @@
.section .rodata.cst8,"aM",@progbits,8
.p2align 3
- ASM_TYPE_DIRECTIVE(one,@object)
+ .type one,@object
one: .double 1.0
ASM_SIZE_DIRECTIVE(one)
- ASM_TYPE_DIRECTIVE(limit,@object)
+ .type limit,@object
limit: .double 0.29
ASM_SIZE_DIRECTIVE(limit)
diff --git a/libc/sysdeps/i386/fpu/e_acoshl.S b/libc/sysdeps/i386/fpu/e_acoshl.S
index 05dbdfdbf..d9b3add13 100644
--- a/libc/sysdeps/i386/fpu/e_acoshl.S
+++ b/libc/sysdeps/i386/fpu/e_acoshl.S
@@ -25,13 +25,13 @@
/* Please note that we use double value for 1.0. This number
has an exact representation and so we don't get accuracy
problems. The advantage is that the code is simpler. */
- ASM_TYPE_DIRECTIVE(one,@object)
+ .type one,@object
one: .double 1.0
ASM_SIZE_DIRECTIVE(one)
/* It is not important that this constant is precise. It is only
a value which is known to be on the safe side for using the
fyl2xp1 instruction. */
- ASM_TYPE_DIRECTIVE(limit,@object)
+ .type limit,@object
limit: .double 0.29
ASM_SIZE_DIRECTIVE(limit)
diff --git a/libc/sysdeps/i386/fpu/e_atanh.S b/libc/sysdeps/i386/fpu/e_atanh.S
index bef30de38..b8ae6ef35 100644
--- a/libc/sysdeps/i386/fpu/e_atanh.S
+++ b/libc/sysdeps/i386/fpu/e_atanh.S
@@ -22,16 +22,16 @@
.section .rodata
.align ALIGNARG(4)
- ASM_TYPE_DIRECTIVE(half,@object)
+ .type half,@object
half: .double 0.5
ASM_SIZE_DIRECTIVE(half)
- ASM_TYPE_DIRECTIVE(one,@object)
+ .type one,@object
one: .double 1.0
ASM_SIZE_DIRECTIVE(one)
- ASM_TYPE_DIRECTIVE(limit,@object)
+ .type limit,@object
limit: .double 0.29
ASM_SIZE_DIRECTIVE(limit)
- ASM_TYPE_DIRECTIVE(ln2_2,@object)
+ .type ln2_2,@object
ln2_2: .tfloat 0.3465735902799726547086160
ASM_SIZE_DIRECTIVE(ln2_2)
diff --git a/libc/sysdeps/i386/fpu/e_atanhf.S b/libc/sysdeps/i386/fpu/e_atanhf.S
index edb605384..c63748537 100644
--- a/libc/sysdeps/i386/fpu/e_atanhf.S
+++ b/libc/sysdeps/i386/fpu/e_atanhf.S
@@ -22,17 +22,17 @@
.section .rodata
.align ALIGNARG(4)
- ASM_TYPE_DIRECTIVE(half,@object)
+ .type half,@object
half: .double 0.5
ASM_SIZE_DIRECTIVE(half)
- ASM_TYPE_DIRECTIVE(one,@object)
+ .type one,@object
one: .double 1.0
ASM_SIZE_DIRECTIVE(one)
- ASM_TYPE_DIRECTIVE(limit,@object)
+ .type limit,@object
limit: .double 0.29
ASM_SIZE_DIRECTIVE(limit)
.align ALIGNARG(4)
- ASM_TYPE_DIRECTIVE(ln2_2,@object)
+ .type ln2_2,@object
ln2_2: .tfloat 0.3465735902799726547086160
ASM_SIZE_DIRECTIVE(ln2_2)
diff --git a/libc/sysdeps/i386/fpu/e_atanhl.S b/libc/sysdeps/i386/fpu/e_atanhl.S
index 3d74f366f..9e22e89f8 100644
--- a/libc/sysdeps/i386/fpu/e_atanhl.S
+++ b/libc/sysdeps/i386/fpu/e_atanhl.S
@@ -25,20 +25,20 @@
/* Please note that we use double values for 0.5 and 1.0. These
numbers have exact representations and so we don't get accuracy
problems. The advantage is that the code is simpler. */
- ASM_TYPE_DIRECTIVE(half,@object)
+ .type half,@object
half: .double 0.5
ASM_SIZE_DIRECTIVE(half)
- ASM_TYPE_DIRECTIVE(one,@object)
+ .type one,@object
one: .double 1.0
ASM_SIZE_DIRECTIVE(one)
/* It is not important that this constant is precise. It is only
a value which is known to be on the safe side for using the
fyl2xp1 instruction. */
- ASM_TYPE_DIRECTIVE(limit,@object)
+ .type limit,@object
limit: .double 0.29
ASM_SIZE_DIRECTIVE(limit)
.align ALIGNARG(4)
- ASM_TYPE_DIRECTIVE(ln2_2,@object)
+ .type ln2_2,@object
ln2_2: .tfloat 0.3465735902799726547086160
ASM_SIZE_DIRECTIVE(ln2_2)
diff --git a/libc/sysdeps/i386/fpu/e_expl.S b/libc/sysdeps/i386/fpu/e_expl.S
index e42c9a121..af339f0ff 100644
--- a/libc/sysdeps/i386/fpu/e_expl.S
+++ b/libc/sysdeps/i386/fpu/e_expl.S
@@ -42,26 +42,26 @@
.p2align 4
#ifdef USE_AS_EXP10L
- ASM_TYPE_DIRECTIVE(c0,@object)
+ .type c0,@object
c0: .byte 0, 0, 0, 0, 0, 0, 0x9a, 0xd4, 0x00, 0x40
.byte 0, 0, 0, 0, 0, 0
ASM_SIZE_DIRECTIVE(c0)
- ASM_TYPE_DIRECTIVE(c1,@object)
+ .type c1,@object
c1: .byte 0x58, 0x92, 0xfc, 0x15, 0x37, 0x9a, 0x97, 0xf0, 0xef, 0x3f
.byte 0, 0, 0, 0, 0, 0
ASM_SIZE_DIRECTIVE(c1)
#else
- ASM_TYPE_DIRECTIVE(c0,@object)
+ .type c0,@object
c0: .byte 0, 0, 0, 0, 0, 0, 0xaa, 0xb8, 0xff, 0x3f
.byte 0, 0, 0, 0, 0, 0
ASM_SIZE_DIRECTIVE(c0)
- ASM_TYPE_DIRECTIVE(c1,@object)
+ .type c1,@object
c1: .byte 0x20, 0xfa, 0xee, 0xc2, 0x5f, 0x70, 0xa5, 0xec, 0xed, 0x3f
.byte 0, 0, 0, 0, 0, 0
ASM_SIZE_DIRECTIVE(c1)
#endif
#ifndef USE_AS_EXPM1L
- ASM_TYPE_DIRECTIVE(csat,@object)
+ .type csat,@object
csat: .byte 0, 0, 0, 0, 0, 0, 0, 0x80, 0x0e, 0x40
.byte 0, 0, 0, 0, 0, 0
ASM_SIZE_DIRECTIVE(csat)
diff --git a/libc/sysdeps/i386/fpu/e_log.S b/libc/sysdeps/i386/fpu/e_log.S
index e4fffb80d..087792499 100644
--- a/libc/sysdeps/i386/fpu/e_log.S
+++ b/libc/sysdeps/i386/fpu/e_log.S
@@ -10,13 +10,13 @@
.section .rodata.cst8,"aM",@progbits,8
.p2align 3
- ASM_TYPE_DIRECTIVE(one,@object)
+ .type one,@object
one: .double 1.0
ASM_SIZE_DIRECTIVE(one)
/* It is not important that this constant is precise. It is only
a value which is known to be on the safe side for using the
fyl2xp1 instruction. */
- ASM_TYPE_DIRECTIVE(limit,@object)
+ .type limit,@object
limit: .double 0.29
ASM_SIZE_DIRECTIVE(limit)
diff --git a/libc/sysdeps/i386/fpu/e_log10.S b/libc/sysdeps/i386/fpu/e_log10.S
index b54bf0ed0..ce6a81abb 100644
--- a/libc/sysdeps/i386/fpu/e_log10.S
+++ b/libc/sysdeps/i386/fpu/e_log10.S
@@ -10,13 +10,13 @@
.section .rodata.cst8,"aM",@progbits,8
.p2align 3
- ASM_TYPE_DIRECTIVE(one,@object)
+ .type one,@object
one: .double 1.0
ASM_SIZE_DIRECTIVE(one)
/* It is not important that this constant is precise. It is only
a value which is known to be on the safe side for using the
fyl2xp1 instruction. */
- ASM_TYPE_DIRECTIVE(limit,@object)
+ .type limit,@object
limit: .double 0.29
ASM_SIZE_DIRECTIVE(limit)
diff --git a/libc/sysdeps/i386/fpu/e_log10f.S b/libc/sysdeps/i386/fpu/e_log10f.S
index 344110c1a..8c2072355 100644
--- a/libc/sysdeps/i386/fpu/e_log10f.S
+++ b/libc/sysdeps/i386/fpu/e_log10f.S
@@ -11,13 +11,13 @@
.section .rodata.cst8,"aM",@progbits,8
.p2align 3
- ASM_TYPE_DIRECTIVE(one,@object)
+ .type one,@object
one: .double 1.0
ASM_SIZE_DIRECTIVE(one)
/* It is not important that this constant is precise. It is only
a value which is known to be on the safe side for using the
fyl2xp1 instruction. */
- ASM_TYPE_DIRECTIVE(limit,@object)
+ .type limit,@object
limit: .double 0.29
ASM_SIZE_DIRECTIVE(limit)
diff --git a/libc/sysdeps/i386/fpu/e_log10l.S b/libc/sysdeps/i386/fpu/e_log10l.S
index eeb49c663..cde987b13 100644
--- a/libc/sysdeps/i386/fpu/e_log10l.S
+++ b/libc/sysdeps/i386/fpu/e_log10l.S
@@ -12,13 +12,13 @@
.section .rodata.cst8,"aM",@progbits,8
.p2align 3
- ASM_TYPE_DIRECTIVE(one,@object)
+ .type one,@object
one: .double 1.0
ASM_SIZE_DIRECTIVE(one)
/* It is not important that this constant is precise. It is only
a value which is known to be on the safe side for using the
fyl2xp1 instruction. */
- ASM_TYPE_DIRECTIVE(limit,@object)
+ .type limit,@object
limit: .double 0.29
ASM_SIZE_DIRECTIVE(limit)
diff --git a/libc/sysdeps/i386/fpu/e_log2.S b/libc/sysdeps/i386/fpu/e_log2.S
index cc377637f..a202bc731 100644
--- a/libc/sysdeps/i386/fpu/e_log2.S
+++ b/libc/sysdeps/i386/fpu/e_log2.S
@@ -11,13 +11,13 @@
.section .rodata.cst8,"aM",@progbits,8
.p2align 3
- ASM_TYPE_DIRECTIVE(one,@object)
+ .type one,@object
one: .double 1.0
ASM_SIZE_DIRECTIVE(one)
/* It is not important that this constant is precise. It is only
a value which is known to be on the safe side for using the
fyl2xp1 instruction. */
- ASM_TYPE_DIRECTIVE(limit,@object)
+ .type limit,@object
limit: .double 0.29
ASM_SIZE_DIRECTIVE(limit)
diff --git a/libc/sysdeps/i386/fpu/e_log2f.S b/libc/sysdeps/i386/fpu/e_log2f.S
index 59f4f212e..f4f9a8c3b 100644
--- a/libc/sysdeps/i386/fpu/e_log2f.S
+++ b/libc/sysdeps/i386/fpu/e_log2f.S
@@ -11,13 +11,13 @@
.section .rodata.cst8,"aM",@progbits,8
.p2align 3
- ASM_TYPE_DIRECTIVE(one,@object)
+ .type one,@object
one: .double 1.0
ASM_SIZE_DIRECTIVE(one)
/* It is not important that this constant is precise. It is only
a value which is known to be on the safe side for using the
fyl2xp1 instruction. */
- ASM_TYPE_DIRECTIVE(limit,@object)
+ .type limit,@object
limit: .double 0.29
ASM_SIZE_DIRECTIVE(limit)
diff --git a/libc/sysdeps/i386/fpu/e_log2l.S b/libc/sysdeps/i386/fpu/e_log2l.S
index 4693f6c71..bd51b5651 100644
--- a/libc/sysdeps/i386/fpu/e_log2l.S
+++ b/libc/sysdeps/i386/fpu/e_log2l.S
@@ -11,13 +11,13 @@
.section .rodata.cst8,"aM",@progbits,8
.p2align 3
- ASM_TYPE_DIRECTIVE(one,@object)
+ .type one,@object
one: .double 1.0
ASM_SIZE_DIRECTIVE(one)
/* It is not important that this constant is precise. It is only
a value which is known to be on the safe side for using the
fyl2xp1 instruction. */
- ASM_TYPE_DIRECTIVE(limit,@object)
+ .type limit,@object
limit: .double 0.29
ASM_SIZE_DIRECTIVE(limit)
diff --git a/libc/sysdeps/i386/fpu/e_logf.S b/libc/sysdeps/i386/fpu/e_logf.S
index e277a2f5e..485180e90 100644
--- a/libc/sysdeps/i386/fpu/e_logf.S
+++ b/libc/sysdeps/i386/fpu/e_logf.S
@@ -11,13 +11,13 @@
.section .rodata.cst8,"aM",@progbits,8
.p2align 3
- ASM_TYPE_DIRECTIVE(one,@object)
+ .type one,@object
one: .double 1.0
ASM_SIZE_DIRECTIVE(one)
/* It is not important that this constant is precise. It is only
a value which is known to be on the safe side for using the
fyl2xp1 instruction. */
- ASM_TYPE_DIRECTIVE(limit,@object)
+ .type limit,@object
limit: .double 0.29
ASM_SIZE_DIRECTIVE(limit)
diff --git a/libc/sysdeps/i386/fpu/e_logl.S b/libc/sysdeps/i386/fpu/e_logl.S
index 7b52b3b2d..d7a459a62 100644
--- a/libc/sysdeps/i386/fpu/e_logl.S
+++ b/libc/sysdeps/i386/fpu/e_logl.S
@@ -11,13 +11,13 @@
.section .rodata.cst8,"aM",@progbits,8
.p2align 3
- ASM_TYPE_DIRECTIVE(one,@object)
+ .type one,@object
one: .double 1.0
ASM_SIZE_DIRECTIVE(one)
/* It is not important that this constant is precise. It is only
a value which is known to be on the safe side for using the
fyl2xp1 instruction. */
- ASM_TYPE_DIRECTIVE(limit,@object)
+ .type limit,@object
limit: .double 0.29
ASM_SIZE_DIRECTIVE(limit)
diff --git a/libc/sysdeps/i386/fpu/e_pow.S b/libc/sysdeps/i386/fpu/e_pow.S
index 73d242116..de850226d 100644
--- a/libc/sysdeps/i386/fpu/e_pow.S
+++ b/libc/sysdeps/i386/fpu/e_pow.S
@@ -23,31 +23,31 @@
.section .rodata.cst8,"aM",@progbits,8
.p2align 3
- ASM_TYPE_DIRECTIVE(one,@object)
+ .type one,@object
one: .double 1.0
ASM_SIZE_DIRECTIVE(one)
- ASM_TYPE_DIRECTIVE(limit,@object)
+ .type limit,@object
limit: .double 0.29
ASM_SIZE_DIRECTIVE(limit)
- ASM_TYPE_DIRECTIVE(p63,@object)
+ .type p63,@object
p63: .byte 0, 0, 0, 0, 0, 0, 0xe0, 0x43
ASM_SIZE_DIRECTIVE(p63)
- ASM_TYPE_DIRECTIVE(p10,@object)
+ .type p10,@object
p10: .byte 0, 0, 0, 0, 0, 0, 0x90, 0x40
ASM_SIZE_DIRECTIVE(p10)
.section .rodata.cst16,"aM",@progbits,16
.p2align 3
- ASM_TYPE_DIRECTIVE(infinity,@object)
+ .type infinity,@object
inf_zero:
infinity:
.byte 0, 0, 0, 0, 0, 0, 0xf0, 0x7f
ASM_SIZE_DIRECTIVE(infinity)
- ASM_TYPE_DIRECTIVE(zero,@object)
+ .type zero,@object
zero: .double 0.0
ASM_SIZE_DIRECTIVE(zero)
- ASM_TYPE_DIRECTIVE(minf_mzero,@object)
+ .type minf_mzero,@object
minf_mzero:
minfinity:
.byte 0, 0, 0, 0, 0, 0, 0xf0, 0xff
diff --git a/libc/sysdeps/i386/fpu/e_powf.S b/libc/sysdeps/i386/fpu/e_powf.S
index 529a96f95..4c622fc56 100644
--- a/libc/sysdeps/i386/fpu/e_powf.S
+++ b/libc/sysdeps/i386/fpu/e_powf.S
@@ -23,28 +23,28 @@
.section .rodata.cst8,"aM",@progbits,8
.p2align 3
- ASM_TYPE_DIRECTIVE(one,@object)
+ .type one,@object
one: .double 1.0
ASM_SIZE_DIRECTIVE(one)
- ASM_TYPE_DIRECTIVE(limit,@object)
+ .type limit,@object
limit: .double 0.29
ASM_SIZE_DIRECTIVE(limit)
- ASM_TYPE_DIRECTIVE(p31,@object)
+ .type p31,@object
p31: .byte 0, 0, 0, 0, 0, 0, 0xe0, 0x41
ASM_SIZE_DIRECTIVE(p31)
.section .rodata.cst16,"aM",@progbits,16
.p2align 3
- ASM_TYPE_DIRECTIVE(infinity,@object)
+ .type infinity,@object
inf_zero:
infinity:
.byte 0, 0, 0, 0, 0, 0, 0xf0, 0x7f
ASM_SIZE_DIRECTIVE(infinity)
- ASM_TYPE_DIRECTIVE(zero,@object)
+ .type zero,@object
zero: .double 0.0
ASM_SIZE_DIRECTIVE(zero)
- ASM_TYPE_DIRECTIVE(minf_mzero,@object)
+ .type minf_mzero,@object
minf_mzero:
minfinity:
.byte 0, 0, 0, 0, 0, 0, 0xf0, 0xff
diff --git a/libc/sysdeps/i386/fpu/e_powl.S b/libc/sysdeps/i386/fpu/e_powl.S
index 5b166eab4..933418cf8 100644
--- a/libc/sysdeps/i386/fpu/e_powl.S
+++ b/libc/sysdeps/i386/fpu/e_powl.S
@@ -23,34 +23,34 @@
.section .rodata.cst8,"aM",@progbits,8
.p2align 3
- ASM_TYPE_DIRECTIVE(one,@object)
+ .type one,@object
one: .double 1.0
ASM_SIZE_DIRECTIVE(one)
- ASM_TYPE_DIRECTIVE(limit,@object)
+ .type limit,@object
limit: .double 0.29
ASM_SIZE_DIRECTIVE(limit)
- ASM_TYPE_DIRECTIVE(p63,@object)
+ .type p63,@object
p63: .byte 0, 0, 0, 0, 0, 0, 0xe0, 0x43
ASM_SIZE_DIRECTIVE(p63)
- ASM_TYPE_DIRECTIVE(p64,@object)
+ .type p64,@object
p64: .byte 0, 0, 0, 0, 0, 0, 0xf0, 0x43
ASM_SIZE_DIRECTIVE(p64)
- ASM_TYPE_DIRECTIVE(p78,@object)
+ .type p78,@object
p78: .byte 0, 0, 0, 0, 0, 0, 0xd0, 0x44
ASM_SIZE_DIRECTIVE(p78)
.section .rodata.cst16,"aM",@progbits,16
.p2align 3
- ASM_TYPE_DIRECTIVE(infinity,@object)
+ .type infinity,@object
inf_zero:
infinity:
.byte 0, 0, 0, 0, 0, 0, 0xf0, 0x7f
ASM_SIZE_DIRECTIVE(infinity)
- ASM_TYPE_DIRECTIVE(zero,@object)
+ .type zero,@object
zero: .double 0.0
ASM_SIZE_DIRECTIVE(zero)
- ASM_TYPE_DIRECTIVE(minf_mzero,@object)
+ .type minf_mzero,@object
minf_mzero:
minfinity:
.byte 0, 0, 0, 0, 0, 0, 0xf0, 0xff
diff --git a/libc/sysdeps/i386/fpu/e_scalb.S b/libc/sysdeps/i386/fpu/e_scalb.S
index 1d8d2dd01..20d489efd 100644
--- a/libc/sysdeps/i386/fpu/e_scalb.S
+++ b/libc/sysdeps/i386/fpu/e_scalb.S
@@ -10,7 +10,7 @@
.section .rodata
.align ALIGNARG(4)
- ASM_TYPE_DIRECTIVE(zero_nan,@object)
+ .type zero_nan,@object
zero_nan:
.double 0.0
nan: .byte 0, 0, 0, 0, 0, 0, 0xff, 0x7f
diff --git a/libc/sysdeps/i386/fpu/e_scalbf.S b/libc/sysdeps/i386/fpu/e_scalbf.S
index 0967dbdc2..b6dd02122 100644
--- a/libc/sysdeps/i386/fpu/e_scalbf.S
+++ b/libc/sysdeps/i386/fpu/e_scalbf.S
@@ -11,7 +11,7 @@
.section .rodata
.align ALIGNARG(4)
- ASM_TYPE_DIRECTIVE(zero_nan,@object)
+ .type zero_nan,@object
zero_nan:
.double 0.0
nan: .byte 0, 0, 0, 0, 0, 0, 0xff, 0x7f
diff --git a/libc/sysdeps/i386/fpu/e_scalbl.S b/libc/sysdeps/i386/fpu/e_scalbl.S
index 434fce46f..83f17b233 100644
--- a/libc/sysdeps/i386/fpu/e_scalbl.S
+++ b/libc/sysdeps/i386/fpu/e_scalbl.S
@@ -12,7 +12,7 @@
.section .rodata
.align ALIGNARG(4)
- ASM_TYPE_DIRECTIVE(zero_nan,@object)
+ .type zero_nan,@object
zero_nan:
.double 0.0
nan: .byte 0, 0, 0, 0, 0, 0, 0xff, 0x7f
diff --git a/libc/sysdeps/i386/fpu/libm-test-ulps b/libc/sysdeps/i386/fpu/libm-test-ulps
index f832e17a2..abd98a295 100644
--- a/libc/sysdeps/i386/fpu/libm-test-ulps
+++ b/libc/sysdeps/i386/fpu/libm-test-ulps
@@ -223,8 +223,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
@@ -249,8 +253,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
@@ -293,8 +301,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
@@ -304,8 +316,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
@@ -315,8 +331,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
@@ -326,8 +346,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
@@ -343,11 +367,19 @@ Test "Imaginary part of: cacosh (-0.5 - 0 i) == +0 - 2.0943951023931954923084289
double: 1
idouble: 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: 9
@@ -366,11 +398,19 @@ Test "Real part of: cacosh (0.75 + 1.25 i) == 1.13239363160530819522266333696834
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
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":
@@ -389,8 +429,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
@@ -415,8 +459,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
@@ -516,11 +564,19 @@ ifloat: 6
ildouble: 5
ldouble: 5
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
@@ -789,6 +845,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 (-0x1.fp+127 + 0x1p-149 i) == 88.69109041335841930424871526389807508374 + pi i":
ildouble: 1
ldouble: 1
@@ -818,6 +880,12 @@ float: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "Real 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.234566p-30 + 1.0 i) == 5.614163921211322622623353961365728040115e-19 + 1.570796325735258575254858696548386439740 i":
ildouble: 1
ldouble: 1
@@ -869,6 +937,20 @@ double: 1
float: 1
idouble: 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 "Imaginary 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":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: clog10 (-0x1.234566p-40 - 1.0 i) == 2.325249110681915353442924915876654139373e-25 - 6.821881769213700828789403802671540158935e-1 i":
float: 1
ifloat: 1
@@ -986,6 +1068,18 @@ idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "Real part of: clog10 (0x1.000566p0 + 0x1.234p-10 i) == 3.604093470239754109961125085078190708674e-5 + 4.824745078422174667425851670822596859720e-4 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x1.000566p0 + 0x1.234p-10 i) == 3.604093470239754109961125085078190708674e-5 + 4.824745078422174667425851670822596859720e-4 i":
+double: 1
+idouble: 1
+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
Test "Imaginary part of: clog10 (0x1.234566p-30 + 1.0 i) == 2.438200411482400072282924063740535840474e-19 + 6.821881764607257184291586401763604544928e-1 i":
float: 1
ifloat: 1
@@ -1386,7 +1480,9 @@ ildouble: 2
ldouble: 2
Test "Real part of: cpow (0.75 + 1.25 i, 1.0 + 0.0 i) == 0.75 + 1.25 i":
double: 1
+float: 1
idouble: 1
+ifloat: 1
ildouble: 1
ldouble: 1
Test "Imaginary part of: cpow (0.75 + 1.25 i, 1.0 + 0.0 i) == 0.75 + 1.25 i":
@@ -3154,7 +3250,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/sysdeps/i386/fpu/s_asinh.S b/libc/sysdeps/i386/fpu/s_asinh.S
index f101f36d6..8bdcfcc92 100644
--- a/libc/sysdeps/i386/fpu/s_asinh.S
+++ b/libc/sysdeps/i386/fpu/s_asinh.S
@@ -22,13 +22,13 @@
.section .rodata
.align ALIGNARG(4)
- ASM_TYPE_DIRECTIVE(huge,@object)
+ .type huge,@object
huge: .double 1e+300
ASM_SIZE_DIRECTIVE(huge)
- ASM_TYPE_DIRECTIVE(one,@object)
+ .type one,@object
one: .double 1.0
ASM_SIZE_DIRECTIVE(one)
- ASM_TYPE_DIRECTIVE(limit,@object)
+ .type limit,@object
limit: .double 0.29
ASM_SIZE_DIRECTIVE(limit)
diff --git a/libc/sysdeps/i386/fpu/s_asinhf.S b/libc/sysdeps/i386/fpu/s_asinhf.S
index aa72676b4..86a49a3fa 100644
--- a/libc/sysdeps/i386/fpu/s_asinhf.S
+++ b/libc/sysdeps/i386/fpu/s_asinhf.S
@@ -22,13 +22,13 @@
.section .rodata
.align ALIGNARG(4)
- ASM_TYPE_DIRECTIVE(huge,@object)
+ .type huge,@object
huge: .double 1e+36
ASM_SIZE_DIRECTIVE(huge)
- ASM_TYPE_DIRECTIVE(one,@object)
+ .type one,@object
one: .double 1.0
ASM_SIZE_DIRECTIVE(one)
- ASM_TYPE_DIRECTIVE(limit,@object)
+ .type limit,@object
limit: .double 0.29
ASM_SIZE_DIRECTIVE(limit)
diff --git a/libc/sysdeps/i386/fpu/s_asinhl.S b/libc/sysdeps/i386/fpu/s_asinhl.S
index ec2434364..4ec5c1021 100644
--- a/libc/sysdeps/i386/fpu/s_asinhl.S
+++ b/libc/sysdeps/i386/fpu/s_asinhl.S
@@ -22,20 +22,20 @@
.section .rodata
.align ALIGNARG(4)
- ASM_TYPE_DIRECTIVE(huge,@object)
+ .type huge,@object
huge: .tfloat 1e+4930
ASM_SIZE_DIRECTIVE(huge)
.align ALIGNARG(4)
/* Please note that we use double value for 1.0. This number
has an exact representation and so we don't get accuracy
problems. The advantage is that the code is simpler. */
- ASM_TYPE_DIRECTIVE(one,@object)
+ .type one,@object
one: .double 1.0
ASM_SIZE_DIRECTIVE(one)
/* It is not important that this constant is precise. It is only
a value which is known to be on the safe side for using the
fyl2xp1 instruction. */
- ASM_TYPE_DIRECTIVE(limit,@object)
+ .type limit,@object
limit: .double 0.29
ASM_SIZE_DIRECTIVE(limit)
diff --git a/libc/sysdeps/i386/fpu/s_cbrt.S b/libc/sysdeps/i386/fpu/s_cbrt.S
index 15b25a42a..aca0b5a92 100644
--- a/libc/sysdeps/i386/fpu/s_cbrt.S
+++ b/libc/sysdeps/i386/fpu/s_cbrt.S
@@ -23,25 +23,25 @@
.section .rodata
.align ALIGNARG(4)
- ASM_TYPE_DIRECTIVE(f7,@object)
+ .type f7,@object
f7: .double -0.145263899385486377
ASM_SIZE_DIRECTIVE(f7)
- ASM_TYPE_DIRECTIVE(f6,@object)
+ .type f6,@object
f6: .double 0.784932344976639262
ASM_SIZE_DIRECTIVE(f6)
- ASM_TYPE_DIRECTIVE(f5,@object)
+ .type f5,@object
f5: .double -1.83469277483613086
ASM_SIZE_DIRECTIVE(f5)
- ASM_TYPE_DIRECTIVE(f4,@object)
+ .type f4,@object
f4: .double 2.44693122563534430
ASM_SIZE_DIRECTIVE(f4)
- ASM_TYPE_DIRECTIVE(f3,@object)
+ .type f3,@object
f3: .double -2.11499494167371287
ASM_SIZE_DIRECTIVE(f3)
- ASM_TYPE_DIRECTIVE(f2,@object)
+ .type f2,@object
f2: .double 1.50819193781584896
ASM_SIZE_DIRECTIVE(f2)
- ASM_TYPE_DIRECTIVE(f1,@object)
+ .type f1,@object
f1: .double 0.354895765043919860
ASM_SIZE_DIRECTIVE(f1)
@@ -50,7 +50,7 @@ f1: .double 0.354895765043919860
#define SQR_CBRT2 1.5874010519681994748
#define ONE_SQR_CBRT2 0.629960524947436582364439673883
- ASM_TYPE_DIRECTIVE(factor,@object)
+ .type factor,@object
factor: .double ONE_SQR_CBRT2
.double ONE_CBRT2
.double 1.0
@@ -58,7 +58,7 @@ factor: .double ONE_SQR_CBRT2
.double SQR_CBRT2
ASM_SIZE_DIRECTIVE(factor)
- ASM_TYPE_DIRECTIVE(two54,@object)
+ .type two54,@object
two54: .byte 0, 0, 0, 0, 0, 0, 0x50, 0x43
ASM_SIZE_DIRECTIVE(two54)
diff --git a/libc/sysdeps/i386/fpu/s_cbrtf.S b/libc/sysdeps/i386/fpu/s_cbrtf.S
index be16b3cb7..c3ba2fa2e 100644
--- a/libc/sysdeps/i386/fpu/s_cbrtf.S
+++ b/libc/sysdeps/i386/fpu/s_cbrtf.S
@@ -23,13 +23,13 @@
.section .rodata
.align ALIGNARG(4)
- ASM_TYPE_DIRECTIVE(f3,@object)
+ .type f3,@object
f3: .double 0.191502161678719066
ASM_SIZE_DIRECTIVE(f3)
- ASM_TYPE_DIRECTIVE(f2,@object)
+ .type f2,@object
f2: .double 0.697570460207922770
ASM_SIZE_DIRECTIVE(f2)
- ASM_TYPE_DIRECTIVE(f1,@object)
+ .type f1,@object
f1: .double 0.492659620528969547
ASM_SIZE_DIRECTIVE(f1)
@@ -38,7 +38,7 @@ f1: .double 0.492659620528969547
#define SQR_CBRT2 1.5874010519681994748
#define ONE_SQR_CBRT2 0.629960524947436582364439673883
- ASM_TYPE_DIRECTIVE(factor,@object)
+ .type factor,@object
.align ALIGNARG(4)
factor: .double ONE_SQR_CBRT2
.double ONE_CBRT2
@@ -47,7 +47,7 @@ factor: .double ONE_SQR_CBRT2
.double SQR_CBRT2
ASM_SIZE_DIRECTIVE(factor)
- ASM_TYPE_DIRECTIVE(two25,@object)
+ .type two25,@object
two25: .byte 0, 0, 0, 0x4c
ASM_SIZE_DIRECTIVE(two25)
diff --git a/libc/sysdeps/i386/fpu/s_cbrtl.S b/libc/sysdeps/i386/fpu/s_cbrtl.S
index e92547e8a..8b50ba4b6 100644
--- a/libc/sysdeps/i386/fpu/s_cbrtl.S
+++ b/libc/sysdeps/i386/fpu/s_cbrtl.S
@@ -23,35 +23,35 @@
.section .rodata
.align ALIGNARG(4)
- ASM_TYPE_DIRECTIVE(f8,@object)
+ .type f8,@object
f8: .tfloat 0.161617097923756032
ASM_SIZE_DIRECTIVE(f8)
.align ALIGNARG(4)
- ASM_TYPE_DIRECTIVE(f7,@object)
+ .type f7,@object
f7: .tfloat -0.988553671195413709
ASM_SIZE_DIRECTIVE(f7)
.align ALIGNARG(4)
- ASM_TYPE_DIRECTIVE(f6,@object)
+ .type f6,@object
f6: .tfloat 2.65298938441952296
ASM_SIZE_DIRECTIVE(f6)
.align ALIGNARG(4)
- ASM_TYPE_DIRECTIVE(f5,@object)
+ .type f5,@object
f5: .tfloat -4.11151425200350531
ASM_SIZE_DIRECTIVE(f5)
.align ALIGNARG(4)
- ASM_TYPE_DIRECTIVE(f4,@object)
+ .type f4,@object
f4: .tfloat 4.09559907378707839
ASM_SIZE_DIRECTIVE(f4)
.align ALIGNARG(4)
- ASM_TYPE_DIRECTIVE(f3,@object)
+ .type f3,@object
f3: .tfloat -2.82414939754975962
ASM_SIZE_DIRECTIVE(f3)
.align ALIGNARG(4)
- ASM_TYPE_DIRECTIVE(f2,@object)
+ .type f2,@object
f2: .tfloat 1.67595307700780102
ASM_SIZE_DIRECTIVE(f2)
.align ALIGNARG(4)
- ASM_TYPE_DIRECTIVE(f1,@object)
+ .type f1,@object
f1: .tfloat 0.338058687610520237
ASM_SIZE_DIRECTIVE(f1)
@@ -62,7 +62,7 @@ f1: .tfloat 0.338058687610520237
/* We make the entries in the following table all 16 bytes
wide to avoid having to implement a multiplication by 10. */
- ASM_TYPE_DIRECTIVE(factor,@object)
+ .type factor,@object
.align ALIGNARG(4)
factor: .tfloat ONE_SQR_CBRT2
.byte 0, 0, 0, 0, 0, 0
@@ -75,7 +75,7 @@ factor: .tfloat ONE_SQR_CBRT2
.tfloat SQR_CBRT2
ASM_SIZE_DIRECTIVE(factor)
- ASM_TYPE_DIRECTIVE(two64,@object)
+ .type two64,@object
.align ALIGNARG(4)
two64: .byte 0, 0, 0, 0, 0, 0, 0xf0, 0x43
ASM_SIZE_DIRECTIVE(two64)
diff --git a/libc/sysdeps/i386/fpu/s_expm1.S b/libc/sysdeps/i386/fpu/s_expm1.S
index d2754de91..2aad34c05 100644
--- a/libc/sysdeps/i386/fpu/s_expm1.S
+++ b/libc/sysdeps/i386/fpu/s_expm1.S
@@ -27,13 +27,13 @@
.section .rodata
.align ALIGNARG(4)
- ASM_TYPE_DIRECTIVE(minus1,@object)
+ .type minus1,@object
minus1: .double -1.0
ASM_SIZE_DIRECTIVE(minus1)
- ASM_TYPE_DIRECTIVE(one,@object)
+ .type one,@object
one: .double 1.0
ASM_SIZE_DIRECTIVE(one)
- ASM_TYPE_DIRECTIVE(l2e,@object)
+ .type l2e,@object
l2e: .tfloat 1.442695040888963407359924681002
ASM_SIZE_DIRECTIVE(l2e)
diff --git a/libc/sysdeps/i386/fpu/s_expm1f.S b/libc/sysdeps/i386/fpu/s_expm1f.S
index fc82b9234..b039049bd 100644
--- a/libc/sysdeps/i386/fpu/s_expm1f.S
+++ b/libc/sysdeps/i386/fpu/s_expm1f.S
@@ -27,13 +27,13 @@
.section .rodata
.align ALIGNARG(4)
- ASM_TYPE_DIRECTIVE(minus1,@object)
+ .type minus1,@object
minus1: .double -1.0
ASM_SIZE_DIRECTIVE(minus1)
- ASM_TYPE_DIRECTIVE(one,@object)
+ .type one,@object
one: .double 1.0
ASM_SIZE_DIRECTIVE(one)
- ASM_TYPE_DIRECTIVE(l2e,@object)
+ .type l2e,@object
l2e: .tfloat 1.442695040888963407359924681002
ASM_SIZE_DIRECTIVE(l2e)
diff --git a/libc/sysdeps/i386/fpu/s_frexp.S b/libc/sysdeps/i386/fpu/s_frexp.S
index 27c494ef0..e76732dc8 100644
--- a/libc/sysdeps/i386/fpu/s_frexp.S
+++ b/libc/sysdeps/i386/fpu/s_frexp.S
@@ -24,7 +24,7 @@
.section .rodata
.align ALIGNARG(4)
- ASM_TYPE_DIRECTIVE(two54,@object)
+ .type two54,@object
two54: .byte 0, 0, 0, 0, 0, 0, 0x50, 0x43
ASM_SIZE_DIRECTIVE(two54)
diff --git a/libc/sysdeps/i386/fpu/s_frexpf.S b/libc/sysdeps/i386/fpu/s_frexpf.S
index 18bc7615a..af0dc8ee3 100644
--- a/libc/sysdeps/i386/fpu/s_frexpf.S
+++ b/libc/sysdeps/i386/fpu/s_frexpf.S
@@ -24,7 +24,7 @@
.section .rodata
.align ALIGNARG(4)
- ASM_TYPE_DIRECTIVE(two25,@object)
+ .type two25,@object
two25: .byte 0, 0, 0, 0x4c
ASM_SIZE_DIRECTIVE(two25)
diff --git a/libc/sysdeps/i386/fpu/s_frexpl.S b/libc/sysdeps/i386/fpu/s_frexpl.S
index e683c2bac..6f464a89d 100644
--- a/libc/sysdeps/i386/fpu/s_frexpl.S
+++ b/libc/sysdeps/i386/fpu/s_frexpl.S
@@ -24,7 +24,7 @@
.section .rodata
.align ALIGNARG(4)
- ASM_TYPE_DIRECTIVE(two64,@object)
+ .type two64,@object
two64: .byte 0, 0, 0, 0, 0, 0, 0xf0, 0x43
ASM_SIZE_DIRECTIVE(two64)
diff --git a/libc/sysdeps/i386/i386-mcount.S b/libc/sysdeps/i386/i386-mcount.S
index 11f7493c3..dfe19a280 100644
--- a/libc/sysdeps/i386/i386-mcount.S
+++ b/libc/sysdeps/i386/i386-mcount.S
@@ -27,7 +27,7 @@
- some (future) systems might want to pass parameters in registers. */
.globl C_SYMBOL_NAME(_mcount)
- ASM_TYPE_DIRECTIVE(C_SYMBOL_NAME(_mcount), @function)
+ .type C_SYMBOL_NAME(_mcount), @function
.align ALIGNARG(4)
C_LABEL(_mcount)
/* Save the caller-clobbered registers. */
@@ -55,7 +55,7 @@ weak_alias (_mcount, mcount)
/* Same as above, but doesn't require a frame pointer */
.globl C_SYMBOL_NAME(__fentry__)
- ASM_TYPE_DIRECTIVE(C_SYMBOL_NAME(__fentry__), @function)
+ .type C_SYMBOL_NAME(__fentry__), @function
.align ALIGNARG(4)
C_LABEL(__fentry__)
/* Save the caller-clobbered registers. */
diff --git a/libc/sysdeps/i386/i686/fpu/e_logl.S b/libc/sysdeps/i386/i686/fpu/e_logl.S
index be2116cb3..8a86222b1 100644
--- a/libc/sysdeps/i386/i686/fpu/e_logl.S
+++ b/libc/sysdeps/i386/i686/fpu/e_logl.S
@@ -12,13 +12,13 @@
.section .rodata.cst8,"aM",@progbits,8
.p2align 3
- ASM_TYPE_DIRECTIVE(one,@object)
+ .type one,@object
one: .double 1.0
ASM_SIZE_DIRECTIVE(one)
/* It is not important that this constant is precise. It is only
a value which is known to be on the safe side for using the
fyl2xp1 instruction. */
- ASM_TYPE_DIRECTIVE(limit,@object)
+ .type limit,@object
limit: .double 0.29
ASM_SIZE_DIRECTIVE(limit)
diff --git a/libc/sysdeps/i386/i686/fpu/multiarch/e_expf-sse2.S b/libc/sysdeps/i386/i686/fpu/multiarch/e_expf-sse2.S
index 31cdffdb0..111838aab 100644
--- a/libc/sysdeps/i386/i686/fpu/multiarch/e_expf-sse2.S
+++ b/libc/sysdeps/i386/i686/fpu/multiarch/e_expf-sse2.S
@@ -243,82 +243,82 @@ L(DP_T): /* table of double precision values 2^(j/K) for j=[0..K-1] */
.long 0xee615a27, 0x3ffefa1b
.long 0x5b6e4540, 0x3fff5076
.long 0x819e90d8, 0x3fffa7c1
- ASM_TYPE_DIRECTIVE(L(DP_T), @object)
+ .type L(DP_T), @object
ASM_SIZE_DIRECTIVE(L(DP_T))
.section .rodata.cst8,"aM",@progbits,8
.p2align 3
L(DP_KLN2): /* double precision K/log(2) */
.long 0x652b82fe, 0x40571547
- ASM_TYPE_DIRECTIVE(L(DP_KLN2), @object)
+ .type L(DP_KLN2), @object
ASM_SIZE_DIRECTIVE(L(DP_KLN2))
.p2align 3
L(DP_NLN2K): /* double precision -log(2)/K */
.long 0xfefa39ef, 0xbf862e42
- ASM_TYPE_DIRECTIVE(L(DP_NLN2K), @object)
+ .type L(DP_NLN2K), @object
ASM_SIZE_DIRECTIVE(L(DP_NLN2K))
.p2align 3
L(DP_RS): /* double precision 2^23+2^22 */
.long 0x00000000, 0x41680000
- ASM_TYPE_DIRECTIVE(L(DP_RS), @object)
+ .type L(DP_RS), @object
ASM_SIZE_DIRECTIVE(L(DP_RS))
.p2align 3
L(DP_P3): /* double precision polynomial coefficient P3 */
.long 0xeb78fa85, 0x3fa56420
- ASM_TYPE_DIRECTIVE(L(DP_P3), @object)
+ .type L(DP_P3), @object
ASM_SIZE_DIRECTIVE(L(DP_P3))
.p2align 3
L(DP_P1): /* double precision polynomial coefficient P1 */
.long 0x008d6118, 0x3fe00000
- ASM_TYPE_DIRECTIVE(L(DP_P1), @object)
+ .type L(DP_P1), @object
ASM_SIZE_DIRECTIVE(L(DP_P1))
.p2align 3
L(DP_P2): /* double precision polynomial coefficient P2 */
.long 0xda752d4f, 0x3fc55550
- ASM_TYPE_DIRECTIVE(L(DP_P2), @object)
+ .type L(DP_P2), @object
ASM_SIZE_DIRECTIVE(L(DP_P2))
.p2align 3
L(DP_P0): /* double precision polynomial coefficient P0 */
.long 0xffffe7c6, 0x3fefffff
- ASM_TYPE_DIRECTIVE(L(DP_P0), @object)
+ .type L(DP_P0), @object
ASM_SIZE_DIRECTIVE(L(DP_P0))
.p2align 2
L(SP_INF_0):
.long 0x7f800000 /* single precision Inf */
.long 0 /* single precision zero */
- ASM_TYPE_DIRECTIVE(L(SP_INF_0), @object)
+ .type L(SP_INF_0), @object
ASM_SIZE_DIRECTIVE(L(SP_INF_0))
.section .rodata.cst4,"aM",@progbits,4
.p2align 2
L(SP_RS): /* single precision 2^23+2^22 */
.long 0x4b400000
- ASM_TYPE_DIRECTIVE(L(SP_RS), @object)
+ .type L(SP_RS), @object
ASM_SIZE_DIRECTIVE(L(SP_RS))
.p2align 2
L(SP_SMALL): /* single precision small value 2^(-100) */
.long 0x0d800000
- ASM_TYPE_DIRECTIVE(L(SP_SMALL), @object)
+ .type L(SP_SMALL), @object
ASM_SIZE_DIRECTIVE(L(SP_SMALL))
.p2align 2
L(SP_LARGE): /* single precision large value 2^100 */
.long 0x71800000
- ASM_TYPE_DIRECTIVE(L(SP_LARGE), @object)
+ .type L(SP_LARGE), @object
ASM_SIZE_DIRECTIVE(L(SP_LARGE))
.p2align 2
L(SP_ONE): /* single precision 1.0 */
.long 0x3f800000
- ASM_TYPE_DIRECTIVE(L(SP_ONE), @object)
+ .type L(SP_ONE), @object
ASM_SIZE_DIRECTIVE(L(SP_ONE))
strong_alias (__ieee754_expf_sse2, __expf_finite_sse2)
diff --git a/libc/sysdeps/i386/i686/multiarch/strcmp-ssse3.S b/libc/sysdeps/i386/i686/multiarch/strcmp-ssse3.S
index 5e6321e53..9735ad00c 100644
--- a/libc/sysdeps/i386/i686/multiarch/strcmp-ssse3.S
+++ b/libc/sysdeps/i386/i686/multiarch/strcmp-ssse3.S
@@ -2445,7 +2445,7 @@ L(less16bytes_sncmp):
# endif
jne L(neq_sncmp)
test %cl, %cl
- je L(eq)
+ je L(eq_sncmp)
cmp $1, REM
je L(eq_sncmp)
diff --git a/libc/sysdeps/i386/i686/multiarch/strstr-c.c b/libc/sysdeps/i386/i686/multiarch/strstr-c.c
index 1fcb00eda..17c75c5f0 100644
--- a/libc/sysdeps/i386/i686/multiarch/strstr-c.c
+++ b/libc/sysdeps/i386/i686/multiarch/strstr-c.c
@@ -7,9 +7,20 @@
__hidden_ver1 (__strstr_ia32, __GI_strstr, __strstr_ia32);
#endif
+/* Redefine strstr so that the compiler won't complain about the type
+ mismatch with the IFUNC selector in strong_alias, below. */
+#undef strstr
+#define strstr __redirect_strstr
+
#include "string/strstr.c"
-extern char *__strstr_sse42 (const char *, const char *) attribute_hidden;
-extern __typeof (__strstr_ia32) __strstr_ia32 attribute_hidden;
+extern __typeof (__redirect_strstr) __strstr_sse42 attribute_hidden;
+extern __typeof (__redirect_strstr) __strstr_ia32 attribute_hidden;
+
+/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
+ ifunc symbol properly. */
+extern __typeof (__redirect_strstr) __libc_strstr;
+libc_ifunc (__libc_strstr, HAS_SSE4_2 ? __strstr_sse42 : __strstr_ia32)
-libc_ifunc (strstr, HAS_SSE4_2 ? __strstr_sse42 : __strstr_ia32);
+#undef strstr
+strong_alias (__libc_strstr, strstr)
diff --git a/libc/sysdeps/i386/i686/strtok.S b/libc/sysdeps/i386/i686/strtok.S
index 92d52556d..5589ae536 100644
--- a/libc/sysdeps/i386/i686/strtok.S
+++ b/libc/sysdeps/i386/i686/strtok.S
@@ -1,6 +1,6 @@
/* strtok (str, delim) -- Return next DELIM separated token from STR.
For Intel 80686.
- Copyright (C) 1998, 2000, 2001, 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1998-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -43,7 +43,7 @@
#else
.bss
.local save_ptr
- ASM_TYPE_DIRECTIVE (save_ptr, @object)
+ .type save_ptr, @object
.size save_ptr, 4
save_ptr:
# if __BOUNDED_POINTERS__
diff --git a/libc/sysdeps/i386/strtok.S b/libc/sysdeps/i386/strtok.S
index e936fc19f..3b222aff3 100644
--- a/libc/sysdeps/i386/strtok.S
+++ b/libc/sysdeps/i386/strtok.S
@@ -1,6 +1,6 @@
/* strtok (str, delim) -- Return next DELIM separated token from STR.
For Intel 80x86, x>=3.
- Copyright (C) 1996-1998,2000,2001,2005,2006 Free Software Foundation, Inc.
+ Copyright (C) 1996-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
@@ -43,7 +43,7 @@
#else
.bss
.local save_ptr
- ASM_TYPE_DIRECTIVE (save_ptr, @object)
+ .type save_ptr, @object
.size save_ptr, 4
save_ptr:
# if __BOUNDED_POINTERS__
diff --git a/libc/sysdeps/i386/sysdep.h b/libc/sysdeps/i386/sysdep.h
index 01e681791..4ea7202fd 100644
--- a/libc/sysdeps/i386/sysdep.h
+++ b/libc/sysdeps/i386/sysdep.h
@@ -50,8 +50,6 @@
/* 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;
@@ -61,12 +59,9 @@
incomplete stabs information. Fake some entries here which specify
the current source file. */
#define ENTRY(name) \
- STABS_CURRENT_FILE1("") \
- STABS_CURRENT_FILE(name) \
- .globl C_SYMBOL_NAME(name); \
- ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \
+ .globl C_SYMBOL_NAME(name); \
+ .type C_SYMBOL_NAME(name),@function; \
.align ALIGNARG(4); \
- STABS_FUN(name) \
C_LABEL(name) \
cfi_startproc; \
CALL_MCOUNT
@@ -74,35 +69,11 @@
#undef END
#define END(name) \
cfi_endproc; \
- ASM_SIZE_DIRECTIVE(name) \
- STABS_FUN_END(name)
+ ASM_SIZE_DIRECTIVE(name)
#define ENTRY_CHK(name) ENTRY (name)
#define END_CHK(name) END (name)
-#ifdef HAVE_CPP_ASM_DEBUGINFO
-/* Disable that goop, because we just pass -g through to the assembler
- and it generates proper line number information directly. */
-# define STABS_CURRENT_FILE1(name)
-# define STABS_CURRENT_FILE(name)
-# define STABS_FUN(name)
-# define STABS_FUN_END(name)
-#else
-/* Remove the following two lines once the gdb bug is fixed. */
-#define STABS_CURRENT_FILE(name) \
- STABS_CURRENT_FILE1 (#name)
-#define STABS_CURRENT_FILE1(name) \
- 1: .stabs name,100,0,0,1b;
-/* Emit stabs definition lines. We use F(0,1) and define t(0,1) as `int',
- the same way gcc does it. */
-#define STABS_FUN(name) STABS_FUN2(name, name##:F(0,1))
-#define STABS_FUN2(name, namestr) \
- .stabs "int:t(0,1)=r(0,1);-2147483648;2147483647;",128,0,0,0; \
- .stabs #namestr,36,0,0,name;
-#define STABS_FUN_END(name) \
- 1: .stabs "",36,0,0,1b-name;
-#endif
-
/* If compiled for profiling, call `mcount' at the start of each function. */
#ifdef PROF
/* The mcount code relies on a normal frame pointer being on the stack
diff --git a/libc/sysdeps/mach/hurd/Makeconfig b/libc/sysdeps/mach/hurd/Makeconfig
index 1b65bb07a..fe3b7c553 100644
--- a/libc/sysdeps/mach/hurd/Makeconfig
+++ b/libc/sysdeps/mach/hurd/Makeconfig
@@ -2,3 +2,6 @@
# See Makefile in this directory for the rule that builds this.
# We must define this variable earlier than sysdeps Makefiles are included.
static-start-installed-name = crt0.o
+
+# GNU libc on the Hurd is always reentrant.
+libc-reentrant = yes
diff --git a/libc/sysdeps/mach/hurd/bits/local_lim.h b/libc/sysdeps/mach/hurd/bits/local_lim.h
index 48411d071..c957dad76 100644
--- a/libc/sysdeps/mach/hurd/bits/local_lim.h
+++ b/libc/sysdeps/mach/hurd/bits/local_lim.h
@@ -1,5 +1,5 @@
/* Minimum guaranteed maximum values for system limits. Hurd version.
- Copyright (C) 1993,94,96,98,2002 Free Software Foundation, Inc.
+ Copyright (C) 1993-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,14 +32,3 @@
suitable, and `sysconf' will return a number at least as large. */
#define NGROUPS_MAX 256
-
-/* The maximum number of symbolic links that are allowed in a single file
- name resolution. When a further link is encountered, the call returns
- ELOOP. This name is a GNU extension; POSIX.1 has no such limit, and BSD
- calls it MAXSYMLINKS in <sys/param.h>. (We define the name under
- _BSD_SOURCE even without _GNU_SOURCE because our <sys/param.h> uses it
- to define MAXSYMLINKS.) */
-
-#if defined __USE_GNU || defined __USE_BSD /* 1003.1a defines this */
-#define SYMLOOP_MAX 8
-#endif
diff --git a/libc/sysdeps/mach/hurd/configure.in b/libc/sysdeps/mach/hurd/configure.in
index 622014226..ad915a568 100644
--- a/libc/sysdeps/mach/hurd/configure.in
+++ b/libc/sysdeps/mach/hurd/configure.in
@@ -1,8 +1,5 @@
GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
-# GNU libc on the Hurd is always reentrant.
-DEFINES="$DEFINES -D_LIBC_REENTRANT"
-
dnl We need this setting because of the need for PLT calls in ld.so.
AC_DEFINE([NO_HIDDEN])
diff --git a/libc/sysdeps/unix/sysv/linux/i386/getrlimit.c b/libc/sysdeps/mach/hurd/eloop-threshold.h
index e18f9de09..b8fae1644 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/getrlimit.c
+++ b/libc/sysdeps/mach/hurd/eloop-threshold.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 1999-2012 Free Software Foundation, Inc.
+/* Threshold at which to diagnose ELOOP. Hurd 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,24 +16,22 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
-#include <sys/resource.h>
+#ifndef _ELOOP_THRESHOLD_H
+#define _ELOOP_THRESHOLD_H 1
-#include <sysdep.h>
-#include <sys/syscall.h>
-#include <shlib-compat.h>
-#include <bp-checks.h>
+/* Return the maximum number of symlink traversals to permit
+ before diagnosing ELOOP.
-extern int __new_getrlimit (enum __rlimit_resource resource,
- struct rlimit *__unbounded rlimits);
+ In the Hurd version, here we are actually setting the only policy
+ there is on the system. We use a literal number here rather than
+ defining SYMLOOP_MAX so that programs don't compile in a number
+ but instead use sysconf and the number can be changed here to
+ affect sysconf's result. */
-/* Consider moving to syscalls.list. */
-
-int
-__new_getrlimit (enum __rlimit_resource resource, struct rlimit *rlimits)
+static inline unsigned int __attribute__ ((const))
+__eloop_threshold (void)
{
- return INLINE_SYSCALL (ugetrlimit, 2, resource, CHECK_1 (rlimits));
+ return 32;
}
-weak_alias (__new_getrlimit, __getrlimit);
-versioned_symbol (libc, __new_getrlimit, getrlimit, GLIBC_2_2);
+#endif /* eloop-threshold.h */
diff --git a/libc/sysdeps/mach/hurd/renameat.c b/libc/sysdeps/mach/hurd/renameat.c
new file mode 100644
index 000000000..8ab5906a6
--- /dev/null
+++ b/libc/sysdeps/mach/hurd/renameat.c
@@ -0,0 +1,51 @@
+/* Rename a file using relative source and destination names. Hurd version.
+ Copyright (C) 1991-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 <stdio.h>
+#include <hurd.h>
+#include <hurd/fd.h>
+
+/* Rename the file OLD relative to OLDFD to NEW relative to NEWFD. */
+int
+renameat (oldfd, old, newfd, new)
+ int oldfd;
+ const char *old;
+ int newfd;
+ const char *new;
+{
+ error_t err;
+ file_t olddir, newdir;
+ const char *oldname, *newname;
+
+ olddir = __directory_name_split_at (oldfd, old, (char **) &oldname);
+ if (olddir == MACH_PORT_NULL)
+ return -1;
+ newdir = __directory_name_split_at (newfd, new, (char **) &newname);
+ if (newdir == MACH_PORT_NULL)
+ {
+ __mach_port_deallocate (__mach_task_self (), olddir);
+ return -1;
+ }
+
+ err = __dir_rename (olddir, oldname, newdir, newname, 0);
+ __mach_port_deallocate (__mach_task_self (), olddir);
+ __mach_port_deallocate (__mach_task_self (), newdir);
+ if (err)
+ return __hurd_fail (err);
+ return 0;
+}
diff --git a/libc/sysdeps/mach/hurd/sys/param.h b/libc/sysdeps/mach/hurd/sys/param.h
index 42f4f46e7..e58d5175b 100644
--- a/libc/sysdeps/mach/hurd/sys/param.h
+++ b/libc/sysdeps/mach/hurd/sys/param.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993,1994,1995,1997,1999,2011 Free Software Foundation, Inc.
+/* Copyright (C) 1993-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
@@ -83,7 +83,6 @@
#define NBBY CHAR_BIT
#define NGROUPS NGROUPS_MAX
-#define MAXSYMLINKS SYMLOOP_MAX
#define CANBSIZ MAX_CANON /* XXX ? */
/* ARG_MAX is unlimited, but we define NCARGS for BSD programs that want to
diff --git a/libc/ports/sysdeps/m68k/nptl/pthread_spin_trylock.c b/libc/sysdeps/mach/hurd/sysconf.c
index f4b0c0d0a..6d1666d93 100644
--- a/libc/ports/sysdeps/m68k/nptl/pthread_spin_trylock.c
+++ b/libc/sysdeps/mach/hurd/sysconf.c
@@ -1,6 +1,6 @@
-/* Copyright (C) 2010 Free Software Foundation, Inc.
+/* Return values of system parameters. Hurd version.
+ Copyright (C) 2012 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
@@ -13,15 +13,14 @@
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
+ License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
-#include <atomic.h>
-#include "pthreadP.h"
+#include <limits.h>
+#include <unistd.h>
-int
-pthread_spin_trylock (pthread_spinlock_t *lock)
-{
- return atomic_compare_and_exchange_val_acq(lock, 1, 0) ? EBUSY : 0;
-}
+#include <eloop-threshold.h>
+
+#define SYMLOOP_MAX (__eloop_threshold ())
+
+#include <sysdeps/posix/sysconf.c>
diff --git a/libc/sysdeps/unix/closedir.c b/libc/sysdeps/posix/closedir.c
index 41abf28c6..41abf28c6 100644
--- a/libc/sysdeps/unix/closedir.c
+++ b/libc/sysdeps/posix/closedir.c
diff --git a/libc/sysdeps/unix/dirfd.c b/libc/sysdeps/posix/dirfd.c
index 536c44e30..536c44e30 100644
--- a/libc/sysdeps/unix/dirfd.c
+++ b/libc/sysdeps/posix/dirfd.c
diff --git a/libc/sysdeps/unix/dirstream.h b/libc/sysdeps/posix/dirstream.h
index 6ca290471..6ca290471 100644
--- a/libc/sysdeps/unix/dirstream.h
+++ b/libc/sysdeps/posix/dirstream.h
diff --git a/libc/sysdeps/unix/fdopendir.c b/libc/sysdeps/posix/fdopendir.c
index beddcbe02..0ffd3f963 100644
--- a/libc/sysdeps/unix/fdopendir.c
+++ b/libc/sysdeps/posix/fdopendir.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005, 2006, 2011 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
@@ -18,6 +18,7 @@
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
+#include <stddef.h>
#include <sys/stat.h>
#include <not-cancel.h>
diff --git a/libc/sysdeps/unix/opendir.c b/libc/sysdeps/posix/opendir.c
index e093142f6..e093142f6 100644
--- a/libc/sysdeps/unix/opendir.c
+++ b/libc/sysdeps/posix/opendir.c
diff --git a/libc/sysdeps/unix/readdir.c b/libc/sysdeps/posix/readdir.c
index be0fcaee9..be0fcaee9 100644
--- a/libc/sysdeps/unix/readdir.c
+++ b/libc/sysdeps/posix/readdir.c
diff --git a/libc/sysdeps/unix/readdir_r.c b/libc/sysdeps/posix/readdir_r.c
index bfa2c0b8f..bfa2c0b8f 100644
--- a/libc/sysdeps/unix/readdir_r.c
+++ b/libc/sysdeps/posix/readdir_r.c
diff --git a/libc/sysdeps/unix/rewinddir.c b/libc/sysdeps/posix/rewinddir.c
index f8eefea54..f8eefea54 100644
--- a/libc/sysdeps/unix/rewinddir.c
+++ b/libc/sysdeps/posix/rewinddir.c
diff --git a/libc/sysdeps/unix/seekdir.c b/libc/sysdeps/posix/seekdir.c
index 88e34ee28..88e34ee28 100644
--- a/libc/sysdeps/unix/seekdir.c
+++ b/libc/sysdeps/posix/seekdir.c
diff --git a/libc/sysdeps/posix/system.c b/libc/sysdeps/posix/system.c
index c4d65bf12..5973b6265 100644
--- a/libc/sysdeps/posix/system.c
+++ b/libc/sysdeps/posix/system.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2000,2002,2003,2005,2007 Free Software Foundation, Inc.
+/* Copyright (C) 1991-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
@@ -70,13 +70,13 @@ do_system (const char *line)
{
if (__sigaction (SIGINT, &sa, &intr) < 0)
{
- SUB_REF ();
+ (void) SUB_REF ();
goto out;
}
if (__sigaction (SIGQUIT, &sa, &quit) < 0)
{
save = errno;
- SUB_REF ();
+ (void) SUB_REF ();
goto out_restore_sigint;
}
}
diff --git a/libc/sysdeps/unix/telldir.c b/libc/sysdeps/posix/telldir.c
index 4a3ad25b1..4a3ad25b1 100644
--- a/libc/sysdeps/unix/telldir.c
+++ b/libc/sysdeps/posix/telldir.c
diff --git a/libc/sysdeps/powerpc/powerpc32/sysdep.h b/libc/sysdeps/powerpc/powerpc32/sysdep.h
index 811ebf2ae..02917a867 100644
--- a/libc/sysdeps/powerpc/powerpc32/sysdep.h
+++ b/libc/sysdeps/powerpc/powerpc32/sysdep.h
@@ -30,15 +30,15 @@
# define CALL_MCOUNT \
mflr r0; \
stw r0,4(r1); \
- cfi_offset (lr, 4); \
+ cfi_offset (lr, 4); \
bl JUMPTARGET(_mcount);
#else /* PROF */
# define CALL_MCOUNT /* Do nothing. */
#endif /* PROF */
#define ENTRY(name) \
- .globl C_SYMBOL_NAME(name); \
- ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \
+ .globl C_SYMBOL_NAME(name); \
+ .type C_SYMBOL_NAME(name),@function; \
.align ALIGNARG(2); \
C_LABEL(name) \
cfi_startproc; \
@@ -46,7 +46,7 @@
/* helper macro for accessing the 32-bit powerpc GOT. */
-#define SETUP_GOT_ACCESS(regname,GOT_LABEL) \
+#define SETUP_GOT_ACCESS(regname,GOT_LABEL) \
bcl 20,31,GOT_LABEL ; \
GOT_LABEL: ; \
mflr (regname)
@@ -64,8 +64,8 @@ GOT_LABEL: ; \
past a 2^align boundary. */
#ifdef PROF
# define EALIGN(name, alignt, words) \
- .globl C_SYMBOL_NAME(name); \
- ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \
+ .globl C_SYMBOL_NAME(name); \
+ .type C_SYMBOL_NAME(name),@function; \
.align ALIGNARG(2); \
C_LABEL(name) \
cfi_startproc; \
@@ -76,8 +76,8 @@ GOT_LABEL: ; \
0:
#else /* PROF */
# define EALIGN(name, alignt, words) \
- .globl C_SYMBOL_NAME(name); \
- ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \
+ .globl C_SYMBOL_NAME(name); \
+ .type C_SYMBOL_NAME(name),@function; \
.align ALIGNARG(alignt); \
EALIGN_W_##words; \
C_LABEL(name) \
@@ -89,7 +89,7 @@ GOT_LABEL: ; \
cfi_endproc; \
ASM_SIZE_DIRECTIVE(name)
-#define DO_CALL(syscall) \
+#define DO_CALL(syscall) \
li 0,syscall; \
sc
diff --git a/libc/sysdeps/powerpc/sysdep.h b/libc/sysdeps/powerpc/sysdep.h
index 7682ae918..302f55970 100644
--- a/libc/sysdeps/powerpc/sysdep.h
+++ b/libc/sysdeps/powerpc/sysdep.h
@@ -147,8 +147,6 @@
/* This seems to always be the case on PPC. */
#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
#endif /* __ASSEMBLER__ */
diff --git a/libc/sysdeps/pthread/Makeconfig b/libc/sysdeps/pthread/Makeconfig
new file mode 100644
index 000000000..2b564eae5
--- /dev/null
+++ b/libc/sysdeps/pthread/Makeconfig
@@ -0,0 +1,2 @@
+# Compile libc code to do internal locking.
+libc-reentrant = yes
diff --git a/libc/sysdeps/pthread/configure b/libc/sysdeps/pthread/configure
deleted file mode 100644
index e39d31138..000000000
--- a/libc/sysdeps/pthread/configure
+++ /dev/null
@@ -1,3 +0,0 @@
-# Local configure fragment for sysdeps/pthread.
-
-DEFINES="$DEFINES -D_LIBC_REENTRANT"
diff --git a/libc/sysdeps/s390/s390-32/s390-mcount.S b/libc/sysdeps/s390/s390-32/s390-mcount.S
index 1c8c79ada..04e14ebd8 100644
--- a/libc/sysdeps/s390/s390-32/s390-mcount.S
+++ b/libc/sysdeps/s390/s390-32/s390-mcount.S
@@ -48,7 +48,7 @@
*/
.globl C_SYMBOL_NAME(_mcount)
- ASM_TYPE_DIRECTIVE(C_SYMBOL_NAME(_mcount), @function)
+ .type C_SYMBOL_NAME(_mcount), @function
cfi_startproc
.align ALIGNARG(4)
C_LABEL(_mcount)
diff --git a/libc/sysdeps/s390/s390-32/sysdep.h b/libc/sysdeps/s390/s390-32/sysdep.h
index 24a07a2a9..78749ee16 100644
--- a/libc/sysdeps/s390/s390-32/sysdep.h
+++ b/libc/sysdeps/s390/s390-32/sysdep.h
@@ -25,15 +25,13 @@
/* 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. */
#define ENTRY(name) \
- .globl C_SYMBOL_NAME(name); \
- ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \
+ .globl C_SYMBOL_NAME(name); \
+ .type C_SYMBOL_NAME(name),@function; \
.align ALIGNARG(2); \
C_LABEL(name) \
cfi_startproc; \
diff --git a/libc/sysdeps/s390/s390-64/s390x-mcount.S b/libc/sysdeps/s390/s390-64/s390x-mcount.S
index 5d8ef9117..3d4392989 100644
--- a/libc/sysdeps/s390/s390-64/s390x-mcount.S
+++ b/libc/sysdeps/s390/s390-64/s390x-mcount.S
@@ -44,7 +44,7 @@
_mcount may not modify any register. */
.globl C_SYMBOL_NAME(_mcount)
- ASM_TYPE_DIRECTIVE(C_SYMBOL_NAME(_mcount), @function)
+ .type C_SYMBOL_NAME(_mcount), @function
cfi_startproc
.align ALIGNARG(4)
C_LABEL(_mcount)
diff --git a/libc/sysdeps/s390/s390-64/sysdep.h b/libc/sysdeps/s390/s390-64/sysdep.h
index b7449b6b1..e62191c2a 100644
--- a/libc/sysdeps/s390/s390-64/sysdep.h
+++ b/libc/sysdeps/s390/s390-64/sysdep.h
@@ -25,15 +25,13 @@
/* 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. */
#define ENTRY(name) \
- .globl C_SYMBOL_NAME(name); \
- ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \
+ .globl C_SYMBOL_NAME(name); \
+ .type C_SYMBOL_NAME(name),@function; \
.align ALIGNARG(2); \
C_LABEL(name) \
cfi_startproc; \
diff --git a/libc/sysdeps/sh/_mcount.S b/libc/sysdeps/sh/_mcount.S
index 878788b59..7c9f6d132 100644
--- a/libc/sysdeps/sh/_mcount.S
+++ b/libc/sysdeps/sh/_mcount.S
@@ -20,7 +20,7 @@
#include <sysdep.h>
.globl C_SYMBOL_NAME(_mcount)
- ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(_mcount),function)
+ .type C_SYMBOL_NAME(_mcount),@function
cfi_startproc
.align 5
C_LABEL(_mcount)
diff --git a/libc/sysdeps/sh/ldsodefs.h b/libc/sysdeps/sh/ldsodefs.h
index 66d1e2fbb..74c0f417b 100644
--- a/libc/sysdeps/sh/ldsodefs.h
+++ b/libc/sysdeps/sh/ldsodefs.h
@@ -26,7 +26,7 @@ struct La_sh_retval;
#define ARCH_PLTENTER_MEMBERS \
uintptr_t (*sh_gnu_pltenter) (Elf32_Sym *, unsigned int, uintptr_t *, \
- uintptr_t *, const struct La_sh_regs *, \
+ uintptr_t *, struct La_sh_regs *, \
unsigned int *, const char *name, \
long int *framesizep)
diff --git a/libc/sysdeps/sh/sysdep.h b/libc/sysdeps/sh/sysdep.h
index 66a198288..1111b8bd4 100644
--- a/libc/sysdeps/sh/sysdep.h
+++ b/libc/sysdeps/sh/sysdep.h
@@ -23,8 +23,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
#ifdef SHARED
@@ -36,8 +34,8 @@
/* Define an entry point visible from C. */
#define ENTRY(name) \
- .globl C_SYMBOL_NAME(name); \
- ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),function) \
+ .globl C_SYMBOL_NAME(name); \
+ .type C_SYMBOL_NAME(name),@function; \
.align ALIGNARG(5); \
C_LABEL(name) \
cfi_startproc; \
diff --git a/libc/sysdeps/sparc/fpu/libm-test-ulps b/libc/sysdeps/sparc/fpu/libm-test-ulps
index 3d54a5901..74af9d571 100644
--- a/libc/sysdeps/sparc/fpu/libm-test-ulps
+++ b/libc/sysdeps/sparc/fpu/libm-test-ulps
@@ -820,6 +820,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 "Imaginary part of: clog (-0x1.234566p-40 - 1.0 i) == 5.354083939753840089583620652120903838944e-25 - 1.570796326795931422008642456283782656359 i":
float: 1
ifloat: 1
@@ -870,6 +876,12 @@ float: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "Real part of: clog (0x1.000566p0 + 0x1.234p-10 i) == 8.298731898331237038231468223024422855654e-5 + 1.110938609507128729312743251313024793990e-3 i":
+float: 1
+ifloat: 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.fp+127 + 0x1p-149 i) == 88.69109041335841930424871526389807508374 + +0 i":
float: 1
ifloat: 1
@@ -930,6 +942,22 @@ double: 1
float: 1
idouble: 1
ifloat: 1
+Test "Real part of: clog10 (-0x1.0000000123456p0 + 0x1.2345678p-1000 i) == 1.150487026509145544402795327729455391948e-10 + 1.364376353841841347485783625431355770210 i":
+double: 2
+idouble: 2
+ildouble: 1
+ldouble: 1
+Test "Imaginary 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: 2
+idouble: 2
+ildouble: 1
+ldouble: 1
+Test "Imaginary 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.fp+1023 + 0x1p-1074 i) == 308.2409272754311106024666378243768099991 + 1.364376353841841347485783625431355770210 i":
double: 1
idouble: 1
@@ -1018,6 +1046,29 @@ ifloat: 1
Test "Imaginary part of: clog10 (0.75 + 1.25 i) == 0.163679467193165171449476605077428975 + 0.447486970040493067069984724340855636 i":
ildouble: 1
ldouble: 1
+Test "Real part of: clog10 (0x1.00000000000000123456789abcp0 + 0x1.23456789p-1000 i) == 4.285899851347756186652871946325962330640e-19 + 4.611541215247321502041995872887317363241e-302 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x1.00000000000000123456789abcp0 + 0x1.23456789p-1000 i) == 4.285899851347756186652871946325962330640e-19 + 4.611541215247321502041995872887317363241e-302 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x1.00000000000000123456789abcp0 + 0x1.23456789p-60 i) == 4.285899851347756188767674032946882584784e-19 + 4.285899850759344225805480528847018395861e-19 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (0x1.000566p0 + 0x1.234p-10 i) == 3.604093470239754109961125085078190708674e-5 + 4.824745078422174667425851670822596859720e-4 i":
+float: 1
+ifloat: 1
+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 "Real part of: clog10 (0x1.000566p0 + 0x1.234p-100 i) == 3.577293486783822178310971763308187385546e-5 + 3.897399639875661463735636919790792140598e-31 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (0x1.000566p0 + 0x1.234p-100 i) == 3.577293486783822178310971763308187385546e-5 + 3.897399639875661463735636919790792140598e-31 i":
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: clog10 (0x1.234566p-30 + 1.0 i) == 2.438200411482400072282924063740535840474e-19 + 6.821881764607257184291586401763604544928e-1 i":
float: 1
ifloat: 1
@@ -1303,6 +1354,8 @@ ifloat: 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
+ildouble: 1
+ldouble: 1
Test "Real part of: cpow (0.75 + 1.25 i, 0.75 + 1.25 i) == 0.117506293914473555420279832210420483 + 0.346552747708338676483025352060418001 i":
double: 1
float: 4
@@ -2981,11 +3034,13 @@ ldouble: 1
Function: Imaginary part of "clog":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Function: Real part of "clog10":
-double: 1
+double: 2
float: 1
-idouble: 1
+idouble: 2
ifloat: 1
ildouble: 1
ldouble: 1
@@ -2995,8 +3050,8 @@ double: 1
float: 1
idouble: 1
ifloat: 1
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
Function: "cos":
double: 2
diff --git a/libc/sysdeps/sparc/ldsodefs.h b/libc/sysdeps/sparc/ldsodefs.h
index 2cfdc49f7..dc6886082 100644
--- a/libc/sysdeps/sparc/ldsodefs.h
+++ b/libc/sysdeps/sparc/ldsodefs.h
@@ -29,12 +29,12 @@ struct La_sparc64_retval;
#define ARCH_PLTENTER_MEMBERS \
Elf32_Addr (*sparc32_gnu_pltenter) (Elf32_Sym *, unsigned int, \
uintptr_t *, uintptr_t *, \
- const struct La_sparc32_regs *, \
+ struct La_sparc32_regs *, \
unsigned int *, const char *name, \
long int *framesizep); \
Elf64_Addr (*sparc64_gnu_pltenter) (Elf64_Sym *, unsigned int, \
uintptr_t *, uintptr_t *, \
- const struct La_sparc64_regs *, \
+ struct La_sparc64_regs *, \
unsigned int *, const char *name, \
long int *framesizep)
diff --git a/libc/sysdeps/unix/Makefile b/libc/sysdeps/unix/Makefile
index 9e95b567c..dda3a3ee0 100644
--- a/libc/sysdeps/unix/Makefile
+++ b/libc/sysdeps/unix/Makefile
@@ -37,23 +37,29 @@ $(objpfx)stub-syscalls.c: $(common-objpfx)sysd-syscalls \
$(..)sysdeps/unix/Makefile
$(make-target-directory)
(for call in $(unix-stub-syscalls); do \
+ call=$${call%%@*}; \
echo "#define $$call RENAMED_$$call"; \
done; \
echo '#include <errno.h>'; \
+ echo '#include <shlib-compat.h>'; \
for call in $(unix-stub-syscalls); do \
+ call=$${call%%@*}; \
echo "#undef $$call"; \
done; \
echo 'long int _no_syscall (void)'; \
echo '{ __set_errno (ENOSYS); return -1L; }'; \
for call in $(unix-stub-syscalls); do \
case $$call in \
- *@@*) ver=$${call##*@}; call=$${call%%*@}; \
- echo "strong_alias (_no_syscall, $${call}_$${ver})"; \
- echo "default_symbol_version \
- ($${call}_$${ver}, $$call, $$ver);" ;; \
- *@*) ver=$${call##*@}; call=$${call%%*@}; \
- echo "strong_alias (_no_syscall, $${call}_$${ver})"; \
- echo "symbol_version ($${call}_$${ver}, $$call, $$ver);" ;; \
+ *@@*) \
+ ver=$${call##*@}; call=$${call%%@*}; ver=$${ver//./_}; \
+ echo "strong_alias (_no_syscall, __$${call}_$${ver})"; \
+ echo "versioned_symbol (libc, __$${call}_$${ver}, $$call, $$ver);"\
+ ;; \
+ *@*) \
+ ver=$${call##*@}; call=$${call%%@*}; ver=$${ver//./_}; \
+ echo "strong_alias (_no_syscall, __$${call}_$${ver})"; \
+ echo "compat_symbol (libc, __$${call}_$${ver}, $$call, $$ver);" \
+ ;; \
*) echo "weak_alias (_no_syscall, $$call)"; \
echo "stub_warning ($$call)"; \
echo "weak_alias (_no_syscall, __GI_$$call)" ;; \
diff --git a/libc/sysdeps/unix/bsd/bsd4.4/bits/dirent.h b/libc/sysdeps/unix/bsd/bsd4.4/bits/dirent.h
deleted file mode 100644
index 1e0f08b26..000000000
--- a/libc/sysdeps/unix/bsd/bsd4.4/bits/dirent.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* Directory entry structure `struct dirent'. 4.4BSD version.
- Copyright (C) 1996,97,98,2001 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 _DIRENT_H
-# error "Never use <bits/dirent.h> directly; include <dirent.h> instead."
-#endif
-
-struct dirent
- {
-#ifndef __USE_FILE_OFFSET64
- __ino_t d_ino; /* File serial number. */
-#else
- __ino64_t d_ino;
-#endif
- unsigned short int d_reclen; /* Length of the whole `struct dirent'. */
- unsigned char d_type; /* File type, possibly unknown. */
- unsigned char d_namlen; /* Length of the file name. */
-
- /* Only this member is in the POSIX standard. */
- char d_name[1]; /* File name (actually longer). */
- };
-
-#ifdef __USE_LARGEFILE64
-struct dirent64
- {
- __ino64_t d_ino;
- unsigned short int d_reclen;
- unsigned char d_type;
- unsigned char d_namlen;
-
- char d_name[1];
- };
-#endif
-
-#define d_fileno d_ino /* Backwards compatibility. */
-
-#define _DIRENT_HAVE_D_RECLEN 1
-#define _DIRENT_HAVE_D_NAMLEN 1
-#define _DIRENT_HAVE_D_TYPE 1
diff --git a/libc/sysdeps/unix/bsd/bsd4.4/bits/fcntl.h b/libc/sysdeps/unix/bsd/bsd4.4/bits/fcntl.h
deleted file mode 100644
index c801d81f5..000000000
--- a/libc/sysdeps/unix/bsd/bsd4.4/bits/fcntl.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/* O_*, F_*, FD_* bit values for 4.4 BSD.
- Copyright (C) 1991, 1992, 1997, 2004 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 _FCNTL_H
-#error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
-#endif
-
-
-/* File access modes for `open' and `fcntl'. */
-#define O_RDONLY 0 /* Open read-only. */
-#define O_WRONLY 1 /* Open write-only. */
-#define O_RDWR 2 /* Open read/write. */
-
-
-/* Bits OR'd into the second argument to open. */
-#define O_CREAT 0x0200 /* Create file if it doesn't exist. */
-#define O_EXCL 0x0800 /* Fail if file already exists. */
-#define O_TRUNC 0x0400 /* Truncate file to zero length. */
-/* Apparently not assigning a controlling terminal is the default
- behavior in BSD, so no bit is required to request that behavior. */
-#define O_NOCTTY 0 /* Don't assign a controlling terminal. */
-#ifdef __USE_MISC
-#define O_ASYNC 0x0040 /* Send SIGIO to owner when data is ready. */
-#define O_FSYNC 0x0080 /* Synchronous writes. */
-#define O_SYNC O_FSYNC
-#define O_SHLOCK 0x0010 /* Open with shared file lock. */
-#define O_EXLOCK 0x0020 /* Open with shared exclusive lock. */
-#endif
-
-/* File status flags for `open' and `fcntl'. */
-#define O_APPEND 0x0008 /* Writes append to the file. */
-#define O_NONBLOCK 0x0004 /* Non-blocking I/O. */
-
-#ifdef __USE_BSD
-#define O_NDELAY O_NONBLOCK
-#endif
-
-#ifdef __USE_BSD
-/* Bits in the file status flags returned by F_GETFL.
- These are all the O_* flags, plus FREAD and FWRITE, which are
- independent bits set by which of O_RDONLY, O_WRONLY, and O_RDWR, was
- given to `open'. */
-#define FREAD 1
-#define FWRITE 2
-
-/* Traditional BSD names the O_* bits. */
-#define FASYNC O_ASYNC
-#define FCREAT O_CREAT
-#define FEXCL O_EXCL
-#define FTRUNC O_TRUNC
-#define FNOCTTY O_NOCTTY
-#define FFSYNC O_FSYNC
-#define FSYNC O_SYNC
-#define FAPPEND O_APPEND
-#define FNONBLOCK O_NONBLOCK
-#define FNDELAY O_NDELAY
-#endif
-
-/* Mask for file access modes. This is system-dependent in case
- some system ever wants to define some other flavor of access. */
-#define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR)
-
-/* Values for the second argument to `fcntl'. */
-#define F_DUPFD 0 /* Duplicate file descriptor. */
-#define F_GETFD 1 /* Get file descriptor flags. */
-#define F_SETFD 2 /* Set file descriptor flags. */
-#define F_GETFL 3 /* Get file status flags. */
-#define F_SETFL 4 /* Set file status flags. */
-#if defined __USE_BSD || defined __USE_UNIX98
-#define F_GETOWN 5 /* Get owner (receiver of SIGIO). */
-#define F_SETOWN 6 /* Set owner (receiver of SIGIO). */
-#endif
-#define F_GETLK 7 /* Get record locking info. */
-#define F_SETLK 8 /* Set record locking info (non-blocking). */
-#define F_SETLKW 9 /* Set record locking info (blocking). */
-
-/* File descriptor flags used with F_GETFD and F_SETFD. */
-#define FD_CLOEXEC 1 /* Close on exec. */
-
-
-#include <bits/types.h>
-
-/* The structure describing an advisory lock. This is the type of the third
- argument to `fcntl' for the F_GETLK, F_SETLK, and F_SETLKW requests. */
-struct flock
- {
- short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */
- short int l_whence; /* Where `l_start' is relative to (like `lseek'). */
- __off_t l_start; /* Offset where the lock begins. */
- __off_t l_len; /* Size of the locked area; zero means until EOF. */
- short int l_pid; /* Process holding the lock. */
- };
-
-/* Values for the `l_type' field of a `struct flock'. */
-#define F_RDLCK 1 /* Read lock. */
-#define F_WRLCK 2 /* Write lock. */
-#define F_UNLCK 3 /* Remove lock. */
diff --git a/libc/sysdeps/unix/bsd/bsd4.4/freebsd/bits/typesizes.h b/libc/sysdeps/unix/bsd/bsd4.4/freebsd/bits/typesizes.h
index 02c24e44c..67d82e6e7 100644
--- a/libc/sysdeps/unix/bsd/bsd4.4/freebsd/bits/typesizes.h
+++ b/libc/sysdeps/unix/bsd/bsd4.4/freebsd/bits/typesizes.h
@@ -61,6 +61,11 @@
#define __SYSCALL_SLONG_TYPE __SLONGWORD_TYPE
#define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE
+
+/* Tell the libc code that off_t and off64_t are actually the same type. */
+#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/sysdeps/unix/make-syscalls.sh b/libc/sysdeps/unix/make-syscalls.sh
index 2bc7cc02a..7e7de65f3 100644
--- a/libc/sysdeps/unix/make-syscalls.sh
+++ b/libc/sysdeps/unix/make-syscalls.sh
@@ -64,18 +64,30 @@ done`
# Any calls left?
test -n "$calls" || exit 0
-# This uses variables $weak and $strong.
+# This uses variables $weak, $strong, and $any_versioned.
emit_weak_aliases()
{
# A shortcoming in the current gas is that it will only allow one
# version-alias per symbol. So we create new strong aliases as needed.
vcount=""
+ # We use the <shlib-compat.h> macros to generate the versioned aliases
+ # so that the version sets can be mapped to the configuration's
+ # minimum version set as per shlib-versions DEFAULT lines. But note
+ # we don't generate any "#if SHLIB_COMPAT (...)" conditionals. To do
+ # that we'd need to change the syscalls.list format so that it can
+ # list the "obsoleted" version set too. If it ever arises that we
+ # have a syscall entry point that is obsoleted by a newer version set,
+ # we'll have to revamp all this.
+ if [ $any_versioned = t ]; then
+ echo " echo '#include <shlib-compat.h>'; \\"
+ fi
+
for name in $weak; do
case $name in
*@@*)
base=`echo $name | sed 's/@@.*//'`
- ver=`echo $name | sed 's/.*@@//'`
+ ver=`echo $name | sed 's/.*@@//;s/\./_/g'`
echo " echo '#ifndef NOT_IN_libc'; \\"
if test -z "$vcount" ; then
source=$strong
@@ -85,14 +97,14 @@ emit_weak_aliases()
vcount=`expr $vcount + 1`
echo " echo 'strong_alias ($strong, $source)'; \\"
fi
- echo " echo 'default_symbol_version($source, $base, $ver)'; \\"
+ echo " echo 'versioned_symbol (libc, $source, $base, $ver)'; \\"
echo " echo '#else'; \\"
echo " echo 'strong_alias ($strong, $base)'; \\"
echo " echo '#endif'; \\"
;;
*@*)
base=`echo $name | sed 's/@.*//'`
- ver=`echo $name | sed 's/.*@//'`
+ ver=`echo $name | sed 's/.*@//;s/\./_/g'`
echo " echo '#ifndef NOT_IN_libc'; \\"
if test -z "$vcount" ; then
source=$strong
@@ -102,7 +114,7 @@ emit_weak_aliases()
vcount=`expr $vcount + 1`
echo " echo 'strong_alias ($strong, $source)'; \\"
fi
- echo " echo 'symbol_version ($source, $base, $ver)'; \\"
+ echo " echo 'compat_symbol (libc, $source, $base, $ver)'; \\"
echo " echo '#endif'; \\"
;;
!*)
@@ -175,10 +187,11 @@ while read file srcfile caller syscall args strong weak; do
# If there are versioned aliases the entry is only generated for the
# shared library, unless it is a default version.
+ any_versioned=f
shared_only=f
case $weak in
- *@@*) ;;
- *@*) shared_only=t;;
+ *@@*) any_versioned=t ;;
+ *@*) any_versioned=t shared_only=t ;;
esac
case x$srcfile"$callnum" in
diff --git a/libc/sysdeps/unix/sysv/linux/bits/dirent.h b/libc/sysdeps/unix/sysv/linux/bits/dirent.h
index 5728618f2..11daabe72 100644
--- a/libc/sysdeps/unix/sysv/linux/bits/dirent.h
+++ b/libc/sysdeps/unix/sysv/linux/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
@@ -50,3 +50,8 @@ struct dirent64
#define _DIRENT_HAVE_D_RECLEN
#define _DIRENT_HAVE_D_OFF
#define _DIRENT_HAVE_D_TYPE
+
+#if defined __OFF_T_MATCHES_OFF64_T && defined __INO_T_MATCHES_INO64_T
+/* Inform libc code that these two types are effectively identical. */
+# define _DIRENT_MATCHES_DIRENT64 1
+#endif
diff --git a/libc/sysdeps/unix/sysv/linux/clock_getcpuclockid.c b/libc/sysdeps/unix/sysv/linux/clock_getcpuclockid.c
index c6ff46671..1cfdf3489 100644
--- a/libc/sysdeps/unix/sysv/linux/clock_getcpuclockid.c
+++ b/libc/sysdeps/unix/sysv/linux/clock_getcpuclockid.c
@@ -1,5 +1,5 @@
/* clock_getcpuclockid -- Get a clockid_t for process CPU time. Linux version.
- Copyright (C) 2004, 2005, 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
@@ -37,11 +37,6 @@ clock_getcpuclockid (pid_t pid, clockid_t *clock_id)
# if !(__ASSUME_POSIX_CPU_TIMERS > 0)
extern int __libc_missing_posix_cpu_timers attribute_hidden;
-# if !(__ASSUME_POSIX_TIMERS > 0)
- extern int __libc_missing_posix_timers attribute_hidden;
- if (__libc_missing_posix_timers && !__libc_missing_posix_cpu_timers)
- __libc_missing_posix_cpu_timers = 1;
-# endif
if (!__libc_missing_posix_cpu_timers)
# endif
{
@@ -53,33 +48,24 @@ clock_getcpuclockid (pid_t pid, clockid_t *clock_id)
return 0;
}
-# if !(__ASSUME_POSIX_TIMERS > 0)
- if (INTERNAL_SYSCALL_ERRNO (r, err) == ENOSYS)
+ if (INTERNAL_SYSCALL_ERRNO (r, err) == EINVAL)
{
- /* The kernel doesn't support these calls at all. */
- __libc_missing_posix_timers = 1;
- __libc_missing_posix_cpu_timers = 1;
- }
- else
-# endif
- if (INTERNAL_SYSCALL_ERRNO (r, err) == EINVAL)
- {
# if !(__ASSUME_POSIX_CPU_TIMERS > 0)
- if (pidclock == MAKE_PROCESS_CPUCLOCK (0, CPUCLOCK_SCHED)
- || INTERNAL_SYSCALL_ERROR_P (INTERNAL_SYSCALL
- (clock_getres, err, 2,
- MAKE_PROCESS_CPUCLOCK
- (0, CPUCLOCK_SCHED), NULL),
- err))
- /* The kernel doesn't support these clocks at all. */
- __libc_missing_posix_cpu_timers = 1;
- else
+ if (pidclock == MAKE_PROCESS_CPUCLOCK (0, CPUCLOCK_SCHED)
+ || INTERNAL_SYSCALL_ERROR_P (INTERNAL_SYSCALL
+ (clock_getres, err, 2,
+ MAKE_PROCESS_CPUCLOCK
+ (0, CPUCLOCK_SCHED), NULL),
+ err))
+ /* The kernel doesn't support these clocks at all. */
+ __libc_missing_posix_cpu_timers = 1;
+ else
# endif
- /* The clock_getres system call checked the PID for us. */
- return ESRCH;
- }
- else
- return INTERNAL_SYSCALL_ERRNO (r, err);
+ /* The clock_getres system call checked the PID for us. */
+ return ESRCH;
+ }
+ else
+ return INTERNAL_SYSCALL_ERRNO (r, err);
}
#endif
diff --git a/libc/sysdeps/unix/sysv/linux/clock_getres.c b/libc/sysdeps/unix/sysv/linux/clock_getres.c
index e7e313854..2bada33b4 100644
--- a/libc/sysdeps/unix/sysv/linux/clock_getres.c
+++ b/libc/sysdeps/unix/sysv/linux/clock_getres.c
@@ -1,5 +1,5 @@
/* clock_getres -- Get the resolution of a POSIX clockid_t. Linux version.
- Copyright (C) 2003,2004,2005,2006,2008,2010 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
@@ -35,11 +35,9 @@
retval = INLINE_VSYSCALL (clock_getres, 2, clock_id, res); \
break
-#ifdef __ASSUME_POSIX_TIMERS
-
-/* This means the REALTIME and MONOTONIC clock are definitely
- supported in the kernel. */
-# define SYSDEP_GETRES \
+/* The REALTIME and MONOTONIC clock are definitely supported in the
+ kernel. */
+#define SYSDEP_GETRES \
SYSDEP_GETRES_CPUTIME \
case CLOCK_REALTIME: \
case CLOCK_MONOTONIC: \
@@ -48,57 +46,6 @@
case CLOCK_MONOTONIC_COARSE: \
SYSCALL_GETRES
-# define __libc_missing_posix_timers 0
-#elif defined __NR_clock_getres
-/* Is the syscall known to exist? */
-extern int __libc_missing_posix_timers attribute_hidden;
-
-static inline int
-maybe_syscall_getres (clockid_t clock_id, struct timespec *res)
-{
- int e = EINVAL;
-
- if (!__libc_missing_posix_timers)
- {
- INTERNAL_SYSCALL_DECL (err);
- int r = INTERNAL_VSYSCALL (clock_getres, err, 2, clock_id, res);
- if (!INTERNAL_SYSCALL_ERROR_P (r, err))
- return 0;
-
- e = INTERNAL_SYSCALL_ERRNO (r, err);
- if (e == ENOSYS)
- {
- __libc_missing_posix_timers = 1;
- e = EINVAL;
- }
- }
-
- return e;
-}
-
-/* The REALTIME and MONOTONIC clock might be available. Try the
- syscall first. */
-# define SYSDEP_GETRES \
- SYSDEP_GETRES_CPUTIME \
- case CLOCK_REALTIME: \
- case CLOCK_MONOTONIC: \
- case CLOCK_MONOTONIC_RAW: \
- case CLOCK_REALTIME_COARSE: \
- case CLOCK_MONOTONIC_COARSE: \
- retval = maybe_syscall_getres (clock_id, res); \
- if (retval == 0) \
- break; \
- /* Fallback code. */ \
- if (retval == EINVAL && clock_id == CLOCK_REALTIME) \
- retval = realtime_getres (res); \
- else \
- { \
- __set_errno (retval); \
- retval = -1; \
- } \
- break;
-#endif
-
#ifdef __NR_clock_getres
/* We handled the REALTIME clock here. */
# define HANDLED_REALTIME 1
@@ -126,26 +73,15 @@ maybe_syscall_getres_cpu (clockid_t clock_id, struct timespec *res)
return 0;
e = INTERNAL_SYSCALL_ERRNO (r, err);
-# ifndef __ASSUME_POSIX_TIMERS
- if (e == ENOSYS)
- {
- __libc_missing_posix_timers = 1;
- __libc_missing_posix_cpu_timers = 1;
- e = EINVAL;
- }
- else
-# endif
+ if (e == EINVAL)
{
- if (e == EINVAL)
- {
- /* Check whether the kernel supports CPU clocks at all.
- If not, record it for the future. */
- r = INTERNAL_VSYSCALL (clock_getres, err, 2,
- MAKE_PROCESS_CPUCLOCK (0, CPUCLOCK_SCHED),
- NULL);
- if (INTERNAL_SYSCALL_ERROR_P (r, err))
- __libc_missing_posix_cpu_timers = 1;
- }
+ /* Check whether the kernel supports CPU clocks at all.
+ If not, record it for the future. */
+ r = INTERNAL_VSYSCALL (clock_getres, err, 2,
+ MAKE_PROCESS_CPUCLOCK (0, CPUCLOCK_SCHED),
+ NULL);
+ if (INTERNAL_SYSCALL_ERROR_P (r, err))
+ __libc_missing_posix_cpu_timers = 1;
}
}
diff --git a/libc/sysdeps/unix/sysv/linux/clock_gettime.c b/libc/sysdeps/unix/sysv/linux/clock_gettime.c
index 446fbb66f..e333d8d9e 100644
--- a/libc/sysdeps/unix/sysv/linux/clock_gettime.c
+++ b/libc/sysdeps/unix/sysv/linux/clock_gettime.c
@@ -1,5 +1,5 @@
/* clock_gettime -- Get current time from a POSIX clockid_t. Linux version.
- Copyright (C) 2003,2004,2005,2006,2007,2010,2011 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
@@ -40,68 +40,15 @@
INTERNAL_VSYSCALL (clock_gettime, err, 2, id, tp)
#endif
-#ifdef __ASSUME_POSIX_TIMERS
-
-/* This means the REALTIME and MONOTONIC clock are definitely
- supported in the kernel. */
-# define SYSDEP_GETTIME \
+/* The REALTIME and MONOTONIC clock are definitely supported in the
+ kernel. */
+#define SYSDEP_GETTIME \
SYSDEP_GETTIME_CPUTIME; \
case CLOCK_REALTIME: \
case CLOCK_MONOTONIC: \
retval = SYSCALL_GETTIME (clock_id, tp); \
break
-# define __libc_missing_posix_timers 0
-#elif defined __NR_clock_gettime
-/* Is the syscall known to exist? */
-int __libc_missing_posix_timers attribute_hidden;
-
-static inline int
-maybe_syscall_gettime (clockid_t clock_id, struct timespec *tp)
-{
- int e = EINVAL;
-
- if (!__libc_missing_posix_timers)
- {
- INTERNAL_SYSCALL_DECL (err);
- int r = INTERNAL_GETTIME (clock_id, tp);
- if (!INTERNAL_SYSCALL_ERROR_P (r, err))
- return 0;
-
- e = INTERNAL_SYSCALL_ERRNO (r, err);
- if (e == ENOSYS)
- {
- __libc_missing_posix_timers = 1;
- e = EINVAL;
- }
- }
-
- return e;
-}
-
-/* The REALTIME and MONOTONIC clock might be available. Try the
- syscall first. */
-# define SYSDEP_GETTIME \
- SYSDEP_GETTIME_CPUTIME; \
- case CLOCK_REALTIME: \
- case CLOCK_MONOTONIC: \
- case CLOCK_MONOTONIC_RAW: \
- case CLOCK_REALTIME_COARSE: \
- case CLOCK_MONOTONIC_COARSE: \
- retval = maybe_syscall_gettime (clock_id, tp); \
- if (retval == 0) \
- break; \
- /* Fallback code. */ \
- if (retval == EINVAL && clock_id == CLOCK_REALTIME) \
- retval = realtime_gettime (tp); \
- else \
- { \
- __set_errno (retval); \
- retval = -1; \
- } \
- break
-#endif
-
#ifdef __NR_clock_gettime
/* We handled the REALTIME clock here. */
# define HANDLED_REALTIME 1
@@ -131,34 +78,23 @@ maybe_syscall_gettime_cpu (clockid_t clock_id, struct timespec *tp)
return 0;
e = INTERNAL_SYSCALL_ERRNO (r, err);
-# ifndef __ASSUME_POSIX_TIMERS
- if (e == ENOSYS)
- {
- __libc_missing_posix_timers = 1;
- __libc_missing_posix_cpu_timers = 1;
- e = EINVAL;
- }
- else
-# endif
+ if (e == EINVAL)
{
- if (e == EINVAL)
- {
# ifdef HAVE_CLOCK_GETRES_VSYSCALL
- /* Check whether the kernel supports CPU clocks at all.
- If not, record it for the future. */
- r = INTERNAL_VSYSCALL (clock_getres, err, 2,
- MAKE_PROCESS_CPUCLOCK (0, CPUCLOCK_SCHED),
- NULL);
+ /* Check whether the kernel supports CPU clocks at all.
+ If not, record it for the future. */
+ r = INTERNAL_VSYSCALL (clock_getres, err, 2,
+ MAKE_PROCESS_CPUCLOCK (0, CPUCLOCK_SCHED),
+ NULL);
# else
- /* Check whether the kernel supports CPU clocks at all.
- If not, record it for the future. */
- r = INTERNAL_SYSCALL (clock_getres, err, 2,
- MAKE_PROCESS_CPUCLOCK (0, CPUCLOCK_SCHED),
- NULL);
+ /* Check whether the kernel supports CPU clocks at all.
+ If not, record it for the future. */
+ r = INTERNAL_SYSCALL (clock_getres, err, 2,
+ MAKE_PROCESS_CPUCLOCK (0, CPUCLOCK_SCHED),
+ NULL);
# endif
- if (INTERNAL_SYSCALL_ERROR_P (r, err))
- __libc_missing_posix_cpu_timers = 1;
- }
+ if (INTERNAL_SYSCALL_ERROR_P (r, err))
+ __libc_missing_posix_cpu_timers = 1;
}
}
diff --git a/libc/sysdeps/unix/sysv/linux/clock_nanosleep.c b/libc/sysdeps/unix/sysv/linux/clock_nanosleep.c
index e003ba21e..110296363 100644
--- a/libc/sysdeps/unix/sysv/linux/clock_nanosleep.c
+++ b/libc/sysdeps/unix/sysv/linux/clock_nanosleep.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004, 2005, 2006 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
@@ -23,7 +23,6 @@
#include "kernel-posix-cpu-timers.h"
-#ifdef __ASSUME_POSIX_TIMERS
/* We can simply use the syscall. The CPU clocks are not supported
with this function. */
int
@@ -53,43 +52,3 @@ clock_nanosleep (clockid_t clock_id, int flags, const struct timespec *req,
return (INTERNAL_SYSCALL_ERROR_P (r, err)
? INTERNAL_SYSCALL_ERRNO (r, err) : 0);
}
-
-#else
-# ifdef __NR_clock_nanosleep
-/* Is the syscall known to exist? */
-extern int __libc_missing_posix_timers attribute_hidden;
-
-/* The REALTIME and MONOTONIC clock might be available. Try the
- syscall first. */
-# define SYSDEP_NANOSLEEP \
- if (!__libc_missing_posix_timers) \
- { \
- clockid_t syscall_clockid; \
- INTERNAL_SYSCALL_DECL (err); \
- \
- if (clock_id == CLOCK_THREAD_CPUTIME_ID) \
- return EINVAL; \
- if (clock_id == CLOCK_PROCESS_CPUTIME_ID) \
- syscall_clockid = MAKE_PROCESS_CPUCLOCK (0, CPUCLOCK_SCHED); \
- else \
- syscall_clockid = clock_id; \
- \
- int oldstate = LIBC_CANCEL_ASYNC (); \
- \
- int r = INTERNAL_SYSCALL (clock_nanosleep, err, 4, \
- syscall_clockid, flags, req, rem); \
- \
- LIBC_CANCEL_RESET (oldstate); \
- \
- if (!INTERNAL_SYSCALL_ERROR_P (r, err)) \
- return 0; \
- \
- if (INTERNAL_SYSCALL_ERRNO (r, err) != ENOSYS) \
- return INTERNAL_SYSCALL_ERRNO (r, err); \
- \
- __libc_missing_posix_timers = 1; \
- }
-# endif
-
-# include <sysdeps/unix/clock_nanosleep.c>
-#endif
diff --git a/libc/sysdeps/unix/sysv/linux/clock_settime.c b/libc/sysdeps/unix/sysv/linux/clock_settime.c
index 8cf320980..f75ceca24 100644
--- a/libc/sysdeps/unix/sysv/linux/clock_settime.c
+++ b/libc/sysdeps/unix/sysv/linux/clock_settime.c
@@ -32,7 +32,6 @@
#endif
#if __ASSUME_POSIX_CPU_TIMERS <= 0 && defined __NR_clock_settime
-extern int __libc_missing_posix_timers attribute_hidden;
extern int __libc_missing_posix_cpu_timers attribute_hidden;
static int
@@ -48,26 +47,15 @@ maybe_syscall_settime_cpu (clockid_t clock_id, const struct timespec *tp)
return 0;
e = INTERNAL_SYSCALL_ERRNO (r, err);
-# ifndef __ASSUME_POSIX_TIMERS
- if (e == ENOSYS)
+ if (e == EINVAL)
{
- __libc_missing_posix_timers = 1;
- __libc_missing_posix_cpu_timers = 1;
- e = EINVAL;
- }
- else
-# endif
- {
- if (e == EINVAL)
- {
- /* Check whether the kernel supports CPU clocks at all.
- If not, record it for the future. */
- r = INTERNAL_VSYSCALL (clock_getres, err, 2,
- MAKE_PROCESS_CPUCLOCK (0, CPUCLOCK_SCHED),
- NULL);
- if (INTERNAL_SYSCALL_ERROR_P (r, err))
- __libc_missing_posix_cpu_timers = 1;
- }
+ /* Check whether the kernel supports CPU clocks at all.
+ If not, record it for the future. */
+ r = INTERNAL_VSYSCALL (clock_getres, err, 2,
+ MAKE_PROCESS_CPUCLOCK (0, CPUCLOCK_SCHED),
+ NULL);
+ if (INTERNAL_SYSCALL_ERROR_P (r, err))
+ __libc_missing_posix_cpu_timers = 1;
}
}
@@ -76,53 +64,11 @@ maybe_syscall_settime_cpu (clockid_t clock_id, const struct timespec *tp)
#endif
-#ifdef __ASSUME_POSIX_TIMERS
-/* This means the REALTIME clock is definitely supported in the
- kernel. */
-# define SYSDEP_SETTIME \
+/* The REALTIME clock is definitely supported in the kernel. */
+#define SYSDEP_SETTIME \
case CLOCK_REALTIME: \
retval = INLINE_SYSCALL (clock_settime, 2, clock_id, tp); \
break
-#elif defined __NR_clock_settime
-/* Is the syscall known to exist? */
-extern int __libc_missing_posix_timers attribute_hidden;
-
-/* The REALTIME clock might be available. Try the syscall first. */
-# define SYSDEP_SETTIME \
- case CLOCK_REALTIME: \
- case CLOCK_REALTIME_COARSE: \
- { \
- int e = EINVAL; \
- \
- if (!__libc_missing_posix_timers) \
- { \
- INTERNAL_SYSCALL_DECL (err); \
- int r = INTERNAL_SYSCALL (clock_settime, err, 2, clock_id, tp); \
- if (!INTERNAL_SYSCALL_ERROR_P (r, err)) \
- { \
- retval = 0; \
- break; \
- } \
- \
- e = INTERNAL_SYSCALL_ERRNO (r, err); \
- if (e == ENOSYS) \
- { \
- __libc_missing_posix_timers = 1; \
- e = EINVAL; \
- } \
- } \
- \
- /* Fallback code. */ \
- if (e == EINVAL && clock_id == CLOCK_REALTIME) \
- HANDLE_REALTIME; \
- else \
- { \
- __set_errno (e); \
- retval = -1; \
- } \
- } \
- break
-#endif
#ifdef __NR_clock_settime
/* We handled the REALTIME clock here. */
diff --git a/libc/sysdeps/unix/sysv/linux/configure b/libc/sysdeps/unix/sysv/linux/configure
index 0650067e4..b04f7715f 100644
--- a/libc/sysdeps/unix/sysv/linux/configure
+++ b/libc/sysdeps/unix/sysv/linux/configure
@@ -284,34 +284,34 @@ test -n "$arch_minimum_kernel" ||
case "$machine" in
i386*)
libc_cv_gcc_unwind_find_fde=yes
- arch_minimum_kernel=2.4.21
+ arch_minimum_kernel=2.6.16
;;
powerpc/powerpc32)
libc_cv_gcc_unwind_find_fde=yes
- arch_minimum_kernel=2.4.21
+ arch_minimum_kernel=2.6.16
;;
s390/s390-32)
libc_cv_gcc_unwind_find_fde=yes
- arch_minimum_kernel=2.4.21
+ arch_minimum_kernel=2.6.16
;;
s390/s390-64)
libc_cv_gcc_unwind_find_fde=yes
- arch_minimum_kernel=2.4.21
+ arch_minimum_kernel=2.6.16
;;
sh*)
- arch_minimum_kernel=2.4.21
+ arch_minimum_kernel=2.6.16
libc_cv_gcc_unwind_find_fde=yes
;;
sparc/sparc64*)
libc_cv_gcc_unwind_find_fde=yes
- arch_minimum_kernel=2.4.21
+ arch_minimum_kernel=2.6.16
;;
sparc*)
libc_cv_gcc_unwind_find_fde=yes
- arch_minimum_kernel=2.4.21
+ arch_minimum_kernel=2.6.16
;;
*)
- arch_minimum_kernel=2.4.21
+ arch_minimum_kernel=2.6.16
;;
esac
if test -n "$minimum_kernel"; then
diff --git a/libc/sysdeps/unix/sysv/linux/configure.in b/libc/sysdeps/unix/sysv/linux/configure.in
index fc514fbf4..e55d9fdb0 100644
--- a/libc/sysdeps/unix/sysv/linux/configure.in
+++ b/libc/sysdeps/unix/sysv/linux/configure.in
@@ -41,34 +41,34 @@ test -n "$arch_minimum_kernel" ||
case "$machine" in
i386*)
libc_cv_gcc_unwind_find_fde=yes
- arch_minimum_kernel=2.4.21
+ arch_minimum_kernel=2.6.16
;;
powerpc/powerpc32)
libc_cv_gcc_unwind_find_fde=yes
- arch_minimum_kernel=2.4.21
+ arch_minimum_kernel=2.6.16
;;
s390/s390-32)
libc_cv_gcc_unwind_find_fde=yes
- arch_minimum_kernel=2.4.21
+ arch_minimum_kernel=2.6.16
;;
s390/s390-64)
libc_cv_gcc_unwind_find_fde=yes
- arch_minimum_kernel=2.4.21
+ arch_minimum_kernel=2.6.16
;;
sh*)
- arch_minimum_kernel=2.4.21
+ arch_minimum_kernel=2.6.16
libc_cv_gcc_unwind_find_fde=yes
;;
sparc/sparc64*)
libc_cv_gcc_unwind_find_fde=yes
- arch_minimum_kernel=2.4.21
+ arch_minimum_kernel=2.6.16
;;
sparc*)
libc_cv_gcc_unwind_find_fde=yes
- arch_minimum_kernel=2.4.21
+ arch_minimum_kernel=2.6.16
;;
*)
- arch_minimum_kernel=2.4.21
+ arch_minimum_kernel=2.6.16
;;
esac
if test -n "$minimum_kernel"; then
diff --git a/libc/sysdeps/unix/sysv/linux/dl-execstack.c b/libc/sysdeps/unix/sysv/linux/dl-execstack.c
index 6408adcc9..9aadb9089 100644
--- a/libc/sysdeps/unix/sysv/linux/dl-execstack.c
+++ b/libc/sysdeps/unix/sysv/linux/dl-execstack.c
@@ -1,5 +1,5 @@
/* Stack executability handling for GNU dynamic linker. Linux version.
- Copyright (C) 2003, 2004, 2005, 2006 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
@@ -46,95 +46,11 @@ _dl_make_stack_executable (void **stack_endp)
|| __builtin_expect (*stack_endp != __libc_stack_end, 0))
return EPERM;
- /* Newer Linux kernels support a flag to make our job easy. */
-#if defined PROT_GROWSDOWN || defined PROT_GROWSUP
-# if __ASSUME_PROT_GROWSUPDOWN == 0
- static bool no_growsupdown;
- if (! no_growsupdown)
-# endif
- {
- if (__builtin_expect (__mprotect ((void *) page, GLRO(dl_pagesize),
- __stack_prot) == 0, 1))
- goto return_success;
-# if __ASSUME_PROT_GROWSUPDOWN == 0
- if (errno == EINVAL)
- no_growsupdown = true;
- else
-# endif
- {
- result = errno;
- goto out;
- }
- }
-#endif
-
- /* There is always a hole in the address space below the bottom of the
- stack. So when we make an mprotect call that starts below the bottom
- of the stack, it will include the hole and fail with ENOMEM.
-
- We start with a random guess at how deep the stack might have gotten
- so as to have extended the GROWSDOWN mapping to lower pages. */
-
-#if __ASSUME_PROT_GROWSUPDOWN == 0
- size_t size = GLRO(dl_pagesize) * 8;
-
-# if _STACK_GROWS_DOWN
- page = page + GLRO(dl_pagesize) - size;
- while (1)
- {
- if (__mprotect ((void *) page, size,
- __stack_prot & ~PROT_GROWSDOWN) == 0)
- /* We got this chunk changed; loop to do another chunk below. */
- page -= size;
- else
- {
- if (errno != ENOMEM) /* Unexpected failure mode. */
- {
- result = errno;
- goto out;
- }
-
- if (size == GLRO(dl_pagesize))
- /* We just tried to mprotect the top hole page and failed.
- We are done. */
- break;
-
- /* Our mprotect call failed because it started below the lowest
- stack page. Try again on just the top half of that region. */
- size /= 2;
- page += size;
- }
- }
-
-# elif _STACK_GROWS_UP
- while (1)
- {
- if (__mprotect ((void *) page, size, __stack_prot & ~PROT_GROWSUP) == 0)
- /* We got this chunk changed; loop to do another chunk below. */
- page += size;
- else
- {
- if (errno != ENOMEM) /* Unexpected failure mode. */
- {
- result = errno;
- goto out;
- }
-
- if (size == GLRO(dl_pagesize))
- /* We just tried to mprotect the lowest hole page and failed.
- We are done. */
- break;
-
- /* Our mprotect call failed because it extended past the highest
- stack page. Try again on just the bottom half of that region. */
- size /= 2;
- }
- }
-
-# else
-# error "Define either _STACK_GROWS_DOWN or _STACK_GROWS_UP"
-# endif
-#endif
+ if (__builtin_expect (__mprotect ((void *) page, GLRO(dl_pagesize),
+ __stack_prot) == 0, 1))
+ goto return_success;
+ result = errno;
+ goto out;
return_success:
/* Clear the address. */
diff --git a/libc/sysdeps/unix/sysv/linux/dl-sysdep.c b/libc/sysdeps/unix/sysv/linux/dl-sysdep.c
index 42c63d2df..da3686a36 100644
--- a/libc/sysdeps/unix/sysv/linux/dl-sysdep.c
+++ b/libc/sysdeps/unix/sysv/linux/dl-sysdep.c
@@ -1,5 +1,5 @@
/* Dynamic linker system dependencies for Linux.
- Copyright (C) 1995,1997,2001,2004,2005,2006, 2008 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
@@ -33,27 +33,6 @@ static inline void
frob_brk (void)
{
__brk (0); /* Initialize the break. */
-
-#if ! __ASSUME_BRK_PAGE_ROUNDED
- /* If the dynamic linker was executed as a program, then the break may
- start immediately after our data segment. However, dl-minimal.c has
- already stolen the remainder of the page for internal allocations.
- If we don't adjust the break location recorded by the kernel, the
- normal program startup will inquire, find the value at our &_end,
- and start allocating its own data there, clobbering dynamic linker
- data structures allocated there during startup.
-
- Later Linux kernels have changed this behavior so that the initial
- break value is rounded up to the page boundary before we start. */
-
- extern char *__curbrk attribute_hidden;
- extern char _end[] attribute_hidden;
- char *const endpage = (void *) 0 + (((__curbrk - (char *) 0)
- + GLRO(dl_pagesize) - 1)
- & -GLRO(dl_pagesize));
- if (__builtin_expect (__curbrk >= _end && __curbrk < endpage, 0))
- __brk (endpage);
-#endif
}
# include <elf/dl-sysdep.c>
diff --git a/libc/sysdeps/unix/sysv/linux/getdents.c b/libc/sysdeps/unix/sysv/linux/getdents.c
index ac4979efb..babfbd0a4 100644
--- a/libc/sysdeps/unix/sysv/linux/getdents.c
+++ b/libc/sysdeps/unix/sysv/linux/getdents.c
@@ -97,7 +97,6 @@ __GETDENTS (int fd, char *buf, size_t nbytes)
{
ssize_t retval;
-#ifdef __ASSUME_GETDENTS32_D_TYPE
/* The d_ino and d_off fields in kernel_dirent and dirent must have
the same sizes and alignments. */
if (sizeof (DIRENT_TYPE) == sizeof (struct dirent)
@@ -135,7 +134,6 @@ __GETDENTS (int fd, char *buf, size_t nbytes)
return retval;
}
-#endif
off64_t last_offset = -1;
@@ -293,11 +291,7 @@ __GETDENTS (int fd, char *buf, size_t nbytes)
DIRENT_SET_DP_INO(dp, kdp->d_ino);
dp->d_off = kdp->d_off;
dp->d_reclen = new_reclen;
-#ifdef __ASSUME_GETDENTS32_D_TYPE
dp->d_type = *((char *) kdp + kdp->d_reclen - 1);
-#else
- dp->d_type = DT_UNKNOWN;
-#endif
memcpy (dp->d_name, kdp->d_name,
kdp->d_reclen - offsetof (struct kernel_dirent, d_name));
diff --git a/libc/sysdeps/unix/sysv/linux/i386/fcntl.c b/libc/sysdeps/unix/sysv/linux/i386/fcntl.c
index c68a06b45..a0f25449e 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/fcntl.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/fcntl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000,2002-2004,2006,2009,2010 Free Software Foundation, Inc.
+/* Copyright (C) 2000-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,25 +22,8 @@
#include <stdarg.h>
#include <sys/syscall.h>
-#include <kernel-features.h>
-#ifndef __ASSUME_FCNTL64
-/* This variable is shared with all files that check for fcntl64. */
-int __have_no_fcntl64;
-#endif
-
-#ifdef __ASSUME_F_GETOWN_EX
-# define miss_F_GETOWN_EX 0
-#elif !defined __ASSUME_FCNTL64
-static int miss_F_GETOWN_EX;
-#endif
-
-
-#if defined NO_CANCELLATION && !defined __ASSUME_FCNTL64
-# define __fcntl_nocancel __libc_fcntl
-#endif
-
-#if !defined NO_CANCELLATION || !defined __ASSUME_FCNTL64
+#ifndef NO_CANCELLATION
int
__fcntl_nocancel (int fd, int cmd, ...)
{
@@ -51,112 +34,11 @@ __fcntl_nocancel (int fd, int cmd, ...)
arg = va_arg (ap, void *);
va_end (ap);
-#ifndef __ASSUME_FCNTL64
-# ifdef __NR_fcntl64
- if (! __have_no_fcntl64)
- {
- int result = INLINE_SYSCALL (fcntl64, 3, fd, cmd, arg);
- if (result >= 0 || errno != ENOSYS)
- return result;
-
- __have_no_fcntl64 = 1;
- }
-# endif
- switch (cmd)
- {
- case F_GETLK64:
- /* Convert arg from flock64 to flock and back. */
- {
- struct flock fl;
- struct flock64 *fl64 = arg;
- int res;
-
- fl.l_start = (off_t)fl64->l_start;
- /* Check if we can represent the values with the smaller type. */
- if ((off64_t) fl.l_start != fl64->l_start)
- {
- eoverflow:
- __set_errno (EOVERFLOW);
- return -1;
- }
- fl.l_len = (off_t) fl64->l_len;
- /* Check if we can represent the values with the smaller type. */
- if ((off64_t) fl.l_len != fl64->l_len)
- goto eoverflow;
-
- fl.l_type = fl64->l_type;
- fl.l_whence = fl64->l_whence;
- fl.l_pid = fl64->l_pid;
-
- res = INLINE_SYSCALL (fcntl, 3, fd, F_GETLK, &fl);
- if (res != 0)
- return res;
- /* Everything ok, convert back. */
- fl64->l_type = fl.l_type;
- fl64->l_whence = fl.l_whence;
- fl64->l_start = fl.l_start;
- fl64->l_len = fl.l_len;
- fl64->l_pid = fl.l_pid;
-
- return 0;
- }
- case F_SETLK64:
- case F_SETLKW64:
- /* Try to convert arg from flock64 to flock. */
- {
- struct flock fl;
- struct flock64 *fl64 = arg;
-
- fl.l_start = (off_t) fl64->l_start;
- /* Check if we can represent the values with the smaller type. */
- if ((off64_t) fl.l_start != fl64->l_start)
- goto eoverflow;
-
- fl.l_len = (off_t)fl64->l_len;
- /* Check if we can represent the values with the smaller type. */
- if ((off64_t) fl.l_len != fl64->l_len)
- {
- __set_errno (EOVERFLOW);
- return -1;
- }
- fl.l_type = fl64->l_type;
- fl.l_whence = fl64->l_whence;
- fl.l_pid = fl64->l_pid;
- assert (F_SETLK - F_SETLKW == F_SETLK64 - F_SETLKW64);
- return INLINE_SYSCALL (fcntl, 3, fd, cmd + F_SETLK - F_SETLK64, &fl);
- }
- case F_GETOWN:
- if (! miss_F_GETOWN_EX)
- {
- INTERNAL_SYSCALL_DECL (err);
- struct f_owner_ex fex;
- int res = INTERNAL_SYSCALL (fcntl, err, 3, fd, F_GETOWN_EX, &fex);
- if (!INTERNAL_SYSCALL_ERROR_P (res, err))
- return fex.type == F_OWNER_GID ? -fex.pid : fex.pid;
-
-# ifndef __ASSUME_F_GETOWN_EX
- if (INTERNAL_SYSCALL_ERRNO (res, err) == EINVAL)
- miss_F_GETOWN_EX = 1;
- else
-# endif
- {
- __set_errno (INTERNAL_SYSCALL_ERRNO (res, err));
- return -1;
- }
- }
- /* FALLTHROUGH */
- default:
- return INLINE_SYSCALL (fcntl, 3, fd, cmd, arg);
- }
- return -1;
-#else
return INLINE_SYSCALL (fcntl64, 3, fd, cmd, arg);
-#endif /* !__ASSUME_FCNTL64 */
}
-#endif /* NO_CANCELLATION || !__ASSUME_FCNTL64 */
+#endif /* NO_CANCELLATION */
-#ifndef __fcntl_nocancel
int
__libc_fcntl (int fd, int cmd, ...)
{
@@ -167,27 +49,17 @@ __libc_fcntl (int fd, int cmd, ...)
arg = va_arg (ap, void *);
va_end (ap);
-# ifdef __ASSUME_FCNTL64
if (SINGLE_THREAD_P || (cmd != F_SETLKW && cmd != F_SETLKW64))
return INLINE_SYSCALL (fcntl64, 3, fd, cmd, arg);
int oldtype = LIBC_CANCEL_ASYNC ();
int result = INLINE_SYSCALL (fcntl64, 3, fd, cmd, arg);
-# else
- if (SINGLE_THREAD_P || (cmd != F_SETLKW && cmd != F_SETLKW64))
- return __fcntl_nocancel (fd, cmd, arg);
-
- int oldtype = LIBC_CANCEL_ASYNC ();
-
- int result = __fcntl_nocancel (fd, cmd, arg);
-# endif
LIBC_CANCEL_RESET (oldtype);
return result;
}
-#endif
libc_hidden_def (__libc_fcntl)
weak_alias (__libc_fcntl, __fcntl)
diff --git a/libc/sysdeps/unix/sysv/linux/i386/lockf64.c b/libc/sysdeps/unix/sysv/linux/i386/lockf64.c
index 6e7603e52..1caf9778e 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/lockf64.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/lockf64.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1994,1996,1997,1998,1999,2000,2003,2006
- Free Software Foundation, Inc.
+/* Copyright (C) 1994-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,66 +22,24 @@
#include <string.h>
#include <sysdep.h>
-#include <kernel-features.h>
-
/* lockf is a simplified interface to fcntl's locking facilities. */
-#ifdef __NR_fcntl64
-# if __ASSUME_FCNTL64 == 0
-/* This variable is shared with all files that check for fcntl64. The
- declaration is in fcntl.c. */
-extern int __have_no_fcntl64;
-# endif
-#endif
-
int
lockf64 (int fd, int cmd, off64_t len64)
{
-#if __ASSUME_FCNTL64 == 0
- struct flock fl;
- off_t len = (off_t) len64;
-#endif
-#ifdef __NR_fcntl64
struct flock64 fl64;
int cmd64;
-#endif
-
-#if __ASSUME_FCNTL64 == 0
- memset ((char *) &fl, '\0', sizeof (fl));
- /* lockf is always relative to the current file position. */
- fl.l_whence = SEEK_CUR;
- fl.l_start = 0;
- fl.l_len = len;
-#endif
-#ifdef __NR_fcntl64
-# if __ASSUME_FCNTL64 == 0
- if (!__have_no_fcntl64)
- {
-# endif
- memset ((char *) &fl64, '\0', sizeof (fl64));
- fl64.l_whence = SEEK_CUR;
- fl64.l_start = 0;
- fl64.l_len = len64;
-# if __ASSUME_FCNTL64 == 0
- }
-# endif
-#endif
+ memset ((char *) &fl64, '\0', sizeof (fl64));
+ fl64.l_whence = SEEK_CUR;
+ fl64.l_start = 0;
+ fl64.l_len = len64;
-#if __ASSUME_FCNTL64 == 0 && !defined __NR_fcntl64
- if (len64 != (off64_t) len)
- {
- /* We can't represent the length. */
- __set_errno (EOVERFLOW);
- return -1;
- }
-#endif
switch (cmd)
{
case F_TEST:
/* Test the lock: return 0 if FD is unlocked or locked by this process;
return -1, set errno to EACCES, if another process holds the lock. */
-#if __ASSUME_FCNTL64 > 0
fl64.l_type = F_RDLCK;
if (INLINE_SYSCALL (fcntl64, 3, fd, F_GETLK64, &fl64) < 0)
return -1;
@@ -90,104 +47,22 @@ lockf64 (int fd, int cmd, off64_t len64)
return 0;
__set_errno (EACCES);
return -1;
-#else
-# ifdef __NR_fcntl64
- if (!__have_no_fcntl64)
- {
- int res;
-
- fl64.l_type = F_RDLCK;
- res = INLINE_SYSCALL (fcntl64, 3, fd, F_GETLK64, &fl64);
- /* If errno == ENOSYS try the 32bit interface if len64 can
- be represented with 32 bits. */
-
- if (res == 0)
- {
- if (fl64.l_type == F_UNLCK || fl64.l_pid == __getpid ())
- return 0;
- __set_errno (EACCES);
- return -1;
- }
- else if (errno == ENOSYS)
- __have_no_fcntl64 = 1;
- else
- /* res < 0 && errno != ENOSYS. */
- return -1;
- if (len64 != (off64_t) len)
- {
- /* We can't represent the length. */
- __set_errno (EOVERFLOW);
- return -1;
- }
- }
-# endif
- fl.l_type = F_RDLCK;
- if (__fcntl (fd, F_GETLK, &fl) < 0)
- return -1;
- if (fl.l_type == F_UNLCK || fl.l_pid == __getpid ())
- return 0;
- __set_errno (EACCES);
- return -1;
-#endif
case F_ULOCK:
-#if __ASSUME_FCNTL64 == 0
- fl.l_type = F_UNLCK;
- cmd = F_SETLK;
-#endif
-#ifdef __NR_fcntl64
fl64.l_type = F_UNLCK;
cmd64 = F_SETLK64;
-#endif
break;
case F_LOCK:
-#if __ASSUME_FCNTL64 == 0
- fl.l_type = F_WRLCK;
- cmd = F_SETLKW;
-#endif
-#ifdef __NR_fcntl64
fl64.l_type = F_WRLCK;
cmd64 = F_SETLKW64;
-#endif
break;
case F_TLOCK:
-#if __ASSUME_FCNTL64 == 0
- fl.l_type = F_WRLCK;
- cmd = F_SETLK;
-#endif
-#ifdef __NR_fcntl64
fl64.l_type = F_WRLCK;
cmd64 = F_SETLK64;
-#endif
break;
default:
__set_errno (EINVAL);
return -1;
}
-#if __ASSUME_FCNTL64 > 0
return INLINE_SYSCALL (fcntl64, 3, fd, cmd64, &fl64);
-#else
-# ifdef __NR_fcntl64
-
- if (!__have_no_fcntl64)
- {
- int res = INLINE_SYSCALL (fcntl64, 3, fd, cmd64, &fl64);
-
- /* If errno == ENOSYS try the 32bit interface if len64 can
- be represented with 32 bits. */
- if (res == 0 || errno != ENOSYS)
- return res;
-
- __have_no_fcntl64 = 1;
-
- if (len64 != (off64_t) len)
- {
- /* We can't represent the length. */
- __set_errno (EOVERFLOW);
- return -1;
- }
- }
-# endif
- return __fcntl (fd, cmd, &fl);
-#endif
}
diff --git a/libc/sysdeps/unix/sysv/linux/i386/readdir64.c b/libc/sysdeps/unix/sysv/linux/i386/readdir64.c
index 570c74161..2023fa5c5 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/readdir64.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/readdir64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2000-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,7 +19,7 @@
#define __GETDENTS __getdents64
#define DIRENT_TYPE struct dirent64
-#include <sysdeps/unix/readdir.c>
+#include <sysdeps/posix/readdir.c>
#include <shlib-compat.h>
@@ -37,7 +37,7 @@ versioned_symbol (libc, __readdir64, readdir64, GLIBC_2_2);
#define __GETDENTS __old_getdents64
#define DIRENT_TYPE struct __old_dirent64
-#include <sysdeps/unix/readdir.c>
+#include <sysdeps/posix/readdir.c>
compat_symbol (libc, __old_readdir64, readdir64, GLIBC_2_1);
#endif
diff --git a/libc/sysdeps/unix/sysv/linux/i386/readdir64_r.c b/libc/sysdeps/unix/sysv/linux/i386/readdir64_r.c
index 3b3116c01..8471f03dc 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/readdir64_r.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/readdir64_r.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2004, 2010 Free Software Foundation, Inc.
+/* Copyright (C) 2000-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,7 +20,7 @@
#define DIRENT_TYPE struct dirent64
#define GETDENTS_64BIT_ALIGNED 1
-#include <sysdeps/unix/readdir_r.c>
+#include <sysdeps/posix/readdir_r.c>
#undef __READDIR_R
#undef __GETDENTS
@@ -38,7 +38,7 @@ versioned_symbol (libc, __readdir64_r, readdir64_r, GLIBC_2_2);
#define __GETDENTS __old_getdents64
#define DIRENT_TYPE struct __old_dirent64
-#include <sysdeps/unix/readdir_r.c>
+#include <sysdeps/posix/readdir_r.c>
compat_symbol (libc, __old_readdir64_r, readdir64_r, GLIBC_2_1);
#endif
diff --git a/libc/sysdeps/unix/sysv/linux/i386/vfork.S b/libc/sysdeps/unix/sysv/linux/i386/vfork.S
index a8a7e4567..11c530de5 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/vfork.S
+++ b/libc/sysdeps/unix/sysv/linux/i386/vfork.S
@@ -28,8 +28,6 @@
ENTRY (__vfork)
-#ifdef __NR_vfork
-
/* Pop the return PC value into ECX. */
popl %ecx
cfi_adjust_cfa_offset (-4)
@@ -55,31 +53,10 @@ ENTRY (__vfork)
cmpl $-4095, %eax
/* Branch forward if it failed. */
-# ifdef __ASSUME_VFORK_SYSCALL
jae SYSCALL_ERROR_LABEL
-# else
- jae .Lerror
-# endif
ret
-# ifndef __ASSUME_VFORK_SYSCALL
-.Lerror:
- /* Check if vfork syscall is known at all. */
- cmpl $-ENOSYS, %eax
- jne SYSCALL_ERROR_LABEL
-# endif
-#endif
-
-#ifndef __ASSUME_VFORK_SYSCALL
- /* If we don't have vfork, fork is close enough. */
-
- movl $SYS_ify (fork), %eax
- int $0x80
- cmpl $-4095, %eax
- jae SYSCALL_ERROR_LABEL
- ret
-#endif
PSEUDO_END (__vfork)
libc_hidden_def (__vfork)
diff --git a/libc/sysdeps/unix/sysv/linux/kernel-features.h b/libc/sysdeps/unix/sysv/linux/kernel-features.h
index cfe335d0b..6b0eb95c5 100644
--- a/libc/sysdeps/unix/sysv/linux/kernel-features.h
+++ b/libc/sysdeps/unix/sysv/linux/kernel-features.h
@@ -82,187 +82,53 @@
# define __ASSUME_ST_INO_64_BIT 1
#endif
-/* To support locking of large files a new fcntl() syscall was introduced
- in 2.4.0-test7. */
-#if defined __i386__ || defined __sparc__
-# define __ASSUME_FCNTL64 1
-#endif
-
-/* Arm got fcntl64 in 2.4.4, PowerPC and SH have it also in 2.4.4 (I
- don't know when it got introduced). But PowerPC64 does not support
- separate FCNTL64 call, FCNTL is already 64-bit */
-#if (defined __powerpc__ || defined __sh__) \
- && !defined __powerpc64__
-# define __ASSUME_FCNTL64 1
-#endif
-
/* The getdents64 syscall was introduced in 2.4.0-test7 (but later for
MIPS n32). */
#define __ASSUME_GETDENTS64_SYSCALL 1
-/* Starting with 2.4.5 kernels the vfork syscall made it into the
- official kernel for PPC. */
-#ifdef __powerpc__
-# define __ASSUME_VFORK_SYSCALL 1
-#endif
-
/* Starting with 2.4.5 kernels the mmap2 syscall made it into the official
kernel. But PowerPC64 does not support a separate MMAP2 call. */
#if defined __powerpc__ && !defined __powerpc64__
# define __ASSUME_MMAP2_SYSCALL 1
#endif
-/* On x86, the set_thread_area syscall was introduced in 2.5.29, but its
- semantics was changed in 2.5.30, and again after 2.5.31. */
-#if __LINUX_KERNEL_VERSION >= 132384 && defined __i386__
-# define __ASSUME_SET_THREAD_AREA_SYSCALL 1
-#endif
-
-/* The vfork syscall on x86 and arm was definitely available in 2.4. */
-#ifdef __i386__
-# define __ASSUME_VFORK_SYSCALL 1
-#endif
-
-/* The late 2.5 kernels saw a lot of new CLONE_* flags. Summarize
- their availability with one define. The changes were made first
- for i386 and the have to be done separately for the other archs.
- For i386 we pick 2.5.50 as the first version with support.
- For s390*, SPARC, PPC, x86-64, and SH we pick 2.5.64 as the first
- version with support. */
-#if ((__LINUX_KERNEL_VERSION >= 132402 && defined __i386__) \
- || (__LINUX_KERNEL_VERSION >= 132416 \
- && (defined __s390__ || defined __sparc__ \
- || defined __powerpc__ || defined __x86_64__ || defined __sh__)))
-# define __ASSUME_CLONE_THREAD_FLAGS 1
-#endif
-
-/* Beginning with 2.5.63 support for realtime and monotonic clocks and
- timers based on them is available. */
-#if __LINUX_KERNEL_VERSION >= 132415
-# define __ASSUME_POSIX_TIMERS 1
-#endif
-
/* Beginning with 2.6.12 the clock and timer supports CPU clocks. */
-#if __LINUX_KERNEL_VERSION >= 0x2060c
-# define __ASSUME_POSIX_CPU_TIMERS 1
-#endif
-
-/* The requeue futex functionality was introduced in 2.5.70. */
-#if __LINUX_KERNEL_VERSION >= 132422
-# define __ASSUME_FUTEX_REQUEUE 1
-#endif
-
-/* The statfs64 syscalls are available in 2.5.74. */
-#if __LINUX_KERNEL_VERSION >= 132426
-# define __ASSUME_STATFS64 1
-#endif
-
-/* Starting with at least 2.5.74 the kernel passes the setuid-like exec
- flag unconditionally up to the child. */
-#if __LINUX_KERNEL_VERSION >= 132426
-# define __ASSUME_AT_SECURE 1
-#endif
-
-/* Starting with the 2.5.75 kernel the kernel fills in the correct value
- in the si_pid field passed as part of the siginfo_t struct to signal
- handlers. */
-#if __LINUX_KERNEL_VERSION >= 132427
-# define __ASSUME_CORRECT_SI_PID 1
-#endif
+#define __ASSUME_POSIX_CPU_TIMERS 1
-/* The tgkill syscall was instroduced for i386 in 2.5.75. On x86-64,
- sparc, SH, ppc, and ppc64 it was introduced in 2.6.0-test3. */
-#if (__LINUX_KERNEL_VERSION >= 132427 && defined __i386__) \
- || (__LINUX_KERNEL_VERSION >= 132609 \
- && (defined __x86_64__ || defined __powerpc__ \
- || defined __sh__ || defined __sparc__))
-# define __ASSUME_TGKILL 1
-#endif
+/* The statfs64 syscalls are available in 2.5.74 (but not for alpha). */
+#define __ASSUME_STATFS64 1
/* The utimes syscall has been available for some architectures
forever. For x86 it was introduced after 2.5.75, for x86-64,
ppc, and ppc64 it was introduced in 2.6.0-test3. */
#if defined __sparc__ \
- || (__LINUX_KERNEL_VERSION > 132427 && defined __i386__) \
- || (__LINUX_KERNEL_VERSION > 132609 && defined __x86_64__) \
- || (__LINUX_KERNEL_VERSION >= 132609 && defined __powerpc__) \
- || (__LINUX_KERNEL_VERSION >= 132609 && defined __sh__)
+ || defined __i386__ \
+ || defined __x86_64__ \
+ || defined __powerpc__ \
+ || defined __sh__
# define __ASSUME_UTIMES 1
#endif
-// XXX Disabled for now since the semantics we want is not achieved.
-#if 0
-/* The CLONE_STOPPED flag was introduced in the 2.6.0-test1 series. */
-#if __LINUX_KERNEL_VERSION >= 132609
-# define __ASSUME_CLONE_STOPPED 1
-#endif
-#endif
-
/* The fixed version of the posix_fadvise64 syscall appeared in
2.6.0-test3. At least for x86 and sparc. Powerpc support appeared
in 2.6.2, but for 32-bit userspace only. */
-#if (__LINUX_KERNEL_VERSION >= 132609 \
- && (defined __i386__ || defined __sparc__)) \
- || (__LINUX_KERNEL_VERSION >= 132610 && defined __powerpc__ \
- && !defined __powerpc64__)
+#if (defined __i386__ || defined __sparc__ \
+ || (defined __powerpc__ && !defined __powerpc64__))
# define __ASSUME_FADVISE64_64_SYSCALL 1
#endif
-/* The PROT_GROWSDOWN/PROT_GROWSUP flags were introduced in the 2.6.0-test
- series. */
-#if __LINUX_KERNEL_VERSION >= 132609
-# define __ASSUME_PROT_GROWSUPDOWN 1
-#endif
-
/* Starting with 2.6.0 PowerPC adds signal/swapcontext support for Vector
SIMD (AKA Altivec, VMX) instructions and register state. This changes
the overall size of the sigcontext and adds the swapcontext syscall. */
-#if __LINUX_KERNEL_VERSION >= 132608 && defined __powerpc__
+#ifdef __powerpc__
# define __ASSUME_SWAPCONTEXT_SYSCALL 1
#endif
-/* The CLONE_DETACHED flag is not necessary in 2.6.2 kernels, it is
- implied. */
-#if __LINUX_KERNEL_VERSION >= 132610
-# define __ASSUME_NO_CLONE_DETACHED 1
-#endif
-
-/* Starting with version 2.6.4-rc1 the getdents syscall returns d_type
- information as well and in between 2.6.5 and 2.6.8 most compat wrappers
- were fixed too. Except s390{,x} which was fixed in 2.6.11. */
-#if (__LINUX_KERNEL_VERSION >= 0x020608 && !defined __s390__) \
- || (__LINUX_KERNEL_VERSION >= 0x02060b && defined __s390__)
-# define __ASSUME_GETDENTS32_D_TYPE 1
-#endif
-
-/* Starting with version 2.5.3, the initial location returned by `brk'
- after exec is always rounded up to the next page. */
-#if __LINUX_KERNEL_VERSION >= 132355
-# define __ASSUME_BRK_PAGE_ROUNDED 1
-#endif
-
-/* Starting with version 2.6.9, the waitid system call is available.
- Except for powerpc{,64} and s390{,x}, where it is available in 2.6.12. */
-#if (__LINUX_KERNEL_VERSION >= 0x020609 \
- && !defined __powerpc__ && !defined __s390__) \
- || (__LINUX_KERNEL_VERSION >= 0x02060c \
- && (defined __powerpc__ || defined __s390__))
-# define __ASSUME_WAITID_SYSCALL 1
-#endif
-
/* On sparc64 stat64/lstat64/fstat64 syscalls were introduced in 2.6.12. */
-#if __LINUX_KERNEL_VERSION >= 0x02060c && defined __sparc__ \
- && defined __arch64__
+#if defined __sparc__ && defined __arch64__
# define __ASSUME_STAT64_SYSCALL 1
#endif
-/* Early kernel used "shm" as the filesystem name for the filesystem used
- for shm_open etc. Later it is "tmpfs". 2.4.20 is a safe bet for the
- cutover. */
-#if __LINUX_KERNEL_VERSION >= 0x02041a
-# define __ASSUME_TMPFS_NAME 1
-#endif
-
/* pselect/ppoll were introduced just after 2.6.16-rc1. Due to the way
the kernel versions are advertised we can only rely on 2.6.17 to have
the code. On x86_64 and SH this appeared first in 2.6.19-rc1,
@@ -329,6 +195,13 @@
# define __ASSUME_O_CLOEXEC 1
#endif
+/* From 2.6.23 onwards the value of ARG_MAX depends on the stack
+ size. */
+#define __LINUX_ARG_MAX_STACK_BASED_MIN_KERNEL 0x020617
+#if __LINUX_KERNEL_VERSION >= __LINUX_ARG_MAX_STACK_BASED_MIN_KERNEL
+# define __ASSUME_ARG_MAX_STACK_BASED 1
+#endif
+
/* Support for ADJ_OFFSET_SS_READ was added in 2.6.24. */
#if __LINUX_KERNEL_VERSION >= 0x020618
# define __ASSUME_ADJ_OFFSET_SS_READ 1
diff --git a/libc/sysdeps/unix/sysv/linux/ldsodefs.h b/libc/sysdeps/unix/sysv/linux/ldsodefs.h
index 50f3e2b64..cf7ace7a9 100644
--- a/libc/sysdeps/unix/sysv/linux/ldsodefs.h
+++ b/libc/sysdeps/unix/sysv/linux/ldsodefs.h
@@ -41,9 +41,7 @@ extern void _dl_non_dynamic_init (void) internal_function;
/* We can assume that the kernel always provides the AT_SECURE value
in the auxiliary vector from 2.5.74 or so on. */
-#if __ASSUME_AT_SECURE
-# define HAVE_AUX_SECURE
-#endif
+#define HAVE_AUX_SECURE
/* Starting with one of the 2.4.0 pre-releases the Linux kernel passes
up the page size information. */
diff --git a/libc/sysdeps/unix/sysv/linux/opendir.c b/libc/sysdeps/unix/sysv/linux/opendir.c
index b0bb80d39..614cba101 100644
--- a/libc/sysdeps/unix/sysv/linux/opendir.c
+++ b/libc/sysdeps/unix/sysv/linux/opendir.c
@@ -17,4 +17,4 @@
#define O_DIRECTORY_WORKS 1
-#include <sysdeps/unix/opendir.c>
+#include <sysdeps/posix/opendir.c>
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/getrlimit.c b/libc/sysdeps/unix/sysv/linux/powerpc/getrlimit.c
deleted file mode 100644
index fc06dbd64..000000000
--- a/libc/sysdeps/unix/sysv/linux/powerpc/getrlimit.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/getrlimit.c>
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S
index 6625e207a..ca20f7beb 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 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
@@ -26,32 +26,8 @@
and the process ID of the new process to the old process. */
ENTRY (__vfork)
-
-#ifdef __NR_vfork
-
DO_CALL (SYS_ify (vfork))
-
-# ifdef __ASSUME_VFORK_SYSCALL
PSEUDO_RET
-# else
- bnslr+
- /* Check if vfork syscall is known at all. */
- cmpwi r3,ENOSYS
- bne- .Lsyscall_error
-
-# endif
-#endif
-
-#ifndef __ASSUME_VFORK_SYSCALL
- /* If we don't have vfork, fork is close enough. */
-
- DO_CALL (SYS_ify (fork))
- bnslr+
-
-.Lsyscall_error:
- b __syscall_error@local
-#endif
-
PSEUDO_END (__vfork)
libc_hidden_def (__vfork)
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h
index 0f4fe5334..9b0693a19 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h
@@ -58,8 +58,6 @@
/* This seems to always be the case on PPC. */
# 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
#endif /* __ASSEMBLER__ */
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S
index 7baefd0c1..3ce38be88 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 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
@@ -27,29 +27,8 @@
ENTRY (__vfork)
CALL_MCOUNT 0
-
-#ifdef __NR_vfork
-
DO_CALL (SYS_ify (vfork))
-
-# ifdef __ASSUME_VFORK_SYSCALL
- PSEUDO_RET
-# else
- bnslr+
- /* Check if vfork syscall is known at all. */
- cmpdi r3,ENOSYS
- bne .Local_syscall_error
-
-# endif
-#endif
-
-#ifndef __ASSUME_VFORK_SYSCALL
- /* If we don't have vfork, fork is close enough. */
-
- DO_CALL (SYS_ify (fork))
PSEUDO_RET
-#endif
-
PSEUDO_END (__vfork)
libc_hidden_def (__vfork)
diff --git a/libc/sysdeps/unix/sysv/linux/readdir64.c b/libc/sysdeps/unix/sysv/linux/readdir64.c
index e2c500239..224f53db8 100644
--- a/libc/sysdeps/unix/sysv/linux/readdir64.c
+++ b/libc/sysdeps/unix/sysv/linux/readdir64.c
@@ -2,6 +2,6 @@
#define __GETDENTS __getdents64
#define DIRENT_TYPE struct dirent64
-#include <sysdeps/unix/readdir.c>
+#include <sysdeps/posix/readdir.c>
weak_alias (__readdir64, readdir64)
diff --git a/libc/sysdeps/unix/sysv/linux/readdir64_r.c b/libc/sysdeps/unix/sysv/linux/readdir64_r.c
index bce56124e..3dfbf4fd2 100644
--- a/libc/sysdeps/unix/sysv/linux/readdir64_r.c
+++ b/libc/sysdeps/unix/sysv/linux/readdir64_r.c
@@ -2,6 +2,6 @@
#define __GETDENTS __getdents64
#define DIRENT_TYPE struct dirent64
-#include <sysdeps/unix/readdir_r.c>
+#include <sysdeps/posix/readdir_r.c>
weak_alias (__readdir64_r, readdir64_r)
diff --git a/libc/sysdeps/unix/sysv/linux/s390/bits/typesizes.h b/libc/sysdeps/unix/sysv/linux/s390/bits/typesizes.h
index def84cc79..b63048840 100644
--- a/libc/sysdeps/unix/sysv/linux/s390/bits/typesizes.h
+++ b/libc/sysdeps/unix/sysv/linux/s390/bits/typesizes.h
@@ -67,6 +67,16 @@
#define __SYSCALL_SLONG_TYPE __SLONGWORD_TYPE
#define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE
+#ifdef __s390x__
+/* 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/sysdeps/unix/sysv/linux/s390/system.c b/libc/sysdeps/unix/sysv/linux/s390/system.c
index f63584c26..66f96617e 100644
--- a/libc/sysdeps/unix/sysv/linux/s390/system.c
+++ b/libc/sysdeps/unix/sysv/linux/s390/system.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 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
@@ -25,9 +25,7 @@
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 (clone, 3, 0, CLONE_PARENT_SETTID | SIGCHLD, &pid)
-#endif
#include "../system.c"
diff --git a/libc/sysdeps/unix/sysv/linux/sh/getrlimit.c b/libc/sysdeps/unix/sysv/linux/sh/getrlimit.c
deleted file mode 100644
index fc06dbd64..000000000
--- a/libc/sysdeps/unix/sysv/linux/sh/getrlimit.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/getrlimit.c>
diff --git a/libc/sysdeps/unix/sysv/linux/shm_open.c b/libc/sysdeps/unix/sysv/linux/shm_open.c
index 763b08746..82332a30e 100644
--- a/libc/sysdeps/unix/sysv/linux/shm_open.c
+++ b/libc/sysdeps/unix/sysv/linux/shm_open.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2004,2006,2007 Free Software Foundation, Inc.
+/* Copyright (C) 2000-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
@@ -86,11 +86,7 @@ where_is_shmfs (void)
while ((mp = __getmntent_r (fp, &resmem, buf, sizeof buf)) != NULL)
/* The original name is "shm" but this got changed in early Linux
2.4.x to "tmpfs". */
- if (strcmp (mp->mnt_type, "tmpfs") == 0
-#ifndef __ASSUME_TMPFS_NAME
- || strcmp (mp->mnt_type, "shm") == 0
-#endif
- )
+ if (strcmp (mp->mnt_type, "tmpfs") == 0)
{
/* Found it. There might be more than one place where the
filesystem is mounted but one is enough for us. */
diff --git a/libc/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h b/libc/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h
index b65a1a5cd..e55d642e7 100644
--- a/libc/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h
+++ b/libc/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h
@@ -61,6 +61,16 @@
#define __SYSCALL_SLONG_TYPE __SLONGWORD_TYPE
#define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE
+#if defined __arch64__ || defined __sparcv9
+/* 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/sysdeps/unix/sysv/linux/sparc/system.c b/libc/sysdeps/unix/sysv/linux/sparc/system.c
index 314909199..a5e34dcdd 100644
--- a/libc/sysdeps/unix/sysv/linux/sparc/system.c
+++ b/libc/sysdeps/unix/sysv/linux/sparc/system.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 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
@@ -25,9 +25,7 @@
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_CLONE_SYSCALL (CLONE_PARENT_SETTID | SIGCHLD, 0, &pid, NULL, NULL)
-#endif
#include "../system.c"
diff --git a/libc/sysdeps/unix/sysv/linux/sys/fsuid.h b/libc/sysdeps/unix/sysv/linux/sys/fsuid.h
index 2fd512e74..4494baf98 100644
--- a/libc/sysdeps/unix/sysv/linux/sys/fsuid.h
+++ b/libc/sysdeps/unix/sysv/linux/sys/fsuid.h
@@ -25,10 +25,10 @@ __BEGIN_DECLS
/* Change uid used for file access control to UID, without affecting
other privileges (such as who can send signals at the process). */
-extern int setfsuid (__uid_t __uid) __THROW;
+extern int setfsuid (__uid_t __uid) __THROW __wur;
/* Ditto for group id. */
-extern int setfsgid (__gid_t __gid) __THROW;
+extern int setfsgid (__gid_t __gid) __THROW __wur;
__END_DECLS
diff --git a/libc/sysdeps/unix/sysv/linux/syscalls.list b/libc/sysdeps/unix/sysv/linux/syscalls.list
index 9ec0028e6..63432725d 100644
--- a/libc/sysdeps/unix/sysv/linux/syscalls.list
+++ b/libc/sysdeps/unix/sysv/linux/syscalls.list
@@ -25,6 +25,7 @@ getpmsg - getpmsg i:ipppp getpmsg
getppid - getppid Ei: __getppid getppid
getresuid - getresuid i:ppp getresuid
getresgid - getresgid i:ppp getresgid
+getrlimit - ugetrlimit i:ip __new_getrlimit __getrlimit getrlimit@@GLIBC_2.2
getsid - getsid i:i getsid
init_module EXTRA init_module 5 init_module
inotify_add_watch EXTRA inotify_add_watch i:isi inotify_add_watch
diff --git a/libc/sysdeps/unix/sysv/linux/sysconf.c b/libc/sysdeps/unix/sysv/linux/sysconf.c
index 5c8f45d78..47ce5ef07 100644
--- a/libc/sysdeps/unix/sysv/linux/sysconf.c
+++ b/libc/sysdeps/unix/sysv/linux/sysconf.c
@@ -1,5 +1,5 @@
/* Get file-specific information about a file. Linux version.
- Copyright (C) 2003,2004,2006 2008,2009,2011 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
@@ -88,11 +88,11 @@ __sysconf (int name)
return HAS_CPUCLOCK (name);
case _SC_ARG_MAX:
-#if __LINUX_KERNEL_VERSION < 0x020617
- /* Determine whether this is a kernel 2.6.23 or later. Only
- then do we have an argument limit determined by the stack
- size. */
- if (GLRO(dl_discover_osversion) () >= 0x020617)
+#if !__ASSUME_ARG_MAX_STACK_BASED
+ /* Determine whether this is a kernel with an argument limit
+ determined by the stack size. */
+ if (GLRO(dl_discover_osversion) ()
+ >= __LINUX_ARG_MAX_STACK_BASED_MIN_KERNEL)
#endif
/* Use getrlimit to get the stack limit. */
if (__getrlimit (RLIMIT_STACK, &rlimit) == 0)
diff --git a/libc/sysdeps/unix/sysv/linux/system.c b/libc/sysdeps/unix/sysv/linux/system.c
index 4604544e6..29ab63ec5 100644
--- a/libc/sysdeps/unix/sysv/linux/system.c
+++ b/libc/sysdeps/unix/sysv/linux/system.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2005 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
@@ -32,7 +32,7 @@
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. */
-#if defined __ASSUME_CLONE_THREAD_FLAGS && !defined FORK
+#ifndef FORK
# define FORK() \
INLINE_SYSCALL (clone, 3, CLONE_PARENT_SETTID | SIGCHLD, 0, &pid)
#endif
diff --git a/libc/sysdeps/unix/sysv/linux/waitid.c b/libc/sysdeps/unix/sysv/linux/waitid.c
index 7a8b6eb8b..0fe633039 100644
--- a/libc/sysdeps/unix/sysv/linux/waitid.c
+++ b/libc/sysdeps/unix/sysv/linux/waitid.c
@@ -1,5 +1,5 @@
/* Linux implementation of waitid.
- 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
@@ -19,14 +19,8 @@
#include <stddef.h>
#include <errno.h>
#include <sys/wait.h>
-#include <kernel-features.h>
#include <sysdep.h>
-
-#ifdef __NR_waitid
-
-# if __ASSUME_WAITID_SYSCALL > 0
-
static inline int
do_waitid (idtype_t idtype, id_t id, siginfo_t *infop, int options)
{
@@ -34,37 +28,6 @@ do_waitid (idtype_t idtype, id_t id, siginfo_t *infop, int options)
pass if we were using waitid to simulate wait3/wait4. */
return INLINE_SYSCALL (waitid, 5, idtype, id, infop, options, NULL);
}
-# define NO_DO_WAITID
-
-# else
-
-static int do_compat_waitid (idtype_t idtype, id_t id,
- siginfo_t *infop, int options);
-# define DO_WAITID do_compat_waitid
-
-static int
-do_waitid (idtype_t idtype, id_t id, siginfo_t *infop, int options)
-{
- static int waitid_works;
- if (waitid_works > 0)
- return INLINE_SYSCALL (waitid, 5, idtype, id, infop, options, NULL);
- if (waitid_works == 0)
- {
- int result = INLINE_SYSCALL (waitid, 5,
- idtype, id, infop, options, NULL);
- if (result < 0 && errno == ENOSYS)
- waitid_works = -1;
- else
- {
- waitid_works = 1;
- return result;
- }
- }
- return do_compat_waitid (idtype, id, infop, options);
-}
-
-# endif
-
-#endif
+#define NO_DO_WAITID
#include "sysdeps/posix/waitid.c"
diff --git a/libc/sysdeps/unix/sysv/linux/wordsize-64/readdir.c b/libc/sysdeps/unix/sysv/linux/wordsize-64/readdir.c
index 300ebb262..e197d93b0 100644
--- a/libc/sysdeps/unix/sysv/linux/wordsize-64/readdir.c
+++ b/libc/sysdeps/unix/sysv/linux/wordsize-64/readdir.c
@@ -1,6 +1,6 @@
#define readdir64 __no_readdir64_decl
#define __readdir64 __no___readdir64_decl
-#include <sysdeps/unix/readdir.c>
+#include <sysdeps/posix/readdir.c>
#undef __readdir64
strong_alias (__readdir, __readdir64)
#undef readdir64
diff --git a/libc/sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c b/libc/sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c
index 12ca1a1ef..5ed8e955e 100644
--- a/libc/sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c
+++ b/libc/sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c
@@ -1,5 +1,5 @@
#define readdir64_r __no_readdir64_r_decl
#define GETDENTS_64BIT_ALIGNED 1
-#include <sysdeps/unix/readdir_r.c>
+#include <sysdeps/posix/readdir_r.c>
#undef readdir64_r
weak_alias (__readdir_r, readdir64_r)
diff --git a/libc/sysdeps/unix/sysv/linux/x86/bits/typesizes.h b/libc/sysdeps/unix/sysv/linux/x86/bits/typesizes.h
index be8985b4c..397e86724 100644
--- a/libc/sysdeps/unix/sysv/linux/x86/bits/typesizes.h
+++ b/libc/sysdeps/unix/sysv/linux/x86/bits/typesizes.h
@@ -73,6 +73,16 @@
#define __FSID_T_TYPE struct { int __val[2]; }
#define __SSIZE_T_TYPE __SWORD_TYPE
+#ifdef __x86_64__
+/* 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/sysdeps/unix/sysv/linux/x86_64/time.c b/libc/sysdeps/unix/sysv/linux/x86_64/time.c
index 0e05ddd52..65703cab9 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/time.c
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/time.c
@@ -16,11 +16,20 @@
<http://www.gnu.org/licenses/>. */
#ifdef SHARED
+/* Redefine time so that the compiler won't complain about the type
+ mismatch with the IFUNC selector in strong_alias, below. */
+#undef time
+#define time __redirect_time
+#include <time.h>
+
#include <dl-vdso.h>
#define VSYSCALL_ADDR_vtime 0xffffffffff600400
-void *time_ifunc (void) __asm__ ("time");
+/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
+ ifunc symbol properly. */
+extern __typeof (__redirect_time) __libc_time;
+void *time_ifunc (void) __asm__ ("__libc_time");
void *
time_ifunc (void)
@@ -30,7 +39,11 @@ time_ifunc (void)
/* If the vDSO is not available we fall back on the old vsyscall. */
return _dl_vdso_vsym ("__vdso_time", &linux26) ?: (void *) VSYSCALL_ADDR_vtime;
}
-__asm (".type time, %gnu_indirect_function");
+__asm (".type __libc_time, %gnu_indirect_function");
+
+#undef time
+strong_alias (__libc_time, time)
+libc_hidden_ver (__libc_time, time)
#else
@@ -45,5 +58,3 @@ time (time_t *t)
}
#endif
-
-strong_alias (time, __GI_time)
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/alphasort.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/alphasort.c
deleted file mode 100644
index 69ec42721..000000000
--- a/libc/sysdeps/unix/sysv/linux/x86_64/x32/alphasort.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/wordsize-64/alphasort.c>
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/alphasort64.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/alphasort64.c
deleted file mode 100644
index 6c5b2a1e0..000000000
--- a/libc/sysdeps/unix/sysv/linux/x86_64/x32/alphasort64.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/wordsize-64/alphasort64.c>
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/fseeko.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/fseeko.c
deleted file mode 100644
index dc47698f2..000000000
--- a/libc/sysdeps/unix/sysv/linux/x86_64/x32/fseeko.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/wordsize-64/fseeko.c>
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/fseeko64.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/fseeko64.c
deleted file mode 100644
index 3e554ec1e..000000000
--- a/libc/sysdeps/unix/sysv/linux/x86_64/x32/fseeko64.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/wordsize-64/fseeko64.c>
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/ftello.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/ftello.c
deleted file mode 100644
index 735e3e16b..000000000
--- a/libc/sysdeps/unix/sysv/linux/x86_64/x32/ftello.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/wordsize-64/ftello.c>
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/ftello64.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/ftello64.c
deleted file mode 100644
index eb155ed57..000000000
--- a/libc/sysdeps/unix/sysv/linux/x86_64/x32/ftello64.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/wordsize-64/ftello64.c>
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/iofgetpos.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/iofgetpos.c
deleted file mode 100644
index de2ff015d..000000000
--- a/libc/sysdeps/unix/sysv/linux/x86_64/x32/iofgetpos.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/wordsize-64/iofgetpos.c>
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/iofgetpos64.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/iofgetpos64.c
deleted file mode 100644
index 34aabfc6b..000000000
--- a/libc/sysdeps/unix/sysv/linux/x86_64/x32/iofgetpos64.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/wordsize-64/iofgetpos64.c>
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/iofopen.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/iofopen.c
deleted file mode 100644
index e39bb5518..000000000
--- a/libc/sysdeps/unix/sysv/linux/x86_64/x32/iofopen.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/wordsize-64/iofopen.c>
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/iofopen64.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/iofopen64.c
deleted file mode 100644
index af0c6ae49..000000000
--- a/libc/sysdeps/unix/sysv/linux/x86_64/x32/iofopen64.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/wordsize-64/iofopen64.c>
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/iofsetpos.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/iofsetpos.c
deleted file mode 100644
index a4c99c93c..000000000
--- a/libc/sysdeps/unix/sysv/linux/x86_64/x32/iofsetpos.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/wordsize-64/iofsetpos.c>
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/iofsetpos64.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/iofsetpos64.c
deleted file mode 100644
index e83fbba19..000000000
--- a/libc/sysdeps/unix/sysv/linux/x86_64/x32/iofsetpos64.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/wordsize-64/iofsetpos64.c>
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/lockf.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/lockf.c
deleted file mode 100644
index 42306a08a..000000000
--- a/libc/sysdeps/unix/sysv/linux/x86_64/x32/lockf.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/wordsize-64/lockf.c>
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/lockf64.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/lockf64.c
deleted file mode 100644
index 3b4b55abc..000000000
--- a/libc/sysdeps/unix/sysv/linux/x86_64/x32/lockf64.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/wordsize-64/lockf64.c>
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/mkostemp.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/mkostemp.c
deleted file mode 100644
index 177f68a55..000000000
--- a/libc/sysdeps/unix/sysv/linux/x86_64/x32/mkostemp.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/wordsize-64/mkostemp.c>
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/mkostemp64.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/mkostemp64.c
deleted file mode 100644
index 68455a84c..000000000
--- a/libc/sysdeps/unix/sysv/linux/x86_64/x32/mkostemp64.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/wordsize-64/mkostemp64.c>
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/mkstemp.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/mkstemp.c
deleted file mode 100644
index 4bc129bac..000000000
--- a/libc/sysdeps/unix/sysv/linux/x86_64/x32/mkstemp.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/wordsize-64/mkstemp.c>
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/mkstemp64.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/mkstemp64.c
deleted file mode 100644
index 76a836372..000000000
--- a/libc/sysdeps/unix/sysv/linux/x86_64/x32/mkstemp64.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/wordsize-64/mkstemp64.c>
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/scandir.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/scandir.c
deleted file mode 100644
index 9288ca258..000000000
--- a/libc/sysdeps/unix/sysv/linux/x86_64/x32/scandir.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/wordsize-64/scandir.c>
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/scandir64.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/scandir64.c
deleted file mode 100644
index 6d2205759..000000000
--- a/libc/sysdeps/unix/sysv/linux/x86_64/x32/scandir64.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/wordsize-64/scandir64.c>
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/scandirat.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/scandirat.c
deleted file mode 100644
index 5b8899367..000000000
--- a/libc/sysdeps/unix/sysv/linux/x86_64/x32/scandirat.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/wordsize-64/scandirat.c>
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/scandirat64.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/scandirat64.c
deleted file mode 100644
index 0d7893d29..000000000
--- a/libc/sysdeps/unix/sysv/linux/x86_64/x32/scandirat64.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/wordsize-64/scandirat64.c>
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/versionsort.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/versionsort.c
deleted file mode 100644
index af5a668c2..000000000
--- a/libc/sysdeps/unix/sysv/linux/x86_64/x32/versionsort.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/wordsize-64/versionsort.c>
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/versionsort64.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/versionsort64.c
deleted file mode 100644
index fe220c90e..000000000
--- a/libc/sysdeps/unix/sysv/linux/x86_64/x32/versionsort64.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/wordsize-64/versionsort64.c>
diff --git a/libc/sysdeps/wordsize-64/alphasort.c b/libc/sysdeps/wordsize-64/alphasort.c
deleted file mode 100644
index edc410129..000000000
--- a/libc/sysdeps/wordsize-64/alphasort.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#define alphasort64 rename_alphasort64
-
-#include "../../dirent/alphasort.c"
-
-#undef alphasort64
-
-weak_alias (alphasort, alphasort64)
diff --git a/libc/sysdeps/wordsize-64/alphasort64.c b/libc/sysdeps/wordsize-64/alphasort64.c
deleted file mode 100644
index 08509131b..000000000
--- a/libc/sysdeps/wordsize-64/alphasort64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Defined in alphasort.c. */
diff --git a/libc/sysdeps/wordsize-64/fseeko.c b/libc/sysdeps/wordsize-64/fseeko.c
deleted file mode 100644
index 692885a8b..000000000
--- a/libc/sysdeps/wordsize-64/fseeko.c
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "../../libio/fseeko.c"
-
-weak_alias (fseeko, fseeko64)
diff --git a/libc/sysdeps/wordsize-64/fseeko64.c b/libc/sysdeps/wordsize-64/fseeko64.c
deleted file mode 100644
index 73e011afb..000000000
--- a/libc/sysdeps/wordsize-64/fseeko64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Defined in fseeko.c. */
diff --git a/libc/sysdeps/wordsize-64/ftello.c b/libc/sysdeps/wordsize-64/ftello.c
deleted file mode 100644
index fa05cfcf0..000000000
--- a/libc/sysdeps/wordsize-64/ftello.c
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "../../libio/ftello.c"
-
-weak_alias (ftello, ftello64)
diff --git a/libc/sysdeps/wordsize-64/ftello64.c b/libc/sysdeps/wordsize-64/ftello64.c
deleted file mode 100644
index 2cbbe6320..000000000
--- a/libc/sysdeps/wordsize-64/ftello64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Defined in ftello.c. */
diff --git a/libc/sysdeps/wordsize-64/iofgetpos.c b/libc/sysdeps/wordsize-64/iofgetpos.c
deleted file mode 100644
index ba8df67c9..000000000
--- a/libc/sysdeps/wordsize-64/iofgetpos.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#define _IO_new_fgetpos64 __renamed__IO_new_fgetpos64
-#define _IO_fgetpos64 __renamed__IO_fgetpos64
-
-#include "../../libio/iofgetpos.c"
-
-#undef _IO_new_fgetpos64
-#undef _IO_fgetpos64
-
-strong_alias (_IO_new_fgetpos, _IO_new_fgetpos64)
-strong_alias (_IO_new_fgetpos64, __new_fgetpos64)
-versioned_symbol (libc, _IO_new_fgetpos64, _IO_fgetpos64, GLIBC_2_2);
-versioned_symbol (libc, __new_fgetpos64, fgetpos64, GLIBC_2_2);
diff --git a/libc/sysdeps/wordsize-64/iofgetpos64.c b/libc/sysdeps/wordsize-64/iofgetpos64.c
deleted file mode 100644
index 1748b810f..000000000
--- a/libc/sysdeps/wordsize-64/iofgetpos64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Defined in iofgetpos.c. */
diff --git a/libc/sysdeps/wordsize-64/iofopen.c b/libc/sysdeps/wordsize-64/iofopen.c
deleted file mode 100644
index d8d92ca5e..000000000
--- a/libc/sysdeps/wordsize-64/iofopen.c
+++ /dev/null
@@ -1,4 +0,0 @@
-#include "../../libio/iofopen.c"
-
-weak_alias (_IO_new_fopen, _IO_fopen64)
-weak_alias (_IO_new_fopen, fopen64)
diff --git a/libc/sysdeps/wordsize-64/iofopen64.c b/libc/sysdeps/wordsize-64/iofopen64.c
deleted file mode 100644
index 68315d857..000000000
--- a/libc/sysdeps/wordsize-64/iofopen64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Defined in iofopen.c. */
diff --git a/libc/sysdeps/wordsize-64/iofsetpos.c b/libc/sysdeps/wordsize-64/iofsetpos.c
deleted file mode 100644
index f2bb8aec5..000000000
--- a/libc/sysdeps/wordsize-64/iofsetpos.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#define _IO_new_fsetpos64 __renamed__IO_new_fsetpos64
-#define _IO_fsetpos64 __renamed__IO_fsetpos64
-
-#include "../../libio/iofsetpos.c"
-
-#undef _IO_new_fsetpos64
-#undef _IO_fsetpos64
-
-strong_alias (_IO_new_fsetpos, _IO_new_fsetpos64)
-strong_alias (_IO_new_fsetpos64, __new_fsetpos64)
-versioned_symbol (libc, __new_fsetpos64, fsetpos64, GLIBC_2_2);
-versioned_symbol (libc, _IO_new_fsetpos64, _IO_fsetpos64, GLIBC_2_2);
diff --git a/libc/sysdeps/wordsize-64/iofsetpos64.c b/libc/sysdeps/wordsize-64/iofsetpos64.c
deleted file mode 100644
index 5fbc7328b..000000000
--- a/libc/sysdeps/wordsize-64/iofsetpos64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Defined in iofsetpos.c. */
diff --git a/libc/sysdeps/wordsize-64/lockf.c b/libc/sysdeps/wordsize-64/lockf.c
deleted file mode 100644
index 502472d98..000000000
--- a/libc/sysdeps/wordsize-64/lockf.c
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "../../io/lockf.c"
-
-weak_alias (lockf, lockf64)
diff --git a/libc/sysdeps/wordsize-64/lockf64.c b/libc/sysdeps/wordsize-64/lockf64.c
deleted file mode 100644
index 8ef5fc6b4..000000000
--- a/libc/sysdeps/wordsize-64/lockf64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Defined in lockf.c. */
diff --git a/libc/sysdeps/wordsize-64/mkostemp.c b/libc/sysdeps/wordsize-64/mkostemp.c
deleted file mode 100644
index 4f81fdf54..000000000
--- a/libc/sysdeps/wordsize-64/mkostemp.c
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "../../misc/mkostemp.c"
-
-weak_alias (mkostemp, mkostemp64)
diff --git a/libc/sysdeps/wordsize-64/mkostemp64.c b/libc/sysdeps/wordsize-64/mkostemp64.c
deleted file mode 100644
index 14bb25023..000000000
--- a/libc/sysdeps/wordsize-64/mkostemp64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Defined in mkostemp.c. */
diff --git a/libc/sysdeps/wordsize-64/mkstemp.c b/libc/sysdeps/wordsize-64/mkstemp.c
deleted file mode 100644
index bf6df1848..000000000
--- a/libc/sysdeps/wordsize-64/mkstemp.c
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "../../misc/mkstemp.c"
-
-weak_alias (mkstemp, mkstemp64)
diff --git a/libc/sysdeps/wordsize-64/mkstemp64.c b/libc/sysdeps/wordsize-64/mkstemp64.c
deleted file mode 100644
index e72bb4643..000000000
--- a/libc/sysdeps/wordsize-64/mkstemp64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Defined in mkstemp.c. */
diff --git a/libc/sysdeps/wordsize-64/scandir.c b/libc/sysdeps/wordsize-64/scandir.c
deleted file mode 100644
index 9af7e9b38..000000000
--- a/libc/sysdeps/wordsize-64/scandir.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#define scandir64 scandir64_renamed
-
-#include "../../dirent/scandir.c"
-
-#undef scandir64
-weak_alias (scandir, scandir64)
diff --git a/libc/sysdeps/wordsize-64/scandir64.c b/libc/sysdeps/wordsize-64/scandir64.c
deleted file mode 100644
index 3c2c4a159..000000000
--- a/libc/sysdeps/wordsize-64/scandir64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Defined in scandir.c. */
diff --git a/libc/sysdeps/wordsize-64/scandirat.c b/libc/sysdeps/wordsize-64/scandirat.c
deleted file mode 100644
index 02b8fdee0..000000000
--- a/libc/sysdeps/wordsize-64/scandirat.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#define scandirat64 scandirat64_renamed
-
-#include "../../dirent/scandirat.c"
-
-#undef scandirat64
-weak_alias (scandirat, scandirat64)
diff --git a/libc/sysdeps/wordsize-64/scandirat64.c b/libc/sysdeps/wordsize-64/scandirat64.c
deleted file mode 100644
index fb938654a..000000000
--- a/libc/sysdeps/wordsize-64/scandirat64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Defined in scandirat.c. */
diff --git a/libc/sysdeps/wordsize-64/versionsort.c b/libc/sysdeps/wordsize-64/versionsort.c
deleted file mode 100644
index bb25550d3..000000000
--- a/libc/sysdeps/wordsize-64/versionsort.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#define versionsort64 rename_versionsort64
-
-#include "../../dirent/versionsort.c"
-
-#undef versionsort64
-
-weak_alias (versionsort, versionsort64)
diff --git a/libc/sysdeps/wordsize-64/versionsort64.c b/libc/sysdeps/wordsize-64/versionsort64.c
deleted file mode 100644
index ac6c3c702..000000000
--- a/libc/sysdeps/wordsize-64/versionsort64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Defined in versionsort.c. */
diff --git a/libc/sysdeps/x86_64/_mcount.S b/libc/sysdeps/x86_64/_mcount.S
index c919865b4..3adfe031f 100644
--- a/libc/sysdeps/x86_64/_mcount.S
+++ b/libc/sysdeps/x86_64/_mcount.S
@@ -25,7 +25,7 @@
#include <sysdep.h>
.globl C_SYMBOL_NAME(_mcount)
- ASM_TYPE_DIRECTIVE(C_SYMBOL_NAME(_mcount), @function)
+ .type C_SYMBOL_NAME(_mcount), @function
.align ALIGNARG(4)
C_LABEL(_mcount)
/* Allocate space for 7 registers. */
@@ -66,7 +66,7 @@ C_LABEL(_mcount)
weak_alias (_mcount, mcount)
.globl C_SYMBOL_NAME(__fentry__)
- ASM_TYPE_DIRECTIVE(C_SYMBOL_NAME(__fentry__), @function)
+ .type C_SYMBOL_NAME(__fentry__), @function
.align ALIGNARG(4)
C_LABEL(__fentry__)
/* Allocate space for 7 registers. */
diff --git a/libc/sysdeps/x86_64/configure b/libc/sysdeps/x86_64/configure
index b87c0b14b..adbaeee32 100644
--- a/libc/sysdeps/x86_64/configure
+++ b/libc/sysdeps/x86_64/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).
@@ -163,56 +167,6 @@ fi
-{ $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}
- .globl 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
- /* comment */
- nop
- /* comment */
- nop
-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
-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSE4 support" >&5
$as_echo_n "checking for SSE4 support... " >&6; }
if ${libc_cv_cc_sse4+:} false; then :
diff --git a/libc/sysdeps/x86_64/configure.in b/libc/sysdeps/x86_64/configure.in
index a95dc8d8c..94bcd19f3 100644
--- a/libc/sysdeps/x86_64/configure.in
+++ b/libc/sysdeps/x86_64/configure.in
@@ -5,39 +5,6 @@ AC_CHECK_HEADER([cpuid.h], ,
[AC_MSG_ERROR([gcc must provide the <cpuid.h> header])],
[/* No default includes. */])
-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}
- .globl 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
- /* comment */
- nop
- /* comment */
- nop
-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
-
dnl Check if -msse4 works.
AC_CACHE_CHECK(for SSE4 support, libc_cv_cc_sse4, [dnl
LIBC_TRY_CC_OPTION([-msse4], [libc_cv_cc_sse4=yes], [libc_cv_cc_sse4=no])
diff --git a/libc/sysdeps/x86_64/fpu/e_expf.S b/libc/sysdeps/x86_64/fpu/e_expf.S
index 340a1c2f0..9b1330435 100644
--- a/libc/sysdeps/x86_64/fpu/e_expf.S
+++ b/libc/sysdeps/x86_64/fpu/e_expf.S
@@ -251,89 +251,89 @@ L(DP_T): /* table of double precision values 2^(j/K) for j=[0..K-1] */
.long 0xee615a27, 0x3ffefa1b
.long 0x5b6e4540, 0x3fff5076
.long 0x819e90d8, 0x3fffa7c1
- ASM_TYPE_DIRECTIVE(L(DP_T), @object)
+ .type L(DP_T), @object
ASM_SIZE_DIRECTIVE(L(DP_T))
.section .rodata.cst8,"aM",@progbits,8
.p2align 3
L(DP_KLN2): /* double precision K/log(2) */
.long 0x652b82fe, 0x40571547
- ASM_TYPE_DIRECTIVE(L(DP_KLN2), @object)
+ .type L(DP_KLN2), @object
ASM_SIZE_DIRECTIVE(L(DP_KLN2))
.p2align 3
L(DP_NLN2K): /* double precision -log(2)/K */
.long 0xfefa39ef, 0xbf862e42
- ASM_TYPE_DIRECTIVE(L(DP_NLN2K), @object)
+ .type L(DP_NLN2K), @object
ASM_SIZE_DIRECTIVE(L(DP_NLN2K))
.p2align 3
L(DP_RS): /* double precision 2^23+2^22 */
.long 0x00000000, 0x41680000
- ASM_TYPE_DIRECTIVE(L(DP_RS), @object)
+ .type L(DP_RS), @object
ASM_SIZE_DIRECTIVE(L(DP_RS))
.p2align 3
L(DP_P3): /* double precision polynomial coefficient P3 */
.long 0xeb78fa85, 0x3fa56420
- ASM_TYPE_DIRECTIVE(L(DP_P3), @object)
+ .type L(DP_P3), @object
ASM_SIZE_DIRECTIVE(L(DP_P3))
.p2align 3
L(DP_P1): /* double precision polynomial coefficient P1 */
.long 0x008d6118, 0x3fe00000
- ASM_TYPE_DIRECTIVE(L(DP_P1), @object)
+ .type L(DP_P1), @object
ASM_SIZE_DIRECTIVE(L(DP_P1))
.p2align 3
L(DP_P2): /* double precision polynomial coefficient P2 */
.long 0xda752d4f, 0x3fc55550
- ASM_TYPE_DIRECTIVE(L(DP_P2), @object)
+ .type L(DP_P2), @object
ASM_SIZE_DIRECTIVE(L(DP_P2))
.p2align 3
L(DP_P0): /* double precision polynomial coefficient P0 */
.long 0xffffe7c6, 0x3fefffff
- ASM_TYPE_DIRECTIVE(L(DP_P0), @object)
+ .type L(DP_P0), @object
ASM_SIZE_DIRECTIVE(L(DP_P0))
.p2align 2
L(SP_RANGE): /* single precision overflow/underflow bounds */
.long 0x42b17217 /* if x>this bound, then result overflows */
.long 0x42cff1b4 /* if x<this bound, then result underflows */
- ASM_TYPE_DIRECTIVE(L(SP_RANGE), @object)
+ .type L(SP_RANGE), @object
ASM_SIZE_DIRECTIVE(L(SP_RANGE))
.p2align 2
L(SP_INF_0):
.long 0x7f800000 /* single precision Inf */
.long 0 /* single precision zero */
- ASM_TYPE_DIRECTIVE(L(SP_INF_0), @object)
+ .type L(SP_INF_0), @object
ASM_SIZE_DIRECTIVE(L(SP_INF_0))
.section .rodata.cst4,"aM",@progbits,4
.p2align 2
L(SP_RS): /* single precision 2^23+2^22 */
.long 0x4b400000
- ASM_TYPE_DIRECTIVE(L(SP_RS), @object)
+ .type L(SP_RS), @object
ASM_SIZE_DIRECTIVE(L(SP_RS))
.p2align 2
L(SP_SMALL): /* single precision small value 2^(-100) */
.long 0x0d800000
- ASM_TYPE_DIRECTIVE(L(SP_SMALL), @object)
+ .type L(SP_SMALL), @object
ASM_SIZE_DIRECTIVE(L(SP_SMALL))
.p2align 2
L(SP_LARGE): /* single precision large value 2^100 */
.long 0x71800000
- ASM_TYPE_DIRECTIVE(L(SP_LARGE), @object)
+ .type L(SP_LARGE), @object
ASM_SIZE_DIRECTIVE(L(SP_LARGE))
.p2align 2
L(SP_ONE): /* single precision 1.0 */
.long 0x3f800000
- ASM_TYPE_DIRECTIVE(L(SP_ONE), @object)
+ .type L(SP_ONE), @object
ASM_SIZE_DIRECTIVE(L(SP_ONE))
strong_alias (__ieee754_expf, __expf_finite)
diff --git a/libc/sysdeps/x86_64/fpu/e_expl.S b/libc/sysdeps/x86_64/fpu/e_expl.S
index 1c37c86f7..a91978039 100644
--- a/libc/sysdeps/x86_64/fpu/e_expl.S
+++ b/libc/sysdeps/x86_64/fpu/e_expl.S
@@ -42,26 +42,26 @@
.p2align 4
#ifdef USE_AS_EXP10L
- ASM_TYPE_DIRECTIVE(c0,@object)
+ .type c0,@object
c0: .byte 0, 0, 0, 0, 0, 0, 0x9a, 0xd4, 0x00, 0x40
.byte 0, 0, 0, 0, 0, 0
ASM_SIZE_DIRECTIVE(c0)
- ASM_TYPE_DIRECTIVE(c1,@object)
+ .type c1,@object
c1: .byte 0x58, 0x92, 0xfc, 0x15, 0x37, 0x9a, 0x97, 0xf0, 0xef, 0x3f
.byte 0, 0, 0, 0, 0, 0
ASM_SIZE_DIRECTIVE(c1)
#else
- ASM_TYPE_DIRECTIVE(c0,@object)
+ .type c0,@object
c0: .byte 0, 0, 0, 0, 0, 0, 0xaa, 0xb8, 0xff, 0x3f
.byte 0, 0, 0, 0, 0, 0
ASM_SIZE_DIRECTIVE(c0)
- ASM_TYPE_DIRECTIVE(c1,@object)
+ .type c1,@object
c1: .byte 0x20, 0xfa, 0xee, 0xc2, 0x5f, 0x70, 0xa5, 0xec, 0xed, 0x3f
.byte 0, 0, 0, 0, 0, 0
ASM_SIZE_DIRECTIVE(c1)
#endif
#ifndef USE_AS_EXPM1L
- ASM_TYPE_DIRECTIVE(csat,@object)
+ .type csat,@object
csat: .byte 0, 0, 0, 0, 0, 0, 0, 0x80, 0x0e, 0x40
.byte 0, 0, 0, 0, 0, 0
ASM_SIZE_DIRECTIVE(csat)
diff --git a/libc/sysdeps/x86_64/fpu/e_log10l.S b/libc/sysdeps/x86_64/fpu/e_log10l.S
index ebc809e83..6c07024c1 100644
--- a/libc/sysdeps/x86_64/fpu/e_log10l.S
+++ b/libc/sysdeps/x86_64/fpu/e_log10l.S
@@ -13,13 +13,13 @@
.section .rodata.cst8,"aM",@progbits,8
.p2align 3
- ASM_TYPE_DIRECTIVE(one,@object)
+ .type one,@object
one: .double 1.0
ASM_SIZE_DIRECTIVE(one)
/* It is not important that this constant is precise. It is only
a value which is known to be on the safe side for using the
fyl2xp1 instruction. */
- ASM_TYPE_DIRECTIVE(limit,@object)
+ .type limit,@object
limit: .double 0.29
ASM_SIZE_DIRECTIVE(limit)
diff --git a/libc/sysdeps/x86_64/fpu/e_log2l.S b/libc/sysdeps/x86_64/fpu/e_log2l.S
index 140b93d10..956489fc3 100644
--- a/libc/sysdeps/x86_64/fpu/e_log2l.S
+++ b/libc/sysdeps/x86_64/fpu/e_log2l.S
@@ -12,13 +12,13 @@
.section .rodata.cst8,"aM",@progbits,8
.p2align 3
- ASM_TYPE_DIRECTIVE(one,@object)
+ .type one,@object
one: .double 1.0
ASM_SIZE_DIRECTIVE(one)
/* It is not important that this constant is precise. It is only
a value which is known to be on the safe side for using the
fyl2xp1 instruction. */
- ASM_TYPE_DIRECTIVE(limit,@object)
+ .type limit,@object
limit: .double 0.29
ASM_SIZE_DIRECTIVE(limit)
diff --git a/libc/sysdeps/x86_64/fpu/e_logl.S b/libc/sysdeps/x86_64/fpu/e_logl.S
index 8876dc218..a8e31084b 100644
--- a/libc/sysdeps/x86_64/fpu/e_logl.S
+++ b/libc/sysdeps/x86_64/fpu/e_logl.S
@@ -12,13 +12,13 @@
.section .rodata.cst8,"aM",@progbits,8
.p2align 3
- ASM_TYPE_DIRECTIVE(one,@object)
+ .type one,@object
one: .double 1.0
ASM_SIZE_DIRECTIVE(one)
/* It is not important that this constant is precise. It is only
a value which is known to be on the safe side for using the
fyl2xp1 instruction. */
- ASM_TYPE_DIRECTIVE(limit,@object)
+ .type limit,@object
limit: .double 0.29
ASM_SIZE_DIRECTIVE(limit)
diff --git a/libc/sysdeps/x86_64/fpu/e_powl.S b/libc/sysdeps/x86_64/fpu/e_powl.S
index 10ede2264..4fe23c06a 100644
--- a/libc/sysdeps/x86_64/fpu/e_powl.S
+++ b/libc/sysdeps/x86_64/fpu/e_powl.S
@@ -23,34 +23,34 @@
.section .rodata.cst8,"aM",@progbits,8
.p2align 3
- ASM_TYPE_DIRECTIVE(one,@object)
+ .type one,@object
one: .double 1.0
ASM_SIZE_DIRECTIVE(one)
- ASM_TYPE_DIRECTIVE(limit,@object)
+ .type limit,@object
limit: .double 0.29
ASM_SIZE_DIRECTIVE(limit)
- ASM_TYPE_DIRECTIVE(p63,@object)
+ .type p63,@object
p63: .byte 0, 0, 0, 0, 0, 0, 0xe0, 0x43
ASM_SIZE_DIRECTIVE(p63)
- ASM_TYPE_DIRECTIVE(p64,@object)
+ .type p64,@object
p64: .byte 0, 0, 0, 0, 0, 0, 0xf0, 0x43
ASM_SIZE_DIRECTIVE(p64)
- ASM_TYPE_DIRECTIVE(p78,@object)
+ .type p78,@object
p78: .byte 0, 0, 0, 0, 0, 0, 0xd0, 0x44
ASM_SIZE_DIRECTIVE(p78)
.section .rodata.cst16,"aM",@progbits,16
.p2align 3
- ASM_TYPE_DIRECTIVE(infinity,@object)
+ .type infinity,@object
inf_zero:
infinity:
.byte 0, 0, 0, 0, 0, 0, 0xf0, 0x7f
ASM_SIZE_DIRECTIVE(infinity)
- ASM_TYPE_DIRECTIVE(zero,@object)
+ .type zero,@object
zero: .double 0.0
ASM_SIZE_DIRECTIVE(zero)
- ASM_TYPE_DIRECTIVE(minf_mzero,@object)
+ .type minf_mzero,@object
minf_mzero:
minfinity:
.byte 0, 0, 0, 0, 0, 0, 0xf0, 0xff
diff --git a/libc/sysdeps/x86_64/fpu/e_scalbl.S b/libc/sysdeps/x86_64/fpu/e_scalbl.S
index 8394310c9..c422d53b1 100644
--- a/libc/sysdeps/x86_64/fpu/e_scalbl.S
+++ b/libc/sysdeps/x86_64/fpu/e_scalbl.S
@@ -13,7 +13,7 @@
.section .rodata
.align ALIGNARG(4)
- ASM_TYPE_DIRECTIVE(zero_nan,@object)
+ .type zero_nan,@object
zero_nan:
.double 0.0
nan: .byte 0, 0, 0, 0, 0, 0, 0xff, 0x7f
diff --git a/libc/sysdeps/x86_64/fpu/libm-test-ulps b/libc/sysdeps/x86_64/fpu/libm-test-ulps
index dba153b61..8a3822113 100644
--- a/libc/sysdeps/x86_64/fpu/libm-test-ulps
+++ b/libc/sysdeps/x86_64/fpu/libm-test-ulps
@@ -197,6 +197,8 @@ ifloat: 1
Test "Imaginary part of: cacos (+0 - 0.5 i) == pi/2 + 0.4812118250596034474977589134243684231352 i":
float: 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
@@ -225,6 +227,8 @@ ifloat: 1
Test "Imaginary part of: cacos (-0 - 0.5 i) == pi/2 + 0.4812118250596034474977589134243684231352 i":
float: 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
@@ -269,6 +273,8 @@ ldouble: 1
Test "Real part of: cacosh (+0 + 0.5 i) == 0.4812118250596034474977589134243684231352 + pi/2 i":
float: 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
@@ -280,6 +286,8 @@ idouble: 1
Test "Real part of: cacosh (+0 - 0.5 i) == 0.4812118250596034474977589134243684231352 - pi/2 i":
float: 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
@@ -291,6 +299,8 @@ idouble: 1
Test "Real part of: cacosh (-0 + 0.5 i) == 0.4812118250596034474977589134243684231352 + pi/2 i":
float: 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
@@ -302,6 +312,8 @@ idouble: 1
Test "Real part of: cacosh (-0 - 0.5 i) == 0.4812118250596034474977589134243684231352 - pi/2 i":
float: 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
@@ -319,9 +331,13 @@ idouble: 1
Test "Real part of: cacosh (-1.5 + +0 i) == 0.9624236501192068949955178268487368462704 + pi i":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "Real part of: cacosh (-1.5 - 0 i) == 0.9624236501192068949955178268487368462704 - pi i":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "Real part of: cacosh (-2 - 3 i) == 1.9833870299165354323470769028940395 - 2.1414491111159960199416055713254211 i":
double: 1
float: 7
@@ -342,9 +358,13 @@ ldouble: 1
Test "Real part of: cacosh (1.5 + +0 i) == 0.9624236501192068949955178268487368462704 + +0 i":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "Real part of: cacosh (1.5 - 0 i) == 0.9624236501192068949955178268487368462704 - 0 i":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
# casin
Test "Imaginary part of: casin (+0 + 0.5 i) == +0 + 0.4812118250596034474977589134243684231352 i":
@@ -367,6 +387,8 @@ ifloat: 1
Test "Imaginary part of: casin (+0 - 0.5 i) == +0 - 0.4812118250596034474977589134243684231352 i":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: casin (+0 - 1.0 i) == +0 - 0.8813735870195430252326093249797923090282 i":
double: 1
float: 1
@@ -395,6 +417,8 @@ ifloat: 1
Test "Imaginary part of: casin (-0 - 0.5 i) == -0 - 0.4812118250596034474977589134243684231352 i":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: casin (-0 - 1.0 i) == -0 - 0.8813735870195430252326093249797923090282 i":
double: 1
float: 1
@@ -500,9 +524,13 @@ ldouble: 5
Test "Real part of: casinh (0.5 + +0 i) == 0.4812118250596034474977589134243684231352 + +0 i":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "Real part of: casinh (0.5 - 0 i) == 0.4812118250596034474977589134243684231352 - 0 i":
float: 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
@@ -729,6 +757,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 "Imaginary part of: clog (-0x1.234566p-40 - 1.0 i) == 5.354083939753840089583620652120903838944e-25 - 1.570796326795931422008642456283782656359 i":
float: 1
ifloat: 1
@@ -778,6 +812,14 @@ float: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "Real part of: clog (0x1.000566p0 + 0x1.234p-10 i) == 8.298731898331237038231468223024422855654e-5 + 1.110938609507128729312743251313024793990e-3 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (0x1.234566p-30 + 1.0 i) == 5.614163921211322622623353961365728040115e-19 + 1.570796325735258575254858696548386439740 i":
+ildouble: 1
+ldouble: 1
Test "Real part of: clog (0x1.fffffep+127 + 0x1.fffffep+127 i) == 89.06941264234832570836679262104313101776 + pi/4 i":
ildouble: 1
ldouble: 1
@@ -841,6 +883,20 @@ double: 1
float: 1
idouble: 1
ifloat: 1
+Test "Real part of: clog10 (-0x1.0000000123456p0 + 0x1.2345678p-1000 i) == 1.150487026509145544402795327729455391948e-10 + 1.364376353841841347485783625431355770210 i":
+double: 2
+idouble: 2
+Test "Imaginary 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: 2
+idouble: 2
+Test "Imaginary part of: clog10 (-0x1.0000000123456p0 + 0x1.2345678p-30 i) == 1.150487028947346337782682105935961875822e-10 + 1.364376353381646356131680448946397884147 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: clog10 (-0x1.fp+1023 + 0x1p-1074 i) == 308.2409272754311106024666378243768099991 + 1.364376353841841347485783625431355770210 i":
double: 1
idouble: 1
@@ -953,6 +1009,20 @@ idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "Real part of: clog10 (0x1.000566p0 + 0x1.234p-10 i) == 3.604093470239754109961125085078190708674e-5 + 4.824745078422174667425851670822596859720e-4 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x1.000566p0 + 0x1.234p-10 i) == 3.604093470239754109961125085078190708674e-5 + 4.824745078422174667425851670822596859720e-4 i":
+double: 1
+idouble: 1
+Test "Real part of: clog10 (0x1.000566p0 + 0x1.234p-100 i) == 3.577293486783822178310971763308187385546e-5 + 3.897399639875661463735636919790792140598e-31 i":
+float: 1
+ifloat: 1
+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
@@ -2940,9 +3010,9 @@ float: 3
ifloat: 3
Function: Real part of "clog10":
-double: 1
+double: 2
float: 1
-idouble: 1
+idouble: 2
ifloat: 1
ildouble: 1
ldouble: 1
diff --git a/libc/sysdeps/x86_64/fpu/s_copysign.S b/libc/sysdeps/x86_64/fpu/s_copysign.S
index d96c3bd95..07ca07584 100644
--- a/libc/sysdeps/x86_64/fpu/s_copysign.S
+++ b/libc/sysdeps/x86_64/fpu/s_copysign.S
@@ -22,12 +22,12 @@
.section .rodata.cst16,"aM",@progbits,16
.align ALIGNARG(4)
- ASM_TYPE_DIRECTIVE(signmask,@object)
+ .type signmask,@object
signmask:
.byte 0, 0, 0, 0, 0, 0, 0, 0x80
.byte 0, 0, 0, 0, 0, 0, 0, 0
ASM_SIZE_DIRECTIVE(signmask)
- ASM_TYPE_DIRECTIVE(othermask,@object)
+ .type othermask,@object
othermask:
.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f
.byte 0, 0, 0, 0, 0, 0, 0, 0
diff --git a/libc/sysdeps/x86_64/fpu/s_copysignf.S b/libc/sysdeps/x86_64/fpu/s_copysignf.S
index 9dd3101c2..99c16e080 100644
--- a/libc/sysdeps/x86_64/fpu/s_copysignf.S
+++ b/libc/sysdeps/x86_64/fpu/s_copysignf.S
@@ -22,7 +22,7 @@
.section .rodata
.align ALIGNARG(4)
- ASM_TYPE_DIRECTIVE(mask,@object)
+ .type mask,@object
mask:
.byte 0xff, 0xff, 0xff, 0x7f
ASM_SIZE_DIRECTIVE(mask)
diff --git a/libc/sysdeps/x86_64/multiarch/memmove.c b/libc/sysdeps/x86_64/multiarch/memmove.c
index ca16263a1..d6bdab4cc 100644
--- a/libc/sysdeps/x86_64/multiarch/memmove.c
+++ b/libc/sysdeps/x86_64/multiarch/memmove.c
@@ -1,6 +1,5 @@
/* Multiple versions of memmove.
- Copyright (C) 2010, 2011
- Free Software Foundation, Inc.
+ Copyright (C) 2010-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
@@ -17,34 +16,44 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <string.h>
-
#ifndef NOT_IN_libc
-#include <shlib-compat.h>
-#include "init-arch.h"
-
-#define MEMMOVE __memmove_sse2
-#ifdef SHARED
-# undef libc_hidden_builtin_def
-# define libc_hidden_builtin_def(name) \
+# define MEMMOVE __memmove_sse2
+# ifdef SHARED
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name) \
__hidden_ver1 (__memmove_sse2, __GI_memmove, __memmove_sse2);
+# endif
+
+/* Redefine memmove so that the compiler won't complain about the type
+ mismatch with the IFUNC selector in strong_alias, below. */
+# undef memmove
+# define memmove __redirect_memmove
+# include <string.h>
+# undef memmove
+
+extern __typeof (__redirect_memmove) __memmove_sse2 attribute_hidden;
+extern __typeof (__redirect_memmove) __memmove_ssse3 attribute_hidden;
+extern __typeof (__redirect_memmove) __memmove_ssse3_back attribute_hidden;
#endif
-#endif
-
-extern __typeof (memmove) __memmove_sse2 attribute_hidden;
-extern __typeof (memmove) __memmove_ssse3 attribute_hidden;
-extern __typeof (memmove) __memmove_ssse3_back attribute_hidden;
#include "string/memmove.c"
#ifndef NOT_IN_libc
-libc_ifunc (memmove,
+# include <shlib-compat.h>
+# include "init-arch.h"
+
+/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
+ ifunc symbol properly. */
+extern __typeof (__redirect_memmove) __libc_memmove;
+libc_ifunc (__libc_memmove,
HAS_SSSE3
? (HAS_FAST_COPY_BACKWARD
? __memmove_ssse3_back : __memmove_ssse3)
- : __memmove_sse2);
+ : __memmove_sse2)
+
+strong_alias (__libc_memmove, memmove)
-#if SHLIB_COMPAT (libc, GLIBC_2_2_5, GLIBC_2_14)
+# if SHLIB_COMPAT (libc, GLIBC_2_2_5, GLIBC_2_14)
compat_symbol (libc, memmove, memcpy, GLIBC_2_2_5);
-#endif
+# endif
#endif
diff --git a/libc/sysdeps/x86_64/multiarch/strstr-c.c b/libc/sysdeps/x86_64/multiarch/strstr-c.c
index b8ed3161d..e05c5f127 100644
--- a/libc/sysdeps/x86_64/multiarch/strstr-c.c
+++ b/libc/sysdeps/x86_64/multiarch/strstr-c.c
@@ -1,4 +1,27 @@
-#include "init-arch.h"
+/* Multiple versions of strstr.
+ 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/>. */
+
+/* Redefine strstr so that the compiler won't complain about the type
+ mismatch with the IFUNC selector in strong_alias, below. */
+#undef strstr
+#define strstr __redirect_strstr
+#include <string.h>
+#undef strstr
#define STRSTR __strstr_sse2
#ifdef SHARED
@@ -9,7 +32,15 @@
#include "string/strstr.c"
-extern char *__strstr_sse42 (const char *, const char *) attribute_hidden;
-extern __typeof (__strstr_sse2) __strstr_sse2 attribute_hidden;
+extern __typeof (__redirect_strstr) __strstr_sse42 attribute_hidden;
+extern __typeof (__redirect_strstr) __strstr_sse2 attribute_hidden;
+
+#include "init-arch.h"
+
+/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
+ ifunc symbol properly. */
+extern __typeof (__redirect_strstr) __libc_strstr;
+libc_ifunc (__libc_strstr, HAS_SSE4_2 ? __strstr_sse42 : __strstr_sse2)
-libc_ifunc (strstr, HAS_SSE4_2 ? __strstr_sse42 : __strstr_sse2);
+#undef strstr
+strong_alias (__libc_strstr, strstr)
diff --git a/libc/sysdeps/x86_64/strtok.S b/libc/sysdeps/x86_64/strtok.S
index fe4a9475b..4028a47f2 100644
--- a/libc/sysdeps/x86_64/strtok.S
+++ b/libc/sysdeps/x86_64/strtok.S
@@ -44,7 +44,7 @@
#else
.bss
.local save_ptr
- ASM_TYPE_DIRECTIVE (save_ptr, @object)
+ .type save_ptr, @object
.size save_ptr, LP_SIZE
save_ptr:
.space LP_SIZE
diff --git a/libc/sysdeps/x86_64/sysdep.h b/libc/sysdeps/x86_64/sysdep.h
index 258781d09..41c3eb2d3 100644
--- a/libc/sysdeps/x86_64/sysdep.h
+++ b/libc/sysdeps/x86_64/sysdep.h
@@ -27,15 +27,13 @@
/* 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. */
#define ENTRY(name) \
- .globl C_SYMBOL_NAME(name); \
- ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \
+ .globl C_SYMBOL_NAME(name); \
+ .type C_SYMBOL_NAME(name),@function; \
.align ALIGNARG(4); \
C_LABEL(name) \
cfi_startproc; \
diff --git a/libc/wcsmbs/Makefile b/libc/wcsmbs/Makefile
index b17c1d38d..3ca9e23ab 100644
--- a/libc/wcsmbs/Makefile
+++ b/libc/wcsmbs/Makefile
@@ -83,9 +83,8 @@ CFLAGS-isoc99_wscanf.c += $(exceptions)
CFLAGS-isoc99_fwscanf.c += $(exceptions)
CFLAGS-isoc99_vwscanf.c += $(exceptions)
CFLAGS-isoc99_vfwscanf.c += $(exceptions)
-ifneq (,$(filter %REENTRANT, $(defines)))
-CPPFLAGS += -D_IO_MTSAFE_IO
-endif
+
+CPPFLAGS += $(libio-mtsafe)
# We need to find the default version of strtold_l in stdlib.
CPPFLAGS-wcstold_l.c = -I../stdlib