native_client/nacl-newlib.git
7 weeks agoFix definition of INTPTR_{MIN,MAX} in stdint.h master
Ben Smith [Thu, 5 Jun 2014 20:47:39 +0000 (13:47 -0700)]
Fix definition of INTPTR_{MIN,MAX} in stdint.h

The newlib headers currently check for __INTPTR_TYPE__ and assume it
means that __INTPTR_MAX__ is defined.

This is true for newer versions of GCC, but it is not true for
pnacl-clang 3.4 (__INTPTR_TYPE__ is defined, but __INTPTR_{MIN,MAX}__
are not).

BUG=none
R=mcgrathr@chromium.org
TEST=built pnacl toolchain locally

Review URL: https://codereview.chromium.org/315213004

7 weeks agoMake new ARMv7 strcmp code NaCl-friendly
Roland McGrath [Mon, 2 Jun 2014 21:56:05 +0000 (14:56 -0700)]
Make new ARMv7 strcmp code NaCl-friendly

Recent upstream changes to the ARMv7 strcmp made it break when
compiled for non-Thumb ARM.  This brings in the same fixes I made
to the glibc version of the identical code when the same changes
from the ARM folks went in there.

BUG= none
TEST= disassembly identical to tested glibc version
R=binji@chromium.org

Review URL: https://codereview.chromium.org/303423005

8 weeks agomerge from upstream
Ben Smith [Fri, 23 May 2014 22:17:57 +0000 (15:17 -0700)]
merge from upstream

2 months ago * libc/machine/sparc/setjmp.S (longjmp): Use register g1 instead of g6. upstream/master
Corinna Vinschen [Thu, 15 May 2014 13:14:25 +0000 (13:14 +0000)]
* libc/machine/sparc/setjmp.S (longjmp): Use register g1 instead of g6.

2 months ago2014-05-14 Sandra Loosemore <sandra@codesourcery.com>
sandra [Wed, 14 May 2014 23:24:36 +0000 (23:24 +0000)]
2014-05-14  Sandra Loosemore  <sandra@codesourcery.com>

Sync from GCC mainline.

* configure.ac (target_makefile_frag): Set for nios2-*-elf*.
* configure: Regenerated.

config/
* mt-nios2-elf: New file.

2 months ago * libc/include/machine/ieeefp.h: Define _DOUBLE_IS_32BITS when double
Corinna Vinschen [Wed, 14 May 2014 11:33:24 +0000 (11:33 +0000)]
* libc/include/machine/ieeefp.h: Define _DOUBLE_IS_32BITS when double
options is not __RL78_64BIT_DOUBLES__.

2 months ago * libc/include/stdint.h (WCHAR_MIN): Copy definition from wchar.h.
Corinna Vinschen [Mon, 12 May 2014 17:02:11 +0000 (17:02 +0000)]
* libc/include/stdint.h (WCHAR_MIN): Copy definition from wchar.h.
(WCHAR_MAX): Ditto.
* libc/include/wchar.h (WCHAR_MIN): Add comment.
(WCHAR_MAX): Ditto.

2 months ago * libc/include/stdio.h (tempnam): Declare as __BSD_VISIBLE or
Corinna Vinschen [Fri, 9 May 2014 14:25:32 +0000 (14:25 +0000)]
* libc/include/stdio.h (tempnam): Declare as __BSD_VISIBLE or
__XSI_VISIBLE or if __POSIX_VISIBLE >= 200112.

2 months ago * libc/include/stdio.h (fcloseall): Declare as __GNU_VISIBLE only.
Corinna Vinschen [Fri, 9 May 2014 08:42:39 +0000 (08:42 +0000)]
* libc/include/stdio.h (fcloseall): Declare as __GNU_VISIBLE only.
(renameat): Drop explicit __CYGWIN__ dependency.

2 months ago * libc/include/stdio.h: Declare various C99 printf/scanf functions for
Corinna Vinschen [Mon, 5 May 2014 12:53:47 +0000 (12:53 +0000)]
* libc/include/stdio.h: Declare various C99 printf/scanf functions for
C++11, too.

2 months ago * msp430/Makefile.in (NOSYS_OBJS): Add unlink.o.
Nick Clifton [Wed, 30 Apr 2014 11:30:11 +0000 (11:30 +0000)]
* msp430/Makefile.in (NOSYS_OBJS): Add unlink.o.
(SCRIPTS): Remove msp430F5438A-s.ld and msp430F5438A-s.ld.
* unlink.c: New file.

3 months ago * libc/machine/arm/strcmp-arm-tiny.S: New file.
rearnsha [Tue, 22 Apr 2014 12:16:21 +0000 (12:16 +0000)]
* libc/machine/arm/strcmp-arm-tiny.S: New file.
* libc/machine/arm/strcmp-armv4.S: New file.
* libc/machine/arm/strcmp-armv4t.S: New file.
* libc/machine/arm/strcmp-armv6.S: New file.
* libc/machine/arm/strcmp-armv7.S: New file.
* libc/machine/arm/strcmp-armv7m.S: New file.
* libc/machine/arm/strcmp.S: Replace with wrapper for various
implementations.
* libc/machine/arm/Makefile.am (strcmp.o, strcmp.obj): Add
dependencies.
* libc/machine/arm/Makefile.in: Regenerated.

3 months ago * libc/sys/rtems/sys/cpuset.h (CPU_SET_S): Add const qualifier.
Corinna Vinschen [Mon, 14 Apr 2014 14:08:25 +0000 (14:08 +0000)]
* libc/sys/rtems/sys/cpuset.h (CPU_SET_S): Add const qualifier.
(CPU_SET): Likewise.

3 months ago* libc/machine/rl78/setjmp.S: Add RL78/G10 support.
DJ Delorie [Wed, 9 Apr 2014 21:35:43 +0000 (21:35 +0000)]
* libc/machine/rl78/setjmp.S: Add RL78/G10 support.

3 months ago2014-04-04 Jeff Johnston <jjohnstn@redhat.com>
Jeff Johnston [Fri, 4 Apr 2014 21:52:07 +0000 (21:52 +0000)]
2014-04-04  Jeff Johnston  <jjohnstn@redhat.com>

        * COPYING.NEWLIB: Add to current TI license to
        include tirtos addition.

3 months ago2014-04-04 Ashish Kapania <akapania@ti.com>
Jeff Johnston [Fri, 4 Apr 2014 21:43:55 +0000 (21:43 +0000)]
2014-04-04  Ashish Kapania  <akapania@ti.com>

        * arm/configure.in: (*-*-tirtos*) Accept TIRTOS target when setting
        objtype
        * arm/configure: Regenerated.

3 months ago2014-04-04 Ashish Kapania <akapania@ti.com>
Jeff Johnston [Fri, 4 Apr 2014 21:40:58 +0000 (21:40 +0000)]
2014-04-04  Ashish Kapania  <akapania@ti.com>

        * configure.host (sys_dir, newlib_cflags): Set sys_dir to tirtos and use
        -D__DYNAMIC_REENT__ and -DMALLOC_PROVIDED compiler options for TIRTOS
        target.
        * libc/stdio/local.h (_STDIO_CLOSE_PER_REENT_STD_STREAMS): Change #ifdef
        to not define this macro when __tirtos__ is defined.
        * libc/sys/tirtos : Add support for TIRTOS.
        * libc/sys/tirtos/Makefile.am, libc/sys/tirtos/lock.c: New files.
        * libc/sys/tirtos/configure.in, libc/sys/tirtos/include/sys/lock.h: Ditto.

