Roland McGrath [Fri, 7 Dec 2012 18:41:38 +0000 (10:41 -0800)]
newlib: Don't use -fshort-enums
The upstream newlib build uses -fshort-enums for a few files. This
is intended to reduce code size, and it's harmless because the enums
affected are not used in at any ABI boundaries, just inside private
functions. But on ARM, using -fshort-enums marks an object with
attributes saying it's using a non-default ABI and the linker warns
about mixing objects with and without -fshort-enums. The possible
performance/code-size benefit of -fshort-enums is negligible in the
NaCl context, and it's more important that SDK users not get these
confusing warnings at link time. Some unrelated whitespace/filling
changes appear as fallout from re-running Automake.
BUG= http://code.google.com/p/nativeclient/issues/detail?id=3193
TEST= none
Change-Id: I844aa8a2bebb43a8660dd7e316eaeebd3c0c574d
Roland McGrath [Mon, 12 Nov 2012 20:39:04 +0000 (12:39 -0800)]
Add __aeabi_atexit to newlib
C++ compilers will sometimes generate calls to this function.
So get it defined in the arm-nacl newlib build.
BUG= none
TEST= none
Change-Id: Ief33f60105fe93f91b831d5281d10b6b8dc25423
Roland McGrath [Fri, 9 Nov 2012 18:38:05 +0000 (10:38 -0800)]
ARM: Use SFI_BREG prefix on PLD instruction
The ARM validator has recently begun requiring sandboxing for
the base register in pld (prefetch) instructions. The newlib
ARM assembly code includes some of these, so they need to get
the sandboxing treatment.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3117
TEST= manual inspection
Change-Id: I3eda57ea967395df3f3d3c1b4ad664052ba6baf4
Roland McGrath [Wed, 27 Jun 2012 01:36:51 +0000 (18:36 -0700)]
Use 'naclret' in x86 assembly code
This macro is now supplied by both the old and new toolchains in
different ways and with different definitions. Using it for all
NaCl-flavored function returns makes the assembly code compatible
with both.
Change-Id: I16a11ce70d7a6ad9908378b6fe9195c4cb38e147
Roland McGrath [Thu, 21 Jun 2012 18:43:51 +0000 (11:43 -0700)]
Move 'rep' prefixes onto instruction lines
We need 'rep' to be a prefix rather than a standalone instruction
for .bundle_align_mode to recognize it as part of a whole instruction
that cannot be split.
Change-Id: I5b3d494e0343657ac22553dc0ee5dac27c257a0e
Roland McGrath [Thu, 21 Jun 2012 18:43:16 +0000 (11:43 -0700)]
Avoid setjmp-dj.h include for __native_client__
The nest of conditionals in setjmp.h is already mostly irrelevant
for NaCl. When __native_client__ is defined, we undefine the macros
set by previous conditional blocks and define them uniformly for
__native_client__ on any machine.
The wrinkle arose that if __i386__ is defined and __unix__ is not also
defined, it tries to include "setjmp-dj.h", which has not just macros
but its own typedef and declarations. We never want to get that file
for NaCl. While the old nacl-gcc compiler happens to avoid this because
it predefines __unix__, the next-generation compiler (so far) does not
predefine __unix__, so it was bitten.
Change-Id: I7c763c1017ca9f98bd75bc6ae2b925cefe791a9e
Roland McGrath [Fri, 15 Jun 2012 17:09:20 +0000 (10:09 -0700)]
Provide sanity check that compiler defines __*_ENDIAN__
We expect all Native Client compilers to define either
__LITTLE_ENDIAN__ or __BIG_ENDIAN__, so make sure we get a
compilation error if one fails to.
Change-Id: I1da9e9cb1c0a66f4d7b0cac58bf4d4368158b751
Roland McGrath [Tue, 12 Jun 2012 20:05:40 +0000 (13:05 -0700)]
Fix newlib configury for all nacl hosts to use -DMISSING_SYSCALL_NAMES
There is an arm-*-* pattern that matches and prevents the default pattern
from matching and adding -DMISSING_SYSCALL_NAMES, whereas for i?86-*-nacl*,
x86_64-*-nacl*, or le32-*-nacl*, that default case does match. So we need
a generic *-*-nacl* pattern to match first so that we ensure we add the
necessary -DMISSING_SYSCALL_NAMES switch for all nacl builds.
Change-Id: I0b73723bdbada47452914f2060472fbda6965d54
Roland McGrath [Fri, 25 May 2012 19:23:10 +0000 (12:23 -0700)]
NaClify ARM string functions
Make the ARM assembly code for string functions pass NaCl validation.
Change-Id: Icabce8e4fc55ba84dd02f4e7eb408e425e01e0eb
Roland McGrath [Fri, 18 May 2012 21:00:54 +0000 (14:00 -0700)]
NaClify ARM setjmp/longjmp
Make the ARM setjmp/longjmp code pass NaCl validation.
Note that this requires a binutils change (nested .bundle_lock)
that is still pending upstream review.
BUG= none
TEST= hand-tested
Robert Muth [Mon, 7 May 2012 16:27:25 +0000 (12:27 -0400)]
Avoid duplicate symbol for _dummy_mallocr which seems to be a hack
aimed at working around a compiler complaint about empty files in MALLOC_PROVIDE
case. This hack is not applied consistently so we removed it altogether.
Not sure sure why newlib is not suppressing the compilation of the files
in the first place.
Change-Id: I43bce4d130a61733001407307d3a682b5a782b22
David Sehr [Wed, 25 Apr 2012 20:46:12 +0000 (13:46 -0700)]
Remove unneeded casts of -0.0 to float.
David Sehr [Wed, 25 Apr 2012 20:00:07 +0000 (13:00 -0700)]
Add llvm intrinsics for sqrt on both sides of the ifdef.
David Sehr [Thu, 22 Mar 2012 19:57:27 +0000 (12:57 -0700)]
Use LLVM intrinsics for square root.
BUG= http://code.google.com/p/nativeclient/issues/detail?id=2295
TEST=none
David Sehr [Thu, 22 Mar 2012 16:20:39 +0000 (09:20 -0700)]
Apply basic pnacl patch to nacl-newlib.git
BUG= http://code.google.com/p/nativeclient/issues/detail?id=2295
TEST=none
Bennet Yee [Thu, 9 Feb 2012 19:40:15 +0000 (11:40 -0800)]
add clock_get{res,time} to newlib
This TC change exposes the clock_get{res,time} calls with the correct
values for CLOCK_REALTIME, CLOCK_MONOTONIC, etc in newlib. A
corresponding glibc TC change is next, followed by a TCB CL with the
test that exercises the clock_get{res,time} calls that uses both TCs.
R=sehr@google.com
BUG= http://code.google.com/p/nativeclient/issues/detail?id=2477
TEST= in subsequent CL
Review URL: https://chromiumcodereview.appspot.com/9368001
Roland McGrath [Fri, 20 Jan 2012 22:52:35 +0000 (14:52 -0800)]
Merge remote-tracking branch 'upstream/master' into pnacl/master
Corinna Vinschen [Tue, 17 Jan 2012 10:03:40 +0000 (10:03 +0000)]
* arm/linux-crt0.c: Use ldr instead of adr to get address of
_start_thumb.
Yaakov Selkowitz [Fri, 13 Jan 2012 09:13:56 +0000 (09:13 +0000)]
* libc/stdio/sprintf.c: Document 'm' conversion specifier.
* libc/stdio/swprintf.c: Ditto.
* libc/stdio/vfprintf.c (_VFPRINTF_R) [_GLIBC_EXTENSION]: Handle 'm'
conversion specifier.
* libc/stdio/vfwprintf.c (_VFWPRINTF_R) [_GLIBC_EXTENSION]: Ditto.
Yaakov Selkowitz [Thu, 12 Jan 2012 11:19:31 +0000 (11:19 +0000)]
* libc/include/tgmath.h: New header.
Yaakov Selkowitz [Mon, 9 Jan 2012 22:49:19 +0000 (22:49 +0000)]
* libc/include/sys/unistd.h [__CYGWIN__] (get_current_dir_name):
Declare.
Yaakov Selkowitz [Mon, 9 Jan 2012 22:46:33 +0000 (22:46 +0000)]
* libc/include/complex.h: Fix "/*" within comment warning.
Corinna Vinschen [Mon, 9 Jan 2012 17:06:19 +0000 (17:06 +0000)]
* libc/include/process.h: Remove Cygwin-only header.
Jeff Johnston [Tue, 3 Jan 2012 19:13:57 +0000 (19:13 +0000)]
2012-01-03 Viachaslau Kulakouski <Viachaslau.Kulakouski@oracle.com>
* libc/stdlib/__atexit.c: Refer to __atexit_lock instead of lock.
schwab [Tue, 20 Dec 2011 17:01:29 +0000 (17:01 +0000)]
config/:
* warnings.m4 (ACX_PROG_CC_WARNING_OPTS): Avoid leading dash in
expr call.
libdecnumber/:
* configure: Regenerate.
libiberty/:
* configure: Regenerate.
Corinna Vinschen [Tue, 20 Dec 2011 09:06:57 +0000 (09:06 +0000)]
* fvwrite.c (__sfvwrite_r): Set __SMBF flag to avoid double free in
fclose. Enhance comment.
Jeff Johnston [Mon, 19 Dec 2011 22:03:17 +0000 (22:03 +0000)]
2011-12-19 Jeff Johnston <jjohnstn@redhat.com>
* NEWS: Update with 1.20.0 info.
* README: Ditto.
* acinclude.m4: Change version number to 1.20.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_1.20
schwab [Mon, 19 Dec 2011 13:20:23 +0000 (13:20 +0000)]
Check for warning flags without no- prefix
config/:
* warnings.m4 (ACX_PROG_CC_WARNING_OPTS)
(ACX_PROG_CC_WARNING_ALMOST_PEDANTIC): Run the test without the
no- prefix.
libdecnumber/:
* configure: Regenerate.
libiberty/:
* configure: Regenerate.
Ralf Corsepius [Sun, 18 Dec 2011 18:41:20 +0000 (18:41 +0000)]
libgloss: bfin: add clear_cache_range support (for gcc)
ebotcazou [Sun, 18 Dec 2011 10:20:51 +0000 (10:20 +0000)]
* configure: Regenerate.
config/
* acx.m4 (Test for GNAT): Update comment and add quotes in final test.
Jeff Johnston [Thu, 15 Dec 2011 22:59:14 +0000 (22:59 +0000)]
2011-12-15 Jeff Johnston <jjohnstn@redhat.com>
* COPYING.LIBGLOSS: Add GPL with exception license.
Jeff Johnston [Thu, 15 Dec 2011 22:58:40 +0000 (22:58 +0000)]
2011-12-15 Konrad Eisele <konrad@gaisler.com>
* configure.in: Add SPARC LEON support.
* configure: Regenerated.
* sparc_leon/asm-leon/amba.h, sparc_leon/asm-leon/asmmacro.h,
sparc_leon/asm-leon/clock.h, sparc_leon/asm-leon/contextswitch.h,
sparc_leon/asm-leon/elfmacro.h, sparc_leon/asm-leon/head.h,
sparc_leon/asm-leon/irq.h, sparc_leon/asm-leon/jiffies.h,
sparc_leon/asm-leon/lambapp.h, sparc_leon/asm-leon/lambapp_devs.h,
sparc_leon/asm-leon/leon.h, sparc_leon/asm-leon/leon3.h,
sparc_leon/asm-leon/leonbare_debug.h, sparc_leon/asm-leon/leonbare_kernel.h,
sparc_leon/asm-leon/leonbare_kernel_queue.h, sparc_leon/asm-leon/leoncompat.h,
sparc_leon/asm-leon/leondbg.h, sparc_leon/asm-leon/leonstack.h,
sparc_leon/asm-leon/liblocks.h, sparc_leon/asm-leon/linkage.h,
sparc_leon/asm-leon/param.h, sparc_leon/asm-leon/queue.h,
sparc_leon/asm-leon/spinlock.h, sparc_leon/asm-leon/stack.h,
sparc_leon/asm-leon/time.h, sparc_leon/asm-leon/timer.h,
sparc_leon/asm-leon/types.h, sparc_leon/asm-leon/winmacros.h:
New file.
* sparc_leon/Makefile.in, sparc_leon/_exit.c,
sparc_leon/amba.c, sparc_leon/amba_dbg.c,
sparc_leon/amba_driver.c, sparc_leon/amba_scan.c,
sparc_leon/asm-leon, sparc_leon/bdinit.S,
sparc_leon/busscan.S, sparc_leon/cacheA.S,
sparc_leon/catch_interrupt.c, sparc_leon/catch_interrupt_mvt.c,
sparc_leon/catch_interrupt_pending.c, sparc_leon/catch_interrupt_svt.c,
sparc_leon/configure.in,
sparc_leon/console.c, sparc_leon/console_dbg.c,
sparc_leon/console_init.c, sparc_leon/contextswitch.c,
sparc_leon/contextswitch_asm.S, sparc_leon/crt0.S,
sparc_leon/crti.S, sparc_leon/crtn.S,
sparc_leon/etrap.S, sparc_leon/etrap_fast.S,
sparc_leon/fpu.S, sparc_leon/gettimeofday.c,
sparc_leon/initcalls.c, sparc_leon/io.c,
sparc_leon/irqinstall.S, sparc_leon/irqtrap.S,
sparc_leon/irqtrap_fast.S, sparc_leon/jiffies.c,
sparc_leon/kernel.c, sparc_leon/kernel_context.S,
sparc_leon/kernel_debug.c, sparc_leon/kernel_debug_var.c,
sparc_leon/kernel_mm.c, sparc_leon/kernel_mutex.c,
sparc_leon/kernel_queue.c, sparc_leon/kernel_sched.c,
sparc_leon/kernel_thread.c, sparc_leon/lcpuinit.S,
sparc_leon/locore.S, sparc_leon/locore_atexit.c,
sparc_leon/locore_clean.S, sparc_leon/locore_mvt.S,
sparc_leon/locore_mvt_reset.S, sparc_leon/locore_svt.S,
sparc_leon/locore_svt_reset.S, sparc_leon/locore_svtdisp.S,
sparc_leon/locore_var.S, sparc_leon/locore_var_svt.S,
sparc_leon/mmu_asm.S, sparc_leon/mutex.c,
sparc_leon/nocache.S, sparc_leon/pnpinit.c,
sparc_leon/pnpinit_malloc.c, sparc_leon/pnpinit_simple.c,
sparc_leon/regwin.S, sparc_leon/regwin_patch.c,
sparc_leon/regwin_slow.S, sparc_leon/regwinflush.S,
sparc_leon/rtc.c, sparc_leon/rtrap.S,
sparc_leon/rtrap_fast.S, sparc_leon/stop.S,
sparc_leon/timer.c, sparc_leon/times.c:
New file
* sparc_leon/configure: Regenerate
Jeff Johnston [Tue, 13 Dec 2011 22:45:11 +0000 (22:45 +0000)]
2011-12-13 Richard Earnshaw <rearnsha@arm.com>
Thomas Klein <th.r.klein@web.de>
* arm/crt0.S: Manually set the target architecture
when compiling for Thumb1 on EABI targets.
Avoid v6-only Thumb-1 MOV instruction.
Jeff Johnston [Tue, 13 Dec 2011 22:40:44 +0000 (22:40 +0000)]
2011-12-13 Richard Earnshaw <rearnsha@arm.com>
Thomas Klein <th.r.klein@web.de>
* libc/sys/arm/crt0.S: Manually set the target architecture
when compiling for Thumb1 on EABI targets.
Don't use SWI on M-profile cores.
Avoid v6-only Thumb-1 MOV instruction.
Corinna Vinschen [Mon, 12 Dec 2011 10:48:28 +0000 (10:48 +0000)]
* libc/time/strftime.c (get_era_info): Fix off-by-one error in month
calculation.
Corinna Vinschen [Tue, 6 Dec 2011 10:45:04 +0000 (10:45 +0000)]
* libc/iconv/Makefile.am (stmp-def): Use $(MAKE) rather than make.
* libc/iconv/Makefile.in: Regenerate.
DJ Delorie [Tue, 29 Nov 2011 06:33:47 +0000 (06:33 +0000)]
[libgloss]
* configure.in: Add rl78.
* configure: Regenerate.
* rl78: New directory
[newlib]
* configure.host: Add rl78.
* libc/include/machine/ieeefp.h: Add rl78 support.
* libc/include/machine/setjmp.h: Add rl78 support.
* libc/machine/configure.in: Add rl78.
* libc/machine/rl78: New directory.
Roland McGrath [Wed, 9 Nov 2011 20:51:05 +0000 (12:51 -0800)]
Merge remote branch 'upstream/master' into pnacl/master
Conflicts:
config.sub
DJ Delorie [Wed, 9 Nov 2011 18:57:28 +0000 (18:57 +0000)]
2011-11-09 Roland McGrath <mcgrathr@google.com>
* configure.ac: Add tool checks for READELF and READELF_FOR_TARGET.
* configure: Rebuild.
* Makefile.def (flags_to_pass): Add READELF_FOR_TARGET.
* Makefile.tpl (READELF, READELF_FOR_TARGET): New variables.
(HOST_EXPORTS): Add READELF, READELF_FOR_TARGET.
(BASE_FLAGS_TO_PASS): Add READELF_FOR_TARGET.
(BASE_TARGET_EXPORTS, EXTRA_HOST_FLAGS, EXTRA_TARGET_FLAGS):
Add READELF.
* Makefile.in: Rebuild.
rth [Tue, 8 Nov 2011 18:23:33 +0000 (18:23 +0000)]
Merge libitm changes to configure.ac from gcc
Corinna Vinschen [Tue, 8 Nov 2011 15:56:49 +0000 (15:56 +0000)]
* libnosys/Makefile.in (install): Use INSTALL_DATA.
Corinna Vinschen [Tue, 8 Nov 2011 15:46:41 +0000 (15:46 +0000)]
* libc/iconv/ccs/Makefile.am: Add missing backslash.
* libc/iconv/ccs/Makefile.in: Regenerate.
ro [Wed, 2 Nov 2011 15:23:36 +0000 (15:23 +0000)]
toplevel:
* Makefile.tpl (EXTRA_GCC_FLAGS): Remove LIBGCC2_CFLAGS,
LIBGCC2_DEBUG_CFLAGS, LIBGCC2_INCLUDES.
* Makefile.in: Regenerate.
config:
* mh-interix (LIBGCC2_DEBUG_CFLAGS): Remove.
DJ Delorie [Wed, 2 Nov 2011 03:08:51 +0000 (03:08 +0000)]
[.]
* configure.ac (rl78-*-*) New case.
* configure: Regenerate.
[bfd]
* Makefile.am (ALL_MACHINES): Add cpu-rl78.lo.
(ALL_MACHINES_CFILES): Add cpu-rl78.c.
(BFD32_BACKENDS): Add elf32-rl78.lo.
(BFD32_BACKENDS_CFILES): Add elf32-rl78.c.
(Makefile.in): Regenerate.
* archures.c (bfd_architecture): Define bfd_arch_rl78.
(bfd_archures_list): Add bfd_rl78_arch.
* config.bfd: Add rl78-*-elf.
* configure.in: Add bfd_elf32_rl78_vec.
* reloc.c (bfd_reloc_code_type): Add BFD_RELOC_RL78_* relocations.
* targets.c (bfd_target_vector): Add bfd_elf32_rl78_vec.
* Makefile.in: Regenerate.
* bfd-in2.h: Regenerate.
* configure: Regenerate.
* libbfd.h: Regenerate.
* cpu-rl78.c: New file.
* elf32-rl78.c: New file.
[binutils]
* readelf.c: Include elf/rl78.h
(guess_is_rela): Handle EM_RL78.
(dump_relocations): Likewise.
(get_machine_name): Likewise.
(is_32bit_abs_reloc): Likewise.
* NEWS: Mention addition of RL78 support.
* MAINTAINERS: Add myself as RL78 port maintainer.
[gas]
* Makefile.am (TARGET_CPU_CFILES): Add tc-rl78.c.
(TARGET_CPU_HFILES): Add rc-rl78.h.
(EXTRA_DIST): Add rl78-parse.c and rl78-parse.y.
(rl78-parse.c, rl78-parse.h, rl78-parse.o, rl78-defs.h): New rules.
* Makefile.in: Regenerate.
* configure.in: Add rl78 case.
* configure: Regenerate.
* configure.tgt: Add rl78 case.
* config/rl78-defs.h: New file.
* config/rl78-parse.y: New file.
* config/tc-rl78.c: New file.
* config/tc-rl78.h: New file.
* NEWS: Add Renesas RL78.
* doc/Makefile.am (c-rl78.texi): New.
* doc/Makefile.in: Likewise.
* doc/all.texi: Enable it.
* doc/as.texi: Add it.
[include]
* dis-asm.h (print_insn_rl78): Declare.
[include/elf]
* common.h (EM_RL78, EM_78K0R): New.
* rl78.h: New.
[include/opcode]
* rl78.h: New file.
[ld]
* Makefile.am (ALL_EMULATION_SOURCES): Add eelf32rl78.c.
(+eelf32rl78.c): New rule.
* Makefile.in: Regenerate.
* configure.tgt: Add rl78-*-* case.
* emulparams/elf32rl78.sh: New file.
* NEWS: Mention addition of Renesas RL78 support.
[opcodes]
* Makefile.am (TARGET_LIBOPCODES_CFILES): Add rl78-decode.c and
rl78-dis.c.
(MAINTAINERCLEANFILES): Add rl78-decode.c.
(rl78-decode.c): New rule, built from rl78-decode.opc and opc2c.
* Makefile.in: Regenerate.
* configure.in: Add bfd_rl78_arch case.
* configure: Regenerate.
* disassemble.c: Define ARCH_rl78.
(disassembler): Add ARCH_rl78 case.
* rl78-decode.c: New file.
* rl78-decode.opc: New file.
* rl78-dis.c: New file.
DJ Delorie [Wed, 2 Nov 2011 00:56:53 +0000 (00:56 +0000)]
* config.sub: Update to version 2011-10-29 (added rl78)
Nick Clifton [Thu, 27 Oct 2011 09:45:24 +0000 (09:45 +0000)]
* config.sub: Import these changes from the config project:
2011-10-08 Joern Rennecke <joern.rennecke@embecosm.com>
Ben Elliston <bje@gnu.org>
* config.sub (epiphany): New.
2011-09-09 Linas Vepstas <linasvepstas@gmail.com>
Ben Elliston <bje@gnu.org>
* config.sub (hexagon, hexagon-*): New.
2011-08-23 Roland McGrath <mcgrathr@google.com>
* config.sub: Rename 32eb to be32, 32el to le32, 64el to le64, and
64eb to be64.
2011-08-16 Roland McGrath <mcgrathr@google.com>
* config.sub (32eb, 32el, 64eb, 64el): New (pseudo-)CPUs.
(nacl): Grok as alias for 32el-unknown-nacl.
Nick Clifton [Tue, 18 Oct 2011 11:35:16 +0000 (11:35 +0000)]
* libc/machine/arm/Makefile.am (lib_a_SOURCES): Add memchr-stub.c,
memchr.S.
* libc/machine/arm/arm_asm.h: Add ifdef to allow it to be included
in .S files.
* libc/machine/arm/memchr-stub.c: New file - just selects what to
compile.
* libc/machine/arm/memchr.S: New file - ARMv6t2/v7 version.
* libc/machine/arm/Makefile.am (lib_a_SOURCES): Add strlen-armv7.S.
* libc/machine/arm/strlen-armv7.S: New file.
* libc/machine/arm/strlen.c: Add ifdef optimised code so it isn't
for v7 or 6t2.
* libc/machine/arm/Makefile.in: Regenerate.
Victor Khimenko [Mon, 26 Sep 2011 22:58:08 +0000 (02:58 +0400)]
Fix CLOCKS_PER_SEC definition.
CLOCKS_PER_SEC was 1000 on Windows and 1000000 elsewhere in M14.
Now it's 1000000 on all platforms. Fix newlib to expose this value.
R=halyavin@google.com
Review URL: http://codereview.chromium.org/8046022
Roland McGrath [Thu, 22 Sep 2011 20:08:54 +0000 (13:08 -0700)]
Exclude newlib's malloc implementation
We are adding a better malloc implementation built in the native_client
tree (into libnacl). It's simple to make the newlib build just omit its
own malloc implementation, so we're doing that rather than changing it.
Note: this will produce a library that cannot build working applications,
until the corresponding native_client tree change goes in along with a
toolchain DEPS update that brings this change in.
BUG= http://code.google.com/p/nativeclient/issues/detail?id=2271
TEST= manual build-with-newlib works
R=pasko@google.com,jvoung@google.com
Review URL: http://codereview.chromium.org/7994014
Egor Pasko [Wed, 10 Aug 2011 13:37:39 +0000 (17:37 +0400)]
Fix race condition in concurrent printf and fopen.
Fixes a race condition reported by ThreadSanitizer that happens when fopen() and
printf() are invoked concurrently. fopen() would traverse the list of all open
files and check their _flags for non-zero (in __sfp()), while printf would
attempt to modify the flags for _stdout via ORIENT(fp, -1) in vfprintf.c:679.
BUG=none, but related to http://code.google.com/p/nativeclient/issues/detail?id=870
TEST=./scons irt=0 platform=x86-64 run_newlib_stdio_test --verbose buildbot=tsan
with patch: http://codereview.chromium.org/3298014
(the fix does not remove the race reports completely, there is a remaining
race on errno)
Review URL: http://codereview.chromium.org/7604003
Egor Pasko [Tue, 9 Aug 2011 17:11:40 +0000 (21:11 +0400)]
Stop flushing streams on every thread exit.
Instead flush+close all files on program exit. This is now possible with _REENT
initialization that properly points to the _GLOBAL_REENT parts (wich in turn is
initialized strictly earlier than any _REENT).
Since significantly more locking is added, the performance may degrade, however,
the locks are expected to be brief and non-contended. To avoid this extra
locking with __sinit_lock we could initialize _GLOBAL_REENT in
__newlib_thread_init(), but this requires more time investment.
newlib/libc/stdio/local.h: Added brief locking around access to __sdidinit.
newlib/libc/stdio/findfp.c: Initialize _GLOBAL_REENT before any other _reent
gets initialized, make the code look more alike in _REENT_SMALL and
non-_REENT_SMALL cases. The _REENT_SMALL has not been tested with NaCl.
Changing the lock order in __sfp() to avoid a potential deadlock: our lock
order is: __init_lock and then possibly __sfp_lock.
newlib/libc/stdio/fwalk.c: Make sure _fwalk* always traverses an initialized
structure.
newlib/libc/reent/impure.c: Removed unnecessary cleanup and initialization.
BUG=http://code.google.com/p/nativeclient/issues/detail?id=2058
TEST=./scons irt=0 run_post_msg_thread_chrome_browser_test
with http://codereview.chromium.org/7455003/
Review URL: http://codereview.chromium.org/7582011
Egor Pasko [Fri, 22 Jul 2011 20:14:58 +0000 (00:14 +0400)]
Let _REENT initialize lazily under proper locking.
This removes the race condition on reading _GLOBAL_REENT->__sdidinit that could
be modified simultaneously from another thread.
We are flushing all streams on every thread exit with _cleanup_r(_REENT) because
it does not work to do so from exit.c. To be investigated.
BUG=http://code.google.com/p/nativeclient/issues/detail?id=2058
TEST=run_post_msg_thread_chrome_browser_test (did not check that it works)
Review URL: http://codereview.chromium.org/7491020
Evgeny Eltsin [Thu, 21 Jul 2011 07:57:55 +0000 (11:57 +0400)]
Force int32_t to be int instead of long
If both int and long are 32-bit, newlib intentionally prefers long over int.
Force the opposite for nacl.
BUG=http://code.google.com/p/nativeclient/issues/detail?id=1173
R=sehr@google.com,khim@chromium.org
TEST=
Review URL: http://codereview.chromium.org/7471004
Roland McGrath [Wed, 4 May 2011 20:22:46 +0000 (13:22 -0700)]
[noupstream] Update codereview.settings for gerrit hosting (newlib)
Fiddle the magic codereview.settings file for the new git hosting locations.
BUG=infrastructure
TEST=git cl upload working for this change!
R=khim@google.com,mseaborn@chromium.org,pasko@google.com,eaeltsin@google.com
Review URL: http://codereview.chromium.org/6929018
Egor Pasko [Sat, 5 Mar 2011 12:57:16 +0000 (15:57 +0300)]
[noupstream] newlib: add codereview settings
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/6624041
Victor Khimenko [Mon, 23 Aug 2010 21:51:23 +0000 (01:51 +0400)]
[newlib] Don't try to implement clock(3) using times(2). NaCl provides native clock(2)
Review URL: http://codereview.chromium.org/3183021
Victor Khimenko [Wed, 28 Jul 2010 10:44:30 +0000 (14:44 +0400)]
[newlib] fix read sandboxing in asm functions
Review URL: http://codereview.chromium.org/3056024
Egor Pasko [Tue, 25 May 2010 11:32:55 +0000 (13:32 +0200)]
[newlib] build newlib with nanosleep enabled
Egor Pasko [Tue, 18 May 2010 13:28:02 +0000 (15:28 +0200)]
[newlib] NaCl newlib bulk
Corinna Vinschen [Tue, 11 Oct 2011 11:28:05 +0000 (11:28 +0000)]
* libc/time/mktm_r.c: (__tzcalc_limits) Fix Julian day calculation.
* libc/time/mktime.c: (mktime) Fix tm_yday, tm_mday updating when
timezone causes roll over.
Nick Clifton [Tue, 11 Oct 2011 09:29:56 +0000 (09:29 +0000)]
oops - fix typo in previous delta.
Nick Clifton [Tue, 11 Oct 2011 07:38:33 +0000 (07:38 +0000)]
oops - omitted from previous delta.
Nick Clifton [Mon, 10 Oct 2011 13:00:25 +0000 (13:00 +0000)]
* libc/sys/arm/crt0.S: Synchronise with libgloss version.
* libc/sys/arm/arm.h: Imported from libgloss.
Nick Clifton [Fri, 7 Oct 2011 10:09:22 +0000 (10:09 +0000)]
* rx/crt0.S: Initialise the PID address register.
(__pid_base): Define weakly.
Jeff Johnston [Tue, 4 Oct 2011 18:43:14 +0000 (18:43 +0000)]
2011-10-04 Greta Yorsh <Greta.Yorsh@arm.com>
* testsuite/newlib.string/memcpy-1.c: New test.
Nick Clifton [Tue, 4 Oct 2011 16:02:25 +0000 (16:02 +0000)]
* libc/machine/arm/memcpy.S: Fix unaligned access copying.
Nick Clifton [Thu, 29 Sep 2011 13:28:50 +0000 (13:28 +0000)]
* libc/machine/arm/memcpy.S: New file. Contains a hand coded
memcpy function optimized for the cortex-a15.
* libc/machine/arm/memcpy-stub.c: New file.
* libc/machine/arm/Makefile.am (lib_a_SOURCES): Add memcpy-stub.c,
memcpy.S.
* libc/machine/arm/Makefile.in: Regenerate.
Nick Clifton [Thu, 29 Sep 2011 11:23:29 +0000 (11:23 +0000)]
* arm/crt0.s: Support 0 heap base response from HeapInfo syscall.
Nick Clifton [Thu, 29 Sep 2011 11:06:49 +0000 (11:06 +0000)]
* arm/arm.h (HAVE_CALL_INDIRECT): Define.
* arm/crt0.S (indirect_call): New macro. Encodes indirect
function calls. Does not use blx for pre-armv5 targets.
Jeff Johnston [Thu, 8 Sep 2011 16:18:23 +0000 (16:18 +0000)]
2011-09-08 Jeff Johnston <jjohnstn@redhat.com>
* testsuite/lib/flags.exp: Add logic to add the
srcdir include directory to compile flags.
Corinna Vinschen [Fri, 26 Aug 2011 07:23:42 +0000 (07:23 +0000)]
* libc/time/mktm_r.c (_mktm_r): Fix previous fix.
Corinna Vinschen [Wed, 24 Aug 2011 13:38:32 +0000 (13:38 +0000)]
* libc/time/mktm_r.c (_mktm_r): Fix computing tm_year.
Ralf Corsépius [Tue, 23 Aug 2011 12:03:55 +0000 (12:03 +0000)]
2011-08-23 Ralf Corsépius <ralf.corsepius@rtems.org>
* libc/stdlib/putenv_r.c: Use "strchr" instead of obsolete "index".
* libc/stdlib/setenv_r.c: Use "memcpy" instead of obsolete "bcopy".
Ralf Corsépius [Tue, 23 Aug 2011 12:01:51 +0000 (12:01 +0000)]
2011-08-23 Ralf Corsépius <ralf.corsepius@rtems.org>
* libc/misc/ffs.c, libc/string/bcmp.c, libc/string/bcopy.c,
libc/string/bzero.c, libc/string/index.c, libc/string/rindex.c,
libc/string/strcasecmp.c, libc/string/strncasecmp.c:
Let synopsis reference "#include <strings.h>".
Ralf Corsépius [Tue, 23 Aug 2011 11:59:56 +0000 (11:59 +0000)]
2011-08-23 Ralf Corsépius <ralf.corsepius@rtems.org>
* libc/posix/regexec.c: Define "nope" only #ifndef NDEBUG.
* libc/stdio/vfscanf.c: Define "state" only #ifdef _MB_CAPABLE.
* libc/string/wcwidth.c: Include <wctypes.h> for "iswprint" and
"iswcntrl".
Ralf Corsépius [Tue, 23 Aug 2011 05:51:04 +0000 (05:51 +0000)]
2011-08-23 Ralf Corsépius <ralf.corsepius@rtems.org>
* libc/sys/rtems/include/limits.h: Compute SSIZE_MAX based on
__SIZE_MAX__, __SIZEOF_SIZE_T__ and __CHAR_BIT__.
ro [Mon, 22 Aug 2011 17:51:24 +0000 (17:51 +0000)]
* picflag.m4: New file.
Ralf Corsépius [Mon, 22 Aug 2011 16:49:37 +0000 (16:49 +0000)]
2011-08-22 Ralf Corsépius <ralf.corsepius@rtems.org>
* libc/string/index.c: Include <strings.h> for "index".
* libc/string/rindex.c: Include <strings.h> for "rindex".
* libc/string/strcasecmp.c: Include <strings.h> for "strcasecmp".
Don't include <string.h>.
* libc/string/strncasecmp.c: Include <strings.h> for "strncasecmp".
Don't include <string.h>.
* libc/string/bzero.c: Include <strings.h> for "bzero".
Don't include <string.h>
* libc/misc/ffs.c: Include <strings.h> for "ffs".
Don't include <_ansi.h>.
Ralf Corsépius [Sat, 20 Aug 2011 05:34:22 +0000 (05:34 +0000)]
2011-08-19 Ralf Corsépius <ralf.corsepius@rtems.org>
* libc/sys/rtems/crt0.c: Rework RTEMS_STUB macro.
Include <unistd.h>.
Remove C++-style comments.
Remove hppa, a29k.
Add clock_gettime, gettimeofday, sched_yield.
Ralf Corsépius [Fri, 19 Aug 2011 17:00:32 +0000 (17:00 +0000)]
2011-08-19 Ralf Corsépius <ralf.corsepius@rtems.org>
* libc/stdio/vasiprintf.c: Include "local.h" for "_svfiprintf_r".
* libc/stdio/vasprintf.c Include "local.h" for "_svfprintf_r".
* libc/stdio/vsiprintf.c: Include "local.h" for "_svfiprintf_r".
* libc/stdio/vsniprintf.c: Include "local.h" for "_svfiprintf_r".
* libc/stdio/vsnprintf.c: Include "local.h" for "_svfprintf_r"
* libc/stdio/vsprintf.c: Include "local.h" for "_svfprintf_r"
Ralf Corsépius [Fri, 19 Aug 2011 16:58:20 +0000 (16:58 +0000)]
2011-08-19 Ralf Corsépius <ralf.corsepius@rtems.org>
* libc/string/bcmp.c: Include <strings.h> for "bcmp".
* libc/string/bcopy.c: Include <strings.h> for "bcopy".
* libc/string/strcasestr.c: Include <strings.h> for "strncasecmp".
* libc/time/strptime.c: Include <strings.h> for "strncasecmp".
brobecke [Fri, 19 Aug 2011 15:48:36 +0000 (15:48 +0000)]
Include the <root>/cpu/ dir in GDB releases
This directory contains some files that are used to generate some
of the files included in the GDB release, and thus must be part of
the GDB release also.
ChangeLog:
* src-release (GDB_SUPPORT_DIRS): Add 'cpu'.
Nick Clifton [Fri, 19 Aug 2011 14:57:50 +0000 (14:57 +0000)]
* iq2000/sim.ld (.gcc_except_table): Include .gcc_except_table.foo
sections as well.
Corinna Vinschen [Fri, 19 Aug 2011 14:29:34 +0000 (14:29 +0000)]
* libc/include/process.h: Remove exec family function declarations.
Add comment.
* libc/include/sys/unistd.h (execlpe): Declare for Cygwin.
Corinna Vinschen [Fri, 19 Aug 2011 14:14:18 +0000 (14:14 +0000)]
* libc/time/mktime.c (validate_structure): Account for tm_mon possibly
being given as negative.
(mktime): Set tm_isdst=0 when !daylight.
qiyao [Sun, 14 Aug 2011 12:28:16 +0000 (12:28 +0000)]
Merge from gcc:
2011-08-14 Yao Qi <yao@codesourcery.com>
* configure.ac (tic6x-*-*): Remove gdb from noconfigdirs.
* configure: Regenerate.
Jeff Johnston [Mon, 8 Aug 2011 18:36:01 +0000 (18:36 +0000)]
Fix name in last entry.
Joel Sherrill [Mon, 1 Aug 2011 17:22:18 +0000 (17:22 +0000)]
2011-08-01 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libc/include/sys/types.h: XML and RTEMS define
_UNIX98_THREAD_MUTEX_ATTRIBUTES and can use the standard
definitions. This avoids redefinition warnings.
Ian Lance Taylor [Tue, 26 Jul 2011 18:48:08 +0000 (18:48 +0000)]
Merge from gcc:
2011-07-26 Ian Lance Taylor <iant@google.com>
* configure.ac: Set have_compiler based on whether gcc directory
exists, rather than on whether gcc is in configdirs.
* configure: Rebuild.
2011-07-20 David Edelsohn <dje.gcc@gmail.com>
* Makefile.tpl (POSTSTAGE1_CONFIGURE_FLAGS): Add libsupc++ to
link directories.
* Makefile.in: Rebuild.
2011-07-20 Ian Lance Taylor <iant@google.com>
PR bootstrap/49787
* configure.ac: Move --enable-bootstrap handling earlier in file.
If --enable-bootstrap and either --enable-build-with-cxx or
--enable-build-poststage1-with-cxx, enable C++ automatically.
* configure: Rebuild.
2011-07-19 Ian Lance Taylor <iant@google.com>
* configure.ac: Add --enable-build-poststage1-with-cxx. If set,
make C++ a boot_language. Set and substitute
POSTSTAGE1_CONFIGURE_FLAGS.
* Makefile.tpl (POSTSTAGE1_CONFIGURE_FLAGS): New variable.
(STAGE[+id+]_CONFIGURE_FLAGS): Add $(POSTSTAGE1_CONFIGURE_FLAGS).
* configure, Makefile.in: Rebuild.
2011-07-16 Jason Merrill <jason@redhat.com>
* Makefile.def (language=c++): Add check-c++0x and
check-target-libmudflap-c++.
* Makefile.tpl (check-target-libmudflap-c++): New.
* Makefile.in: Regenerate.
2011-07-16 Matthias Klose <doko@ubuntu.com>
* Makefile.tpl (EXTRA_CONFIGARGS_LIBJAVA): Define.
* Makefile.def (target_modules/libjava): Pass
$(EXTRA_CONFIGARGS_LIBJAVA).
* configure.ac: Pass --disable-static in EXTRA_CONFIGARGS_LIBJAVA,
if not configured with --enable-static-libjava.
* Makefile.in: Regenerate.
* configure: Likewise.
2011-06-22 Hans-Peter Nilsson <hp@axis.com>
PR regression/47836
PR bootstrap/23656
PR other/47733
PR bootstrap/49247
PR c/48825
* configure.ac (target_libraries): Remove target-libiberty.
Remove case-statement setting skipdirs=target-libiberty for
multiple targets. Remove checking target_configdirs and
removing target-libiberty but keeping target-libgcc if
otherwise empty.
* Makefile.def (target_modules): Don't add libiberty.
(dependencies): Remove all traces of target-libiberty.
* configure, Makefile.in: Regenerate.
Ralf Corsépius [Tue, 26 Jul 2011 04:42:06 +0000 (04:42 +0000)]
* ChangeLog: Fix my name's spelling.
Ralf Corsépius [Tue, 26 Jul 2011 04:04:45 +0000 (04:04 +0000)]
2011-07-26 Ralf Corsépius <ralf.corsepius@rtems.org>
* libc/sys/rtems/sys/dirent.h (scandir):
Add const to "select" parameter.
Ralf Corsépius [Mon, 25 Jul 2011 12:41:38 +0000 (12:41 +0000)]
2011-07-25 Ralf Corsépius <ralf.corsepius@rtems.org>
* libc/iconv/iconv.tex: Rename node "Introduction" into
"Introduction to iconv".
jason [Fri, 22 Jul 2011 18:20:21 +0000 (18:20 +0000)]
* Makefile.def (language=c++): Add check-c++0x and
check-target-libmudflap-c++.
* Makefile.tpl (check-target-libmudflap-c++): New.
* Makefile.in: Regenerate.
Yaakov Selkowitz [Wed, 20 Jul 2011 19:41:15 +0000 (19:41 +0000)]
* libc/include/time.h [_POSIX_CLOCK_SELECTION] (clock_nanosleep):
Declare.
* libc/include/sys/features.h [__CYGWIN__] (_POSIX_CLOCK_SELECTION):
Define.
Yaakov Selkowitz [Wed, 20 Jul 2011 01:14:50 +0000 (01:14 +0000)]
* libc/include/sys/unistd.h (_CS_XBS5_WIDTH_RESTRICTED_ENVS): Define.
(_CS_V6_ENV): Fix definition.
Corinna Vinschen [Tue, 19 Jul 2011 19:24:45 +0000 (19:24 +0000)]
* libc/locale/lmessages.c (_C_messages_locale):
Move __HAVE_LOCALE_INFO_EXTENDED__ before codeset.
Corinna Vinschen [Tue, 19 Jul 2011 07:23:09 +0000 (07:23 +0000)]
* libc/reent/sbrkr.c: Define _sbrk_r independently of the definition
of MALLOC_PROVIDED.
ro [Mon, 18 Jul 2011 10:15:06 +0000 (10:15 +0000)]
toplevel:
* configure: Regenerate.
config:
* elf.m4 (target_elf): Remove *-netware*.
Jeff Johnston [Fri, 15 Jul 2011 17:20:16 +0000 (17:20 +0000)]
2011-07-15 Yufeng Zhang <yufeng.zhang@arm.com>
* libc/stdio/vfwprintf.c (wcvt): Add a new parameter len of type
int. *length is set to the value of (rev - digits) regardless
of whether _MB_CAPABLE is defined or not. Replace BUF with len
in calling _mbsnrtowcs_r and also in the loop where _MB_CAPABLE
is not defined.
(_VFWPRINTF_R): Call wcvt with an extra argument. Call wcvt
again with allocated new buffer if buf is not large enough for
the conversion.
* testsuite/newlib.stdio/stdio.exp: New.
* testsuite/newlib.stdio/swprintf.c: Likewise.
Corinna Vinschen [Fri, 15 Jul 2011 08:04:17 +0000 (08:04 +0000)]
* libc/stdio/fscanf.c (fscanf): Call _vfscanf_r instead of __svfscanf_r
to make sure CHECK_INIT is called.
(_fscanf_r): Ditto.
* /libc/stdio/scanf.c (scanf): Ditto.
(_scanf_r): Ditto.
* libc/stdio/fwscanf.c (fwscanf): Call _vfwscanf_r instead of
__svfwscanf_r to make sure CHECK_INIT is called.
(_fwscanf_r): Ditto.
* libc/stdio/wscanf.c (wscanf): Ditto.
(_wscanf_r): Ditto.