Commit Graph

2526 Commits

Author SHA1 Message Date
Corinna Vinschen 1628bb8995 Only build _strtodg_r on targets supporting a distinct long double type
* libc/stdlib/strtodg.c: Add ifdef to check _HAVE_LONG_DOUBLE and
	_LDBL_EQ_DBL.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-11-26 10:13:53 +01:00
Steve Ellcey 10677229b9 libc/stdlib/strtorx.c: Fix ifdef to check _LDBL_EQ_DBL. 2015-11-24 13:59:31 -08:00
Marcus Shawcroft 8e62ab4ccc [ARM] Adjust strcmp-armv7.S selection logic.
Reformulate the strcmp-armv7.S selection logic around the architecture
features required by the implementation code rather (some) version of
the architecture that expose those features.
2015-11-23 15:22:26 +00:00
Marcus Shawcroft dc38827570 [ARM] Factor out the thumb2 -Os implementation.
The patch moves the inline ASM thumb2 -Os implementation out into its
own .S file.

Tested by building newlib and comparing libc.a binaries before and
after for all permutations of:

      Architectures:
        armv4 armv4t armv5 armv5t armv5te armv6 armv6j armv6k
        armv6z armv6kz armv6t2 armv6-m armv6s-m armv7 armv7-a
        armv7ve armv7-r armv7-m armv7e-m armv8-a iwmmxt iwmmxt2

      ISAs:
        thumb arm

      Optimization Levels:
        Os O2

      Excluding:
        armv6s-m -mthumb
        armv6-m -mthumb

        armv6zk -mthumb
        armv6z -mthumb
        armv6k -mthumb
        armv6j -mthumb
2015-11-23 15:21:47 +00:00
Corinna Vinschen 666a3482a5 Handle multibyte decimapl point in strtold.
* libc/stdlib/strtodg.c: Define USE_LOCALE.
	(_strtodg_r): Handle multibyte decimal point.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-11-21 16:40:21 +01:00
Corinna Vinschen fbace81684 Import correctly working strtold from David M. Gay.
* libc/stdlib/Makefile.am (GENERAL_SOURCES): Add strtodg.c and
	strtorx.c.
	* libc/stdlib/Makefile.in: Regenerate.
	* libc/stdlib/strtodg.c: New file implementing generic string to long
	double conversion.
	* libc/stdlib/strtorx.c: New file, implementing IEEE format string to
	long double conversion.
	* libc/stdlib/mprec.h (_strtodg_r): Declare.
	(_strtorx_r): Declare.
	* libc/stdlib/gdtoa.h (__UShort): Define.
	* libc/stdlib/strtold.c (__flt_rounds): Define for i386 and x86_64
	target.
	(FLT_ROUNDS): Define, as 0 on platforms missing a __flt_rounds
	function.
	(_strtold_r): Converted from strtold.  Call _strtorx_r on targets
	supporting distinct long doubles.
	(strtold): Just call _strtold_r.
	* libc/include/stdlib.h (_strtold_r): Declare.
	* libc/stdlib/ldtoa.c (_strtold): Comment out.  Explain why.
	* libc/stdio/vfscanf.c (__SVFSCANF_R): Call _strtold_r instead of
	_strtold.
	* libc/machine/powerpc/vfscanf.c (__svfscanf_r): Ditto.

	* common.din (strtold): Drop redirection to _strtold.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-11-20 18:14:58 +01:00
Corinna Vinschen 51bf1b81f3 Make match function globally available to stdlib functions.
* libc/stdlib/strtod.c (match): Move from here...
	* libc/stdlib/gdtoa-hexnan.c (match): ...to here.
	* libc/stdlib/mprec.h (match): Declare and add __match define.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-11-20 18:03:05 +01:00
Corinna Vinschen b5d8a403ec Drop unused declaration from wcstold.c
* libc/stdlib/wcstold.c (_strtold): Drop unused declaration.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-11-20 17:57:20 +01:00
Yaakov Selkowitz 1c1a925fc4 Fix typo in rpmatch doc reference
* libc/stdlib/stdlib.tex: Fix typo in rpmatch reference.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2015-11-19 15:28:06 -06:00
Corinna Vinschen fcc2dcbb21 ldtoa.c: Reindent to GNU style
* libc/stdlib/ldtoa.c: Convert to GNU style so as not to get crazy
	reading the code.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-11-19 17:09:58 +01:00
Corinna Vinschen e2802064b2 Fix rpmatch build problem
* libc/stdlib/rpmatch.c: Include sys/types.h to make GCC happy.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-11-19 16:31:08 +01:00
Jon Turney bdc6169381 Simplify the markup for sprintf and swprintf documentation
- move the description of the alternative form produced with the # flag from a
nested table to an additional table

2015-11-12  Jon Turney  <jon.turney@dronecode.org.uk>

	* libc/stdio/sprintf.c: Simplify documentation markup.
	* libc/stdio/swprintf.c: Ditto.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2015-11-19 11:39:52 +00:00
Jon Turney 21e6ba20ae Improve markup of sscanf and swscanf documentation
- use bullet points to separate width, size and type sections, rather than using
rows in an enormous table, for consistency with sprintf and swprintf.

- use code markup for size bullet point for consistency

- use a texinfo multitable for description of the size flags, rather than some
preformatted text

- tidy up some whitespace so type flags are all aligned

2015-11-12  Jon Turney  <jon.turney@dronecode.org.uk>

	* libc/stdio/sscanf.c: Improve documentation markup.
	* libc/stdio/swscanf.c: Ditto.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2015-11-19 11:39:49 +00:00
Yaakov Selkowitz 9a6acafd04 Add rpmatch(3)
2015-11-17  Yaakov Selkowitz  <yselkowi@redhat.com>

* libc/include/stdlib.h (rpmatch): Declare.
* libc/stdlib/Makefile.am (ELIX_4_SOURCES): Add rpmatch.c.
(CHEWOUT_FILES): Add rpmatch.def.
* libc/stdlib/Makefile.in: Regenerate.
* libc/stdlib/rpmatch.c: New file.
* libc/stdlib/stdlib.tex: Add references to rpmatch.
2015-11-17 12:00:20 -06:00
Marcus Shawcroft 9959058932 [ARM] Factor out the thumb1 -Os implementation.
The patch moves the inline ASM thumb1 -O2 implementation out into its
own .S file.

Tested by building newlib and comparing libc.a binaries before and
after for all permutations of:

      Architectures:
        armv4 armv4t armv5 armv5t armv5te armv6 armv6j armv6k
        armv6z armv6kz armv6t2 armv6-m armv6s-m armv7 armv7-a
        armv7ve armv7-r armv7-m armv7e-m armv8-a iwmmxt iwmmxt2

      ISAs:
        thumb arm

      Optimization Levels:
        Os O2

      Excluding:
        armv6s-m -mthumb
        armv6-m -mthumb

        armv6zk -mthumb
        armv6z -mthumb
        armv6k -mthumb
        armv6j -mthumb
2015-11-13 11:54:28 +00:00
Marcus Shawcroft bcd5e8e3f9 [ARM] Adding strlen.S
The patch adds strlen.S to contain the complementary preprocessor
logic to strlen-stub.c intended to provide #inclusion of alternative
.S implementations.

Initially we just include the existing strlen-armv7.S implementation.

We rewrite _ISA_ARMV7 in both strlen.S and strlen-stub.c to use the
underlying existing underlying defintion from arm_asm.h in order to
avoide including that file, this is in effect the first step towards a
move to ACLE predefines only.

Tested by building newlib and comparing libc.a binaries before and
after for all permutations of:

      Architectures:
        armv4 armv4t armv5 armv5t armv5te armv6 armv6j armv6k
        armv6z armv6kz armv6t2 armv6-m armv6s-m armv7 armv7-a
        armv7ve armv7-r armv7-m armv7e-m armv8-a iwmmxt iwmmxt2

      ISAs:
        thumb arm

      Optimization Levels:
        Os O2

      Excluding:
        armv6s-m -mthumb
        armv6-m -mthumb

        armv6zk -mthumb
        armv6z -mthumb
        armv6k -mthumb
        armv6j -mthumb
2015-11-13 11:54:28 +00:00
Marcus Shawcroft 42de6f5085 [ARM] Rename strlen to strlen-stub.c
In order to maintain consistency both within machine/arm and between
machine/arm and machine/aarch64, rename the 'c' stub to -stub.c.

Tested by building newlib and comparing libc.a binaries before and
after for all permutations of:

      Architectures:
        armv4 armv4t armv5 armv5t armv5te armv6 armv6j armv6k
        armv6z armv6kz armv6t2 armv6-m armv6s-m armv7 armv7-a
        armv7ve armv7-r armv7-m armv7e-m armv8-a iwmmxt iwmmxt2

      ISAs:
        thumb arm

      Optimization Levels:
       Os O2

      Excluding:
        armv6s-m -mthumb
        armv6-m -mthumb

        armv6zk -mthumb
        armv6z -mthumb
        armv6k -mthumb
        armv6j -mthumb
2015-11-13 11:54:23 +00:00
Marcus Shawcroft 2c8e31d654 [ARM] Reorganize strlen selection.
Remove automake and autoconf selection of strchr implementation in
favour of conditional compilation in strlen.c.
2015-11-13 11:52:01 +00:00
Marcus Shawcroft 52f5864096 [ARM] Refactor strlen.c #if nesting.
This patch flattens the condition code selection used in strlen in an
attempt to make the guarding condition for each alternative
implementation clearer and to structure the logic in a manner that
makes it easier to maintain complementary logic between the
alternative 'C' and assembler implementations.

Tested by building newlib and comparing libc.a binaries before and
after for all permutations of:

  Architectures:
    armv4 armv4t armv5 armv5t armv5te armv6 armv6j armv6k
    armv6z armv6kz armv6t2 armv6-m armv6s-m armv7 armv7-a
    armv7ve armv7-r armv7-m armv7e-m armv8-a iwmmxt iwmmxt2

  ISAs:
    thumb arm

  Optimization Levels:
    Os O2

  Excluding:
    armv6s-m -mthumb
    armv6-m -mthumb

    armv6zk -mthumb
    armv6z -mthumb
    armv6k -mthumb
    armv6j -mthumb
2015-11-13 11:51:31 +00:00
Anton Kolesov c0a99f0293 Add support for ARC to newlib
newlib/ChangeLog:
2015-11-12  Anton Kolesov  <Anton.Kolesov@synopsys.com>

	* configure.host: Add ARC support.
	* libc/include/machine/setjmp.h: Likewise.
	* libc/machine/configure: Likewise.
	* libc/machine/configure.in: Likewise.
	* libc/machine/arc/Makefile.am: Likewise.
	* libc/machine/arc/Makefile.in: Likewise.
	* libc/machine/arc/aclocal.m4: Likewise.
	* libc/machine/arc/asm.h: Likewise.
	* libc/machine/arc/configure: Likewise.
	* libc/machine/arc/configure.in: Likewise.
	* libc/machine/arc/memcmp-bs-norm.S: Likewise.
	* libc/machine/arc/memcmp-stub.c: Likewise.
	* libc/machine/arc/memcmp.S: Likewise.
	* libc/machine/arc/memcpy-archs.S: Likewise.
	* libc/machine/arc/memcpy-bs.S: Likewise.
	* libc/machine/arc/memcpy-stub.c: Likewise.
	* libc/machine/arc/memcpy.S: Likewise.
	* libc/machine/arc/memset-archs.S: Likewise.
	* libc/machine/arc/memset-bs.S: Likewise.
	* libc/machine/arc/memset-stub.c: Likewise.
	* libc/machine/arc/memset.S: Likewise.
	* libc/machine/arc/setjmp.S: Likewise.
	* libc/machine/arc/strchr-bs-norm.S: Likewise.
	* libc/machine/arc/strchr-bs.S: Likewise.
	* libc/machine/arc/strchr-stub.c: Likewise.
	* libc/machine/arc/strchr.S: Likewise.
	* libc/machine/arc/strcmp-archs.S: Likewise.
	* libc/machine/arc/strcmp-stub.c: Likewise.
	* libc/machine/arc/strcmp.S: Likewise.
	* libc/machine/arc/strcpy-bs-arc600.S: Likewise.
	* libc/machine/arc/strcpy-bs.S: Likewise.
	* libc/machine/arc/strcpy-stub.c: Likewise.
	* libc/machine/arc/strcpy.S: Likewise.
	* libc/machine/arc/strlen-bs-norm.S: Likewise.
	* libc/machine/arc/strlen-bs.S: Likewise.
	* libc/machine/arc/strlen-stub.c: Likewise.
	* libc/machine/arc/strlen.S: Likewise.
	* libc/machine/arc/strncpy-bs.S: Likewise.
	* libc/machine/arc/strncpy-stub.c: Likewise.
	* libc/machine/arc/strncpy.S: Likewise.
2015-11-12 14:14:17 +01:00
Anton Kolesov e945a19cb2 Remove obsolete ARC system
ARC architecture specific files has been added ages ago in newlib/libc/sys,
but with invention of libgloss those files should be moved from newlib to
libgloss.

newlib/ChangeLog:
2015-11-12  Anton Kolesov  <Anton.Kolesov@synopsys.com>

	* configure.host: Remove ARC system.
	* libc/sys/configure: Likewise.
	* libc/sys/configure.in: Likewise.
	* libc/sys/arc/Makefile.am: Likewise.
	* libc/sys/arc/Makefile.in: Likewise.
	* libc/sys/arc/aclocal.m4: Likewise.
	* libc/sys/arc/configure: Likewise.
	* libc/sys/arc/configure.in: Likewise.
	* libc/sys/arc/crt0.S: Likewise.
	* libc/sys/arc/dummy.S: Likewise.
	* libc/sys/arc/isatty.c: Likewise.
	* libc/sys/arc/mem-layout.c: Likewise.
	* libc/sys/arc/sbrk.c: Likewise.
	* libc/sys/arc/sys/syscall.h: Likewise.
	* libc/sys/arc/syscalls.c: Likewise.
2015-11-12 14:03:05 +01:00
Marcus Shawcroft 332a6236a2 Fix multilib libgloss selection.
Regression testing newlib in conjunction with libgloss and
--enable-multilib can result in incompatible multilib versions of
newlib and libgloss being used during link.

This manifests on ARM target when newlib regression is run using a
GCC configured using --with-multilib-list=aprofile

With this configuration many of the multilib variants built are
mutually incompatible.

The issue is that the newlib dejagnu foo iterates each multilib
variant and correctly chooses the appropriate newlib variant but
always chooses the root/base libgloss variant.

The implementation of newlib/testsuite/lib/flags.exp contains the
following fragment:

set target_build_path "$objdir/$multibuildtop.."

The effect of this fragment is to explicitly select the root version
of libgloss, irrespective of the current multilib.

Digging around in VC it appears that the original implementation of
multlib magic came into the tree back in 2002 with:

6e9d950a (Thomas Fitzsimmons 2002-05-01 17:06:25 +0000 39)

In this initial version of multilib support, newlib was multilib
capable, but libgloss was not multilib capable, hence the necessity to
explicitly select the root libgloss version.

Subsequently flags.exp was modified to support out of tree testing:

cec1d3b4 (Jeff Johnston      2005-07-05 00:11:50 +0000 25)

This change is orthogonal to this issue, its effect is to exit early
in none multilib configurations.

Subsequently libgloss gained --enable-multilib support, the relevant
change is:

https://sourceware.org/ml/newlib/2006/msg00440.html
commit 00a4b31ad0
Author: Jeff Johnston <jjohnstn@redhat.com>
Date: Wed May 10 20:51:41 2006 +0000

This change enabled multilib support throughout libgloss, but ommitted
to adjust the flag.exp behaviour which anchors the libgloss multilib
selection to the base version.

The attached patch adjusts flags.exp to select the current multilib
variant of libgloss.

2015-11-06  Marcus Shawcroft  <marcus.shawcroft@arm.com>

        * testsuite/lib/flags.exp (libgloss_link_flags): Drop multilibtop
        from target_build_path.
2015-11-12 13:48:06 +01:00
Jon Turney 1129ef019f makedoc: Don't interpret license text as a command
Align makedoc's iscommand() with it's documentation, and don't allow commands to
contain a space.  A command is a line containing only a sequence of capital
letters or '_', followed by optional spaces.

This prevents "IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE" (the only line in the license text which consists of only
capitals and spaces, without any punctuation) from being interepreted as a
makedoc command, leading to:

"Can't find IMPLIED"
"warning, IMPLIED is not recognised"

being emitted by makedoc, (which is normally un-noticed because makedoc's stderr
is redirected to a .ref file)

2015-11-06  Jon Turney  <jon.turney@dronecode.org.uk>

	* doc/makedoc.c (iscommand): Only allow commands to have trailing
	spaces, not space separated words.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2015-11-12 12:42:19 +00:00
Jon Turney 81a7c8c37f doc: Fix some inconsistent QUICKREF lines
makedoc defines a command as 'all upper case, and alone on a line'.

A few QUICKREF lines currently violate this by having some additional text after
the QUICKREF.

So, currently, these lines are treated as an unknown command.

This is benign as QUICKREF currently does nothing but produce some ignored
output on stderr.  I'm not sure what the intent of QUICKREF is.

2015-11-06  Jon Turney  <jon.turney@dronecode.org.uk>

	* libm/mathfp/s_acos.c: Fix QUICKREF.
	* libm/mathfp/e_acosh.c: Ditto.
	* libm/math/w_asin.c: Ditto.
	* libm/mathfp/e_acosh.c: Ditto.
	* libm/mathfp/s_acos.c: Ditto.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2015-11-12 12:42:17 +00:00