3 months ago * libc/machine/arm/acle-compat.h: New file.
rearnsha [Thu, 27 Mar 2014 13:26:39 +0000 (13:26 +0000)]
* libc/machine/arm/acle-compat.h: New file.
* libc/machine/arm/arm_asm.h: Use it.

4 months ago2014-03-21 Maciej W. Rozycki <macro@codesourcery.com>
Jeff Johnston [Fri, 21 Mar 2014 21:27:28 +0000 (21:27 +0000)]
2014-03-21  Maciej W. Rozycki  <macro@codesourcery.com>

        * libc/stdlib/gd_qnan.h (f_QNAN, d_QNAN0, d_QNAN1): Add MIPS
        versions.
        (ld_QNAN0, ld_QNAN1, ld_QNAN2, ld_QNAN3): Don't define for MIPS.
        (ldus_QNAN0, ldus_QNAN1, ldus_QNAN2, ldus_QNAN3, ldus_QNAN4):
        Likewise.
        * libc/stdlib/ldtoa.c (nan113, nan64, nan53, nan24): Add MIPS
        versions.
        (enan): Handle legacy MIPS payloads.
        * libm/common/s_nan.c (nan): Use __builtin_nan if supported by
        the compiler.
        * libm/common/sf_nan.c (nanf): Likewise.

4 months ago2014-03-21 Sabrini Ni <sabrinanitw@gmail.com>
Jeff Johnston [Fri, 21 Mar 2014 21:17:42 +0000 (21:17 +0000)]
2014-03-21  Sabrini Ni  <sabrinanitw@gmail.com>

        * nds32/_sbrk.S: Add .size and .type directive.

4 months ago2014-03-21 Sabrini Ni <sabrinanitw@gmail.com>
Jeff Johnston [Fri, 21 Mar 2014 21:16:39 +0000 (21:16 +0000)]
2014-03-21  Sabrini Ni  <sabrinanitw@gmail.com>

        * nds32/crt0.S: Tweak initialization sqeuence.
        * nds32/crt1.S: Ditto.

4 months ago2014-03-21 Sabrina Ni <sabrinanitw@gmail.com>
Jeff Johnston [Fri, 21 Mar 2014 21:15:15 +0000 (21:15 +0000)]
2014-03-21  Sabrina Ni  <sabrinanitw@gmail.com>

        * libc/machine/nds32/configure: Regenerated.
        * libc/machine/nds32/configure.in: Add AC_NOEXECUTABLES.

4 months ago2014-03-21 Sabrina Ni <sabrinanitw@gmail.com>
Jeff Johnston [Fri, 21 Mar 2014 21:09:46 +0000 (21:09 +0000)]
2014-03-21  Sabrina Ni  <sabrinanitw@gmail.com>

        * libc/machine/nds32/Makefile.am: Use C code implemented memcpy,
        memset for 'ISA V3M'.
        * libc/machine/nds32/Makefile.in: Generated.
        * libc/machine/nds32/configure: Generated.
        * libc/machine/nds32/configure.in: Detect IS_NDS32_ISA_V3M.

4 months ago2014-03-21 Sabrini Ni <sabrinanitw@gmail.com>
Jeff Johnston [Fri, 21 Mar 2014 21:02:50 +0000 (21:02 +0000)]
2014-03-21  Sabrini Ni  <sabrinanitw@gmail.com>

        * nds32/_argv.S: Replace syscall with break.
        * nds32/_argvlen.S: Ditto.
        * nds32/_chdir.S: Ditto.
        * nds32/_chmod.S: Ditto.
        * nds32/_close.S: Ditto.
        * nds32/_exit.S: Ditto.
        * nds32/_fstat.S: Ditto.
        * nds32/_getpid.S: Ditto.
        * nds32/_gettimeofday.S: Ditto.
        * nds32/_isatty.S: Ditto.
        * nds32/_kill.S: Ditto.
        * nds32/_link.S: Ditto.
        * nds32/_lseek.S: Ditto.
        * nds32/_open.S: Ditto.
        * nds32/_read.S: Ditto.
        * nds32/_rename.S: Ditto.
        * nds32/_stat.S: Ditto.
        * nds32/_system.S: Ditto.
        * nds32/_time.S: Ditto.
        * nds32/_times.S: Ditto.
        * nds32/_unlink.S: Ditto.
        * nds32/_utime.S: Ditto.
        * nds32/_write.S: Ditto.
        * nds32/syscall_error_handler.S: Ditto.
        * nds32/vh.h: New.

4 months ago2014-03-21 Sabrini Ni <sabrinanitw@gmail.com>
Jeff Johnston [Fri, 21 Mar 2014 20:58:54 +0000 (20:58 +0000)]
2014-03-21  Sabrini Ni  <sabrinanitw@gmail.com>

        * nds32/crt0.S: Initialize ITB base.
        * nds32/crt1.S: Ditto.

4 months ago2014-03-21 Sabrini Ni <sabrinanitw@gmail.com>
Jeff Johnston [Fri, 21 Mar 2014 20:55:50 +0000 (20:55 +0000)]
2014-03-21  Sabrini Ni  <sabrinanitw@gmail.com>

        * nds32/Makefile.in: Alter filename.
        * nds32/syscall_argv.S: Rename to _argv.S
        * nds32/syscall_argvlen.S: Rename to _argvlen.S
        * nds32/syscall_chdir.S: Rename to _chdir.S
        * nds32/syscall_chmod.S: Rename to _chmod.S
        * nds32/syscall_close.S: Rename to _close.S
        * nds32/syscall_exit.S: Rename to _exit.S
        * nds32/syscall_fstat.S: Rename to _fstat.S
        * nds32/syscall_getpid.S: Rename to _getpid.S
        * nds32/syscall_gettimeofday.S: Rename to _gettimeofday.S
        * nds32/syscall_isatty.S: Rename to _isatty.S
        * nds32/syscall_kill.S: Rename to _kill.S
        * nds32/syscall_link.S: Rename to _link.S
        * nds32/syscall_lseek.S: Rename to _lseek.S
        * nds32/syscall_open.S: Rename to _open.S
        * nds32/syscall_read.S: Rename to _read.S
        * nds32/syscall_rename.S: Rename to _rename.S
        * nds32/syscall_sbrk.S: Rename to _sbrk.S
        * nds32/syscall_stat.S: Rename to _stat.S
        * nds32/syscall_system.S: Rename to _system.S
        * nds32/syscall_time.S: Rename to _time.S
        * nds32/syscall_times.S: Rename to _times.S
        * nds32/syscall_unlink.S: Rename to _unlink.S
        * nds32/syscall_utime.S: Rename to _utime.S
        * nds32/syscall_write.S: Rename to _write.S

