summaryrefslogtreecommitdiffstats
path: root/newlib
Commit message (Collapse)AuthorAgeFilesLines
* Revert previous change to sys/stat.h and fix cris libglossJeff Johnston2019-08-191-9/+0
| | | | | | - revert previous fix which altered sys/stat.h - fix libgloss/cris/gensyscalls to undef st_atime, st_mtime, and st_ctime macros which cannot be used with new_stat structure
* Fix regression in cris-elf caused by sys/stat.h changeJeff Johnston2019-08-191-2/+11
|
* stat.h: use POSIX-required timefields throughoutCorinna Vinschen2019-08-161-16/+6
| | | | | | ...except in certain SysV R4 cases for backward compat. This is probably not required anymore, but it doesn't hurt to keep it in.
* fenv: Include documentation in generated .info fileJoel Sherrill2019-08-155-2/+49
|
* memmem.c and strstr.c: do not require -std=c99Giacomo Tesio2019-08-142-5/+10
|
* fenv: Update makedocbook for eae68bfcJon Turney2019-08-131-1/+3
| | | | | | | | | Teach makedocbook how to handle some new things seen in the makedoc markup since eae68bfc: - 'link with' lines appearing in SYNOPSIS sections Also, don't raise a NoneType exception when there's something we don't know how to handle in a SYNOPSIS section, just exit.
* fenv: Fix typo-ed variable name in documentationJon Turney2019-08-131-1/+1
|
* fenv: Fix mangled makedoc markupJon Turney2019-08-134-8/+8
| | | | | | See makedoc.c:657: Variables are marked up as '<[foo]>'. Code is marked up as '<<foo>>'.
* fenv: fe_dfl_env.c doesn't contain any documentationJon Turney2019-08-132-2/+2
| | | | | fe_dfl_env.c doesn't contain any documentation, so drop it from makedoc processing.
* sched.h: Declare affinity functions only on targets supporting themCorinna Vinschen2019-08-121-0/+6
|
* Regenerated files from fenv.h additionJoel Sherrill2019-08-093-7/+636
|
* Add default implementation of fenv.h and all methodsJoel Sherrill2019-08-0917-5/+997
| | | | | | | | | | The default implementation of the fenv.h methods return -EOPNOTSUP. Some of these have implementations appropriate for soft-float. The intention of the new fenv.h is that it be portable and that architectures provide their own implementation of sys/fenv.h.
* Miscellaneous Makefile.in regeneratedJoel Sherrill2019-08-094-46/+33
|
* Align libgloss/arm and libc/sys/arm sources: miscellaneous fixesAlexander Fedotov2019-08-052-17/+35
| | | | | 1. Trim trailing spaces 2. Align comments, function declarations and definitions
* Align libgloss/arm and libc/sys/arm sources: Lite exit supportAlexander Fedotov2019-08-051-0/+16
| | | | | | | Applied changes from commit 2404223: * arm/crt0.S (_mainCRTStartup): Weak reference to atexit and _fini when lite exit is enabled.
* Align libgloss/arm and libc/sys/arm sources: HeapInfo and __heap_limitAlexander Fedotov2019-08-052-2/+14
| | | | | | | | | | | Applied changes from commit 8d98f95: * arm/crt0.S: Initialise __heap_limit when ARM_RDI_MONITOR is defined. * arm/syscalls.c: define __heap_limit global symbol. * arm/syscalls.c (_sbrk): Honour __heap_limit. Applied changes from commit 8d98f95: Fixed semihosting for ARM when heapinfo not provided by debugger
* Align libgloss/arm and libc/sys/arm sources: Fix GetCmdLine semihosting ↵Alexander Fedotov2019-08-051-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | directives Applied changes from the commit 9b11672: When simulating arm code, the target program startup code (crt0) uses semihosting invocations to get the command line from the simulator. The simulator returns the command line and its size into the area passed in parameter. (ARM 32-bit specifications : http://infocenter.arm.com/help/topic/com.arm.doc.dui0058d/DUI0058.pdf chapter "5.4.19 SYS_GET_CMDLINE"). The memory area pointed by the semihosting register argument is located in .text section (usually not writtable (RX)). If we run this code on a simulator that respects this rights properties (qemu user-mode for instance), the command line will not be written to the .text program memory, in particular the length of the string. The program runs with an empty command line. This problem hasn't been seen earlier probably because qemu user-mode is not so much used, but this can happen with another simulator that refuse to write in a read-only segment. With this modification, the command line can be correctly passed to the target program. Changes: - newlib/libc/sys/arm/crt0.S : Arguments passed to the AngelSWI_Reason_GetCmdLine semihosting invocation are placed into .data section instead of .text
* RISC-V: Fix header guard for sys/fenv.hKito Cheng2019-08-021-3/+3
|
* common/math_errf.c: Enable compilation of __math_oflowfJoel Sherrill2019-07-261-2/+3
| | | | | This resolved linking errors when using methods such as expm1().
* hash.c: #include <reent.h>Ken Brown2019-07-261-0/+1
| | | | | | This is needed for the prototypes of _stat64 and _fstat64 on Cygwin. Fixes: commit 279805b2 "hash functions: use reentrant stat functions".
* [arm] remove libc/sys/arm/sys/param.hRichard Earnshaw2019-07-261-25/+0
| | | | | | | The Arm sys/param.h does not define anything differently to the generic sys/param.h, but fails to define some things that that file provides. There does not appear to be any reason to keep this version and we should revert to using the common version.
* Port ndbm - Remove Declaration of dbm_forderVaibhav Gupta2019-07-251-3/+0
|
* hash functions: use reentrant stat functionsCorinna Vinschen2019-07-241-6/+6
| | | | | | | _stat64 and _fstat64 are not exported from Cygwin. Use the reentrant analogues, like everywhere else. Signed-off-by: Corinna Vinschen <corinna-cygwin@cygwin.com>
* Regenerate newlib/libc/search/Makefile.in for ndpm portCorinna Vinschen2019-07-241-20/+42
| | | | Signed-off-by: Corinna Vinschen <corinna-cygwin@cygwin.com>
* fix compile errors for efgcvt.cuchan-nos2019-07-241-15/+18
|
* Port ndbmVaibhav Gupta2019-07-243-0/+311
|
* Stack Pointer and Stack Limit initialization refactored.Alexander Fedotov2019-07-232-89/+227
| | | | | | | | | SP initialization changes: 1. set default value in semihosting case as well 2. moved existing SP & SL init code for processor modes in separate routine and made it as "hook" 3. init SP for processor modes in Thumb mode as well Add new macro FN_RETURN, FN_EH_START and FN_EH_END.
* Set errno in expm1{,f} / log1p{,f}Jeff Johnston2019-07-094-6/+14
| | | | | | | | | | | | | 2019-07-09 Joern Rennecke <joern.rennecke@riscy-ip.com> * libm/common/s_expm1.c ("math_config.h"): Include. (expm1): Use __math_oflow to set errno. * libm/common/s_log1p.c ("math_config.h"): Include. (log1p): Use __math_divzero and __math_invalid to set errno. * libm/common/sf_expm1.c ("math_config.h"): Include. (expm1f): Use __math_oflow to set errno. * libm/common/sf_log1p.c ("math_config.h"): Include. (log1pf): Use __math_divzero and __math_invalid to set errno.
* sched: Move Cygwin cpuset definitions into Cygwin-specific headerCorinna Vinschen2019-06-271-18/+0
| | | | | | This avoids build breakage on RTEMS. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* or1k: Avoid write outside setjmp buf & shrink bufMartin Erik Werner2019-06-272-29/+32
| | | | | | | | | | | | Update the offsets used to save registers into the stejmp jmp_buf structure in order to: * Avoid writing the supervision register outside the buffer and thus clobbering something on the stack. Previously the supervision register was written at offset 124 while the buffer was of length 124. * Shrink the jmp_buf down to the size actually needed, by avoiding holes at the locations of omitted registers.
* or1k: Correct longjmp return valueMartin Erik Werner2019-06-271-1/+1
| | | | | | | | | | | Invert equality check instruction to correct the return value handling in longjmp. The return value should be the value of the second argument to longjmp, unless the argument value was 0 in which case it should be 1. Previously, longjmp would set return value 1 if the second argument was non-zero, and 0 if it was 0, which was incorrect.
* Support calculation of pointer size for __int20__ type in _intsup.hJozef Lawrynowicz2019-06-251-0/+4
| | | | | | | | | GCC r272640 modifies the MSP430 target to use "__int20__" for PTRDIFF_TYPE (and therefore INTPTR_TYPE) instead of "__int20". To support the calculation of pointer size in newlib/libc/include/sys/_intsup.h, definitions for __int20__ need to be added.
* Cygwin: Implement sched_[gs]etaffinity()Mark Geisert2019-06-241-0/+23
| | | | | | | | | This patch set implements the Linux syscalls sched_getaffinity, sched_setaffinity, pthread_getaffinity_np, and pthread_setaffinity_np. Linux has a straightforward view of the cpu sets used in affinity masks. They are simply long (1024-bit) bit masks. This code emulates that view while internally dealing with Windows' distribution of available CPUs among processor groups.
* Rename <xlocale.h> back to <sys/_locale.h>Corinna Vinschen2019-06-1411-13/+13
| | | | | | | | | | | | | | | | | | | libX11 provides <X11/Xlocale.h>. The build of libX11 itself adds include/X11 to the compiler's include path. This results in a name collision with /usr/include/xlocale.h on case-insensitive filesystems. Commit 90e35b1eb3df renamed sys/_locale.h to xlocale.h in March 2017 under the assumption that we should provide the locale_t type in the same file as on Linux, FreeBSD, and Darwin. A few weeks later (June 2017), glibc removed the xlocale.h file in favor of bits/types/locale_t.h, which shouldn't be included directly anyway. For reference and the reasoning, see https://sourceware.org/git/?p=glibc.git;a=commit;h=f0be25b6336d Given the above, revert 90e35b1eb3df4070e68afc5e7060665214d586be and fix additional usage of xlocale.h.
* Fix __getreent stack calculations for AMD GCNJeff Johnston2019-06-071-6/+6
| | | | | | | | From: Andrew Stubbs <ams@codesourcery.com> Fix a bug in which the high-part of 64-bit values are being corrupted, leading to erroneous stack overflow errors. The problem was only that the mixed-size calculations are being treated as signed when they should be unsigned.
* Add gfortran support for AMD GCNJeff Johnston2019-06-0710-3/+212
| | | | | | | | | | From: Kwok Cheung Yeung <kcy@codesourcery.com> This patch adds enough support for constructors/destructors and OS functions to be able to link and run gfortran programs on AMD GCN. There's no actual ability to do I/O operations on this targets, besides "write" to stdout and stderr, so most of the functions are just stubs.
* Mark inline functions with __unused;trasz2019-06-071-5/+5
| | | | | | | | | | prevents compiler warning when they end up being unused. Reviewed by: kib Obtained from: OpenBSD MFC after: 2 weeks Sponsored by: Klara Inc. Differential Revision: https://reviews.freebsd.org/D20185
* sys/sys: further adoption of SPDX licensing ID tags.pfg2019-06-071-0/+2
| | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts.
* Fix vfwscanf(3) assignment suppression flag handling bugLucio Andrés Illanes Albornoz2019-06-031-0/+1
| | | | | | | | | | | | | | newlib's vfwscanf(3) (or specifically, __SVFWSCANF_R()) fails to correctly set the assignment-suppressing character (`*') flag[1] which, when present in the formatting string, results in undefined behaviour comprising retrieving and dereferencing a pointer that was not supplied by the caller as such or at all. When compared to the vfscanf(3) implementation, this would appear to be over the missing goto match_failure statement preceded by the flags test seen below. Hence, this patch (re)introduces it. [1] <http://pubs.opengroup.org/onlinepubs/009695399/functions/fwscanf.html> --
* Fix <sys/_types.h> issues with <stddef.h>Sebastian Huber2019-06-032-5/+3
| | | | | | | | | | | | | | | | | | | | A commit from 2016 tried to address this GCC provided <stddef.h> issue #if (defined (__FreeBSD__) && (__FreeBSD__ >= 5)) \ || defined(__DragonFly__) \ || defined(__FreeBSD_kernel__) /* __size_t is a typedef on FreeBSD 5, must not trash it. */ #elif defined (__VMS__) /* __size_t is also a typedef on VMS. */ #else #define __size_t #endif with an include of <stddef.h> before <sys/_types.h> in <sys/types.h>. Is is not robust enough. Do the include of <stddef.h> in <sys/_types.h> directly and request only the necessary types. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Avoid <sys/cdefs.h> dependency in <sys/_types.h>Sebastian Huber2019-06-031-2/+7
| | | | | | Including <sys/cdefs.h> could result in cyclic header dependencies. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Avoid cyclic header dependenciesSebastian Huber2019-06-032-5/+5
| | | | | | | | | | | | RTEMS uses a considerable part of FreeBSD kernel and user space sources. These sources are compiled with a __FreeBSD__ define. On 2018-06-26 Gerald Pfeifer changed the GCC provided <stddef.h> so that it includes <sys/_types.h> if __FreeBSD__ is defined. The Newlib <sys/_types.h> included <sys/lock.h> which includes <sys/cdefs.h> on RTEMS which includes <stddef.h>. To get rid of this cyclic dependency move the optional _flock_t definition to <sys/reent.h>. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* RISC-V: Add size optimized memcpy, memmove, memset and strcmp.Jim Wilson2019-05-228-2/+146
| | | | | | | This patch adds implementations of memcpy, memmove, memset and strcmp optimized for size. The changes have been tested in riscv/riscv-gnu-toolchain by riscv-dejagnu with riscv-sim.exp/riscv-sim-nano.exp.
* Implement reduced code size "tiny" printf and putsJozef Lawrynowicz2019-04-156-428/+132
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "tiny" printf is derived from _vfprintf_r in libc/stdio/nano-vfprintf.c. "tiny" puts has been implemented so that it just calls write, without any other processing. Support for buffering, reentrancy and streams has been removed from these functions to achieve reduced code size. This reduced code size implementation of printf and puts can be enabled in an application by passing "--wrap printf" and "--wrap puts" to the GNU linker. This will replace references to "printf" and "puts" in user code with "__wrap_printf" and "__wrap_puts" respectively. If there is no implementation of these __wrap* functions in user code, these "tiny" printf and puts implementations will be linked into the final executable. The wrapping mechanism is supposed to be invisible to the user: - A GCC wrapper option such as "-mtiny-printf" will be added to alias these wrap commands. - If the user is unaware of the "tiny" implementation, and chooses to implement their own __wrap_printf and __wrap_puts, their own implementation will be automatically chosen over the "tiny" printf and puts from the library. Newlib must be configured with --enable-newlib-nano-formatted-io for the "tiny" printf and puts functions to be built into the library. Code size reduction examples: printf("Hello World\n") baseline - msp430-elf-gcc gcc-8_3_0-release text data bss 5638 214 26 "tiny" puts enabled text data bss 714 90 20 printf("Hello %d\n", a) baseline - msp430-elf-gcc gcc-8_3_0-release text data bss 10916 614 28 "tiny" printf enabled text data bss 4632 280 20
* Copy prerequisite file for "tiny" printf implementationJozef Lawrynowicz2019-04-151-0/+661
| | | | Use newlib/libc/stdio/nano-vfprintf.c as baseline for tiny-printf.c
* Align comments and spaces in libgloss/arm/crt0.S and ↵Alexander Fedotov2019-04-121-8/+10
| | | | newlib/libc/sys/arm/crt0.S to ease further code alignment.
* Include code in trap.S for APCS only.Christophe Lyon2019-04-111-1/+1
| | | | | | | | | | The code in trap.S is to support the old APCS chunked stack variant, which dates back to the Acorn days, so put it under #ifndef __ARM_EABI__. * libgloss/arm/trap.S: Use __ARM_EABI rather than PREFER_THUMB. * newlib/libc/sys/arm/trap.S: Use __ARM_EABI rather than __thumb2__.
* Make more macro checks ARMv8-M baseline proof.Christophe Lyon2019-04-111-4/+4
| | | | | | | | | | | | Commit 69f4c4029183fb26d2fcae00790881620c1978a3 improved most macro checks to be ARMv8-M baseline proof, but missed a few occurrences which otherwise fail to build when using a CPU setting such as cortex-m0 or cortex-m23. This patch brings the same changes as the ones that were committed to libgloss at that time. newlib: * libc/sys/arm/crt0.S: Use THUMB1_ONLY rather than __ARM_ARCH_6M__.
* Add missing includes.Andrew Stubbs2019-03-253-1/+4
| | | | | | These missing includes were causing build warnings, but also a real bug in which the "size" parameter to "write" was being passed in 32-bit, whereas it ought to be 64-bit. This led to intermittent bad behaviour.
* AMD GCN: Implement circular buffering.Andrew Stubbs2019-03-181-17/+38
| | | | | | | | | | | | | | | | | | | The GCN port outputs stdout and stderr via a shared-memory interface. Previously the buffer was limited to 1000 write operations, which was enough for testing purposes, but easy to exhaust. This patch implements a new circular buffering system allowing a greater amount of output. The interface must allow hundreds of hardware threads to output simultaneously. The new limit is UINT32_MAX write operations. Unfortunately, there's no way to tell if the host side has also been updated. This code will misbehave unless the gcn-run from GCC is also updated (although it's fine the other way around), but that patch has already been committed. OK? Andrew Stubbs Mentor Graphics / CodeSourcery