Jon Turney 0c02db4d28 makedoc: Fix INTERNAL(|DEFINITION|FUNCTION) command definitions
The unused INTERNAL_DEFINITION, INTERNAL_FUNCTION and INTERNAL commands are
defined in terms of the non-existent built-in 'func'

This causes every single invocation of makedoc to output "Can't find func" three
times, as it parses doc.str.

This is normally un-noticed because makedoc's stderr is redirected to a .ref
file.

Fix these unused command definitions to something with equivalent lack of
effect, but without generating an error.

2015-11-06  Jon Turney  <jon.turney@dronecode.org.uk>

	* doc/doc.str: Fix INTERNAL_DEFINITION, INTERNAL_FUNCTION and
	INTERNAL.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2015-11-12 12:42:15 +00:00
Wilco Dijkstra 3c8636acf6 AArch64: Tune memcpy
* newlib/libc/machine/aarch64/memcpy.S (memcpy):
 	Further tuning for performance.
2015-11-12 13:38:39 +01:00
Joseph Myers e6459123e4 Avoid .eh_frame in ARM newlib.
ARM newlib has various strcmp implementations that use .cfi_*
directives to generate unwind information.

The effect of this is that the generated objects contain .eh_frame
sections.  However, ARM uses its own unwind info format, not
.eh_frame, which is generated by ARM-specific directives, not .cfi_*.
The .eh_frame sections are useless, but also not removed by strip and
may be loaded into memory at runtime.

This patch fixes this by using .cfi_sections .debug_frame (as in
glibc) so that the directives generate .debug_frame instead.
.debug_frame is useful for the debugger, can be removed by strip, and
is not loaded into memory at runtime.

	* libc/machine/arm/strcmp-arm-tiny.S: Use .cfi_sections
	.debug_frame.
	* libc/machine/arm/strcmp-armv4.S: Likewise.
	* libc/machine/arm/strcmp-armv4t.S: Likewise.
	* libc/machine/arm/strcmp-armv6.S: Likewise.
	* libc/machine/arm/strcmp-armv6m.S: Likewise.
	* libc/machine/arm/strcmp-armv7.S: Likewise.
	* libc/machine/arm/strcmp-armv7m.S: Likewise.
2015-11-12 12:09:24 +00:00
Marcus Shawcroft d18f1fc8a3 Reorganize memchr selection.
The patch cleans up the auto configury mechanism used to select
different implementations of memchr for various architecture versions.

The approach here is to remove the selection of memchr within automake
and instead use complimentary logic in memchr-stub.c and memchr.S to
choose between the gerneric memchr.c implementation or one of the
architecture specific implementations.

This patch also changes the selection criteria inline with the
previous proposal here:

https://sourceware.org/ml/newlib/2015/msg00752.html

but using the ACLE predefines.

Regressed for armv7-a armv5 armv8-a, correct selection of memcpy
implementation by manual inspection of a test program built for these
three architectures.
2015-11-06 16:11:32 +00:00
Marcus Shawcroft 72be1dead4 Reorganize memcpy selection.
This patch cleans up the auto configury mechanism used to select
different implementations of memcpy for various architecture versions.

The approach here is to remove the selection of memcpy within automake
and instead use complimentary logic in memcpy-stub.c and memcpy.S to
choose between the generic memcpy.c implemenation or one of the
architecture specific memcpy*.S implemenations.

Regressed for armv7-a armv5 armv8-a, correct selection of memcpy
implementation by manual inspection of a test program built for these
three architectures.

This revised patch flips the remaining preprocessor logic in
memcpy-stub.c to use ACLE defines as requested in the previous review
and removes the now disused HAVE_ARMV7A and HAVE_ARMV8A configure.in
support.
2015-11-06 15:40:31 +00:00
Olivier Martin cdb1ebe107 Replace __attribute((__warning__())) by __attribute__((deprecated()))
Clang raises the warning message:
warning: unknown attribute '__warning__' ignored [-Wunknown-attributes]

	* libc/include/stdlib.h (mktemp): Change attribute to deprecated.
	(_mktemp_r): Ditto.

Signed-off-by: Olivier Martin <olivier@labapart.com>
2015-11-06 11:29:58 +01:00
Marcus Shawcroft 0a4019eed2 [ARM] Select appropriate memcpy implementation for ARMv8-a.
The newlib configury logic that detects architecture version and
chooses an appropriate memcpy implementation does not consider
ARMv8-a.

This patch adds configury logic to detect ARMv8-a along with the
associated changes in Makefile.am and memcpy.
2015-11-03 11:04:55 +00:00
Jeff Johnston 0631279394 Move duplicated documentation rules to Makefile.shared
- Also, harmonize libm to use CHEWOUT_FILES like libc, rather than chobj.
  Update documentation appropriately.

        * HOWTO: Update.
        * Makefile.shared: Move documentation rules to here...
        * libc/argz/Makefile.am: ... from here ...
        * libc/ctype/Makefile.am: ... and here.
        * libc/errno/Makefile.am: Ditto.
        * libc/iconv/Makefile.am: Ditto.
        * libc/iconv/ccs/Makefile.am : Ditto.
        * libc/iconv/ces/Makefile.am: Ditto.
        * libc/iconv/lib/Makefile.am: Ditto.
        * libc/locale/Makefile.am: Ditto.
        * libc/misc/Makefile.am: Ditto.
        * libc/posix/Makefile.am: Ditto.
        * libc/reent/Makefile.am: Ditto.
        * libc/search/Makefile.am: Ditto.
        * libc/stdio/Makefile.am: Ditto.
        * libc/stdio64/Makefile.am: Ditto.
        * libc/stdlib/Makefile.am : Ditto.
        * libc/string/Makefile.am: Ditto.
        * libc/syscalls/Makefile.am: Ditto.
        * libc/time/Makefile.am : Ditto.
        * libc/unix/Makefile.am: Ditto.
        * libc/xdr/Makefile.am: Ditto.
        * libm/common/Makefile.am: Ditto.
        * libm/complex/Makefile.am: Ditto.
        * libm/math/Makefile.am: Ditto.
        * libm/mathfp/Makefile.am: Ditto.
2015-11-02 18:02:39 -05:00
Jeff Johnston 53617ce4e6 Consistently use an em-dash in math functions.
- also move previous ChangeLog entry to newlib instead of top-level

        * libc/time/wcsftime.c: Consistently use an em-dash in FUNCTION
summary.
        * libm/common/isgreater.c: Ditto.
        * libm/common/s_fdim.c: Ditto.
        * libm/common/s_fma.c: Ditto.
        * libm/common/s_fmax.c: Ditto.
        * libm/common/s_fmin.c: Ditto.
        * libm/common/s_infinity.c: Ditto.
        * libm/common/s_isnan.c: Ditto.
        * libm/common/s_log2.c: Ditto.
        * libm/common/s_logb.c: Ditto.
        * libm/common/s_lrint.c: Ditto.
        * libm/common/s_lround.c: Ditto.
        * libm/common/s_nearbyint.c: Ditto.
        * libm/common/s_remquo.c: Ditto.
        * libm/common/s_rint.c: Ditto.
        * libm/common/s_round.c: Ditto.
        * libm/common/s_scalbn.c: Ditto.
        * libm/common/s_signbit.c: Ditto.
        * libm/common/s_trunc.c: Ditto.
        * libm/math/w_exp2.c: Ditto.
        * libm/math/w_gamma.c: Ditto.
2015-11-02 16:43:22 -05:00
Jeff Johnston 72e18faf62 Add missing semicolons to prototypes.
* libc/stdio/fseek.c: Add missing semicolons to prototypes in
        SYNOPSIS.
        * libc/stdio/fwide.c: Ditto.
        * libc/stdio64/fseeko64.c: Ditto.
        * libc/string/strtok.c: Ditto.
        * libc/string/wcstok.c: Ditto.
        * libm/math/w_cosh.c: Ditto.
        * libm/math/w_fmod.c:  Ditto.
        * libm/mathfp/s_cosh.c: Ditto.
        * libm/mathfp/s_fmod.c: Ditto.
2015-11-02 16:34:49 -05:00
Steve Ellcey 5045532322 Improve performance of MIPS memcpy.
* libc/machine/mips/memcpy.S (memcpy): Add word copies for small
	aligned data.
2015-11-02 13:30:19 -08:00
Corinna Vinschen 7ac60f6ceb Add missing ChangeLog entry for ce8159d5 2015-11-02 10:24:14 +01:00
Sebastian Huber ce8159d5ce Include <sched.h> in <pthread.h>
This is mandated by POSIX.

2015-10-30  Sebastian Huber  <sebastian.huber@embedded-brains.de>

	libc/include/pthread.h: Include <sched.h> instead of
	<sys/sched.h>.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-10-30 20:28:00 +01:00
Brian Inglis 6090952296 strftime: Add support for %s (seconds since epoch)
* libc/time/strftime.c (__strftime): add support for %s (seconds from
	Unix epoch).  Fix whitespaces.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-10-27 09:41:40 +01:00
Nick Clifton c3b6da1781 Extend _intsup.h to support 16-bit and 20-bit pointers.
* libc/include/sys/_intsup.h: Add support for 16-bit and 20-bit
	pointers.
2015-10-19 14:48:30 +01:00
Sebastian Huber f86afe5a3a C11 aligned_alloc() implementation
aligned_alloc() is implemented in terms of posix_memalign() which is
only declared in <stdlib.h> but not defined in Newlib in general.  At
least Linux and RTEMS implement this function.

newlib/ChangeLog
2015-10-14  Sebastian Huber  <sebastian.huber@embedded-brains.de>

	* libc/stdlib/Makefile.am (GENERAL_SOURCES): Add
	alloc_aligned.c.c.
	* libc/stdlib/Makefile.in: Regenerate.
	* libc/stdlib/aligned_alloc.c: New.
2015-10-19 14:10:33 +02:00
Sebastian Huber da60762bfe C11 aligned_alloc() support for <stdlib.h>
newlib/ChangeLog
2015-10-14  Sebastian Huber  <sebastian.huber@embedded-brains.de>

	* libc/include/stdlib.h (alloc_aligned): Declare.
2015-10-19 14:10:09 +02:00
Sebastian Huber d67f71ab85 C11 quick_exit() support for <stdlib.h>
Import some <stdlib.h> function declarations from latest FreeBSD and
implement them.  I am not sure if we should call the global reent
cleanup in quick_exit() similar to exit().

newlib/ChangeLog
2015-10-14  Sebastian Huber  <sebastian.huber@embedded-brains.de>

	* libc/include/stdlib.h (at_quick_exit): Declare.
	(quick_exit): Likewise.
	* libc/stdlib/Makefile.am (GENERAL_SOURCES): Add
	quick_exit.c.
	* libc/stdlib/Makefile.in: Regenerate.
	* libc/stdlib/quick_exit.c: New.
2015-10-19 14:09:17 +02:00
Jeff Johnston c98d01ee0c Import <threads.h> from latest FreeBSD.
- Move types and defines to
  <machine/_threads.h> so that it can be customized per target.

	* libc/include/threads.h: New.
	* libc/sys/rtems/include/machine/_threads.h: Likewise.
2015-10-13 17:52:34 -04:00
Jeff Johnston ecee0b0607 Synchronize with FreeBSD.
* libc/include/sys/cdefs.h: Synchronize with latest FreeBSD
        version.
2015-10-13 17:50:30 -04:00
Jeff Johnston 443467d752 Add FreeBSD style changes to sys/cdefs.h
* libc/include/sys/cdefs.h: Add style changes of latest FreeBSD
        version.
2015-10-13 17:46:47 -04:00
Nick Clifton e6430c9e8c Define setjmp buffer length for IA64. 2015-10-08 15:46:34 +01:00
Jeff Johnston f296bb3569 Minimize newlib code size for ft32
* configure.host (ft32): minimise newlib code size
2015-09-22 18:12:23 -04:00
Jeff Johnston 948b5f0043 Add support for ft32 to newlib. 2015-09-04 14:37:37 -04:00
Hans-Peter Nilsson 82d7069a5e libc/machine/cris/sys/signal.h (kill): Declare. 2015-09-03 01:59:43 +02:00
Corinna Vinschen 38fd7ddb79 Allow sysconf to return CPU cache information
* include/sys/unistd.h (_SC_LEVEL*): Add cache-related variables as
        on Linux.

        * fhandler_proc.cc (format_proc_cpuinfo): Fetch cache information
        from new cache functions in sysconf.cc, get_cpu_cache_intel and
        get_cpu_cache_amd.
        * sysconf.cc (__nt_query_system): New local helper.
        (get_nproc_values): Utilize __nt_query_system on pre-Windows 7 systems.
        Use GetLogicalProcessorInformationEx otherwise to handle more than
        64 CPUs.  Only handle _SC_NPROCESSORS_CONF and _SC_NPROCESSORS_ONLN.
        (get_phys_pages): New helper to handle _SC_PHYS_PAGES.
        (cpuid2_cache_descriptor): New array to map Intel CPUID 2 descriptor
        values to cache type, cache size, associativity and linesize.
        (cpuid2_cache_desc_compar): Comparision function for bsearch over
        cpuid2_cache_descriptor.
        (get_cpu_cache_intel_cpuid2): New function to fetch cache info from
        Intel CPUID 2.
        (get_cpu_cache_intel_cpuid4): Ditto from Intel CPUID 4.
        (get_cpu_cache_intel): New function as CPU-specific entry point.
        (assoc): New array to map associativity values from AMD CPUID
        0x80000006.
        (get_cpu_cache_amd): New function to fetch cache info from AMD CPUIDs
        0x80000005 and 0x80000006.
        (get_cpu_cache): New function to fetch cache info.
        (sca): Call get_phys_pages if _SC_PHYS_PAGES is requested.  Call
        get_cpu_cache for new _SC_* cache requests.
        (SC_MAX): Set to _SC_LEVEL4_CACHE_LINESIZE.
        (get_phys_pages(void)): Call get_phys_pages(int).
        * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.

        * new-features.xml (ov-new2.3): Document sysconf cache addition.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-08-29 09:16:47 +02:00
Corinna Vinschen e6d9af11f1 strlen-armv7.S: Fix preprocessor check
Hi!

I've got the situation, that the function strlen() occurs twice in libc.a
(building newlib for ARM-V7a and Size-Optimized).

In newlib/libc/machine/arm/strlen.c there are the pre-processor stetements ...
#if defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED) || \
  (defined (__thumb__) && !defined (__thumb2__))
/*...*/
#else

#if !(defined(_ISA_ARM_7) || defined(__ARM_ARCH_6T2__))
/*...*/
#endif

and in newlib/libc/machine/arm/strlen-armv7.S the "exclude" begins with

/* NOTE: This ifdef MUST match the ones in arm/strlen.c
   We fallback to the one in arm/strlen.c for size optimised or
   for older architectures. */
#if defined(_ISA_ARM_7) || defined(__ARM_ARCH_6T2__) && \
    !(defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED) || \
      (defined (__thumb__) && !defined (__thumb2__)))

But this is not completely contrary to arm/strlen.c (see above)!

To fix the logical statement in arm/strlen-armv7.S there are parentheses needed

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-08-27 12:55:22 +02:00
Andre Simoes Dias Vieira 892cfcb7c2 Fix for pri and scn formats 2015-08-27 12:50:25 +02:00
James Greenhalgh 4eca8ea0cf Always declare "kill" in include/sys/signal.h
Hi,

As I mentioned recently [1], newlib is providing a "kill" symbol to link
against, without declaring "kill" in signal.h. This is confusing for the
libgfortran build, which tries to link against kill (which succeeds), then
tries to use it (which triggers -Werror=implicit-function-declaration).

This patch implements my suggestion in that thread - making the declaration
of 'kill' in libc/include/sys/signal.h unconditional.

I've tested this by building a modified libgfortran on AArch64/ARM to see
that the Werror goes away, and the libgfortran build succeeds.

Is something like this OK for newlib? If so, can someone please commit
it on my behalf, as I have no commit access here.

Otherwise, what is your preferred direction for me to take this patch?

Thanks,
James
2015-08-25 16:17:14 +02:00
Jon TURNEY a669484b81 Manuals failing to build on Ubuntu LTS 14.04
On 11/08/2015 11:08, Andre Vieira wrote:
> On 10/08/15 14:38, Jon TURNEY wrote:
>> On 07/08/2015 11:13, Andre Vieira wrote:
>>> Building the manuals on Ubuntu LTS 14.04 (64-bit) using pdfTeX
>>> 3.1415926-2.5-1.40.14 (TeX Live 2013/Debian) is failing with the
>>> following error:
>>> "Transcript written on libc.log.
>>> /usr/bin/texi2dvi: pdfetex exited with bad status, quitting."
>>>
>>> libc.log complaints about the following:
>>>
>>> You can't use `@unskip' in vertical mode.
>>>
[...]
>>>
>>> This code has been around for a while, so it might have to do with a
>>> change in pdfTex?

So it seems this problem has been around for a while, and looks like it
is due to a change in texi2dvi in texinfo 5.0 or late 4.x, see [1].

I guess it's not very noticeable since it only occurs when doing 'make
dvi', which doesn't happen by default.

Attached is a different and perhaps cleaner workaround to the one in
that thread.

[1] https://sourceware.org/ml/newlib/2013/msg00057.html

From 4d386b5900b6c68e022004b447faa696be5ff8c7 Mon Sep 17 00:00:00 2001
From: Jon TURNEY <jon.turney@dronecode.org.uk>
Date: Tue, 11 Aug 2015 14:46:39 +0100
Subject: [PATCH] Use '@sp 1' rather than '@*' to workaround a change in
 texi2dvi.

Since about TexInfo 5.0, using '@*' immediately after a table causes a 'You
can't use `@unskip' in vertical mode' error.