4 months ago2014-03-21 Sabrini Ni <sabrinanitw@gmail.com>
Jeff Johnston [Fri, 21 Mar 2014 20:34:45 +0000 (20:34 +0000)]
2014-03-21  Sabrini Ni  <sabrinanitw@gmail.com>

        * nds32/syscall_argv.S: Correct the method to set errno.
        * nds32/syscall_argvlen.S: Ditto.
        * nds32/syscall_chdir.S: Ditto.
        * nds32/syscall_chmod.S: Ditto.
        * nds32/syscall_close.S: Ditto.
        * nds32/syscall_error_handler.S: Ditto.
        * nds32/syscall_fstat.S: Ditto.
        * nds32/syscall_getpid.S: Ditto.
        * nds32/syscall_gettimeofday.S: Ditto.
        * nds32/syscall_isatty.S: Ditto.
        * nds32/syscall_kill.S: Ditto.
        * nds32/syscall_link.S: Ditto.
        * nds32/syscall_lseek.S: Ditto.
        * nds32/syscall_open.S: Ditto.
        * nds32/syscall_read.S: Ditto.
        * nds32/syscall_rename.S: Ditto.
        * nds32/syscall_sbrk.S: Ditto.
        * nds32/syscall_stat.S: Ditto.
        * nds32/syscall_system.S: Ditto.
        * nds32/syscall_time.S: Ditto.
        * nds32/syscall_times.S: Ditto.
        * nds32/syscall_unlink.S: Ditto.
        * nds32/syscall_utime.S: Ditto.
        * nds32/syscall_write.S: Ditto.

4 months ago2014-03-21 Sabrina Ni <sabrinanitw@gmail.com>
Jeff Johnston [Fri, 21 Mar 2014 20:28:57 +0000 (20:28 +0000)]
2014-03-21  Sabrina Ni  <sabrinanitw@gmail.com>

        * libc/machine/nds32/setjmp.S: Keep jmp_buff sync with GDB.

4 months ago2014-03-21 Sabrini Ni <sabrinanitw@gmail.com>
Jeff Johnston [Fri, 21 Mar 2014 20:27:41 +0000 (20:27 +0000)]
2014-03-21  Sabrini Ni  <sabrinanitw@gmail.com>

        * nds32/crt0.S: Use pseudo-instruction "bal frame" to replace
        "la + jral".
        * nds32/crt1.S: Ditto.

4 months ago2014-03-21 Sabrini Ni <sabrinanitw@gmail.com>
Jeff Johnston [Fri, 21 Mar 2014 20:26:00 +0000 (20:26 +0000)]
2014-03-21  Sabrini Ni  <sabrinanitw@gmail.com>

        * nds32/crt0.S: Eliminate initialization for $fp.
        * nds32/crt1.S: Ditto.

4 months ago2014-03-21 Sabrini Ni <sabrinanitw@gmail.com>
Jeff Johnston [Fri, 21 Mar 2014 20:24:04 +0000 (20:24 +0000)]
2014-03-21  Sabrini Ni  <sabrinanitw@gmail.com>

        * nds32/crt0.S: Refine.
        * nds32/crt1.S: Refine.

4 months ago2014-03-21 Sabrini Ni <sabrinanitw@gmail.com>
Jeff Johnston [Fri, 21 Mar 2014 20:22:29 +0000 (20:22 +0000)]
2014-03-21  Sabrini Ni  <sabrinanitw@gmail.com>

        * nds32/crt0.S: Set argc=argv=env=0.
        * nds32/crt1.S: Ditto.

4 months ago2014-03-21 Sabrini Ni <sabrinanitw@gmail.com>
Jeff Johnston [Fri, 21 Mar 2014 20:20:53 +0000 (20:20 +0000)]
2014-03-21  Sabrini Ni  <sabrinanitw@gmail.com>

        * nds32/Makefile.in: Add syscall_error_handler.o.
        * nds32/syscall_error_handler.S: New.
        * nds32/syscall_extra.h: Reduce code size.

4 months ago2014-03-21 Sabrini Ni <sabrinanitw@gmail.com>
Jeff Johnston [Fri, 21 Mar 2014 20:16:13 +0000 (20:16 +0000)]
2014-03-21  Sabrini Ni  <sabrinanitw@gmail.com>

        * nds32/syscall_extra.h: Define macro.
        * nds32/syscall_argv.S: Use define macro.
        * nds32/syscall_argvlen.S: Ditto.
        * nds32/syscall_chdir.S: Ditto.
        * nds32/syscall_chmod.S: Ditto.
        * nds32/syscall_close.S: Ditto.
        * nds32/syscall_fstat.S: Ditto.
        * nds32/syscall_getpid.S: Ditto.
        * nds32/syscall_gettimeofday.S: Ditto.
        * nds32/syscall_isatty.S: Ditto.
        * nds32/syscall_kill.S: Ditto.
        * nds32/syscall_link.S: Ditto.
        * nds32/syscall_lseek.S: Ditto.
        * nds32/syscall_open.S: Ditto.
        * nds32/syscall_read.S: Ditto.
        * nds32/syscall_rename.S: Ditto.
        * nds32/syscall_stat.S: Ditto.
        * nds32/syscall_system.S: Ditto.
        * nds32/syscall_time.S: Ditto.
        * nds32/syscall_times.S: Ditto.
        * nds32/syscall_unlink.S: Ditto.
        * nds32/syscall_utime.S: Ditto.
        * nds32/syscall_write.S: Ditto.

4 months ago2014-03-21 Sabrina Ni <sabrinanitw@gmail.com>
Jeff Johnston [Fri, 21 Mar 2014 20:09:10 +0000 (20:09 +0000)]
2014-03-21  Sabrina Ni  <sabrinanitw@gmail.com>

        * libc/machine/nds32/setjmp.S: Optimize.

4 months ago * libc/include/stdlib.h (strtold): Define if _HAVE_LONG_DOUBLE is
Corinna Vinschen [Fri, 7 Mar 2014 20:06:53 +0000 (20:06 +0000)]
* libc/include/stdlib.h (strtold): Define if _HAVE_LONG_DOUBLE is
defined.
* libc/stdlib/strtold.c (strtold): Ditto.  Call strtod on systems
with long double == double, _strtold otherwise.

4 months ago * libc/include/time.h (__TM_GMTOFF): Remove Cygwin-specific definition.
Corinna Vinschen [Wed, 5 Mar 2014 12:49:40 +0000 (12:49 +0000)]
* libc/include/time.h (__TM_GMTOFF): Remove Cygwin-specific definition.
(__TM_ZONE): Ditto.

4 months ago * libc/include/time.h (__TM_GMTOFF): Define on Cygwin.
Corinna Vinschen [Wed, 5 Mar 2014 12:43:12 +0000 (12:43 +0000)]
* libc/include/time.h (__TM_GMTOFF): Define on Cygwin.
(__TM_ZONE): Ditto.
(struct tm): Add __TM_GMTOFF and __TM_ZONE members if they are defined.

4 months ago2014-02-27 Joey Ye <joey.ye@arm.com>
Jeff Johnston [Tue, 4 Mar 2014 17:39:26 +0000 (17:39 +0000)]
2014-02-27  Joey Ye  <joey.ye@arm.com>

        * libnosys/sbrk.c (_sbrk): Remove TWS

4 months ago * libc/include/machine/_default_types.h: Define unsigned type using
Corinna Vinschen [Tue, 4 Mar 2014 08:05:39 +0000 (08:05 +0000)]
* libc/include/machine/_default_types.h: Define unsigned type using
signed type macros in case unsigned type macros are not available.

5 months ago * libm/complex/complex.tex: Fix wrong syntax in documentation.
Corinna Vinschen [Thu, 20 Feb 2014 18:59:09 +0000 (18:59 +0000)]
* libm/complex/complex.tex: Fix wrong syntax in documentation.
* libm/math/math.tex: Ditto.

