summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [ARM] Make _kill() a noreturn function.Christophe Lyon2018-10-083-9/+14
| | | | | | | | | | | | | | AngelSWI_Reason_ReportException does not return accoring to the ARM documentation, so it is valid to mark _kill() as noreturn. This way, the compiler does not warn about _exit() returning a value despite being noreturn. 2018-10-01 Christophe Lyon <christophe.lyon@linaro.org> * libgloss/arm/_exit.c (_exit): Declare _kill() as noreturn. * libgloss/arm/_exit.c (_kill): Likewise. Remove the return statements. * newlib/libc/sys/arm/syscalls.c (_kill): Likewise..
* Define _COMPILING_NEWLIB on aarch64 to define function prototypes from unistd.h.Christophe Lyon2018-10-051-0/+3
| | | | | | 2018-10-01 Christophe Lyon <christophe.lyon@linaro.org> * newlib/configure.host: Define _COMPILING_NEWLIB for aarch64.
* [Aarch64] Fix warning in _sbrkChristophe Lyon2018-10-051-1/+1
| | | | | | | 2018-10-01 Christophe Lyon <christophe.lyon@linaro.org> * libgloss/aarch64/syscalls.c (_sbrk): Cast "__heap_limit" to "char *".
* [ARM] Cast string pointers to int to avoid compiler warnings.Christophe Lyon2018-10-051-4/+4
| | | | | | | | 2018-10-01 Christophe Lyon <christophe.lyon@linaro.org> * newlib/libc/sys/arm/syscalls.c (_unlink): Cast 'path' to int. (_system): Cast 's' to int. (_rename): Cast 'newpath' and 'oldpath' to int.
* Update Arm copyright notices in new math filesWilco Dijkstra2018-09-2826-47/+79
| | | | | | | | While working on the strstr patch I noticed several copyright headers of the new math functions are missing closing quotes after ``AS IS. I've added these. Also update spellings of Arm Ltd in a few places (but still use ARM LTD in upper case portion). Finally add SPDX identifiers to make everything consistent.
* Update Arm entry in COPYING.NEWLIB.Jeff Johnston2018-09-251-2/+2
| | | | | | | - per Wilco Dijkstra's patch - update Arm copyright notice to not exclude AArch64 and the various generic contributions made (like the new math functions). Also update the date and change spelling to Arm Ltd.
* Fix the documentation comment of checkintSzabolcs Nagy2018-09-182-2/+4
| | | | checkint in pow is not supposed to be used with 0, inf or nan inputs.
* Committed, CRIS port: fix fallout from time_t defaulting to 64 bits, part 2Hans-Peter Nilsson2018-09-131-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | It's been a while... I see the CRIS port broke with the time_t-default-to-64-bit change, observable by a few test-cases in the gcc fortran(!) tests failing, regressing when trying a recent newlib. This is a two-part belt-and-suspenders change: adjust the CRIS port gettimeofday syscall (the only one in newlib/CRIS passing a time_t or struct timeval) to handle a userspace 64-bit time_t and secondly default time_t to 32-bit long anyway. I considered making the local "kernel_timeval" copy in _gettimeofday conditional on (userspace) time_t being 64 bits, but thought it not worth bothering with the few move insns. The effect of a 64-bit time_t is however observable as longer simulation time when running the gcc testsuite and as bigger binaries without any actual upside from the larger time_t size, so I thought better make the default for this port go back to being a "long" again. Tested by running the gcc testsuite over the three combinations of two parts of the patch and observing the expected changes. Committed. newlib: * configure.host (cris, crisv32): Default to "long" time_t. Signed-off-by: Hans-Peter Nilsson <hp@axis.com>
* Committed, CRIS port: fix fallout from time_t defaulting to 64 bits, part 1Hans-Peter Nilsson2018-09-132-5/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's been a while... I see the CRIS port broke with the time_t-default-to-64-bit change, observable by a few test-cases in the gcc fortran(!) tests failing, regressing when trying a recent newlib. This is a two-part belt-and-suspenders change: adjust the CRIS port gettimeofday syscall (the only one in newlib/CRIS passing a time_t or struct timeval) to handle a userspace 64-bit time_t and secondly default time_t to 32-bit long anyway. I considered making the local "kernel_timeval" copy in _gettimeofday conditional on (userspace) time_t being 64 bits, but thought it not worth bothering with the few move insns. The effect of a 64-bit time_t is however observable as longer simulation time when running the gcc testsuite and as bigger binaries without any actual upside from the larger time_t size, so I thought better make the default for this port go back to being a "long" again. Tested by running the gcc testsuite over the three combinations of two parts of the patch and observing the expected changes. Committed. libgloss: Adjust for syscall and userspace having different time_t or timeval. * cris/linunistd.h (kernel_time_t, kernel_suseconds_t, kernel_timeval): New types. (gettimeofday): Change the type of the first argument to be a pointer to a struct kernel_timeval. * cris/gensyscalls (_gettimeofday): Use an intermediate struct kernel_timeval for the syscall and initialize the result from that. Signed-off-by: Hans-Peter Nilsson <hp@axis.com>
* Cygwin: console: make sure EnumFontFamiliesExW loop isn't infiniteCorinna Vinschen2018-09-071-2/+8
| | | | | | | | The current loop condition is borderline. Make sure it ends and choose a replacement char in the unlikely case the current console font isn't recognized at all. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: console: store replacement char directlyCorinna Vinschen2018-09-071-4/+3
| | | | | | | Rather than relying on an index variable, store the current replacement char and use that directly in WriteConsoleW. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: console: don't hang in check_font with raster fontsCorinna Vinschen2018-09-071-2/+2
| | | | | | | EnumFontFamiliesExW fails if the font is "Terminal" (aka "Raster Fonts") and lfCharSet requests ANSI_CHARSET. Using DEFAULT_CHARSET fixes this. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* search: Fix Berkeley DB hash code for 16-bit targets.Jon Beniston2018-09-063-20/+32
| | | | | | | | hash.h: Use 32-bit type for data stored on disk, so code works for 16 and 64-bit targets. Reduce maximum bucket size on 16-bit targets, so it fits in available memory. hash.c: Check bucket size isn't too big for target. hash_buf.c: Fix overflow warning on 16-bit targets.
* Use !__HAVE_LOCALE_INFO__ define to use _ctype_ directly [v2]Keith Packard2018-09-063-0/+19
| | | | | | | | | | | | | | | | | | When __HAVE_LOCALE_INFO__ is not selected, directly access the existing _ctype_ variable from __locale_ctype_ptr() and __locale_ctype_ptr_l(), eliminating the need for any locale or reent structure Signed-off-by: Keith Packard <keithp@keithp.com> v2: locale: fix conflict with __locale_ctype_ptr macro If we are building without __HAVE_LOCALE_INFO__, there is a macro providing __locale_ctype_ptr which in turn fouls up this declaration. Signed-off-by: Michael Lyle <mlyle@lyle.org>
* stdlib: Use __get_numeric_locale instead of __localeconv_l for decimal_pointKeith Packard2018-09-065-13/+14
| | | | | | | | | The string/float conversion functions need to get the locale decimal point. Instead of calling __localeconv_l (which copies locale data into lconv form from __get_numeric_locale), use __get_numeric_locale directly. Signed-off-by: Keith Packard <keithp@keithp.com>
* Include sys/syslimits.h in limits.hKeith Packard2018-09-061-0/+1
| | | | | | | | | | This makes sure any system-defined limits are specified before the defaults are checked. Without this, ARG_MAX and PATH_MAX end up getting the default definitions from limits.h rather than the defines from syslimits.h. This could potentially cause problems when different files used different values for the same name. Signed-off-by: Keith Packard <keithp@keithp.com>
* xdr_private.h needs sys/types.h for u_charKeith Packard2018-09-061-0/+1
| | | | | | | u_char is defined in sys/types.h, which doesn't appear to get included, at least in my environments. Signed-off-by: Keith Packard <keithp@keithp.com>
* Document the log table generation methodSzabolcs Nagy2018-09-063-0/+74
| | | | Add comments with enough detail so the log lookup tables can be recreated.
* stdlib/arc4random.c: Fix reseed count for 16-bit targets.Jon Beniston2018-09-061-1/+1
|
* Cygwin: console: device context is process privateCorinna Vinschen2018-09-061-1/+1
| | | | | | | Make sure device context is not copied to forked process. It is a process-specific datastructure. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: console: improve replacement char algorithmCorinna Vinschen2018-09-052-3/+99
| | | | | | | | | | | | | | Try various Unicode characters which may be used as a replacement character in case an invalid character has to be printed. Current list is 0xfffd "REPLACEMENT CHARACTER", 0x25a1 "WHITE SQUARE", and 0x2592 "MEDIUM SHADE" in that order. Additionally workaround a problem with some fonts (namely DejaVu Sans Mono) which are returned wit ha broken fontname with trailing stray characters. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: console: use UNICODE API throughoutCorinna Vinschen2018-09-051-6/+6
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: Bump DLL version to 2.11.2Corinna Vinschen2018-09-051-1/+1
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Improve strstr performance of short needlesWilco Dijkstra2018-09-051-10/+65
| | | | | | | | Improve strstr performance for the common case of short needles. For a single character strchr is best, for 2-4 characters a small loop is fastest. For these the speedup over the Two-Way algorithm is ~10 times on large strings. Newlib builds, the new code passes GLIBC testsuite. OK for commit?
* math_config.h: Fix signed overflow warning for 16-bit targetscygwin-2_11_1-releaseJon Beniston2018-09-031-1/+1
|
* e_scalb.c: Call scalbln instead of scalbn on 16-bit targets to ensure ↵Jon Beniston2018-09-031-0/+5
| | | | constant fits in an int.
* Avoid ARM SWI Seek when querying file positionAndy Koppe2018-09-031-2/+9
| | | | | | | | | | | | | | | | | | | Issuing an ARM semi-hosting Seek command when just querying file position with SEEK_CUR and offset zero is unnecessary, because unlike the lseek() Unix system call the Seek command does not actually return the file position. For that reason, syscalls.c for ARM keeps track of file position in the 'poslog', so we can just return that. Moreover, since the Seek command only accepts an absolute file position, SEEK_CUR operations are implemented by adding the relative offset to the position in the poslog. If the host implements non-binary files with implicit carriage return characters but doesn't discount those implicit CRs when implementing Seek (by just mapping straight to Windows file operations), this actually ended up wrongly changing file position when using SEEK_CUR with offset zero or functions like ftell() or fgetpos() that are based on that. Also, use off_t rather than int for the poslog.
* Cygwin: console: Print Unicode REPLACEMENT CHARACTER for invalid input charsCorinna Vinschen2018-09-011-4/+3
| | | | | | | | So far we printed a half filled square (0x2592) if the input char is invalid, but using REPLACEMENT CHARACTER (0xfffd) is apparently the way to go. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: fix Win32 path ".." backtrackingCorinna Vinschen2018-09-012-5/+29
| | | | | | | | | | | | | Commit 35998fc2fa6cbb7d761f6d88346246bd3627552b fixed the buffer underun in win32 path normalization, but introduced a new bug: A wrong assumption led to the inability to backtrack the path outside of the current working directory in case of relative paths. This patch fixes this problem, together with a minor problem if the CWD is on a network share: The result erroneously started with tripple backslash if the src path starts with a single backslash. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Add --disable-newlib-fno-builtin to allow compilation without -fno-builtin ↵newlib-snapshot-20180831Jon Beniston2018-08-31102-228/+1436
| | | | for smaller and faster code.
* Cygwin: Bump DLL version to 2.11.1Corinna Vinschen2018-08-311-1/+1
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Drop non-reserved parameter names from sys/signal.hcygwin-2_11_0-releaseAndy Koppe2018-08-291-8/+7
| | | | | | Standard headers shouldn't use non-reserved identifiers as parameter names in function declarations, because programs could in theory define macros with such names before including a header.
* Use __inhibit_loop_to_libcall in all memset/memcpy implementationsKeith Packard2018-08-2910-2/+28
| | | | | | | | This macro selects a compiler option that disables recognition of common memset/memcpy patterns and converting those to direct memset/memcpy calls. Signed-off-by: Keith Packard <keithp@keithp.com>
* Remove unused variable 'one' from sf_cos.cKeith Packard2018-08-291-6/+0
| | | | | | Defined, never mentioned. Signed-off-by: Keith Packard <keithp@keithp.com>
* Use nanf("") instead of nanf(NULL)Keith Packard2018-08-295-8/+8
| | | | | | | Newer GCC versions require a non-NULL argument to this function for some reason. Signed-off-by: Keith Packard <keithp@keithp.com>
* RISC-V: Fix _sbrk, it's failed only when return value is -1.Denis Ivanov2018-08-292-7/+12
| | | | Signed-off-by: Kito Cheng <kito.cheng@gmail.com>
* RISC-V: Fixed return code in _times syscall.Denis Ivanov2018-08-291-2/+2
| | | | | | | | Upon successful completion, times() shall return the elapsed real time, in clock ticks, since an arbitrary point in the past (for example, system start-up time). Signed-off-by: Kito Cheng <kito.cheng@gmail.com>
* Cygwin: Accommodate logon sessions on Windows 10Corinna Vinschen2018-08-282-1/+34
| | | | | | | | | Starting with Windows 10, LookupAccountSid/Name return valid info for the login session with new SID_NAME_USE value SidTypeLogonSession. To return the same info as on pre-Windows 10, we have to handle this type. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: drop workaround for missing USER_INFO_24 definitionCorinna Vinschen2018-08-281-13/+1
| | | | | | Recent mingw64 provide USER_INFO_24 Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: add release note for previous ACL changesCorinna Vinschen2018-08-271-0/+4
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: Add name->SID conversion for self-constructed namesCorinna Vinschen2018-08-272-9/+116
| | | | | | ...as far as it makes sense. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: don't return valid acl entry type for unknown SIDCorinna Vinschen2018-08-271-3/+9
| | | | | | | | | | | cygpsid::get_id neglects to set the type to 0 (ACL_UNDEFINED_TAG in POSIX speak) if the SID can not be translated into a valid uid or gid. This in turn leads to incorrect handling of uid/gid -1 entries. Fix this by setting type to 0 if the id is unknown. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: Remove union waitCorinna Vinschen2018-08-244-82/+23
| | | | | | | | | | | | | | | | This patch follows glibc. Original commit message: Author: Florian Weimer <fweimer@redhat.com> Date: Thu, 14 Apr 2016 06:54:57 +0000 Remove union wait [BZ #19613] The overloading approach in the W* macros was incompatible with integer expressions of a type different from int. Applications using union wait and these macros will have to migrate to the POSIX-specified int status type. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* RTEMS: Add kvaddr_t and ksize_tSebastian Huber2018-08-241-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | These types were introduced by FreeBSD commit: "Make struct xinpcb and friends word-size independent. Replace size_t members with ksize_t (uint64_t) and pointer members (never used as pointers in userspace, but instead as unique idenitifiers) with kvaddr_t (uint64_t). This makes the structs identical between 32-bit and 64-bit ABIs. On 64-bit bit systems, the ABI is maintained. On 32-bit systems, this is an ABI breaking change. The ABI of most of these structs was previously broken in r315662. This also imposes a small API change on userspace consumers who must handle kernel pointers becoming virtual addresses. PR: 228301 (exp-run by antoine) Reviewed by: jtl, kib, rwatson (various versions) Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D15386" In RTEMS, there is no user/kernel space separation. So, use the types size_t and uintptr_t. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* RTEMS: Introduce <machine/_kernel_mman.h>Sebastian Huber2018-08-241-48/+5
| | | | | | This helps to avoid Newlib updates due to FreeBSD kernel space changes. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* RTEMS: Introduce <machine/_kernel_socket.h>Sebastian Huber2018-08-241-54/+3
| | | | | | This helps to avoid Newlib updates due to FreeBSD kernel space changes. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* RTEMS: Introduce <machine/_kernel_if.h>Sebastian Huber2018-08-241-7/+4
| | | | | | This helps to avoid Newlib updates due to FreeBSD kernel space changes. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* RTEMS: Introduce <machine/_kernel_in.h>Sebastian Huber2018-08-241-26/+4
| | | | | | This helps to avoid Newlib updates due to FreeBSD kernel space changes. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* RTEMS: Introduce <machine/_kernel_in6.h>Sebastian Huber2018-08-241-163/+7
| | | | | | This helps to avoid Newlib updates due to FreeBSD kernel space changes. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* RTEMS: Introduce <machine/_kernel_uio.h>Sebastian Huber2018-08-241-54/+6
| | | | | | This helps to avoid Newlib updates due to FreeBSD kernel space changes. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>