See https://sourceware.org/ml/newlib/2013/msg00057.html

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-08-20 10:53:55 +02:00
Andre Vieira 9303de77d9 Add MIN MAX macro to param header file.
newlib/ChangeLog:
2015-07-28  Andre Vieira  <andre.simoesdiasvieira@arm.com>

   * libc/sys/arm/sys/param.h (MIN,MAX): Define.

From 536ca7365d269f5e56679048e336d6969186d550 Mon Sep 17 00:00:00 2001
From: Andre Simoes Dias Vieira <andsim01@arm.com>
Date: Tue, 28 Jul 2015 14:19:08 +0100
Subject: [PATCH] Added min max macros
2015-08-20 10:52:34 +02:00
Andre Vieira a732159809 Use machine header file for endianness configuration.
newlib/ChangeLog:
2015-07-28  Andre Vieira  <andre.simoesdiasvieira@arm.com>

   * libc/sys/arm/sys/param.h (BIG_ENDIAN, LITTLE_ENDIAN): Moved
   to machine/endian.h.
   * libc/machine/arm/machine/param.h (BYTE_ORDER): Idem.
   * libc/machine/arm/machine/endian.h: New.

From ca6efccda91bc6b620b7d96a466b0f1e2f02cfeb Mon Sep 17 00:00:00 2001
From: Andre Simoes Dias Vieira <andsim01@arm.com>
Date: Tue, 28 Jul 2015 12:16:20 +0100
Subject: [PATCH 2/2] Move endianness configuration to machine/endian.h
2015-08-20 10:52:34 +02:00
Andre Vieira 573532df7f Use machine header file for param configuration.
On 31/07/15 10:34, Richard Earnshaw wrote:
> On 31/07/15 10:28, Andre Vieira wrote:
>> newlib/ChangeLog:
>> 2015-07-28  Andre Vieira  <andre.simoesdiasvieira@arm.com>
>>
>>    * libc/sys/arm/sys/param.h: Include machine/param.h
>>    (HZ, NOFILE, PATHSIZE): Define.
>>
>> param_refactor_1.patch
>>
>>
>>  From abc2d5f3398721f6ca891b9581feaba58730b19c Mon Sep 17 00:00:00 2001
>> From: Andre Simoes Dias Vieira <andsim01@arm.com>
>> Date: Tue, 28 Jul 2015 12:10:59 +0100
>> Subject: [PATCH 1/2] Moved param configuration to machine/param.h
>>
>> ---
>>   newlib/libc/sys/arm/sys/param.h | 12 ++++++++++--
>>   1 file changed, 10 insertions(+), 2 deletions(-)
>>
>> diff --git a/newlib/libc/sys/arm/sys/param.h b/newlib/libc/sys/arm/sys/param.h
>> index adc066e9a8756e07edaaa8cadc79b5f05c996ac9..622c371972ab3c9dbb93ea5c51323a593e2a171a 100644
>> --- a/newlib/libc/sys/arm/sys/param.h
>> +++ b/newlib/libc/sys/arm/sys/param.h
>> @@ -3,9 +3,17 @@
>>   #ifndef _SYS_PARAM_H
>>   # define _SYS_PARAM_H
>>
>> -# define HZ (100)
>> -# define NOFILE	(60)
>> +#include <machine/param.h>
>> +
>> +#ifndef HZ
>> +# define HZ (60)
>
> Why have you changed the value for HZ?  It seems that, by convention,
> ARM boards have always used 100.
>
> R.
>
>> +#endif
>> +#ifndef NOFILE
>> +# define NOFILE>(60)
>> +#endif
>> +#ifndef PATHSIZE
>>   # define PATHSIZE (1024)
>> +#endif
>>
>>   #define BIG_ENDIAN      4321
>>   #define LITTLE_ENDIAN   1234
>>
>
Hi Richard,

ARM's machine/param.h that is included in "#include <machine/param.h>",
before the 'ifndef' already defines HZ to be 100. This file was already
there, it was just not being used. I understand that this 'ifndef' might
be confusing, though I decided to add it to mimic the behavior of the
default sys/param.h.

There is however an unrelated issue with this patch, a typo in the
"#define NOFILE" that crept in there due to some copy pasting when
splitting the patch.

Here is a fixed version.

BR,
Andre

newlib/ChangeLog:
2015-07-28  Andre Vieira  <andre.simoesdiasvieira@arm.com>

   * libc/sys/arm/sys/param.h: Include machine/param.h
   (HZ, NOFILE, PATHSIZE): Define.

From abc2d5f3398721f6ca891b9581feaba58730b19c Mon Sep 17 00:00:00 2001
From: Andre Simoes Dias Vieira <andsim01@arm.com>
Date: Tue, 28 Jul 2015 12:10:59 +0100
Subject: [PATCH 1/2] Moved param configuration to machine/param.h
2015-08-20 10:52:34 +02:00
Yaakov Selkowitz 9f3100c958 sys/signal.h: include sys/ucontext.h on Cygwin per POSIX.1-2008
* libc/include/sys/signal.h [__CYGWIN__]: include <sys/ucontext.h>
if compiling for POSIX.1-2008.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2015-08-18 11:05:41 +02:00
Jeff Johnston 4098f69c43 or1k: Fix critical handling in malloc locks
Only on first call to the recursive malloc lock the restore value of
    exception enable fields is stored.

    	  * libc/sys/or1k/mlock.c: Fix exception enable saving
2015-08-07 15:01:58 -04:00
Shoichi Sakon 001ef5af39 Fix wscanf family positional parameter handling in %lc, %ls, %l[]
* libc/stdio/vfwscanf.c (__SVFWSCANF_R): Convert wrong usage of va_arg
        to GET_ARG in %lc, %ls nad %l[] cases.  Fix unterminated string in %l[]
        case.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-08-03 21:51:35 +02:00
Jon TURNEY 6fc911071f Don't include stdio64 functions in reentrant syscalls menu when not bulding stdio64.
Fix documentation build since 6c2b1842 by not including stdio64 functions in the
reent syscalls menu if the node itself isn't going to be included because it's
under the STDIO64 flag.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-08-03 09:54:33 +01:00
Sebastian Huber b7ca25162a Fix typo in <sys/lock.h>
Sorry, there was a typo in <sys/lock.h> which leads to memory corruption
since not enough space is reserved for the lock object.

newlib/ChangeLog
2015-07-30  Sebastian Huber  <sebastian.huber@embedded-brains.de>

	* libc/sys/rtems/include/sys/lock.h (__LOCK_INIT_RECURSIVE): Use
	proper type.
2015-07-31 06:21:04 -07:00
Wilco Dijkstra 127c38bd44 [AArch64] Rewrite optimized memset.
This is an optimized memset for AArch64.  Memset is split into 4 main
cases: small sets of up to 16 bytes, medium of 16..96 bytes which are
fully unrolled.  Large memsets of more than 96 bytes align the
destination and use an unrolled loop processing 64 bytes per
iteration.  Memsets of zero of more than 256 use the dc zva
instruction, and there are faster versions for the common ZVA sizes 64
or 128.  STP of Q registers is used to reduce codesize without loss of
performance.
2015-07-30 12:51:34 +01:00
Sebastian Huber f04e46b141 Move header files
During libgcc build the first include search path for <...> is
"../newlib/libc/sys/rtems/include".  Move all RTEMS specific header
files to "libc/sys/rtems/include" so that they can be found.  Later
during libc build the header files in the previous location were somehow
present, but for libgcc build they were invisible.  This change is
necessary to use <pthread.h> for the GCC thread model implementation.

newlib/ChangeLog
2015-07-27  Sebastian Huber  <sebastian.huber@embedded-brains.de>

	libc/sys/rtems/machine/_types.h: Move to ...
	libc/sys/rtems/include/machine/_types.h: ... here.
	libc/sys/rtems/machine/limits.h: Move to ...
	libc/sys/rtems/include/machine/limits.h: ... here.
	libc/sys/rtems/machine/param.h: Move to ...
	libc/sys/rtems/include/machine/param.h: ... here.
	libc/sys/rtems/sys/cpuset.h: Move to ...
	libc/sys/rtems/include/sys/cpuset.h: ... here.
	libc/sys/rtems/sys/dirent.h: Move to ...
	libc/sys/rtems/include/sys/dirent.h: ... here.
	libc/sys/rtems/sys/param.h: Move to ...
	libc/sys/rtems/include/sys/param.h: ... here.
	libc/sys/rtems/sys/syslimits.h: Move to ...
	libc/sys/rtems/include/sys/syslimits.h: ... here.
	libc/sys/rtems/sys/utime.h: Move to ...
	libc/sys/rtems/include/sys/utime.h: ... here.
2015-07-29 12:53:53 -07:00
Joel Sherrill 763e0b7baf newlib/ChangeLog: Left out of previous commit. 2015-07-29 12:48:07 -07:00
Sebastian Huber ecaef05f66 Add <sys/lock.h>
Provide self-contained synchronization objects for RTEMS.  The API was
designed to be able to use it for the Newlib internal locks, the C11
threads support, the GCC thread model support and the libgomp operating
system configuration in combination with <pthread.h>.

References:

https://lists.rtems.org/pipermail/devel/2015-July/011989.html
https://lists.rtems.org/pipermail/devel/2015-July/012000.html

Tickets:

https://devel.rtems.org/ticket/1247
https://devel.rtems.org/ticket/2274.

v2: Fix typo in _Condition_Wait_recursive_timed() declaration.

newlib/ChangeLog
2015-07-28  Sebastian Huber  <sebastian.huber@embedded-brains.de>

	* libc/sys/rtems/include/sys/lock.h: New.
2015-07-29 11:30:05 -07:00
Jon TURNEY 9753bc3333 Remove workaround for texinfo bug with underscores in filenames from mothballed mathfp/
This got removed everywhere else in commit 139f923b, so I'm assuming whatever
ancient bug this was has been fixed long since.

There are plenty of other uses of texinfo with a filename containing an
underscore now.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-07-24 15:50:11 +01:00
Jon TURNEY 556a3ef544 Remove a stray sentence fragment in iconv.tex
I can't work out any meaning for this random sentence fragment, so remove it.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-07-24 15:50:09 +01:00
Jon TURNEY fde9684b52 Fix a typo in iconv.tex
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-07-24 15:50:07 +01:00
Jon TURNEY fdb73a8e43 Fix SYNPOSIS prototypes for iconv functions
Terminate all protoypes with a semicolon.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-07-24 15:50:05 +01:00
Jon TURNEY 6c2b184277 Use makedoc generated texinfo documentation for reentrant syscalls
We use texinfo nodes beginning with an underscore in several other places, so
revert this ancient workaround for a no longer existing bug, and use the makedoc
generated texinfo for reentrant versions of syscalls, rather than handwritten
documentation.

Also alphabetically sort these functions.

Also add documentation for _execve_r, _getpid_r, _kill_r and _times_r functions,
whose non-reentrant versions are documented as stubs

v2:
Keep _open64_r, _lseek64_r and _fstat64_r functions under texinfo conditional STDIO64
Add _stat64_r function likewise.

Notes:

1. The handwritten prototypes give the reentrancy structure pointer as of type
void *, rather than the presumably more correct struct __reent *

2. The fcntl, gettimeofday, mkdir and rename functions are not documented as
stubs, so I haven't added the reentrant versions either

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-07-24 15:50:03 +01:00
Jon TURNEY 1c19a13fd1 Add missing NEWPAGE commands to makedoc markup in reent/
makedoc requires a NEWPAGE command to preceed the second and subsequent FUNCTION
commands in a file in order to produce the correct texinfo output.

Add missing NEWPAGE commands needed in reent/execr.c. and reent/signalr.c, which
contain makedoc markup for multiple functions.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-07-24 15:50:00 +01:00
Corinna Vinschen 7c96ab0b43 Cygwin: Implement siglongjmp and sigsetjmp functions.
* libc/include/machine/setjmp.h (siglongjmp): Declare as function on
	Cygwin.
	(sigsetjmp): Ditto.
	(_longjmp): Mark as noreturn function on Cygwin.

	* common.din (siglongjmp): Export.
	(sigsetjmp): Export.
	* gendef: Change formatting of some comments.
	(sigsetjmp): Implement.
	(siglongjmp): Implement.
	(__setjmpex): x86_64 only: Drop entry point.
	(setjmp): x86_64 only: Store tls stackptr in Frame now, store MXCSR
	and FPUCW registers in Spare, as MSVCRT does.
	(longjmp): x86_64 only: Restore tls stackptr from Frame now, restore
	MXCSR and FPUCW registers from Spare.
	* include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.

	* new-features.xml (ov-new2.2): Document sigsetjmp, siglongjmp.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-07-21 17:31:02 +02:00
Marcus Shawcroft c7806ef76a [AArch64] Reverting recent optimized memset(). 2015-07-15 13:34:58 +01:00
Wilco Dijkstra 3263f90ef7 [AArch64] Optimized memset.
This is an optimized memset for AArch64.  Memset is split into 4 main
cases: small sets of up to 16 bytes, medium of 16..96 bytes which are
fully unrolled.  Large memsets of more than 96 bytes align the
destination and use an unrolled loop processing 64 bytes per
iteration.  Memsets of zero of more than 256 use the dc zva
instruction, and there are faster versions for the common ZVA sizes 64
or 128.  STP of Q registers is used to reduce codesize without loss of
performance.
2015-07-13 13:17:16 +01:00
Marcus Shawcroft 8e6a9ad74d Fix ChangeLog entry for previous two commits. 2015-07-13 13:17:04 +01:00
Wilco Dijkstra b295f6ba44 [AArch64] Optimized memcpy.
This is an optimized memcpy for AArch64.  Copies are split into 3 main
cases: small copies of up to 16 bytes, medium copies of 17..96 bytes
which are fully unrolled.  Large copies of more than 96 bytes align
the destination and use an unrolled loop processing 64 bytes per
iteration.  In order to share code with memmove, small and medium
copies read all data before writing, allowing any kind of overlap.  On
a random copy test memcpy is 40.8% faster on A57 and 28.4% on A53.
2015-07-13 13:09:02 +01:00
Wilco Dijkstra 9503c7f275 [AArch64] Optimized memmove.
This is an optimized memmove for AArch64.  All copies of up to 96
bytes and all backward copies are done by the new memcpy.  The only
remaining case is large forward copies which are done in the same way
as the memcpy loop, but copying from the end rather than the start.
2015-07-13 13:03:02 +01:00
Jeff Johnston a505f607be Fix typo in README. 2015-07-10 16:49:40 -04:00
Yaakov Selkowitz 79e419de62 Rework handling of basename variants
As a commonly-included header, the #define basename in <string.h> can
affect code which uses "basename" for its own purposes (e.g. struct
members or C++ namespaced functions).  When such cases occur and some
code includes <string.h> and some not, then errors result.  OTOH,
<libgen.h> is rarely used, and that's where the renaming occurs in
glibc, so code using <libgen.h> should already be safe.

* libc/include/libgen.h (basename): Define as __xpg_basename
for source compatibility with glibc.
Declare with __ASMNAME("basename") for ABI compatibility.
* libc/include/string.h (basename): Define as basename for
source compatibility with glibc.
Declare with __ASMNAME("__gnu_basename") for ABI compatibility.
2015-07-06 14:58:51 -05:00
Corinna Vinschen f9b87aaf10 Fix sys/time.h build problem due to inconsistent macro usage
https://sourceware.org/ml/newlib/2015/msg00520.html describes
	how sys/time.h uses __BSD_VISIBLE while the types used in the
	affected inline functions are guarded with !_POSIX_SOURCE.
	Fix that by guarding the type with __BSD_VISIBLE as well.

        * libc/include/sys/time.h: Explicitely include sys/cdefs.h.
        * libc/include/sys/types.h: Ditto.  Guard BSD convenience base types
        with __BSD_VISIBLE rather than !_POSIX_SOURCE.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-07-06 14:08:30 +02:00
Sebastian Huber 757c0871f7 Prevent use of uninitialized file lock
The CHECK_INIT() is necessary before the _newlib_flockfile_start() since
this would use otherwise acquire an uninitialized lock which gets
initialized after this leading to a corrupt release.

newlib/ChangeLog
2015-07-01  Sebastian Huber  <sebastian.huber@embedded-brains.de>

	libc/stdio/fputs.c (_puts_r): Add missing CHECK_INIT().
	libc/stdio/gets.c (_gets_r): Add missing _REENT_SMALL_CHECK_INIT() and
	CHECK_INIT().  Use _stdin_r() to get the file pointer instead of stdin.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-07-02 09:38:06 +02:00
Jon TURNEY 166d86c9d4 Regenerate Makefile.in
Regenerate Makefile.in with changes in commits 153385d8 and 433aad91

2015-06-29  Jon Turney  <jon.turney@dronecode.org.uk>

	* libc/ctype/Makefile.in: Regenerate.
	* libc/posix/Makefile.in: Ditto.
	* libc/stdio/Makefile.in: Ditto.
	* libc/stdio64/Makefile.in: Ditto.
	* libc/stdlib/Makefile.in: Ditto.
	* libc/string/Makefile.in: Ditto.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-06-29 12:29:50 +01:00
Jon TURNEY 153385d847 Use source files which have makedoc markup, but aren't processed or included.
These source files have makedoc markup, but aren't listed to be chewed by
makedoc. I am assuming that is accidental.

Future work: Note that stdio/fseeko.c, stdio/ftello.c and common/s_isnand.c have
makedoc markup, but duplicate stdio/fseek.c, stdio/ftell.c and common/s_isnan.c
respectively.