5 months ago * libc/stdio/open_memstream.c (internal_open_memstream_r): Initialize
Corinna Vinschen [Thu, 20 Feb 2014 13:32:34 +0000 (13:32 +0000)]
* libc/stdio/open_memstream.c (internal_open_memstream_r): Initialize
c->pos to 0.

5 months ago2014-02-11 Joey Ye <joey.ye@arm.com>
Jeff Johnston [Tue, 11 Feb 2014 19:55:22 +0000 (19:55 +0000)]
2014-02-11  Joey Ye  <joey.ye@arm.com>

        * arm/syscalls.c (_sbrk): Define as weak symbols.
        (_read, _write): Ditto.

5 months ago2014-02-11 Joey Ye <joey.ye@arm.com>
Jeff Johnston [Tue, 11 Feb 2014 19:54:29 +0000 (19:54 +0000)]
2014-02-11  Joey Ye  <joey.ye@arm.com>

        * libc/sys/arm/syscalls.c (_sbrk): Define as weak symbols.
        (_read, _write): Ditto.

5 months agoFix fopen.c when REENTRANT_SYSCALLS_PROVIDED is defined.
Sam Clegg [Mon, 10 Feb 2014 17:54:17 +0000 (09:54 -0800)]
Fix fopen.c when REENTRANT_SYSCALLS_PROVIDED is defined.

Always in include <fcntl.h> in fopen.c so the that the forward
declation of open(2) is present.

This is needed for any platform that uses
REENTRANT_SYSCALLS_PROVIDED, because in this mode
_open_r is defined to open.

For whatever reason this ended up effecting the PNaCl
toolchain but not the NaCl one.

BUG= https://code.google.com/p/nativeclient/issues/detail?id=3782
R=mcgrathr@chromium.org

Review URL: https://codereview.chromium.org/137813007

5 months ago * libc/include/pwd.h: Include <sys/cdefs.h>.
Corinna Vinschen [Sun, 9 Feb 2014 20:02:16 +0000 (20:02 +0000)]
* libc/include/pwd.h: Include <sys/cdefs.h>.
* libc/include/grp.h: Ditto.

5 months agoRemove isatty and rename symbols from newlib NaCl build.
Sam Clegg [Thu, 6 Feb 2014 21:21:25 +0000 (13:21 -0800)]
Remove isatty and rename symbols from newlib NaCl build.

The net effect of this change is that libcrt_common.a ends
up having undefined references to isatty and rename that
can then be provided by libnacl, just like the other
syscalls.

This is achieved by defining HAVE_ISATTY and HAVE_RENAME
in configure.host and honoring these in isatty.c and
rename.c.

Also, add _rename to _syslist.h when MISSING_SYSCALL_NAMES
is defined.  This means that just like of the _r function,
when _rename_r calls _rename it will really be calling
rename (without the underscore).

TEST= toolchain trybots
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3776
R=mseaborn@chromium.org

Review URL: https://codereview.chromium.org/138423004

5 months ago PR target/59788
Rainer Orth [Wed, 5 Feb 2014 13:17:47 +0000 (13:17 +0000)]
PR target/59788
* ltmain.sh (opt_duplicate_compiler_generated_deps): Enable on
*solaris2*.

5 months ago2014-02-04 Matthias Braun <matze@braunis.de>
Jeff Johnston [Tue, 4 Feb 2014 20:49:53 +0000 (20:49 +0000)]
2014-02-04  Matthias Braun  <matze@braunis.de>

        * libm/mathfp/sf_numtest.c: Fix NaN/Inf detection logic.

5 months agoDefine REENTRANT_SYSCALLS_PROVIDED when building for NaCl.
Sam Clegg [Tue, 4 Feb 2014 19:10:36 +0000 (11:10 -0800)]
Define REENTRANT_SYSCALLS_PROVIDED when building for NaCl.

The effect of this change is to remove the _<syscall>_r
wrapper functions and have the syscalls invoked directly
when called from within newlib.

After consulting the documentation in reent.h it seems
to me that NaCl should be defining both
REENTRANT_SYSCALLS_PROVIDED and MISSING_SYSCALL_NAMES.
The _<syscall>_r function in libc/reent and used for
cases where the actual syscall function are not build
against newlib and therefore don't correctly set its
TLS-based errno value.

Since libnacl (where the NaCl syscalls live) is built
against newlib all the NaCl syscalls are already
reentrant in that sense and there is no need for the
_<syscall>_r wrappers.

syscall invocations from outside the newlib were already
calling the libnacl syscalls directly so this change
only effects internal syscalls from within newlib.

TEST= toolchain trybots
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3782
R=mcgrathr@chromium.org

Review URL: https://codereview.chromium.org/148213015

5 months ago * aarch64/Makefile.in (RDIMON_SCRIPTS): Rule to build in-tree copies
rearnsha [Mon, 3 Feb 2014 10:30:34 +0000 (10:30 +0000)]
* aarch64/Makefile.in (RDIMON_SCRIPTS): Rule to build in-tree copies
of scripts.
(all): Build the in-tree copies of the scripts.
(clean): Also delete the in-tree copies of the scripts.

5 months ago* msp430/Makefile.in (crt0-minrt.o, crtn-minrt.o): New. Build
DJ Delorie [Thu, 30 Jan 2014 02:46:34 +0000 (02:46 +0000)]
* msp430/Makefile.in (crt0-minrt.o, crtn-minrt.o): New.  Build
from crt0.S with -DMINRT.
(CRT_OBJS): Expand.
(crt_%.o): New rule pattern.  Build multiple objects from crt0.S.
* msp430/crt0.S: Further break out functionality.  Support -DMINRT
that omits all init/fini logic.
* msp430/crtn.S: Likewise.
* msp430/msp430-sim.ld: Wildcard all .crt_* sections, sorted.
* msp430/msp430.ld: Likewise.
* msp430/msp430xl-sim.ld: Likewise.

5 months agoRevert "Fix race condition in concurrent printf and fopen."
Sam Clegg [Thu, 30 Jan 2014 00:12:00 +0000 (16:12 -0800)]
Revert "Fix race condition in concurrent printf and fopen."

This reverts commit a46dfff66f8c8f13a7be3b78bd4c81ba0b94ccb0
since it introduced a possible deadlock between two threads
calling fopen() and fclose().  See: http://codereview.chromium.org/7604003

fclose() takes two locks using _flockfile() and then later
on __sfp_lock_acquire().  __sfp previously only took one
lock using __sfp_lock_acquire but this change added an inner
call to _flockfile() which causes deadlock.

Although accessing the fp->flags in __sfp to check it
against zero is technically a data race with any function
that writes to it, this seems to be by design here.

Specifically, AFAICT, the race with printf() can't change
the outcome of the zero test since flags is guarantees to
be non-zero both before and after the call or ORIENT().
So my conclusion is that tsan found a false positive here.

BUG=338220
R=mcgrathr@chromium.org

Committed: https://git.chromium.org/gitweb?p=native_client/nacl-newlib.git;a=commit;h=d28ae86

Review URL: https://codereview.chromium.org/145953007

5 months ago * aarch64/cpu-init/rdimon-aem-el3.S (flat_map): Use bic-immediate
Corinna Vinschen [Tue, 28 Jan 2014 11:16:19 +0000 (11:16 +0000)]
* aarch64/cpu-init/rdimon-aem-el3.S (flat_map): Use bic-immediate
form to clear WXN bit.

5 months ago2014-01-24 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
Jeff Johnston [Fri, 24 Jan 2014 19:01:15 +0000 (19:01 +0000)]
2014-01-24  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

        * aarch64/cpu-init/rdimon-aem-el3.S (flat_map): Clear WXN bit
        in SCTLR_EL3. Add dsb.

6 months ago * libc/include/setjmp.h (longjmp): Fix copy/paste error.
Corinna Vinschen [Mon, 20 Jan 2014 17:23:40 +0000 (17:23 +0000)]
* libc/include/setjmp.h (longjmp): Fix copy/paste error.

6 months ago * libc/include/setjmp.h (longjmp): Mark "noreturn" when building with
Corinna Vinschen [Sun, 19 Jan 2014 09:38:33 +0000 (09:38 +0000)]
* libc/include/setjmp.h (longjmp): Mark "noreturn" when building with
GCC.

6 months agoAdd -D_I386MACH_ALLOW_HW_INTERRUPTS in configure.host for nacl
Roland McGrath [Fri, 17 Jan 2014 21:59:28 +0000 (13:59 -0800)]
Add -D_I386MACH_ALLOW_HW_INTERRUPTS in configure.host for nacl

Add this predefine in the configure stage, so that it's no longer
necessary to pass it on the configure command line in CFLAGS_FOR_TARGET.

BUG= none
TEST= none
R=bradnelson@google.com

Review URL: https://codereview.chromium.org/141923002

6 months ago * libc/include/pwd.h: Use __foo_VISIBLE macros from sys/cdefs.h.
Corinna Vinschen [Fri, 17 Jan 2014 14:54:31 +0000 (14:54 +0000)]
* libc/include/pwd.h: Use __foo_VISIBLE macros from sys/cdefs.h.
(setpassent): Declare.

6 months ago * libc/include/sys/_default_fcntl.h (LOCK_SH): Define.
Corinna Vinschen [Fri, 17 Jan 2014 10:57:54 +0000 (10:57 +0000)]
* libc/include/sys/_default_fcntl.h (LOCK_SH): Define.
(LOCK_EX): Likewise.
(LOCK_NB): Likewise.
(LOCK_UN): Likewise.
(flock): Declare.

6 months ago Introduce _STDIO_BSD_SEMANTICS flag to switch fclose/exit file flushing
Corinna Vinschen [Fri, 17 Jan 2014 10:55:31 +0000 (10:55 +0000)]
Introduce _STDIO_BSD_SEMANTICS flag to switch fclose/exit file flushing
semantics from POSIX to BSD.
* libc/stdio/fclose.c (_fclose_r): Conditionalize file flushing on
_STDIO_BSD_SEMANTICS.  Call __sflush_r rather than _fflush_r.  Add
comment.
* libc/stdio/fflush.c (__sflushw_r): New function, only available
if _STDIO_BSD_SEMANTICS is defined.
* libc/stdio/findfp.c (_cleanup_r): Call _fwalk_reent rather than
_fwalk.  Conditionalize cleanup function call on _STDIO_BSD_SEMANTICS.
Add comments.  Add FIXME.
* libc/stdio/local.h (__sflushw_r): Declare if _STDIO_BSD_SEMANTICS is
defined.

6 months ago2014-01-10 Jeff Johnston <jjohnstn@redhat.com>
Jeff Johnston [Fri, 10 Jan 2014 23:04:01 +0000 (23:04 +0000)]
2014-01-10  Jeff Johnston  <jjohnstn@redhat.com>

        * arm/configure.in: Revert previous fix and change host_makefile_frag
        to calculate the absolute location of srcdir/../config/default.mh.
        * arm/configure: Regenerated.

6 months ago2014-01-07 Jeff Johnston <jjohnstn@redhat.com>
Jeff Johnston [Tue, 7 Jan 2014 22:41:38 +0000 (22:41 +0000)]
2014-01-07  Jeff Johnston  <jjohnstn@redhat.com>

        * arm/configure.in: Fix host_makefile_frag to use ac_abs_srcdir.
        * arm/configure: Regenerated.

6 months ago2014-01-06 Sebastian Huber <sebastian.huber@embedded-brains.de>
Jeff Johnston [Mon, 6 Jan 2014 20:59:37 +0000 (20:59 +0000)]
2014-01-06  Sebastian Huber  <sebastian.huber@embedded-brains.de>

        * libc/include/sys/_default_fcntl.h (AT_FDCWD): Define according
        to POSIX.
        (AT_EACCESS): Likewise.
        (AT_SYMLINK_NOFOLLOW): Likewise.
        (AT_SYMLINK_FOLLOW): Likewise.
        (AT_REMOVEDIR): Likewise.
        (openat): Declare according to POSIX.
        * libc/include/stdio.h (renameat): Likewise.
        * libc/include/sys/stat.h (fchmodat): Likewise.
        (fstatat): Likewise.
        (mkdirat): Likewise.
        (mkfifoat): Likewise.
        (mknodat): Likewise.
        (utimensat): Likewise.
        (futimens): Likewise.
        * libc/include/sys/unistd.h (faccessat): Likewise.
        (fchownat): Likewise.
        (linkat): Likewise.
        (readlinkat): Likewise.
        (symlinkat): Likewise.
        (unlinkat): Likewise.

6 months ago2014-01-06 Mike Frysinger <vapier@gentoo.org>
Jeff Johnston [Mon, 6 Jan 2014 19:50:32 +0000 (19:50 +0000)]
2014-01-06  Mike Frysinger  <vapier@gentoo.org>

        * libc/search/hash.c (hash_delete): Change __uint32_t to u_int.
        (hash_get): Likewise.
        (hash_put): Likewise.
        (hash_seq): Likewise.
        (hash_sync): Likewise.

Also fix former ChangeLog entry to be 2014.

6 months ago2013-01-06 Mike Frysinger <vapier@gentoo.org>
Jeff Johnston [Mon, 6 Jan 2014 19:30:50 +0000 (19:30 +0000)]
2013-01-06  Mike Frysinger  <vapier@gentoo.org>

        * libc/ctype/jp2uc.c: Include string.h.

7 months ago2013-12-23 Jeff Johnston <jjohnstn@redhat.com>
Jeff Johnston [Mon, 23 Dec 2013 20:44:58 +0000 (20:44 +0000)]
2013-12-23  Jeff Johnston  <jjohnstn@redhat.com>

        * NEWS: Update with 2.1.0 info.
        * README: Ditto.
        * acinclude.m4: Change version number to 2.1.0.
        * aclocal.m4: Regenerated.
        * configure: Ditto.
        * Makefile.in: Regenerated.
        * doc/aclocal.m4: Ditto.
        * doc/configure: Ditto.
        * libc/*/aclocal.m4: Ditto.
        * libc/*/configure: Ditto.
        * libc/libc.texinfo: Ditto.
        * libm/*/aclocal.m4: Ditto.
        * libm/*/configure: Ditto.
        * libm/libm.texinfo: Ditto.
        * libc/sys/linux/shared.ld: Add VERS_2.1