2015-06-23  Jon Turney  <jon.turney@dronecode.org.uk>

	* libc/ctype/Makefile.am (CHEWOUT_FILES): Add isblank.def.
	* libc/ctype/ctype.tex: Include isblank and add to menu.
	* libc/posix/Makefile.am (CHEWOUT_FILES): Add posix_spawn.def.
	* libc/posix/posix.tex: Include posix_spawn and add to menu.
	* libc/stdio64/Makefile.am (CHEWOUT_FILES): Add fdopen.def.
	* libc/stdio64/stdio64.tex: Include fdopen64 and add to menu.
	* libc/stdio64/fdopen64.c: Improve one-line description.
	* libc/string/Makefile.am (CHEWOUT_FILES): Add strchrnul.def.
	* libc/string/strings.tex: Include strchrnul and add to menu.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-06-24 12:24:01 +01:00
Jon TURNEY a4dd7dd87c Use makedoc output files which are generated but aren't included
I think these are accidental omissions, as these source files are listed to be
chewed by makedoc, but the result is not included by any texinfo source file.

Future work: Nothing in libc/reent/ which is processed by makedoc is included by
reent.tex

2015-06-23  Jon Turney  <jon.turney@dronecode.org.uk>

	* libc/stdlib/stdlib.tex: Include itoa and utoa, and add to menu.
	* libc/string/strings.tex: Include memrchr and rawmemchr, and add
	to menu.
	* libm/math/math.tex: Include exp10 and pow10, and add to menu.
	* libm/common/s_exp10.c: Improve one-line description.
	* libm/common/s_exp10.c: Ditto.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-06-24 12:23:55 +01:00
Jon TURNEY 433aad912d Don't chew files which contain no documentation markup
Don't chew files which contain no documentation markup.

Neither of the alternatives for MALLOCR (mallocr.c or nano-mallocr.c) contain
any documentation markup.

2015-06-23  Jon Turney  <jon.turney@dronecode.org.uk>

	* libc/stdlib/Makefile.am (CHEWOUT_FILES): Remove $(MALLOCR).def.
	* libc/stdio/Makefile.am (CHEWOUT_FILES): Remove getwc.def and
	putwc.def.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-06-24 12:23:49 +01:00
Jon TURNEY 958c953416 Fix mismatched parentheses in documentation.
2015-06-23  Jon Turney  <jon.turney@dronecode.org.uk>

	* libc/locale/locale.c: Fix mismatched parentheses in
	documentation.
	* libc/locale/locale.tex: Ditto.
	* libc/stdio/fgetwc.c: Ditto.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-06-24 12:23:25 +01:00
Jon TURNEY de5e58a640 Fix typo-ed function names in efgcvt.c documentation
Fix typo-ed function names in efgcvt.c documentation, neither gvcvt nor gdvtf
exists.

2015-06-23  Jon Turney  <jon.turney@dronecode.org.uk>

	* libc/stdlib/efgcvt.c: Fix typo-ed function names in
	documentation.
	* libc/stdlib/stdlib.tex: Fix function name in menu to match.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-06-23 20:56:30 +01:00
Jon TURNEY eb61ffe8dd Fix an inconsistent use of '.' in FUNCTION
Fix an inconsistent use of '.' to separate function names in FUNCTION. ',' is
used everywhere else.

2015-06-23  Jon Turney  <jon.turney@dronecode.org.uk>

	* libc/stdio/fread.c: Fix inconsistent use of '.' to separate
	function names in FUNCTION mark up.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-06-23 20:56:15 +01:00
Jon TURNEY ff4a4f2655 Fix SYNOPSIS prototypes without marked up parameter names
2015-06-23  Jon Turney  <jon.turney@dronecode.org.uk>

	* libc/stdlib/llabs.c: Mark up parameter name in ANSI_SYNOPSIS.
	* libc/time/tzset.c: Add and mark up parameter in SYNOPSIS.
	* libm/common/s_nan.c: Ditto.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-06-23 17:30:22 +01:00
Jon TURNEY 6c75f6fcb2 Correct a non-ANSI prototype in SYNOPSIS
2015-06-23  Jon Turney  <jon.turney@dronecode.org.uk>

	* libc/stdio/getchar_u.c: Fix a non-ANSI prototype in SYNOPSIS.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-06-23 17:30:17 +01:00
Jon TURNEY e8442c9625 Remove stray punctuation in ANSI_SYNOPSIS prototypes
2015-06-23  Jon Turney  <jon.turney@dronecode.org.uk>

	* libc/string/wcscpy.c: Remove stray ',' from prototype in
	ANSI_SYNOPSIS.
	* libc/string/wcpcpy.c: Ditto.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-06-23 17:30:07 +01:00
Jon TURNEY c7b1e4cbf2 Fix some mangled makedoc markup
2015-06-23  Jon Turney  <jon.turney@dronecode.org.uk>

	* libc/stdlib/itoa.c: Fix makedoc markup.
	* libc/stdlib/wcsnrtombs.c: Ditto.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-06-23 16:14:53 +01:00
Jon TURNEY 42e040a448 Fix makedoc markup used in texinfo source
2015-06-23  Jon Turney  <jon.turney@dronecode.org.uk>

	* libc/signal/signal.tex: Use texinfo not makedoc markup.
	* libc/stdio/stdio.tex: Ditto.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-06-23 16:14:39 +01:00
Corinna Vinschen 2b615b47d4 sys/signal.h requires sys/cdefs.h
* libc/include/sys/signal.h: Include forgotten sys/cdefs.h.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-06-22 10:49:29 +02:00
Corinna Vinschen a88afecce6 ChangeLog entries for Cygwin's alternate signal stack implementation
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-06-20 20:36:16 +02:00
Corinna Vinschen 6442e914d9 Use MINSIGSTKSZ and SIGSTKSZ from newlib for Cygwin as well
* libc/include/sys/signal.h: Move altstack macros completely
	outside of rtems block.

	* include/cygwin/signal.h: Remove definitions of MINSIGSTKSZ
	and SIGSTKSZ here.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-06-20 19:05:51 +02:00
Corinna Vinschen 22465796ed Preliminary infrastructure to implement alternate stack
* libc/include/sys/signal.h: Define SS_ONSTACK and SS_DISABLE
	unconditionally.
	(sigaltstack): Enable prototype on Cygwin.

	* common.din (sigaltstack): Export.
	* cygtls.cc (_cygtls::init_thread): Initialize altstack.
	* cygtls.h (__tlsstack_t): Rename from __stack_t to distinguish
	more clearly from stack_t.  Accommodate throughout.
	(_cygtls): Add altstack member.
	* exceptions.cc (exception::handle): Set SIGSEGV handler to SIG_DFL
	if we encounter a stack overflow, and no alternate stack has been
	defined.
	* include/cygwin/signal.h (MINSIGSTKSZ): Define
	(SIGSTKSZ): Define.
	(SA_ONSTACK): Define.
	* signal.cc (sigaltstack): New function.
	* tlsoffset.h: Regenerate.
	* tlsoffset64.h: Ditto.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-06-19 16:12:45 +02:00
Freddie Chopin 325926031b gmtime_r: Use faster algorithm by Howard Hinnant
* libc/time/gmtime_r.c (gmtime_r): use faster algorithm from
	civil_from_days() by Howard Hinnant

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-06-15 12:00:59 +02:00
Hale Wang 24e054c8c8 Update the assembler code to support old ARM architectures.
* libc/machine/arm/aeabi_memmove-arm.S (__aeabi_memmove): Update the
        assembler implementation.
        * libc/machine/arm/aeabi_memmove-thumb.S (__aeabi_memmove): Ditto.
        * libc/machine/arm/aeabi_memmove-thumb2.S (__aeabi_memmove): Ditto.
        * libc/machine/arm/aeabi_memset-arm.S (__aeabi_memset): Ditto.
        * libc/machine/arm/aeabi_memset-thumb.S (__aeabi_memset): Ditto.
        * libc/machine/arm/aeabi_memset-thumb2.S (__aeabi_memset): Ditto.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-06-01 12:49:37 +02:00
Szabolcs Nagy b27c7d1d9a aarch64: fabs and sqrt implementation with inline asm
* libm/machine/aarch64/e_sqrt.c: New file.
        * libm/machine/aarch64/ef_sqrt.c: New file.
        * libm/machine/aarch64/s_fabs.c: New file.
        * libm/machine/aarch64/sf_fabs.c: New file.
        * libm/machine/aarch64/Makefile.in: Add new source files.
        * libm/machine/aarch64/Makefile.am: Regenerate.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-06-01 10:17:34 +02:00
David Stacey 8fe35bd15f Correct argz_replace behaviour when memory is exhausted.
* libc/argz/argz_replace.c (argz_replace): Correct behaviour when memory
	is exhausted.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-06-01 10:09:04 +02:00
Corinna Vinschen 1aeda8a95f Fix comment in sys/wait.h
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-05-28 16:40:43 +02:00
David Stacey ca632c9015 Fix potential memory leak in argz_replace
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-05-27 13:30:20 +02:00
DJ Delorie 4f3cc70cb6 Avoid unneeded truncation to "int"
* libm/math/e_sqrt.c (__ieee754_sqrt): Don't truncate constant to
"int".
2015-05-27 13:30:20 +02:00
Nick Clifton 7b3c1cffce Update signbit functions to work on targets where integers are only 16-bits.
* libm/common/s_signbit.c (__signbitf): Fix for 16-bit targets.
	(__signbitd): Likewise.
2015-05-27 13:30:19 +02:00
Corinna Vinschen a7a784c774 Revert to exposing sys/select.h from sys/time.h on Cygwin
* libc/include/sys/time.h: Include sys/select.h on Cygwin.  Explain why.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-05-02 15:09:03 +02:00
Corinna Vinschen 6109eadff5 Improve check for int32_t being long or int
* libc/include/sys/config.h: Move evaluation of _UINTPTR_EQ_ULONG and
        _UINTPTR_EQ_ULONGLONG from here...
        * libc/include/sys/_intsup.h: ...to here.  Rename to _INTPTR_EQ_LONG
        and _INTPTR_EQ_LONGLONG to refer to signed base type.  Add test for
        base type of int32_t and set _INT32_EQ_LONG accordingly.
        * libc/include/stdint.h: Change checks for __have_long32 to checks
        for _INT32_EQ_LONG.
        * libc/include/inttypes.h: Ditto.  Accommodate aforementioned name
        change.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-04-29 13:07:17 +02:00
Corinna Vinschen 97a5dda2b0 Fix basename prototype collision string.h vs libgen.h
* libc/include/libgen.h (basename): Drop defining _BASENAME_DEFINED.
        Always define macro basename.  Add comment to explain why.
        * libc/include/string.h (basename): Check for basename instead of
        _BASENAME_DEFINED.  Drop __GNUC__ branch, always use basename macro.
        Change comment to explain why.  Add nonnull function attribute.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-04-23 22:03:45 +02:00
Nick Clifton cd0d459135 For the RX port, avoid using string instructions when __RX_DISALLOW_STRING_INSNS__ is defined.
* rx/crt0.S (_start): If string instructions are not allowed,
	avoid using SMOVF.

	* libc/machine/rx/memchr.S: Add non-string insn using version.
	* libc/machine/rx/memcpy.S: Likewise.
	* libc/machine/rx/memmove.S: Likewise.
	* libc/machine/rx/mempcpy.S: Likewise.
	* libc/machine/rx/strcat.S: Likewise.
	* libc/machine/rx/strcmp.S: Likewise.
	* libc/machine/rx/strcpy.S: Likewise.
	* libc/machine/rx/strlen.S: Likewise.
	* libc/machine/rx/strncat.S: Likewise.
	* libc/machine/rx/strncmp.S: Likewise.
	* libc/machine/rx/strncpy.S: Likewise.
2015-04-23 21:57:13 +02:00
Corinna Vinschen 50adb19f03 Add parens around MIN/MAX values in stdint.h.
* libc/include/stdint.h: Throughout add parens around MIN/MAX values.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-04-23 21:57:11 +02:00
Sebastian Huber 897d3a3cc4 Add <sys/_stdint.h> for FreeBSD compatibility
* libc/include/sys/_stdint.h: New file.
        * libc/include/stdint.h (int8_t): Move to <sys/_stdint.h>.
        (uint8_t): Likewise.
        (int16_t): Likewise.
        (uint16_t): Likewise.
        (int32_t): Likewise.
        (uint32_t): Likewise.
        (int64_t): Likewise.
        (uint64_t): Likewise.
        (intptr_t): Likewise.
        (uintptr_t): Likewise.
        * libc/include/sys/types.h: Include <sys/_stdint.h>.
        * libc/sys/rtems/machine/_types.h: Remove <stdint.h> include.
        * libc/sys/time.h>: Replace __uint32_t with uint32_t and
        __uint64_t with uint64_t.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-04-23 21:57:10 +02:00
Jon TURNEY 38a8d3e216 Make stack_t typedef generally available
* libc/include/sys/signal.h (stack_t): Make typedef generally
	available.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-04-23 21:57:10 +02:00
Corinna Vinschen 9b42474f29 Fix UTF-16 surrogate handling in wctomb and friends.
* libc/stdlib/wctomb_r.c (__utf8_wctomb): Fix check for handling a
	lone high surrogate.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-04-23 21:57:09 +02:00
Corinna Vinschen b3a09ae34b Avoid excessive locking and calling tzset in time functions.
* libc/time/lcltime_r.c (localtime_r): Call _tzset_unlocked inside
	TZ lock.
	* libc/time/mktime.c (mktime):  Ditto.
	* libc/time/strftime.c (strftime, wcsftime): Ditto.  Guard against
	calling _tzset_unlocked more than once (baring recursion).

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-04-23 21:57:08 +02:00
Corinna Vinschen c117793326 Add _tzset_unlocked and _tzset_unlocked_r
newlib:

	* libc/time/local.h (_tzset_unlocked_r): Add prototype.
	(_tzset_unlocked): Ditto.
	* libc/time/tzset.c (_tzset_unlocked): New function, call
	_tzset_unlocked_r.
	(tzset): Lock and call _tzset_unlocked_r.
	* libc/time/tzset_r (_tzset_unlocked_r): Remove locking and rename
	from _tzset_r.
	(_tzset_r): Lock and call _tzset_unlocked_r.

cygwin:

	* localtime.cc (tzset_unlocked): Export as _tzset_unlocked.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-04-23 21:57:08 +02:00
Craig Howland 382fa90fe1 Move tzset calls to time functions.
* libc/stdlib/setenv_r.c (_setenv_r): Remove tzset() call for TZ
	definition.
	* libc/time/lcltime_r.c (localtime_r): Add tzset() call
	* libc/time/mktime.c (mktime):  Ditto.
	* libc/time/strftime.c (strftime, wcsftime): Ditto.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-04-23 21:57:08 +02:00
Yaakov Selkowitz 95a4fc8726 strftime: use tzname if TM_ZONE is NULL
This avoids a strlen(NULL) crash a few lines later.

* libc/time/strftime.c (strftime) <%Z>: Initialize tznam to NULL.
Use _tzname as fallback if TM_ZONE is NULL.
2015-04-23 21:57:08 +02:00
Yaakov Selkowitz d67052321e string: add GNU basename(3)
* libc/include/libgen.h (_BASENAME_DEFINED): Define.
* libc/include/string.h (basename): Declare.
* libc/string/Makefile.am (ELIX_4_SOURCES): Add gnu_basename.c.
* libc/string/Makefile.in: Regenerate.
* libc/string/gnu_basename.c: New file.
2015-04-23 21:57:07 +02:00
Sebastian Huber 4f3f09ad72 Import <sys/tree.h> from FreeBSD
* libc/include/sys/tree.h: New file.
2015-04-23 21:57:06 +02:00
Joel Sherrill 839cba2b14 * newlib.hin: Remove _UINTPTR_EQ_ULONG and _UINTPTR_EQ_ULONGLONG.
2013-03-23  Joel Sherrill <joel.sherrill@oarcorp.com>

	* newlib.hin: Remove _UINTPTR_EQ_ULONG and _UINTPTR_EQ_ULONGLONG.
2015-04-23 21:57:06 +02:00
Joel Sherrill 380c00f175 Change from configure time to compile time probe for intptr_t definition.
2015-03-23  Joel Sherrill <joel.sherrill@oarcorp.com

	* configure.in: Delete logic to determine _UINTPTR_EQ_ULONGLONG
	and _UINTPTR_EQ_ULONG at configuration time.
	*libc/include/sys/config.h: Add logic to determine
	_UINTPTR_EQ_ULONGLONG and _UINTPTR_EQ_ULONG at compilation time.
	* libc/include/inttypes.h: Add include of <sys/config.h>.
	* configure: Regenerated.
2015-04-23 21:57:06 +02:00
Steve Ellcey d1df82a6ee Add ChangeLog entry for last patch to libc/include/sys/time.h. 2015-04-23 21:57:05 +02:00
Steve Ellcey 05b71d1408 Replace uint32_t/uint64_t type usage with __uint32_t/__uint64_t.
* libc/include/sys/time.h: Replace uint32_t and uint64_t
	with __uint32_t and __uint64_t.
2015-04-23 21:57:05 +02:00
Jon TURNEY 44e5c14e08 Fix newlib texinfo source so 'info libc' and 'info libm' work
If the newlib .info files are installed using install-info, 'info libc' and
'info libm' don't work.

This seems to be due to the formatting of the directory entry line not being
quite right, so fix that.

Also use @direntry texinfo command, rather than writing .info directory entry
literally.

Also use @dircategory texinfo command to place into 'Newlib' category, rather
than ending up in 'Miscellaneous'

newlib/ChangeLog:

2015-03-13  Jon TURNEY  <jon.turney@dronecode.org.uk>

	* libc/libc.texinfo: Fix directory entry.
	* libm/libm.texinfo: Ditto.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-03-16 15:02:22 +00:00
Corinna Vinschen e6af944145
Drop including cygwin/sys_time.h on Cygwin.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-03-13 13:19:14 +01:00
Sebastian Huber bb01594897
Merge parts of <sys/time.h> from FreeBSD
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-03-13 13:17:34 +01:00
Sebastian Huber c93d44add9
Import libc/sys/rtems/include/semaphore.h from FreeBSD.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-03-12 16:03:42 +01:00
Sebastian Huber b161b155c8 Add and use latest <sys/timespec.h> from FreeBSD
* libc/include/sys/_timespec.h: Import from FreeBSD.
        * libc/include/sys/timespec.h: Likewise.
        * libc/include/time.h: Include <sys/timespec.h>.
       	* libc/include/sys/types.h (timespec): Delete.
        (itimerspec): Likewise.
        * libc/include/machine/time.h: Include <sys/_timespec.h>.
        * libc/include/sys/sched.h: Likewise.
        * libc/include/sys/signal.h: Likewise.
        * libc/include/sys/stat.h: Likewise.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-03-11 15:45:38 +01:00
Nick Clifton 58c9102ea2 Fix a build problem running the newlib testsuite on targets that only have 32-bit doubles.
* testsuite/newlib.stdio/swprintf.c (main): Change size of value
	used to initialise 'val' variable so that it will compile on
	targets with 32-bit doubles.
2015-03-11 11:14:38 +00:00
Corinna Vinschen 5a97e28f6a * libc/include/stdio.h (FILE): Protect typedef from redefinition.
* libc/include/wchar.h: Ditto.
2015-03-05 17:15:24 +00:00
Joel Sherrill 2387583ee2 2015-02-25 Gedare Bloom <gedare@rtems.org>
* libc/include/machine/time.h (_CLOCKS_PER_SEC_): redefine for RTEMS.
2015-03-03 21:53:55 +00:00
Steve Ellcey bc860c9894 * libc/machine/mips/memset.S: Add support for mips32r6/mips64r6. 2015-03-03 19:49:00 +00:00
Steve Ellcey b8cd02f65a * libc/machine/mips/memcpy.S: Add support for mips32r6/mips64r6. 2015-03-03 17:46:27 +00:00
Steve Ellcey d2f9dbb3ee 2015-02-26 Steve Ellcey <sellcey@imgtec.com>
* libc/machine/mips/memcpy.S: Fix macro indentation and typos in
	comments.
2015-02-26 23:36:56 +00:00
Jon TURNEY 67d150ca14 * libc/include/sys/cdefs.h (_GNU_SOURCE): Move check so it has an
effect when _XOPEN_SOURCE is also defined.
2015-02-25 15:58:41 +00:00
Corinna Vinschen 72ba8b107a * libc/machine/arm/aeabi_memclr.c: New file to support
aeabi_memclr.
	* libc/machine/arm/aeabi_memset.c: New file to support
	aeabi_memset.
	* libc/machine/arm/aeabi_memset-soft.S: Ditto.
	* libc/machine/arm/aeabi_memset-arm.S: Ditto.
	* libc/machine/arm/aeabi_memset-thumb.S: Ditto.
	* libc/machine/arm/aeabi_memset-thumb2.S: Ditto.
	* libc/machine/arm/Makefile.am: Add dependencies.
	* libc/machine/arm/Makefile.in: Regenerated.
2015-02-17 09:26:54 +00:00
Corinna Vinschen 554f33c48d * libc/machine/arm/aeabi_memmove.c: New file to support
aeabi_memmove.
	* libc/machine/arm/aeabi_memmove-soft.S: Ditto.
	* libc/machine/arm/aeabi_memmove-arm.S: Ditto.
	* libc/machine/arm/aeabi_memmove-thumb.S: Ditto.
	* libc/machine/arm/aeabi_memmove-thumb2.S: Ditto.
	* libc/machine/arm/Makefile.am: Add dependencies.
	* libc/machine/arm/Makefile.in: Regenerated.
2015-02-17 09:06:51 +00:00
Nick Clifton b9e7cd9a84 * libc/include/complex.h (cabsl): Add prototype.
(cimagl): Add prototype.
	(creall): Add prototype.
	* libc/include/ieeefp.h: Include float.h.
	(EXT_EXPBITS, EXT_FRACHBITS, EXT_FRACLBITS)
	(EXT_EXP_INFNAN. EXT_EXP_BIAS, EXT_FRACBITS): Define.
	(struct ieee_ext, union ieee_ext_u): New types for long double
	support.
	* libc/include/math.h (finitel): Add prototype.
	(hypotl): Add prototype.
	(sqrtl): Add prototype.
	* libm/common/Makefile.am (lsrc): Add sl_finite.c.
	* libm/common/Makefile.in: Regenerate.
	* libm/common/fdlibm.h (__ieee754_hypotl): Add prototype.
	* libm/common/hypotl.c (hypotl): Add implementation for when long
	double is larger than double.
	* libm/common/sqrtl.c (sqrtl): Likewise.
	* libm/common/sl_finite.c: New file.  Adds implementation of the
	finitel function.
	* libm/complex/Makefile.am (lsrc): Define.
	(libcomplex_la_SOURCES): Add lsrc.
	(lib_a_SOURCES): Add lsrc.
	* libm/complex/Makefile.in: Regenerate.
	* libm/complex/cabs.c: Add documentation of cabsl function.
	* libm/complex/cimag.c: Add documentation of cimagl function.
	* libm/complex/creall.c: Add documentation of creall function.
	* libm/complex/cabsl.c: New file.  Adds implementation of the
	cabsl function.
	* libm/complex/cimagl.c: New file.  Adds implementation of the
	cimagl function.
	* libm/complex/creall.c: New file.  Adds implementation of the
	creall function.
	* libm/math/Makefile.am (lsrc): Define.
	(libmath_la_SOURCES): Add lsrc.
	(lib_a_SOURCES): Add lsrc.
	* libm/math/Makefile.in: Regenerate.
	* libm/math/el_hypot.c: New file.  Adds implementation of the
	__ieee754_hypotl function.
2015-02-06 16:14:04 +00:00
Corinna Vinschen f2eb8ca8bf * libc/include/wchar.h (wcstold): Drop _LDBL_EQ_DBL requirement for
declaration.
2015-02-04 11:02:36 +00:00
Nick Clifton 1f3dd90552 * libc/stdlib/wcstold.c (wcstold): Add implementation for when
long double is not the same as double.
2015-01-29 08:37:26 +00:00
Corinna Vinschen 3e4183d15b * libc/include/sys/time.h: #include <sys/cdefs.h> for __BSD_VISIBLE. 2015-01-28 21:03:41 +00:00
Corinna Vinschen 2ee3908b45 Complete action from 2001-12-18:
* libc/machine/i386/f_*: Remove duplicate files.
2015-01-23 10:16:00 +00:00
Yaakov Selkowitz 128e9e0be5 * libc/sys/sparc64/sys/time.h: #include <sys/types.h> for time_t. 2015-01-22 17:34:47 +00:00
Corinna Vinschen bdc1799556 * libc/sys/or1k/mlock.c: Fix dependency on libgloss. 2015-01-22 15:32:51 +00:00
Eric Botcazou bf8f43ae8a * COPYING.LIBGLOSS: Add Controls and Data Services copyright.
* COPYING.NEWLIB: Likewise.
libgloss/
	* configure.in: Add Visium support.
	* configure: Regenerate.
	* visium/: New directory.
newlib/
	* configure.host: Add Visium support.
	* libc/machine/configure.in: Likewise.
	* libc/machine/configure: Regenerate.
	* libc/machine/visium/: New directory.
	* libc/include/machine/setjmp.h (_JBLEN): Define for Visium.
	* libc/include/machine/ieeefp.h (__IEEE_BIG_ENDIAN): Likewise.
	* libc/include/machine/time.h (_CLOCKS_PER_SEC_): Likewise.
2015-01-21 18:27:47 +00:00
Corinna Vinschen d63bec588e * libc/sys/configure.in: Add OpenRISC.
* libc/sys/configure: Regenerate.
2015-01-20 12:28:27 +00:00
Corinna Vinschen 43f80ffb7d Fix typo in entry header 2015-01-20 12:27:30 +00:00
Corinna Vinschen c30509f569 Fix dates 2015-01-20 10:13:26 +00:00
Corinna Vinschen 086cd00d24 * libc/machine/aarch64/strlen.S (strlen): Improve performance. 2015-01-20 10:11:56 +00:00
Corinna Vinschen d0695096ba * configure.host: Add extra system for OpenRISC baremetal. 2015-01-20 09:59:40 +00:00
Jeff Johnston 89b6034299 2015-01-14 Joel Sherrill <joel.sherrill@oarcorp.com>
* libc/include/sys/unistd.h [__BSD_VISIBLE]: Add issetugid() prototype.
2015-01-14 21:19:26 +00:00
Jeff Johnston 4fab65dc6b 2015-01-14 Joel Sherrill <joel.sherrill@oarcorp.com>
* doc/makedoc.c: Use uintptr_t to avoid int/pointer size warnings
2015-01-14 21:15:36 +00:00
Corinna Vinschen 29193dd04c * configure.host: Add extra system for OpenRISC baremetal
* libc/include/sys/config.h: Dynamic reentrancy for or1k sys targets
	* libc/sys/or1k/: New system for or1k baremetal
	* libc/sys/or1k/Makefile.am: New file
	* libc/sys/or1k/Makefile.in: New file
	* libc/sys/or1k/aclocal.m4: New file
	* libc/sys/or1k/configure.in: New file
	* libc/sys/or1k/configure: New file
	* libc/sys/or1k/getreent.S: New file
	* libc/sys/or1k/mlock.S: New file
	* libc/sys/or1k/or1k-asm.S: New file
2015-01-14 09:25:16 +00:00
Corinna Vinschen 8ddeb7008e * testsuite/newlib.wctype/tiswctype.c (main): Use wide character type
function.
2015-01-12 10:50:26 +00:00
Corinna Vinschen 808fde520f * libc/time/strftime.c (__strftime): Utilize __TM_GMTOFF and __TM_ZONE
on systems where available.  On Cygwin, call function to get values.
	Add comment to explain why.  Drop TZ_LOCK/TZ_UNLOCK in 'z' case since
	it's not necessary.  In 'Z' case, add a comment to document a potential
	codeset problem.
2015-01-08 09:51:34 +00:00
Corinna Vinschen ee65ca81d7 * testsuite/newlib.wctype/twctrans.c (main): Use towlower and towupper. 2015-01-08 09:35:14 +00:00
Richard Earnshaw 6a35dbf342 * libc/machine/aarch64/strcpy.S (strcpy): Further performance
improvements.  Adjust to allow building as stpcpy.
	* libc/machine/aarch64/stpcpy.S: New file.
	* libc/machine/aarch64/stpcpy-stub.c: New file.
	* libc/machine/aarch64/Makefile.am (lib_a_SOURCES): Build stpcpy.
	* libc/machine/aarch64/Makefile.in: Regenerated.
2015-01-06 09:57:55 +00:00
Jeff Johnston f0e3a51e9f 2014-12-26 Freddie Chopin <freddie_chopin@op.pl>
* libc/include/sys/features.h: update newlib version and copyright year
2015-01-05 17:31:28 +00:00
Jeff Johnston 0615b4bb5f 2014-12-18 Jeff Johnston <jjohnstn@redhat.com>
* NEWS: Update with 2.2.0 info.
        * README: Ditto.
        * acinclude.m4: Change version number to 2.2.0.
        * libc/libc.texinfo: Ditto.
        * libm/libm.texinfo: Ditto.
        * configure: Regenerated.
        * Makefile.in: Regenerated.
        * doc/configure: Ditto.
        * libc/*/configure: Ditto.
        * libm/*/configure: Ditto.
        * libc/sys/linux/shared.ld: Add VERS_2.2
2014-12-18 20:30:11 +00:00
Yaakov Selkowitz 968738f9b1 Implement BSD/GNU unlocked stdio extensions.
* libc/include/stdio.h (clearerr_unlocked, feof_unlocked,
ferror_unlocked, fflush_unlocked, fgetc_unlocked, fgets_unlocked,
fileno_unlocked, fputc_unlocked, fputs_unlocked, fread_unlocked,
fwrite_unlocked): Declare.
* libc/include/wchar.h (fgetwc_unlocked, fgetws_unlocked,
fputwc_unlocked, fputws_unlocked, getwc_unlocked, getwchar_unlocked,
putwc_unlocked, putwchar_unlocked): Declare.
* libc/stdio/Makefile.am (ELIX_4_SOURCES): Add clearerr_u.c,
feof_u.c, ferror_u.c, fflush_u.c, fgetc_u.c, fgets_u.c, fgetwc_u.c,
fgetws_u.c, fileno_u.c, fputc_u.c, fputs_u.c, fputwc_u.c, fputws_u.c,
fread_u.c, fwrite_u.c, getwc_u.c, getwchar_u.c, putwc_u.c, putwchar_u.c.
Add necessary dependencies.
* libc/stdio/Makefile.in: Regenerate.
* libc/stdio/clearerr.c: Document unlocked variant.
* libc/stdio/clearerr_u.c: New file.
* libc/stdio/feof.c: Document unlocked variant.
* libc/stdio/feof_u.c: New file.
* libc/stdio/ferror.c: Document unlocked variant.
* libc/stdio/ferror_u.c: New file.
* libc/stdio/fflush.c: Add __IMPL_UNLOCKED__ overrides.
Document unlocked variants.
* libc/stdio/fflush_u.c: New file.
* libc/stdio/fgetc.c: Document unlocked variants.
* libc/stdio/fgetc_u.c: New file.
* libc/stdio/fgets.c: Add __IMPL_UNLOCKED__ overrides.
Document unlocked variants.
* libc/stdio/fgets_u.c: New file.
* libc/stdio/fgetwc.c: Document unlocked variants.
(__fgetwc): Make non-static.
* libc/stdio/fgetwc_u.c: New file.
* libc/stdio/fgetws.c: Add __IMPL_UNLOCKED__ overrides.
Document unlocked variants.
* libc/stdio/fgetws_u.c: New file.
* libc/stdio/fileno.c: Document unlocked variant.
* libc/stdio/fileno_u.c: New file.
* libc/stdio/fputc.c: Document unlocked variants.
* libc/stdio/fputc_u.c: New file.
* libc/stdio/fputs.c: Add __IMPL_UNLOCKED__ overrides.
Document unlocked variants.
* libc/stdio/fputs_u.c: New file.
* libc/stdio/fputwc.c: Document unlocked variants.
(__fputwc): Make non-static.
* libc/stdio/fputwc_u.c: New file.
* libc/stdio/fputws.c: Add __IMPL_UNLOCKED__ overrides.
Document unlocked variants.
* libc/stdio/fputws_u.c: New file.
* libc/stdio/fread.c: Add __IMPL_UNLOCKED__ overrides.
Document unlocked variants.
* libc/stdio/fread_u.c: New file.
* libc/stdio/fwrite.c: Add __IMPL_UNLOCKED__ overrides.
Document unlocked variants.
* libc/stdio/fwrite_u.c: New file.
* libc/stdio/getwc_u.c: New file.
* libc/stdio/getwchar.c: Document unlocked variants.
* libc/stdio/getwchar_u.c: New file.
* libc/stdio/local.h: Define locking macros as empty ifdef
__IMPL_UNLOCKED__.
(__fgetwc, __fputwc): Declare.
* libc/stdio/putwc_u.c: New file.
* libc/stdio/putwchar.c: Document unlocked variants.
* libc/stdio/putwchar_u.c: New file.
2014-12-18 14:55:21 +00:00
Corinna Vinschen 2a06c6dcc4 * stdio.tex: Add menu entries for __fsetlocking and stdio_ext.
* stdio_ext.c: Add "stdio_ext" to synopsis.
2014-12-18 10:08:09 +00:00
DJ Delorie ae4a2bd820 * libc/stdlib/nano-mallocr.c (ALIGN_TO): Do not assume that
integers are as big as pointers.
2014-12-16 20:46:25 +00:00
Richard Earnshaw 52edca9f86 * libc/machine/aarch64/strcpy.S: Improve handling of short strings. 2014-12-16 15:48:58 +00:00
Corinna Vinschen 32c96ddd14 * libc/include/stdlib.h (__itoa): Declare prototype.
(__utoa): Ditto.
	(itoa): Ditto, non-strict-ANSI only.
	(utoa): Ditto.
	* libc/stdlib/Makefile.am: Add itoa.c and utoa.c.
	* libc/stdlib/Makefile.in: Regenerate.
	* libc/stdlib/itoa.c: New file.
	* libc/stdlib/utoa.c: New file.
2014-12-16 10:55:17 +00:00
Jeff Johnston 705cda717e 2014-12-15 Jonathan Roelofs <jonathan@codesourcery.com>
* libc/include/math.h: Add log2l,logbl,nexttowardf,
        * nexttoward,nexttowardl
        * libm/common/Makefile.am: Reference new files
        * libm/common/Makefile.in: Reference new files
        * libm/common/log2l.c: New File
        * libm/common/logbl.c: Likewise
        * libm/common/nexttowardf.c: Likewise
        * libm/common/nexttoward.c: Likewise
        * libm/common/nexttowardl.c: Likewise