7 months ago2013-12-22 JF Bastien <jfb@chromium.org>
Jeff Johnston [Mon, 23 Dec 2013 19:21:07 +0000 (19:21 +0000)]
2013-12-22  JF Bastien  <jfb@chromium.org>

        * libc/include/limits.h: Define LLONG_MIN, LLONG_MAX and ULLONG_MAX
        for C++11 too.
        * libc/include/stdlib.h: Define struct lldiv_t, _Exit, atoll, llabs
        and lldiv for C99 and C++11.  Move wcstold to wchar.h.
        * libc/include/wchar.h: Define WCHAR_MIN and WCHAR_MAX according to
        __WCHAR_UNSIGNED__ if it is provided, and correct the limit when
        unsigned (to 32 all-1 bits, not 31).  Define FILE as in stdio.h.
        Move wcstold from stdlib.h here.

7 months ago * configure.host (newlib_cflags): Use -Os, -ffunction-sections and
Nick Clifton [Fri, 20 Dec 2013 10:27:48 +0000 (10:27 +0000)]
* configure.host (newlib_cflags): Use -Os, -ffunction-sections and
-fdata-sections for RL78.

7 months ago * libc/stdio/vfwscanf.c (__SVFWSCANF_R): Fix fetching decimal_point in
Corinna Vinschen [Thu, 19 Dec 2013 18:50:00 +0000 (18:50 +0000)]
* libc/stdio/vfwscanf.c (__SVFWSCANF_R): Fix fetching decimal_point in
!_MB_CAPABLE as well as in !__HAVE_LOCALE_INFO_EXTENDED__ case.

7 months agoFix ChangeLog entry
Corinna Vinschen [Thu, 19 Dec 2013 09:50:19 +0000 (09:50 +0000)]
Fix ChangeLog entry

7 months ago * vfscanf.c (BUF): Change definition to take multibyte decimal point
Corinna Vinschen [Wed, 18 Dec 2013 19:23:33 +0000 (19:23 +0000)]
* vfscanf.c (BUF): Change definition to take multibyte decimal point
into account.
(__SVFSCANF_R): Handle radix char language-dependent
per POSIX.
(__SVFWSCANF_R): Ditto.

7 months ago2013-12-10 Jeff Johnston <jjohnstn@redhat.com>
Jeff Johnston [Tue, 10 Dec 2013 18:57:30 +0000 (18:57 +0000)]
2013-12-10  Jeff Johnston  <jjohnstn@redhat.com>

        * acconfig.h: Add _HAVE_CC_INHIBIT_LOOP_TO_LIBCALL.
        * newlib.hin: Ditto.
        * configure: Regenerate.
        * configure.in: Add setting of _HAVE_CC_INHIBIT_LOOP_TO_LIBCALL.
        * libc/string/local.h: Add check for _HAVE_CC_INHIBIT_LOOP_TO_LIBCALL
        and set __inhibit_loop_to_libcall macro appropriately.
        * libc/string/memmove.c: Use __inhibit_loop_to_libcall macro in
        function declaration.
        * libc/string/memset.c: Ditto.

7 months ago * libc/sys/rtems/include/limits.h: Update page size to match
Corinna Vinschen [Tue, 10 Dec 2013 09:20:37 +0000 (09:20 +0000)]
* libc/sys/rtems/include/limits.h: Update page size to match
libc/sys/rtems/machine/param.h.

7 months ago2013-12-04 Steve Ellcey <sellcey@mips.com>
Steve Ellcey [Wed, 4 Dec 2013 21:18:02 +0000 (21:18 +0000)]
2013-12-04  Steve Ellcey <sellcey@mips.com>

* mips/cfe_api.h: Include stdint.h.

7 months ago * libc/sys/rtems/sys/cpuset.h: Use __inline instead of inline.
Corinna Vinschen [Tue, 3 Dec 2013 16:07:32 +0000 (16:07 +0000)]
* libc/sys/rtems/sys/cpuset.h: Use __inline instead of inline.

7 months ago * libc/include/machine/_default_types.h: Move extern "C" after
Corinna Vinschen [Tue, 3 Dec 2013 16:04:40 +0000 (16:04 +0000)]
* libc/include/machine/_default_types.h: Move extern "C" after
header includes.  Include <sys/features.h> for
__GNUC_PREREQ__().
(__u?int.*_t): Define via GCC provided __U?INT.*_TYPE__ if
available.
(__intptr_t): Define.
(__uintptr_t): Likewise.
* libc/include/stdint.h: Include <machine/_default_types.h>
instead of <_ansi.h>.
(u?int.*_t): Define via __u?int.*_t provided by
<machine/_default_types.h>.
(u?int_fast.*_t): Define via GCC provided
__U?INT_FAST.*_TYPE__ if available.
(U?INT.*(MIN|MAX)): Define via GCC provided __U?INT.*(MIN|MAX)__
if available.
(U?INT.*_C): Define via GCC provided __U?INT.*_C if available.
* libc/include/sys/cdefs.h: Use <machine/_default_types.h>
instead of <stdint.h>.
* libc/sys/rtems/sys/cpuset.h: Likewise.
* libc/sys/rtems/machine/_types.h: Include <stdint.h> for
FreeBSD compatibility.

7 months ago2013-11-29 Sebastian Huber <sebastian.huber@embedded-brains.de>
Joel Sherrill [Fri, 29 Nov 2013 23:35:33 +0000 (23:35 +0000)]
2013-11-29  Sebastian Huber <sebastian.huber@embedded-brains.de>

* libc/include/pthread.h (pthread_cleanup_push): Delete prototype
and add macro of the same name.
(pthread_cleanup_pop): Likewise.
(_pthread_cleanup_context): Define.
(_pthread_cleanup_push): Likewise.
(_pthread_cleanup_pop): Likewise.
(pthread_cleanup_push_defer_np): Define if _GNU_SOURCE is defined.
(pthread_cleanup_pop_restore_np): Likewise.
(_pthread_cleanup_push_defer): Likewise.
(_pthread_cleanup_pop_restore): Likewise.

7 months ago2013-11-29 Jennifer Averett <jennifer.averett@oarcorp.com>
Joel Sherrill [Fri, 29 Nov 2013 23:14:56 +0000 (23:14 +0000)]
2013-11-29  Jennifer Averett <jennifer.averett@oarcorp.com>

* libc/include/pthread.h (pthread_attr_setaffinity_np):
Add pthread SMP affinity attributes to methods to RTEMS for
compatibility with GNU/Linux.
(pthread_attr_getaffinity_np): Likewise.
(pthread_setaffinity_np): Likewise.
(pthread_getaffinity_np): Likewise.
(pthread_getattr_np): Add for GNU/Linux compatibility.
* libc/include/sys/types.h: Add cpuset to pthread_attr_t for RTEMS.
* libc/include/sys/cdefs.h (_GNU_SOURCE): Defining _GNU_SOURCE
turns on all _XXX_VISBLE feature flags.

7 months ago2013-11-27 Sebastian Huber <sebastian.huber@embedded-brains.de>
Joel Sherrill [Wed, 27 Nov 2013 14:53:58 +0000 (14:53 +0000)]
2013-11-27  Sebastian Huber  <sebastian.huber@embedded-brains.de>

* libc/sys/rtems/cpusetalloc.c: New file.
* libc/sys/rtems/cpusetfree.c: Likewise.
* libc/sys/rtems/Makefile.am (lib_a_SOURCES): Add new files.
* libc/sys/rtems/Makefile.in: Regenerate.
* libc/sys/rtems/sys/cpuset.h: Delete #if 0 block.  Include
<stddef.h> for size_t.
(_NCPUBITS): Avoid NBBY and assume 8 bits per char.
(__cpuset_mask): Use int instead of size_t parameter for Linux
compatibility.
(__cpuset_index): Likewise.
(__cpuset_alloc): Declare.
(__cpuset_free): Likewise.
(CPU_ALLOC_SIZE): Likewise.
(CPU_ALLOC): Define.
(CPU_FREE): Likewise.
(CPU_ZERO_S): Likewise.
(CPU_FILL_S): Likewise.
(CPU_SET_S): Likewise.
(CPU_CLR_S): Likewise.
(CPU_ISSET_S): Likewise.
(CPU_COUNT_S): Likewise.
(CPU_AND_S): Likewise.
(CPU_OR_S): Likewise.
(CPU_XOR_S): Likewise.
(CPU_NAND_S): Likewise.
(CPU_EQUAL_S): Likewise.
(CPU_ZERO): Use CPU_ZERO_S().
(CPU_FILL): Use CPU_FILL_S().
(CPU_SET): Use CPU_SET_S().
(CPU_CLR): Use CPU_CLR_S().
(CPU_ISSET): Use CPU_ISSET_S().
(CPU_COUNT): Use CPU_COUNT_S().
(CPU_AND): Use CPU_AND_S().
(CPU_OR): Use CPU_OR_S().
(CPU_XOR): Use CPU_XOR_S().
(CPU_NAND): Use CPU_NAND_S().
(CPU_EQUAL): Use CPU_EQUAL_S().
(CPU_CMP): Delete superfluous const qualifier.
(CPU_EMPTY): Likewise.

7 months ago * libc/machine/mips/setjmp.S: Fix definition of macro FPR_LAYOUT
Corinna Vinschen [Wed, 27 Nov 2013 12:45:56 +0000 (12:45 +0000)]
* libc/machine/mips/setjmp.S: Fix definition of macro FPR_LAYOUT
for ABI == N32.

7 months ago2013-11-26 Matheus Almeida <Matheus.Almeida@imgtec.com>
Jeff Johnston [Tue, 26 Nov 2013 19:58:18 +0000 (19:58 +0000)]
2013-11-26  Matheus Almeida  <Matheus.Almeida@imgtec.com>

        * libc/include/machine/setjmp.h: Add support for __mips_fpr being
        64 and treat it the same as if __mips64 is set.
        * libc/machine/mips/setjmp.S: Ditto, plus add checks for _MIPS_SIM
        being _ABIN32 and _ABI64.

7 months agoCorrect for missing entries for wchar.h changes and white space changes
Joel Sherrill [Tue, 26 Nov 2013 17:27:08 +0000 (17:27 +0000)]
Correct for missing entries for wchar.h changes and white space changes

7 months ago2013-11-26 Julio Gutierrez <jgutleyva@gmail.com>
Joel Sherrill [Tue, 26 Nov 2013 17:20:59 +0000 (17:20 +0000)]
2013-11-26  Julio Gutierrez <jgutleyva@gmail.com>

*libc/include/wchar.h: Add restrict keyword.
*libc/stdio/fgetws.c (fgetws): ditto.
*libc/stdio/fputws.c (fputws): ditto.
*libc/stdio/fwprintf.c (fwprintf): ditto.
*libc/stdio/fwscanf.c (fwscanf): ditto.
*libc/stdio/swprintf.c (swprintf): ditto.
*libc/stdio/swscanf.c (swscanf): ditto.
*libc/stdio/vfwprintf.c (vfwprintf): ditto.
*libc/stdio/vfwscanf.c (vfwscanf): ditto.
*libc/stdio/vswprintf.c (vswprintf): ditto.
*libc/stdio/vswscanf.c (vswscanf): ditto.
*libc/stdio/vwprintf.c (vwprintf): ditto.
*libc/stdio/vwscanf.c (vwscanf): ditto.
*libc/stdio/wprintf.c (wprintf): ditto.
*libc/stdio/wscanf.c (wscanf): ditto.
*libc/stdlib/mbrlen.c (mbrlen): ditto.
*libc/stdlib/mbrtowc.c (mbrtowc): ditto.
*libc/stdlib/mbsnrtowcs.c (mbsnrtowcs): ditto.
*libc/stdlib/mbsrtowcs.c (mbsrtowcs): ditto.
*libc/stdlib/wcrtomb.c (wcrtomb): ditto.
*libc/stdlib/wcsnrtombs.c (wcsnrtombs): ditto.
*libc/stdlib/wcsrtombs.c (wcsrtombs): ditto.
*libc/stdlib/wcstod.c (wcstod): ditto.
*libc/stdlib/wcstol.c (wcstol): ditto.
*libc/stdlib/wcstold.c (wcstold): ditto.
*libc/stdlib/wcstoll.c (wcstoll): ditto.
*libc/stdlib/wcstoul.c (wcstoul): ditto.
*libc/stdlib/wcstoull.c (cstoull): ditto.
*libc/string/wcpcpy.c (wcpcpy): ditto.
*libc/string/wcpncpy.c (wcpncpy): ditto.
*libc/string/wcscat.c (wcscat): ditto.
*libc/string/wcscpy.c (wcscpy): ditto.
*libc/string/wcsncat.c (wcsncat): ditto.
*libc/string/wcsncpy.c (wcsncpy): ditto.
*libc/string/wcsstr.c (wcsstr): ditto.
*libc/string/wcstok.c (wcstok): ditto.
*libc/string/wcsxfrm.c (wcsxfrm): ditto.
*libc/string/wmemcpy.c (wmemcpy): ditto.

7 months ago2013-11-25 Joel Sherrill <joel.sherrill@oarcorp.com>
Joel Sherrill [Tue, 26 Nov 2013 14:38:58 +0000 (14:38 +0000)]
2013-11-25  Joel Sherrill <joel.sherrill@oarcorp.com>

        * libc/iconv/lib/iconv.c, libc/time/strftime.c: Change "restrict<" to
        "restrict <" to fix formatting.

7 months ago * libc/posix/posix_spawn.c: Drop using namespace.h.
Corinna Vinschen [Tue, 26 Nov 2013 13:51:19 +0000 (13:51 +0000)]
* libc/posix/posix_spawn.c: Drop using namespace.h.

7 months ago * libc/posix/posix_spawn.c: Eliminate OS function calls not present
Corinna Vinschen [Tue, 26 Nov 2013 13:48:00 +0000 (13:48 +0000)]
* libc/posix/posix_spawn.c: Eliminate OS function calls not present
in newlib or Cygwin.
(process_spawnattr): Use sigprocmask rather than _sigprocmask.  Use
sigaction rather than _sigaction.
(process_file_actions_entry): Use dup2 rather than _dup2.
(do_posix_spawn): Use execvpe rather than _execvpe.  Use waitpid
rather than _waitpid.

7 months agoInclude more of sys/types.h and sys/signal.h under NaCl
Sam Clegg [Mon, 25 Nov 2013 18:49:03 +0000 (10:49 -0800)]
Include more of sys/types.h and sys/signal.h under NaCl

sys/types.h: define types needed to for BSD socket headers.
sys/socket.h: include sigaction declaration.

These files are currently forked in the NaCl SDK.  Landing
this change upstream in newlib will allows us to unfork them.

BUG= https://code.google.com/p/chromium/issues/detail?id=315196
R=mseaborn@chromium.org