2014-12-15 20:50:23 +00:00
Yaakov Selkowitz 6485fc66f2 * libc/include/stdio.h (__SNLK): Define.
* libc/include/stdio_ext.h (FSETLOCKING_QUERY, FSETLOCKING_INTERNAL,
FSETLOCKING_BYCALLER): Define.
(__fsetlocking): Declare.
* libc/stdio/Makefile.am: Build fsetlocking.c.
* libc/stdio/Makefile.in: Regenerate.
* libc/stdio/fsetlocking.c: New file.
* libc/stdio/local.h (_newlib_flockfile_start): Make _flockfile
call dependent on __SNLK flag.
(_newlib_flockfile_exit, _newlib_flockfile_end): Ditto for
_funlockfile calls.
Define all locking macros as empty if __SINGLE_THREAD__.
* libc/stdio/stdio.tex: Include fsetlocking.def.
2014-12-15 18:22:56 +00:00
Corinna Vinschen f5ce72dffc * newlib/libc/include/machine/setjmp.h: Add FPU support.
* newlib/libc/machine/nds32/setjmp.S: Add FPU support.
2014-12-15 13:32:17 +00:00
Corinna Vinschen 0cbcde7bdb * configure.host: Add libm nds32 machine directory.
* libm/machine/configure: Regenerated.
	* libm/machine/configure.in: Add nds32 AC_CONFIG.
	* libm/machine/nds32/Makefile.am: New file.
	* libm/machine/nds32/Makefile.in: Generated.
	* libm/machine/nds32/aclocal.m4: Generated.
	* libm/machine/nds32/configure: Generated.
	* libm/machine/nds32/configure.in: New file.
	* libm/machine/nds32/w_sqrt.S: New file.
	* libm/machine/nds32/wf_sqrt.S: New file.
2014-12-15 13:27:38 +00:00
Corinna Vinschen 601c50292b * libc/include/stdlib.h: Include sys/cdefs.h to avoid undefined
__ASMNAME.
2014-12-15 12:58:19 +00:00
Jeff Johnston f58bc5991f 2014-12-12 Stefan Wallentowitz <stefan.wallentowitz@tum.de>
* configure.host: or1knd support, OpenRISC without delay slot
        * libc/include/machine/setjmp.h: Add or1knd
        * libc/machine/or1k/setjmp.S: Optional delay slot
2014-12-12 21:14:06 +00:00
Jeff Johnston 31cf15b180 2014-12-12 Stefan Wallentowitz <stefan.wallentowitz@tum.de>
* libc/machine/or1k/setjmp.S: Remove save/restore of r3-r8
2014-12-12 20:17:26 +00:00
Corinna Vinschen c6332722d9 * libc/include/stdio.h: Fix type signature of __sfeof and __sferror
(and thus feof and ferror) for C++.
2014-12-11 17:42:19 +00:00
Yaakov Selkowitz 6f34876e5e * libc/include/stdio_ext.h: Rename __fwriteable to __fwritable.
[!__GNUC__]: Declare real functions for the macros, and make
the macros conditional on !__cplusplus.
* libc/stdio/Makefile.am (ELIX_4_SOURCES): Add stdio_ext.c.
(CHEWOUT_FILES): Add stdio_ext.def.
* libc/stdio/Makefile.in: Regenerate.
* libc/stdio/stdio.tex: Include stdio_ext.def.
* libc/stdio/stdio_ext.c: New file.
2014-12-11 16:53:32 +00:00
Corinna Vinschen 2d48118f11 * libc/include/stdio_ext.h: Remove excess "inline". 2014-12-10 09:39:06 +00:00
Richard Earnshaw 8608e14a3b * libc/machine/aarch64/strchrnul.S (vrepmask): Use a call-clobbered
register.
2014-12-10 09:35:10 +00:00
Richard Earnshaw c53c2915a7 * libc/machine/aarch64/strrchr.S: New file.
* libc/machine/aarch64/strrchr-stub.c: New file.
	* libc/machine/aarch64/Makefile.am: Add them to build list.
	* libc/machine/aarch64/Makefile.in: Regenerated.
2014-12-08 15:21:42 +00:00
Corinna Vinschen 37152e9703 * libc/time/gmtime_r.c (gmtime_r): Fixed bug in calculations for dates
after year 2069 or before year 1901. Ideas for solution taken from
	musl's __secs_to_tm()
2014-12-08 11:48:31 +00:00
Yaakov Selkowitz bf9897549d * libc/include/stdlib.h (__bsd_qsort_r): Declare.
(qsort_r): Declare.
* libc/search/Makefile.am (ELIX_2_SOURCES): Rename from ELIX_SOURCES.
(ELIX_4_SOURCES): Define.  Add bsd_qsort_r.c and qsort_r.c.
(libsearch_la_SOURCES): Adapt accordingly.
(lib_a_SOURCES): Adapt accordingly.
(CHEWOUT_FILES): Add qsort_r.def.
* libc/search/Makefile.in: Regenerate.
* libc/search/bsd_qsort_r.c: New file.
* libc/search/qsort.c: Update from FreeBSD HEAD. Adapt for both BSD
and GNU qsort_r flavors.
* libc/search/qsort_r.c: New file.
2014-12-05 16:21:04 +00:00
Corinna Vinschen a800b3ae9c * libc/include/sys/signal.h [__SPU__] (kill): Declare. 2014-12-04 09:15:50 +00:00
Jeff Johnston 8c049028d9 2014-12-03 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/inttypes.h: Only enable the 8-bit scanning macros
        if _WANT_IO_C99_FORMATS is defined by configuration.  Add comment
        on why.
2014-12-03 20:25:09 +00:00
Corinna Vinschen d37bfe1da2 * libc/include/machine/setjmp.h [__mips__]: Remove __mips_fpr == 64
from the 64-bit _JBTYPE definition.
	* libc/machine/mips/setjmp.S: Re-work the o32 FP64 support to match
	the now one-and-only supported o32 FP64 ABI extension.  Also
	support o32 FPXX.
2014-11-28 08:47:39 +00:00
Corinna Vinschen 8a2ab1aea1 * libc/machine/arm/strcmp-armv6m.S: New file.
* libc/machine/arm/strcmp.S: Add new wrapper.
	* libc/machine/arm/Makefile.am: Add dependencies.
	* libc/machine/arm/Makefile.in: Regenerated.
2014-11-26 09:47:26 +00:00
Corinna Vinschen 75e2565a57 * libc/include/sys/_default_fcntl.h: Move all Cygwin-specific open
flags from Cygwin's fcntl.h here.  Remove check for WIN32.  Remove
	Windows-specific macros.
2014-11-25 11:53:00 +00:00
Joel Sherrill 63d53b9255 2014-11-23 Joel Sherrill <joel.sherrill@oarcorp.com>
* libc/include/sys/resource.h: Add prototype for getrusage()
	to <sys/resource.h>
2014-11-24 14:12:32 +00:00
Nick Clifton d5692c713f PR target/63901
* configure.host (msp430): Add -mhwmult=none to newlib_cflags.
2014-11-21 11:55:39 +00:00
Corinna Vinschen 556b13a0c2 * libc/stdio/nano-vfprintf_i.c (_printf_i): Use LONGINT when void* is
larger than an int.
2014-11-20 14:05:28 +00:00
Corinna Vinschen 308186a134 * libc/sys/rtems/sys/syslimits.h (NGROUPS_MAX): Adjust value so
that NGROUPS is even.
2014-11-20 14:03:17 +00:00
Corinna Vinschen 3dce84ad07 * libc/stdlib/strtod.c (sulp): Cast to int32_t to avoid overflow.
* libc/time/gmtime_r.c (DAYS_PER_*_YEARS): Convert to long constants
	to avoid overflow.
2014-11-12 09:10:22 +00:00
Richard Earnshaw fbb8f1a2c7 * libc/machine/aarch64/strcpy.S: New file.
* libc/machine/aarch64/strcpy-stub.S: New file.
	* libc/machine/aarch64/Makefile.am (lib_a_SOURCES): Add new files.
	* libc/machine/aarch64/Makefile.in: Regenerate.
2014-11-10 14:57:37 +00:00
Jeff Johnston 85907fe082 2014-11-06 Joel Sherrill <joel.sherrill@oarcorp.com>
* configure.in: Add autoconf test to determine size of uintptr_t.
        * newlib.hin: Add new autoconf feature variables.
        * libc/include/inttypes.h: Use new feature variables.
        * configure: Regenerate.
2014-11-06 17:45:14 +00:00
Corinna Vinschen 97e2f27aa1 * libc/stdio/nano-vfprintf_i.c (_printf_i): Use Newlib approach to
handle string that might be not nul-terminated.
	* testsuite/newlib.stdio/nulprintf.c: New test.
2014-11-06 11:08:14 +00:00
Jon TURNEY e7ebfb119e 2014-10-29 Jon Turney <jon.turney@dronecode.org.uk>
* libc/include/string.h: Correct guard for strcasecmp().
2014-10-30 11:25:17 +00:00
Corinna Vinschen 963545173c Remove accidentally added Change Log entry 2014-10-29 15:23:31 +00:00
Corinna Vinschen 28e1bd0159 * libc/stdio/vfprintf.c (_VFPRINTF_R): Remove unnecessary comparison. 2014-10-29 11:06:42 +00:00
Corinna Vinschen 8134be8ac2 * libc/include/sys/unistd.h (sethostname): Declare if
requested.
2014-10-27 14:35:46 +00:00
Corinna Vinschen 2a126568ad * libc/time/gmtime_r.c (gmtime_r): Remove dead code. 2014-10-20 07:30:17 +00:00
Corinna Vinschen ec2a57f476 * libc/unix/getcwd.c (getcwd): Close directory also in case of an error. 2014-10-16 15:00:59 +00:00
Corinna Vinschen 7a84e9c4bc * libc/include/_ansi.h: _LONG_LONG_TYPE definition removed.
* libc/include/math.h: _LONG_LONG_TYPE replaced by "long long".
	Guards for C99 and C++11 functions fixed.
	* libc/include/stdlib.h: Guards for C99 and C++11 functions fixed.
2014-10-10 14:43:19 +00:00
Jeff Johnston 50f799240e 2014-10-09 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libc/include/stdint.h: Include <sys/_intsup.h>.
        (__STDINT_EXP): Delete.
        (__have_long32): Likewise.
        (__have_long64): Likewise.
        (__have_longlong64): Likewise.
        * libc/include/sys/_intsup.h: New file.
        (__STDINT_EXP): Move from libc/include/stdint.h.
        (__have_long32): Likewise.
        (__have_long64): Likewise.
        (__have_longlong64): Likewise.
        * libc/include/inttypes.h: Include <sys/_intsup.h>.
        (__INTTYPES_EXP): Delete and use __STDINT_EXP() instead.
2014-10-09 15:57:50 +00:00
Corinna Vinschen 633cf9b5dd * libc/string/memccpy.c (memccpy): Fix warning about signed-unsigned
comparison
	* libc/string/memchr.c (memchr): Ditto.
	* libc/string/memrchr.c (memrchr): Ditto.
	* libc/string/memset.c: (memset): Ditto.
	* libc/string/rawmemchr.c (rawmemchr): Ditto.
	* libc/string/local.h (__locale_cjk_lang): Fix "function declaration
	isn't a prototype" warning.
	* libc/string/strcasestr.c (strcasestr): Ditto.
	* libc/string/u_strerr.c (_user_strerror): Fix "unused parameter"
	warnings.
	* libc/string/rawmemchr.c (rawmemchr): Fix comment type
	"// ..." -> "/* ... */".
2014-10-09 12:24:56 +00:00
Steve Ellcey ca86eee8de 2014-10-08 Steve Ellcey <sellcey@mips.com>
* newlib/libc/machine/mips/strcmp.c: Remove.
	* newlib/libc/machine/mips/strcmp.S: New.
	* newlib/libc/machine/mips/Makefile.am (lib_a_SOURCES):
	Replace strcmp.c with strcmp.S
	* newlib/libc/machine/mips/Makefile.in: Regenerate.
2014-10-08 22:29:52 +00:00
Corinna Vinschen da77c6d1e5 * libc/include/string.h (ffsl): Declare as GNU function.
(ffsll): Ditto.
2014-10-08 21:04:59 +00:00
Jeff Johnston 99eb60455b 2014-09-17 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/sys/features.h: Add __NEWLIB__ and
        __NEWLIB_MINOR__ macros.
2014-09-17 22:20:16 +00:00
Jeff Johnston ad9ed96b6b 2014-09-17 Joel Sherrill <joel.sherrill@oarcorp.com>
Thomas Uhle <thomas.uhle@eas.iis.fraunhofer.de>

        * libc/include/string.h: Correct guard for strnlen().
2014-09-16 19:59:01 +00:00
Jeff Johnston 3158e7d674 2014-09-15 Jeff Johnston <jjohnstn@redhat.com>
* libc/time/month_lengths.c: Fix to define __month_lengths.
2014-09-15 16:05:37 +00:00
Jeff Johnston 78a52749b2 2014-09-12 Jeff Johnston <jjohnstn@redhat.com>
* libc/time/tzcalc_limits.c: Fix __months_lengths reference.
2014-09-12 21:41:46 +00:00
Jeff Johnston 43b3310bc9 2014-09-12 Jeff Johnston <jjohnstn@redhat.com>
* libc/time/month_lengths.c: Actually add file this time.
        * libc/time/tzcalc_limits.c: Ditto.
2014-09-12 16:38:10 +00:00
Jeff Johnston c9dded6775 2014-09-11 Freddie Chopin <freddie_chopin@op.pl>
* libc/time/month_lengths.c: New file with __month_lengths array
        (previously mon_lengths array in mktm_r.c)
        * libc/time/tzcalc_limits.c: New file with __tzcalc_limits() from
        mktm_r.c
        * libc/time/lcltime_r.c (localtime_r): Simplify by changing call to
        _mktm_r() with call to gmtime_r() and code moved from _mktm_r() which
        was used to do time zone adjustments
        * libc/time/gmtime_r.c (gmtime_r): Simplify by moving all relevant
        code from _mktm_r(), breaking all dependencies on time zone related
        functions
        * libc/time/mktm_r.c: Delete file
        * libc/time/local.h: Update accordingly - remove declaration of
        _mktm_r(), add declaration of __month_lengths[]
        * libc/time/Makefile.am: Modify accordingly.
        * libc/time/Makefile.in: Regenerate.
2014-09-11 21:55:01 +00:00
Jeff Johnston 1c5ab1f862 2014-09-08 Freddie Chopin <freddie_chopin@op.pl>
* libc/machine/arm/Makefile.am: Fix typo.
        * libc/machine/arm/Makefile.in: Regenerated.
2014-09-08 18:57:52 +00:00
Jeff Johnston c8a01afd97 2014-09-05 Hale Wang <hale.wang@arm.com>
* libc/machine/arm/memchr.S: Clean up the wrapper.
        * libc/machine/arm/memcpy.S: Likewise.
        * libc/machine/arm/memchr-stub.c: Delete this redundant file.
        * libc/machine/arm/memcpy-stub.c: Likewise.
        * libc/machine/arm/strcmp.S: Add speed-preferred wrapper.
        * libc/machine/arm/strlen.S: Likewise.
        * libc/machine/arm/Makefile.am: Add dependencies.
        * libc/machine/arm/Makefile.in: Regenerated.
        * libc/machine/arm/configure.in: Add dependencies.
        * libc/machine/arm/configure: Regenerated.
2014-09-05 17:26:42 +00:00
Corinna Vinschen e7565f1088 * libc/stdio/findfp.c (_cleanup_r): Call _fflush_r when configuration
option "--enable-lite-exit" is in effect.  Refactor the code.
2014-09-05 09:42:15 +00:00
Corinna Vinschen 1ec7de7271 * libc/stdio/fwalk.c (_fwalk_reent): Remove redundant test. 2014-09-05 09:31:32 +00:00
Corinna Vinschen a015d9b507 Add missing libc/machine/arm/aeabi_memcpy.c file 2014-09-05 08:42:45 +00:00
Corinna Vinschen 9adec6fd79 * libc/time/mktm_r.c (_mktm_r): Optimize speed. 2014-09-04 09:47:14 +00:00
Corinna Vinschen 7d407cb678 Add missing libc/machine/arm/aeabi_memcpy-armv7a.S file 2014-09-04 08:27:35 +00:00
Corinna Vinschen f9bafa4640 * libc/time/clock.c (clock): Fix warnings about signed-unsigned
comparisons.
	* libc/time/strftime.c (strftime): Likewise.
	* libc/time/strptime.c (match_string): Fix warning about discarding
	'restrict' qualifier from pointer target type.
2014-09-04 08:27:03 +00:00
Corinna Vinschen 4a9103c410 * libc/machine/arm/aeabi_memcpy.c: New file.
* libc/machine/arm/aeabi_memcpy-armv7a.S: New file.
	* libc/machine/arm/Makefile.am: Add dependencies.
	* libc/machine/arm/Makefile.in: Regenerated.
2014-09-04 08:23:23 +00:00
DJ Delorie dd48219ba9 * libc/include/math.h (frexpl): Remove parameter name. 2014-08-27 19:27:03 +00:00
Richard Earnshaw 59c3d5a1a4 * libc/machine/aarch64/memchr.S: Add check for zero-sized buffer. 2014-08-19 10:44:44 +00:00
Corinna Vinschen d5fd6aeb6d * libc/include/sys/signal.h: Declare sigaltstack for RTEMS only. 2014-08-18 18:18:10 +00:00
Jeff Johnston 6811cfb0b9 2014-08-18 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/sys/config.h[__m68k__]: Set _READ_WRITE_RETURN_TYPE
        to _ssize_t to match underlying code in libgloss.