Review URL: https://codereview.chromium.org/79003002

7 months ago2013-11-25 Joel Sherrill <joel.sherrill@oarcorp.com>
Joel Sherrill [Mon, 25 Nov 2013 17:55:33 +0000 (17:55 +0000)]
2013-11-25  Joel Sherrill <joel.sherrill@oarcorp.com>

* libc/iconv/lib/iconv.c, libc/time/strftime.c: Change "restrict<" to
"restrict <" to fix formatting.

7 months ago * libc/include/spawn.h (posix_spawn_file_actions_destroy): Fix typo
Corinna Vinschen [Mon, 25 Nov 2013 17:23:30 +0000 (17:23 +0000)]
* libc/include/spawn.h (posix_spawn_file_actions_destroy): Fix typo
in function name.
* libc/posix/posix_spawn.c (posix_spawn_file_actions_destroy): Ditto.

7 months ago2013-11-25 Sahil Patnayakuni <sahil.patnayakuni@gmail.com>
Joel Sherrill [Mon, 25 Nov 2013 13:46:22 +0000 (13:46 +0000)]
2013-11-25  Sahil Patnayakuni <sahil.patnayakuni@gmail.com>

* libc/include/time.h (time): Add restrict keyword.
* libc/include/wchar.h (wcsftime): Add restrict keyword.
* libc/time/asctime_r.c (asctime_r): Same.
* libc/time/gmtime_r.c (gmtime_r): Same.
* libc/time/lcltime_r.c (lcltime_r): Same.
* libc/time/strftime.c (strftime): Same.
* libc/time/strptime.c (strptime): Same.
* libc/sys/linux/linuxthreads/timer_create.c (timer_create): Same.
* libc/sys/linux/linuxthreads/timer_settime.c (timer_settime): Same.

7 months ago2013-11-23 Bryan Dunsmore <dunsmoreb@gmail.com>
Joel Sherrill [Sat, 23 Nov 2013 22:39:34 +0000 (22:39 +0000)]
2013-11-23 Bryan Dunsmore <dunsmoreb@gmail.com>

* libc/include/wordexp.h (wordexp): Add restrict keyword.
* libc/posix/wordexp.c (wordexp): Ditto.

8 months ago2013-11-22 Bryan Dunsmore <dunsmoreb@gmail.com>
Joel Sherrill [Sat, 23 Nov 2013 01:25:47 +0000 (01:25 +0000)]
2013-11-22  Bryan Dunsmore <dunsmoreb@gmail.com>

* libc/include/sys/time.h (gettimeofday): Add restrict keyword.
(setitimer): Likewise.
* libc/sys/rdos/gettod.c (gettimeofday): Likewise.
* libc/sys/rtems/crt0.c (gettimeofday): Likewise.

8 months agoDefine _POSIX_THREADS under NaCl.
Sam Clegg [Sat, 23 Nov 2013 00:59:20 +0000 (16:59 -0800)]
Define _POSIX_THREADS under NaCl.

Previously this was not being defined at all, and when it
was defined things would break because the types in
sys/types.h are not compatible with NaCl's pthread.h.

This will allow for the simplification of the python
port in naclports, which relies on _POSIX_THREADS being
defined (if not in features.h then at least in pthread.h).

BUG= https://code.google.com/p/nativeclient/issues/detail?id=3551
TEST= trybots + manual testing
R=mseaborn@chromium.org

Review URL: https://codereview.chromium.org/82523004

8 months ago2013-11-22 Chirayu Desai <chirayudesai1@gmail.com>
Joel Sherrill [Fri, 22 Nov 2013 22:39:50 +0000 (22:39 +0000)]
2013-11-22  Chirayu Desai  <chirayudesai1@gmail.com>

* libc/include/sys/unistd.h (readlink): Add restrict keyword.
(readlinkat): Ditto.
(swab): Ditto.
* libc/sys/rdos/readlink.c (readlink): Ditto.
* libc/string/swab.c (swab): Ditto.

8 months ago2013-11-21 Daniel Ramirez <javamonn@gmail.com>
Joel Sherrill [Fri, 22 Nov 2013 01:17:42 +0000 (01:17 +0000)]
2013-11-21  Daniel Ramirez <javamonn@gmail.com>

* libc/sys/linux/statvfs.c (statvfs): Added restrict keyword.

8 months agoFix computed jump calculations in ARM memcpy
Roland McGrath [Fri, 22 Nov 2013 00:05:36 +0000 (16:05 -0800)]
Fix computed jump calculations in ARM memcpy

phosek@ diagnosed the bug: the calculation of computed jumps was not
correctly accounting for the expansion of sfi_bx into two instructions.
The new method is more resilient to variation in the exact instruction
sequence (after macro expansion and bundle padding) and also replaces
two execute nops with two jumped-over nops.

BUG= none
TEST= manual testing of glibc version (identical object code) with glibc test suite

Change-Id: Ia474ea1d5f7188d5ac433f0b6464a6363b747229

R=jfb@chromium.org, phosek@chromium.org

Review URL: https://codereview.chromium.org/81913002

8 months ago2013-11-21 Joel Sherrill <joel.sherrill@oarcorp.com>
Joel Sherrill [Thu, 21 Nov 2013 19:27:16 +0000 (19:27 +0000)]
2013-11-21  Joel Sherrill <joel.sherrill@oarcorp.com>

* libc/sys/rdos/chown.c, libc/sys/rdos/close.c, libc/sys/rdos/execve.c,
libc/sys/rdos/fork.c, libc/sys/rdos/fstat.c, libc/sys/rdos/getpid.c,
libc/sys/rdos/gettod.c, libc/sys/rdos/isatty.c, libc/sys/rdos/kill.c,
libc/sys/rdos/link.c, libc/sys/rdos/lseek.c, libc/sys/rdos/open.c,
libc/sys/rdos/rdos.h, libc/sys/rdos/read.c, libc/sys/rdos/readlink.c,
libc/sys/rdos/sbrk.c, libc/sys/rdos/stat.c, libc/sys/rdos/symlink.c,
libc/sys/rdos/times.c, libc/sys/rdos/unlink.c, libc/sys/rdos/wait.c,
libc/sys/rdos/write.c: Convert from DOS to UNIX CRLF.

8 months ago2013-11-21 Julio Gutierrez <jgutleyva@gmail.com>
Joel Sherrill [Thu, 21 Nov 2013 17:04:57 +0000 (17:04 +0000)]
2013-11-21  Julio Gutierrez <jgutleyva@gmail.com>

* libc/include/glob.h (glob): Add restrict keyword.
* libc/posix/glob.c (glob): Ditto.

8 months ago2013-11-21 Joel Sherrill <joel.sherrill@oarcorp.com>
Joel Sherrill [Thu, 21 Nov 2013 16:44:39 +0000 (16:44 +0000)]
2013-11-21  Joel Sherrill <joel.sherrill@oarcorp.com>

* libc/posix/readdir_r.c: Add restrict keyword.
* libc/machine/spu/sys/dirent.h, libc/sys/decstation/sys/dirent.h,
libc/sys/linux/sys/dirent.h, libc/sys/rtems/sys/dirent.h,
libc/sys/sparc64/sys/dirent.h, libc/sys/sun4/sys/dirent.h,
libc/sys/sysvi386/sys/dirent.h: Add readdir_r() prototype.