2014-08-18 16:43:42 +00:00
Joel Sherrill 81c17949f0 2014-08-18 Joel Sherrill <joel.sherrill@oarcorp.com>
* libc/include/string.h: Improve language and OS standard guards.
2014-08-18 14:18:10 +00:00
Joel Sherrill 6042d39486 2014-08-18 Joel Sherrill <joel.sherrill@oarcorp.com>
* libc/include/sys/signal.h: Add sigaltstack() support.
2014-08-18 14:03:35 +00:00
Corinna Vinschen f703e6aa08 * libc/stdio/findfp.c (std): Don't inline when optimizing for code size. 2014-08-14 08:33:00 +00:00
Jon TURNEY a4a96eb436 * libc/include/math.h: Also define M_PI etc. if _XOPEN_SOURCE is
defined appropriately.
2014-08-04 21:32:37 +00:00
Eric Blake ada456dcfe headers: properly decorate attributes
Found by:
find -name '*.h' |xargs grep -i 'attribute.*(([a-z]'

For an example of the type of bugs this causes, try compiling this valid
C11 program (it's valid because 'noreturn' is reserved for use in the
user namespace unless you include <stdnoreturn.h>):

$ cat foo.c
#define noreturn __attribute__((noreturn))
#include <stdlib.h>
$ gcc -c -o foo.o -Wall foo.c
In file included from /usr/include/stdlib.h:11:0,
                 from foo.c:2:
foo.c:1:18: error: expected ')' before '__attribute__'
 #define noreturn __attribute__((noreturn))
                  ^
/usr/include/stdlib.h:66:28: error: expected ',' or ';' before ')' token
 _VOID _EXFUN(abort,(_VOID) _ATTRIBUTE ((noreturn)));
                            ^

* libc/machine/spu/spu_timer_internal.h: Decorate attribute names
with __, for namespace safety.
* libc/machine/xscale/machine/profile.h: Likewise.
* libc/include/stdlib.h: Likewise.
* libc/include/_ansi.h: Likewise.
* libc/include/sys/unistd.h: Likewise.
* libc/sys/linux/linuxthreads/libc-symbols.h: Likewise.
* libc/sys/linux/linuxthreads/internals.h: Likewise.
* libc/sys/linux/machine/i386/weakalias.h: Likewise.
* libc/sys/linux/machine/i386/dl-procinfo.h: Likewise.
* libc/sys/linux/machine/i386/dl-machine.h: Likewise.
* libc/sys/linux/libc-symbols.h: Likewise.
* libc/sys/linux/iconv/gconv_charset.h: Likewise.
* libc/sys/linux/include/resolv.h: Likewise.
* libc/sys/linux/sys/unistd.h: Likewise.
* libc/sys/linux/dl/atomicity.h: Likewise.
* libc/sys/linux/dl/dynamic-link.h: Likewise.
* libc/sys/linux/dl/ldsodefs.h: Likewise.
2014-08-01 15:44:51 +00:00
Corinna Vinschen db0378d50f * libc/string/strerror.c: Fix documentation so makedoc doesn't
stumble over a sole EAGAIN.
2014-07-30 08:02:12 +00:00
Anthony Green 0a0f33e501 Add moxiebox support. 2014-07-27 14:37:10 +00:00
Joel Sherrill e4994e769e 2014-07-22 Joel Sherrill <joel.sherrill@oarcorp.com>
* libc/include/sys/time.h: Add prototype for adjtime() and
	wrap it and settimeofday() prototype with __BSD_VISIBLE.
2014-07-22 19:30:00 +00:00
Corinna Vinschen cdd7651698 Fix missing generated files 2014-07-17 18:43:55 +00:00
Corinna Vinschen 81fd6210c0 * configure.host: Remove or16 and or32 targets and add or1k.
* libc/include/machine/ieeefp.h: Replace or32 with or1k.
	* libc/machine/configure.in: Add or1k subdirectory.
	* libc/machine/or1k/configure.in: New file.
	* libc/machine/or1k/Makefile.am: New file.
	* libc/machine/or1k/setjmp.S: New file.
2014-07-17 18:43:05 +00:00
Corinna Vinschen e2b585c12c * libc/include/sys/errno.h: Fix comments.
* libc/string/strerror.c: Fix documentation.
	(_strerror_r): Handle ENETRESET, EILSEQ, ENODATA, ECONNRESET,
	EADDRNOTAVAIL, EOVERFLOW.  Fix strings for EMFILE and EDOM.
2014-07-14 13:40:17 +00:00
Richard Earnshaw 87375c75b3 [aarch64] Add memchr.
2014-07-11  K�vin Petit  <kevin.petit@arm.com>

	* libc/machine/aarch64/memchr.S: New file.
	* libc/machine/aarch64/memchr-stub.c: New file.
	* libc/machine/aarch64/Makefile.am: Add the new files.
	* libc/machine/aarch64/Makefile.in: Regenerated.
2014-07-11 09:10:50 +00:00
Richard Earnshaw 7bd00a0bef 2014-07-07 Pavel Pisa <pisa@cmp.felk.cvut.cz>
Richard Earnshaw  <rearnsha@arm.com>

	* libc/machine/arm/memchr.S (.arch): Require revision ARMv6t2.
2014-07-07 13:58:35 +00:00
Corinna Vinschen 2ccbe5129d * configure.in (--enable-newlib-nano-formatted-io): Set to "no"
by default.
	* configure: Regenerated.
2014-07-07 13:15:55 +00:00
Jeff Johnston d34336767e 2014-07-04 Bin Cheng <bin.cheng@arm.com>
* README (--enable-newlib-nano-formatted-io): Describe.
        * acconfig.h (_NANO_FORMATTED_IO): Undef.
        * newlib.hin (_NANO_FORMATTED_IO): Undef.
        * configure.in (--enable-newlib-nano-formatted-io): New option.
        * configure: Regenerated.
        * libc/configure.in (--enable-newlib-nano-formatted-io): New option.
        * libc/configure: Regenerated.
        * libc/stdio/Makefile.am (NEWLIB_NANO_FORMATTED_IO): Support new
        configuration option.
        * libc/stdio/Makefile.in: Regenerated.
        * libc/stdio/asnprintf.c (_asniprintf_r, asniprintf): Use
        _NANO_FORMATTED_IO to declare alias prototypes.
        * libc/stdio/asprintf.c (_asiprintf_r, asiprintf): Ditto.
        * libc/stdio/dprintf.c (_diprintf_r, diprintf): Ditto.
        * libc/stdio/fprintf.c (_fiprintf_r, fiprintf): Ditto.
        * libc/stdio/fscanf.c (fiscanf, _fiscanf_r): Ditto.
        * libc/stdio/printf.c (_iprintf_r, iprintf): Ditto.
        * libc/stdio/scanf.c (iscanf, _iscanf_r): Ditto.
        * libc/stdio/snprintf.c (_sniprintf_r, sniprintf): Ditto.
        * libc/stdio/sprintf.c (_siprintf_r, siprintf): Ditto.
        * libc/stdio/sscanf.c (siscanf, _siscanf_r): Ditto.
        * libc/stdio/vasnprintf.c (_vasniprintf_r, vasniprintf): Ditto.
        * libc/stdio/vasprintf.c (vasiprintf, _vasiprintf_r): Ditto.
        * libc/stdio/vdprintf.c (_vdiprintf_r, vdiprintf): Ditto.
        * libc/stdio/vprintf.c (viprintf, _viprintf_r): Ditto.
        * libc/stdio/vscanf.c (viscanf, _viscanf_r): Ditto.
        * libc/stdio/vsnprintf.c (vsniprintf, _vsniprintf_r): Ditto.
        * libc/stdio/vsprintf.c (vsiprintf, _vsiprintf_r): Ditto.
        * libc/stdio/vsscanf.c (vsiscanf, _vsiscanf_r): Ditto.
        * libc/stdio/nano-vfprintf.c: New file.
        * libc/stdio/nano-vfprintf_float.c: New file.
        * libc/stdio/nano-vfprintf_i.c: New file.
        * libc/stdio/nano-vfprintf_local.h: New file.
        * libc/stdio/nano-vfscanf.c: New file.
        * libc/stdio/nano-vfscanf_float.c: New file.
        * libc/stdio/nano-vfscanf_i.c: New file.
        * libc/stdio/nano-vfscanf_local.h: New file.
2014-07-04 17:21:45 +00:00
Corinna Vinschen 4491d189ae * libc/argz/envz_merge.c (envz_merge): Fix memory leak (Cygwin Coverity
Scan CID 60023).
	* libc/ctype/iswalpha.c (iswalpha): Add bounds check to avoid
	out-of-bounds read from utf8 tables (CID 59949).
	* libc/locale/ldpart.c (__part_load_locale): Add 1 byte to size of lbuf.
	Write NUL into the last byte to accommodate split_lines (CID 60047).
2014-06-23 20:21:54 +00:00
Richard Earnshaw deda48a9fb * libc/machine/aarch64/strchrnul.S: New file.
* libc/machine/aarch64/strchrnul-stub.c: New file.
	* libc/machine/aarch64/Makefile.am: Add them to build list.
	* libc/machine/aarch64/Makefile.in: Regenerated.
2014-06-11 10:42:54 +00:00
Richard Earnshaw 5efd066df2 * libc/machine/aarch64/strchr.S: New file
* libc/machine/aarch64/strchr-stub.c: New file
	* libc/machine/aarch64/Makefile.am: Add them to build list.
	* libc/machine/aarch64/Makefile.in: Regenerated.
2014-06-10 14:04:31 +00:00
DJ Delorie d043b4c527 * configure.host (default_newlib_nano_malloc): New.
(msp430): Set it.
* configure.in (newlib_nano_malloc): Leave unset if not set by
the user.
* configure: Regenerate.
* libc/configure.in (NEWLIB_NANO_MALLOC): Set after running
configure.host.
(newlib_nano_malloc): Leave unset if not set by	the user.
* libc/configure: Regenerate.
2014-06-10 03:09:35 +00:00
Corinna Vinschen e9eef8ec14 * libc/machine/sparc/setjmp.S (longjmp): Use register g1 instead of g6. 2014-05-15 13:14:25 +00:00
Corinna Vinschen a265e7269f * libc/include/machine/ieeefp.h: Define _DOUBLE_IS_32BITS when double
options is not __RL78_64BIT_DOUBLES__.
2014-05-14 11:33:24 +00:00
Corinna Vinschen c57ccec649 * 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.
2014-05-12 17:02:11 +00:00
Corinna Vinschen 7bc7b551f5 * libc/include/stdio.h (tempnam): Declare as __BSD_VISIBLE or
__XSI_VISIBLE or if __POSIX_VISIBLE >= 200112.
2014-05-09 14:25:32 +00:00
Corinna Vinschen 783e4d51e2 * libc/include/stdio.h (fcloseall): Declare as __GNU_VISIBLE only.
(renameat): Drop explicit __CYGWIN__ dependency.
2014-05-09 08:42:39 +00:00
Corinna Vinschen 7e9b678464 * libc/include/stdio.h: Declare various C99 printf/scanf functions for
C++11, too.
2014-05-05 12:53:47 +00:00
Richard Earnshaw 742e729664 * 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.
2014-04-22 12:16:22 +00:00
Corinna Vinschen a6e73f9505 * libc/sys/rtems/sys/cpuset.h (CPU_SET_S): Add const qualifier.
(CPU_SET): Likewise.
2014-04-14 14:08:26 +00:00
DJ Delorie 0f05e4b24f * libc/machine/rl78/setjmp.S: Add RL78/G10 support. 2014-04-09 21:35:43 +00:00
Jeff Johnston d3925b72d5 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.
2014-04-04 21:40:59 +00:00
Richard Earnshaw 31eade549d * libc/machine/arm/acle-compat.h: New file.
* libc/machine/arm/arm_asm.h: Use it.
2014-03-27 13:26:39 +00:00
Jeff Johnston b7f5fb36f1 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.
2014-03-21 21:27:29 +00:00
Jeff Johnston 7f6278bc08 2014-03-21 Sabrina Ni <sabrinanitw@gmail.com>
* libc/machine/nds32/configure: Regenerated.
        * libc/machine/nds32/configure.in: Add AC_NOEXECUTABLES.
2014-03-21 21:15:15 +00:00
Jeff Johnston ef073b8f82 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.
2014-03-21 21:09:46 +00:00
Jeff Johnston c18decccef 2014-03-21 Sabrina Ni <sabrinanitw@gmail.com>
* libc/machine/nds32/setjmp.S: Keep jmp_buff sync with GDB.
2014-03-21 20:28:57 +00:00
Jeff Johnston 5805cb1f8c 2014-03-21 Sabrina Ni <sabrinanitw@gmail.com>
* libc/machine/nds32/setjmp.S: Optimize.
2014-03-21 20:09:10 +00:00
Corinna Vinschen 0b3ad39364 * 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.
2014-03-07 20:06:54 +00:00
Corinna Vinschen d5b32c8fad * libc/include/time.h (__TM_GMTOFF): Remove Cygwin-specific definition.
(__TM_ZONE): Ditto.
2014-03-05 12:49:40 +00:00
Corinna Vinschen 07be216aab * 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.
2014-03-05 12:43:12 +00:00
Corinna Vinschen 17ff765184 * libc/include/machine/_default_types.h: Define unsigned type using
signed type macros in case unsigned type macros are not available.
2014-03-04 08:05:39 +00:00
Corinna Vinschen 6480b2ae76 * libm/complex/complex.tex: Fix wrong syntax in documentation.
* libm/math/math.tex: Ditto.
2014-02-20 18:59:10 +00:00
Corinna Vinschen 23c0f21594 * libc/stdio/open_memstream.c (internal_open_memstream_r): Initialize
c->pos to 0.
2014-02-20 13:32:34 +00:00
Jeff Johnston 35dcecc6db 2014-02-11 Joey Ye <joey.ye@arm.com>
* libc/sys/arm/syscalls.c (_sbrk): Define as weak symbols.
        (_read, _write): Ditto.
2014-02-11 19:54:30 +00:00
Corinna Vinschen ab7165e43b * libc/include/pwd.h: Include <sys/cdefs.h>.
* libc/include/grp.h: Ditto.
2014-02-09 20:02:17 +00:00
Jeff Johnston d581a24a36 2014-02-04 Matthias Braun <matze@braunis.de>
* libm/mathfp/sf_numtest.c: Fix NaN/Inf detection logic.
2014-02-04 20:49:53 +00:00
Corinna Vinschen ae691ac535 * libc/include/setjmp.h (longjmp): Fix copy/paste error. 2014-01-20 17:23:41 +00:00
Corinna Vinschen 5e66ab7852 * libc/include/setjmp.h (longjmp): Mark "noreturn" when building with
GCC.
2014-01-19 09:38:34 +00:00
Corinna Vinschen 93012a1d0d * libc/include/pwd.h: Use __foo_VISIBLE macros from sys/cdefs.h.
(setpassent): Declare.
2014-01-17 14:54:31 +00:00
Corinna Vinschen ad1a102dd6 * libc/include/sys/_default_fcntl.h (LOCK_SH): Define.
(LOCK_EX): Likewise.
	(LOCK_NB): Likewise.
	(LOCK_UN): Likewise.
	(flock): Declare.
2014-01-17 10:57:54 +00:00
Corinna Vinschen 7a7e4d4d95 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.
2014-01-17 10:55:32 +00:00
Jeff Johnston 439f4e7a87 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.
2014-01-06 20:59:38 +00:00
Jeff Johnston 0707f1df6c 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.
2014-01-06 19:50:33 +00:00
Jeff Johnston 60ea042c37 2013-01-06 Mike Frysinger <vapier@gentoo.org>
* libc/ctype/jp2uc.c: Include string.h.
2014-01-06 19:30:50 +00:00
Jeff Johnston 5ac847c629 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
2013-12-23 20:45:10 +00:00
Jeff Johnston b153931f18 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.
2013-12-23 19:21:07 +00:00
Nick Clifton 57cfbb7bbf * configure.host (newlib_cflags): Use -Os, -ffunction-sections and
-fdata-sections for RL78.
2013-12-20 10:27:49 +00:00
Corinna Vinschen 281924766d * libc/stdio/vfwscanf.c (__SVFWSCANF_R): Fix fetching decimal_point in
!_MB_CAPABLE as well as in !__HAVE_LOCALE_INFO_EXTENDED__ case.
2013-12-19 18:50:00 +00:00
Corinna Vinschen 0fcafd1535 Fix ChangeLog entry 2013-12-19 09:50:19 +00:00
Corinna Vinschen 576b7804d6 * vfscanf.c (BUF): Change definition to take multibyte decimal point
into account.
	(__SVFSCANF_R): Handle radix char language-dependent
	per POSIX.
	(__SVFWSCANF_R): Ditto.
2013-12-18 19:23:33 +00:00
Jeff Johnston 10e4d79a19 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.
2013-12-10 18:57:30 +00:00
Corinna Vinschen a6a307d8c2 * libc/sys/rtems/include/limits.h: Update page size to match
libc/sys/rtems/machine/param.h.
2013-12-10 09:20:37 +00:00
Corinna Vinschen f4fc6b0663 * libc/sys/rtems/sys/cpuset.h: Use __inline instead of inline. 2013-12-03 16:07:33 +00:00
Corinna Vinschen 9bd3bcc642 * 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.
2013-12-03 16:04:41 +00:00
Joel Sherrill a534dfd26e 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.
2013-11-29 23:35:34 +00:00
Joel Sherrill 62c28b76ac 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.
2013-11-29 23:14:57 +00:00
Joel Sherrill 2d50094276 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.
2013-11-27 14:53:59 +00:00
Corinna Vinschen 963addfa27 * libc/machine/mips/setjmp.S: Fix definition of macro FPR_LAYOUT
for ABI == N32.
2013-11-27 12:45:56 +00:00
Jeff Johnston a00d2722b6 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.
2013-11-26 19:58:19 +00:00
Joel Sherrill db026d86d8 Correct for missing entries for wchar.h changes and white space changes 2013-11-26 17:27:08 +00:00
Joel Sherrill 380c9f6165 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.
2013-11-26 17:21:01 +00:00
Joel Sherrill 6221252b5e 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.
2013-11-26 14:38:58 +00:00
Corinna Vinschen 4d3c733045 * libc/posix/posix_spawn.c: Drop using namespace.h. 2013-11-26 13:51:19 +00:00
Corinna Vinschen 6fe752f94f * 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.
2013-11-26 13:48:00 +00:00
Joel Sherrill d264970f79 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.
2013-11-25 17:55:33 +00:00
Corinna Vinschen 05efdc441d * 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.
2013-11-25 17:23:30 +00:00
Joel Sherrill d482870337 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.
2013-11-25 13:46:23 +00:00
Joel Sherrill f68a40cdf9 2013-11-23 Bryan Dunsmore <dunsmoreb@gmail.com>
* libc/include/wordexp.h (wordexp): Add restrict keyword.
	* libc/posix/wordexp.c (wordexp): Ditto.
2013-11-23 22:39:34 +00:00
Joel Sherrill 9cd69d84ef 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.
2013-11-23 01:25:47 +00:00
Joel Sherrill 849fe25d0e 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.
2013-11-22 22:39:51 +00:00
Joel Sherrill 2464ecbf64 2013-11-21 Daniel Ramirez <javamonn@gmail.com>
* libc/sys/linux/statvfs.c (statvfs): Added restrict keyword.
2013-11-22 01:17:42 +00:00
Joel Sherrill d0d3968f8f 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.
2013-11-21 19:27:17 +00:00
Joel Sherrill 9977fcbc42 2013-11-21 Julio Gutierrez <jgutleyva@gmail.com>
* libc/include/glob.h (glob): Add restrict keyword.
	* libc/posix/glob.c (glob): Ditto.
2013-11-21 17:04:57 +00:00
Joel Sherrill a7c3258311 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.
2013-11-21 16:44:39 +00:00
Joel Sherrill 21cf2aee53 2013-11-21 Joel Sherrill <joel.sherrill@oarcorp.com>
* libc/sys/rdos/stat.c: Remove stray +.
2013-11-21 16:39:06 +00:00
Joel Sherrill 32e2cbeeab 2013-11-21 Daniel Ramirez <javamonn@gmail.com>
* libc/include/sys/stat.h, libc/sys/linux/sys/stat.h,
	libc/sys/m88kbug/syscalls.c, libc/sys/rdos/stat.c,
	libc/sys/sparc64/sys/stat.h: Add restrict keyword.
2013-11-21 16:35:47 +00:00
Joel Sherrill 3c7451d8de 2013-11-20 Daniel Ramirez <javamonn@gmail.com>
* libc/include/search.h, libc/search/tdelete.c: Add restrict keyword.
2013-11-20 18:22:27 +00:00
Joel Sherrill ea9d80921f 2013-11-20 Chirayu Desai <chirayudesai1@gmail.com>
* libc/include/regex.h, libc/posix/regcomp.c,
	libc/posix/regerror.c, libc/posix/regex.3
	libc/posix/regexec.c: Add restrict keyword.
2013-11-20 16:25:50 +00:00
Joel Sherrill a2c4eac5d0 2013-11-20 Daniel Ramirez <javamonn@gmail.com>
* libc/iconv/lib/iconv.c, libc/include/iconv.h,
	libc/sys/linux/iconv/iconv.c: Add restrict keyword.
2013-11-20 13:39:36 +00:00
Corinna Vinschen 8273b2112f * libc/include/stdlib.h: Declare realpath only if !__STRICT_ANSI__. 2013-11-20 09:46:39 +00:00
Joel Sherrill 3007afbca3 3013-11-19 Jennifer Averett <jennifer.averett@oarcorp.com>
* libc/sys/rtems/sys/cpuset.h: New file.
2013-11-19 19:11:24 +00:00
Joel Sherrill 670c036efa Fix date 2013-11-19 17:39:43 +00:00
Joel Sherrill aed5f73fa8 2013-11-18 Joel Sherrill <joel.sherrill@oarcorp.com>
* libc/include/stdlib.h: Add prototype of realpath().
	* libc/sys/linux/realpath.c: Add restrict keyword.
2013-11-19 17:32:24 +00:00
Joel Sherrill 7dffe44b09 2013-11-19 Joel Sherrill <joel.sherrill@oarcorp.com>
* libm/common/modfl.c: Add cast to remove compiler warning.
2013-11-19 17:28:04 +00:00
Corinna Vinschen ff125797e3 * libc/posix/closedir.c: Fix use after free.
Remove useless test dd_fd != -1
	* libc/posix/readdir.c: Remove useless test dd_fd == -1
	* libc/posix/readdir_r.c: Ditto.
2013-11-19 11:48:02 +00:00
Joel Sherrill 481cb456a4 2013-11-18 Sahil Patnayakuni <sahilp@oarcorp.com>
* libc/include/stdio.h, libc/machine/powerpc/vfscanf.c,
	libc/machine/spu/fgetpos.c, libc/machine/spu/fgets.c,
	libc/machine/spu/fopen.c, libc/machine/spu/fputs.c,
	libc/machine/spu/fread.c, libc/machine/spu/freopen.c,
	libc/machine/spu/fwrite.c, libc/machine/spu/setbuf.c,
	libc/machine/spu/vfprintf.c, libc/machine/spu/vfscanf.c,
	libc/machine/spu/vsnprintf.c, libc/machine/spu/vsprintf.c,
	libc/machine/spu/vsscanf.c, libc/stdio/asnprintf.c,
	libc/stdio/asprintf.c, libc/stdio/dprintf.c,
	libc/stdio/fgetpos.c, libc/stdio/fgets.c,
	libc/stdio/fmemopen.c, libc/stdio/fopen.c,
	libc/stdio/fprintf.c, libc/stdio/fputs.c,
	libc/stdio/fread.c, libc/stdio/freopen.c,
	libc/stdio/fscanf.c, libc/stdio/fwrite.c,
	libc/stdio/printf.c, libc/stdio/scanf.c,
	libc/stdio/setbuf.c, libc/stdio/snprintf.c,
	libc/stdio/sprintf.c, libc/stdio/sscanf.c,
	libc/stdio/vdprintf.c, libc/stdio/vprintf.c,
	libc/stdio/vscanf.c, libc/stdio/vsnprintf.c,
	libc/stdio/vsprintf.c, libc/stdio/vsscanf.c: Add restrict keyword.
2013-11-18 17:28:06 +00:00
Joel Sherrill 8ab08406da 2013-11-18 Sahil Patnayakuni <sahilp@oarcorp.com>
* libc/include/stdlib.h, libc/stdlib/mbstowcs.c,
	libc/stdlib/mbstowcs_r.c, libc/stdlib/mbtowc.c,
	libc/stdlib/mbtowc_r.c, libc/stdlib/strtod.c,
	libc/stdlib/strtol.c, libc/stdlib/strtold.c,
	libc/stdlib/strtoll.c, libc/stdlib/strtoll_r.c,
	libc/stdlib/strtoul.c, libc/stdlib/strtoull.c,
	libc/stdlib/strtoull_r.c, libc/stdlib/wcstombs.c,
	libc/stdlib/wcstombs_r.c: Add restrict keyword.
2013-11-18 17:26:52 +00:00
Marcus Shawcroft 7c62befe16 [AArch64] Provide ftruncate() and truncate() stubs. 2013-11-18 10:04:56 +00:00
Marcus Shawcroft c709105913 [ARM] Provide ftruncate() and truncate() stubs. 2013-11-18 09:53:46 +00:00
Corinna Vinschen 2b2290caba * newlib/libc/stdlib/getopt.c (getopt_internal): Add missing braces. 2013-11-13 20:04:18 +00:00
Corinna Vinschen 02365c2064 * newlib/libc/include/getopt.h (struct option): name field should be
"const char *".
	* newlib/libc/stdlib/getopt.c (getopt_internal): Use fputs()/fputc()
	instead of fprintf() to save code space.  Fix signed/unsigned
	comparison.
2013-11-13 09:09:45 +00:00
Corinna Vinschen f1359420da * libc/libc/stdlib/getopt.c (getopt_internal): Fix NULL pointer access. 2013-11-12 11:30:32 +00:00
Corinna Vinschen 874e065fa1 * libm/libm.texinfo: Rename node Index to Document Index.
* libc/libc.texinfo: Rename node Library Index to Document Index.
2013-11-08 12:48:29 +00:00
Corinna Vinschen 2a98b3363e * libc/stdio/fvwrite.c: Allow writing in larger chunks for fully
buffered and unbuffered files, to improve write performance.
2013-11-04 14:18:44 +00:00
Corinna Vinschen a5f316d8cf * libc/stdio/fvwrite.h: change type of uio_resid from int to size_t to
fix fwrite() of > 2GByte buffers.
2013-10-31 10:35:54 +00:00
Corinna Vinschen 566fd12b68 Implement malloc_stats for nano.
* libc/stdlib/nano-mallocr.c (RONECALL): New parameter macro.
	(sbrk_start): New variable.
	(current_mallinfo, free_list): Forward declaration of data.
	(chunk): Define size as long type.
	(mallinfo): Synchronize with latest malloc.h.
	(nano_*): Forward declaration of functions.
	(get_chunk_from_ptr): Defined to static inline.
	(nano_mallinfo): Implement this function.
	(nano_malloc_stats): Implement this function.
2013-10-30 15:53:05 +00:00
Corinna Vinschen 4afcc6ced9 * libc/include/machine/_default_types.h: Revert change from 2013-10-10. 2013-10-30 15:51:13 +00:00
Hans-Peter Nilsson 72a386373e * libc/include/stdio.h [!__LARGE64_FILES] (funopen): Fix typo
in last change.
2013-10-24 01:21:33 +00:00
Corinna Vinschen 0c3d8e5ab5 * libc/include/stdio.h (funopen): Change prototype of
__readfn and __writefn parameter to match new definition of
	FILE's _read and _write methods.
	(_funopen_r): Ditto.
	(funopen): Ditto.
	(_funopen_r): Ditto.
	* libc/include/sys/config.h (_READ_WRITE_BUFSIZE_TYPE) Define
	as type int if not already defined.  Add comment to explain.
	* libc/include/sys/reent.h: Include stddef.h.
	(struct __sFILE): Change type of last parameter in declaration
	of _read and _write methods to _READ_WRITE_BUFSIZE_TYPE.
	(struct __sFILE64): Ditto.
	* libc/stdio/local.h (__sread): Declare with last parameter set
	to _READ_WRITE_BUFSIZE_TYPE.
	(__seofread): Ditto.
	(__swrite): Ditto.
	(__swrite64): Ditto.
	* libc/stdio/fvwrite.c (__sfvwrite_r): Change type of local
	variables w and s to _READ_WRITE_RETURN_TYPE.
	* libc/stdio/fflush.c (__sflush_r): Change type of local variables
	n and t to _READ_WRITE_BUFSIZE_TYPE and _READ_WRITE_RETURN_TYPE.
	Add local variables flags to keep _flags value.
	* libc/stdio/fmemopen.c (fmemreader): Align to above change.
	(fmemwriter): Ditto.
	* libc/stdio/fopencookie.c (fcreader): Ditto.
	(fcwriter): Ditto.
	* libc/stdio/funopen.c (funread): Ditto.
	(funwrite): Ditto.
	(funreader): Ditto.
	(funwriter): Ditto.
	* libc/stdio/open_memstream.c (memwriter): Ditto.
	* libc/stdio/stdio.c (__sread): Ditto.
	(__seofread): Ditto.
	(__swrite): Ditto.
	* libc/stdio64/stdio64.c (__swrite64): Ditto.
2013-10-23 10:04:43 +00:00
Corinna Vinschen f3debae528 Fix formatting 2013-10-18 08:44:12 +00:00
Corinna Vinschen e4aa6ea112 * configure.in (enable-newlib-global-atexit): New option.
* configure: Regenerated.
	* newlib.hin (_REENT_GLOBAL_ATEXIT): Place-holder.
	* README (enable-newlib-global-atexit): Description for
	new option.
2013-10-18 08:43:05 +00:00
Corinna Vinschen 05b637e340 * libc/include/sys/unistd.h (MAXPATHLEN): Delete.
* libc/include/sys/param.h (MAXPATHLEN): Define.
	* libc/sys/rtems/sys/param.h (MAXPATHLEN): Likewise.
	* libc/unix/getcwd.c: Include <sys/param.h> for MAXPATHLEN.
2013-10-18 08:30:29 +00:00
Corinna Vinschen 1c1fa247a6 Fix ChangeLog entries 2013-10-16 10:41:06 +00:00
Joel Sherrill 77e22783e4 2013-10-10 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libc/libc/sys/rtems/sys/param.h: Update some parameters to
	the latest FreeBSD values.
2013-10-15 17:40:02 +00:00
Joel Sherrill 50eb944a7c 2013-10-10 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libc/sys/rtems/machine/_types.h (_HAVE_SYSTYPES): Define.
2013-10-15 17:39:19 +00:00
Joel Sherrill 8635dec1a5 2013-10-10 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libc/sys/rtems/machine/_types.h (__dev_t): Define.
	(__dev_t_defined) Likewise.
	* libc/include/sys/_types.h (__dev_t): Delete RTEMS specific
	definition.
2013-10-15 17:38:32 +00:00
Joel Sherrill 0351747c13 2013-10-10 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libc/sys/rtems/machine/_types.h (__dev_t): Define.
	(__dev_t_defined) Likewise.
	* libc/include/sys/_types.h (__dev_t): Delete RTEMS specific
	definition.
2013-10-15 17:37:37 +00:00
Joel Sherrill 7a75a3aa7c 2013-10-10 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libc/sys/rtems/machine/_types.h (_ssize_t): Delete.
	(__ssize_t_defined) Likewise.
2013-10-15 17:36:16 +00:00
Joel Sherrill 6a0563a2e3 2013-10-10 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libc/include/machine/_default_types.h (__int8_t): Define via
	<stdint.h> provided type.
	(__uint8_t): Likewise.
	(__int8_least_t): Likewise.
	(__uint8_least_t): Likewise.
	(__int16_t): Likewise.
	(__uint16_t): Likewise.
	(__int16_least_t): Likewise.
	(__uint16_least_t): Likewise.
	(__int32_t): Likewise.
	(__uint32_t): Likewise.
	(__int32_least_t): Likewise.
	(__uint32_least_t): Likewise.
	(__int64_t): Likewise.
	(__uint64_t): Likewise.
2013-10-15 17:35:38 +00:00
Joel Sherrill 50588a20d4 2013-10-10 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libc/include/paths.h (_PATH_DEVNULL): Define.
	(_PATH_DEVZERO): Likewise.
2013-10-15 17:34:23 +00:00
Joel Sherrill 40c63f3ec0 Formatting. 2013-10-15 17:33:47 +00:00
Jeff Johnston d8914394e3 2013-10-09 Marcus Shawcroft <marcus.shawcroft@arm.com>
* testsuite/newlib.wctype/twctype.c (main): Update
        iswprint(0xce2) test case.
2013-10-09 18:56:52 +00:00
Steve Ellcey e828abfaea 2013-10-03 Steve Ellcey <sellcey@mips.com>
* libc/machine/mips/memset.c: Remove.
	* libc/machine/mips/memset.S: New.
	* libc/machine/mips/Makefile.am: Change memset.c to memset.S
	* libc/machine/mips/Makefile.in: Regenerate.
2013-10-03 21:51:52 +00:00
Jeff Johnston c7c1a1ca1b 2013-10-01 Petr Hosek <phosek@chromium.org>
* configure.host: Disable new posix_spawn function for all
        users of posix dir except Cygwin.
        * libc/posix/Makefile.am: Add support for new posix_spawn function.
        * libc/posix/Makefile.in: Regenerate.
        * libc/posix/posix_spawn.c: New file.
        * libc/include/spawn.h: Ditto.
2013-10-01 18:08:46 +00:00
Jeff Johnston 00fd23d50f 2013-09-13 Joey Ye <joey.ye@arm.com>
* libc/stdlib/nano-mallocr.c (nano_allopt): Typo fixed to ...
	(nano_mallopt): ... this.
2013-09-13 16:51:48 +00:00
Jeff Johnston 44d6d53977 2013-09-12 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libc/include/sys/cdefs.h: Synchronize with latest FreeBSD
        version.
        * libc/include/stdatomic.h: Likewise.
2013-09-12 22:05:43 +00:00
Yaakov Selkowitz 45070312d4 * libc/include/search.h (__compar_fn_t): Add typedef.
(tdelete, tfind, tsearch): Use it.
* libc/include/stdlib.h (__compar_fn_t): Add typedef.
(bsearch, qsort): Use it.
2013-09-08 07:11:33 +00:00
Corinna Vinschen cbd871ad41 * libc/stdlib/__atexit.c (__register_exitproc): NULL-ify
_on_exit_args_ptr when creating a new _atexit structure while
	_REENT_SMALL is defined.
2013-08-19 09:03:42 +00:00
Corinna Vinschen 56d5fc7cda * libc/configure.in (--enable-newlib-wchar-orient): Remove.
* libc/configure: Regenerated.
	* libc/stdio/Makefile.am (NEWLIB_WIDE_ORIENT): Remove.
	* libc/stdio/Makefile.in: Regenerated.
2013-08-12 11:31:53 +00:00
Corinna Vinschen 454b880298 * libc/sys/arm/crt0.S: Remove 'start'. 2013-08-12 11:28:28 +00:00