summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* newlib: vf[w]scanf: Use SIZE_MAX rather than ~0Corinna Vinschen2017-11-302-4/+4
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* newlib: vfscanf: fix formattingCorinna Vinschen2017-11-301-2/+2
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* newlib: vf[w]scanf: Only return from a single point to simplify cleanupCorinna Vinschen2017-11-302-4/+2
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* cygwin: export wmempcpyYaakov Selkowitz2017-11-303-1/+4
| | | | Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* string: add wmempcpyYaakov Selkowitz2017-11-305-38/+85
| | | | Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* cygwin: add Object Size Checking to sys/socket.hYaakov Selkowitz2017-11-302-0/+24
| | | | Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* cygwin: add Object Size Checking to sys/poll.hYaakov Selkowitz2017-11-302-0/+30
| | | | Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* RTEMS: Add semaphore <sys/lock.h> functionsSebastian Huber2017-11-301-0/+4
| | | | | | Declare semaphore try wait and post binary functions. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* RTEMS: Timed wait by ticks <sys/lock.h> functionsSebastian Huber2017-11-301-0/+16
| | | | | | Declare timed wait by ticks functions. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* RTEMS: Add set/get name <sys/lock.h> functionsSebastian Huber2017-11-301-1/+71
| | | | | | Add inline functions to set/get the name. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* cygwin: create libssp compatibility import libraryYaakov Selkowitz2017-11-291-1/+4
| | | | Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* cygwin: export SSP functionsYaakov Selkowitz2017-11-292-1/+25
| | | | Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* ssp: add build infrastructureYaakov Selkowitz2017-11-298-9/+798
| | | | Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* ssp: add documentationYaakov Selkowitz2017-11-293-0/+46
| | | | Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* ssp: add Object Size Checking for unistd.h, part 1Yaakov Selkowitz2017-11-292-0/+58
| | | | | | | | | The implementation is from NetBSD, with the addition of feature test macros for readlink. glibc also wraps the following functions: confstr, getdomainname, getgroups, gethostname, getlogin_r, getwd, pread, readlinkat, ttyname_r. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* ssp: add Object Size Checking for stdio.h, part 1Yaakov Selkowitz2017-11-297-0/+416
| | | | | | | | | The implementation is mostly from NetBSD, except for switching fgets to pure inline, and the addition of fgets_unlocked, fread, and fread_unlocked for parity with glibc. The following functions are also guarded in glibc: asprintf, dprintf, fprintf, printf, vasprintf, vdprintf, vfprintf, vprintf. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* ssp: add Object Size Checking for strings.hYaakov Selkowitz2017-11-292-0/+59
| | | | | | | The implementation is from NetBSD, with the addition of explicit_bzero for parity with glibc. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* ssp: add Object Size Checking for string.hYaakov Selkowitz2017-11-2912-0/+652
| | | | | | | The implementation is from NetBSD, with the addition of mempcpy (a GNU extension) for parity with glibc and libssp. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* ssp: add Object Size Checking common codeYaakov Selkowitz2017-11-293-1/+107
| | | | | | | | | | | | | | | | | The Object Size Checking (-D_FORTIFY_SOURCE=*) functionality provides wrappers around functions suspectible to buffer overflows. While independent from Stack Smashing Protection (-fstack-protector*), they are often used and implemented together. While GCC also provides an implementation in libssp, it is completely broken (CVE-2016-4973, RHBZ#1324759) and seemingly unfixable, as there is no reliable way for a preprocessor macro to trigger a link flag. Therefore, adding this here is necessary to make it work. Note that this does require building gcc with --disable-libssp and gcc_cv_libc_provides_ssp=yes. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* ssp: add APIs for Stack Smashing ProtectionYaakov Selkowitz2017-11-291-0/+45
| | | | | | | | | | Compiling with any of the -fstack-protector* flags requires the __stack_chk_guard data import (which needs to be initialized) and the __stack_chk_fail{,_local} functions. While GCC's own libssp can provide these, it is better that we provide these ourselves. The implementation is custom due to being OS-specific. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* newlib: [w]scanf: Fix behaviour on matching failureCorinna Vinschen2017-11-292-22/+3
| | | | | | | | | | | | | | | | The special handling of %\0 in [w]scanf is flawed. It's just a matching failure and should be handled as such. scanf also fakes an int input value on %X with X being an invalid conversion char. This is also just a matching failure and should be handled the same way as %\0. There's no indication of the reason for this "disgusting backwards compatibility hacks" in the logs, given this code made it into newlib before setting up the CVS repo. Just handle these cases identically as matching failures. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* cygserver: remove all asserts on "this"Corinna Vinschen2017-11-282-7/+0
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* cygwin: fix getconf after commit 032aa2dba5a5bf90c198d930c8d309b5de57cb47Yaakov Selkowitz2017-11-281-0/+1
| | | | Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* Make __nonnull macro compatible with glibcYaakov Selkowitz2017-11-284-5/+5
| | | | | | This form allows for multiple arguments, e.g. __nonnull((1,2)). Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* cygwin: define _POSIX_TIMEOUTSYaakov Selkowitz2017-11-282-2/+2
| | | | | | | | Since commit 8128f5482f2b1889e2336488e9d45a33c9972d11, we have all the non-tracing functions listed in posixoptions(7). The tracing functions are gated by their own option, and are obsolecent anyway. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* cygwin: don't allow empty strings in __ASMNAME tagsCorinna Vinschen2017-11-281-1/+1
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* cygwin: improve _EXFUN tags generationCorinna Vinschen2017-11-281-1/+2
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* cygwin: remove accidentally committed debug statmentsCorinna Vinschen2017-11-281-2/+0
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* cygwin: further improve tags generationCorinna Vinschen2017-11-282-1/+5
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Feature test macros overhaul: Cygwin limits.h, part 2Yaakov Selkowitz2017-11-281-2/+28
| | | | | | | http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/limits.h.html https://sourceware.org/ml/newlib/2017/msg01133.html Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* cygwin: convert most #ifndef __x86_64__ to #ifdef __i386__Corinna Vinschen2017-11-2727-140/+140
| | | | | | Address the real offender Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* cygwin: improve tags generationCorinna Vinschen2017-11-271-1/+4
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* cygwin: cleanup fhandler_socket::release_eventsCorinna Vinschen2017-11-271-7/+9
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Add the Aarch64 SVE specific HWCAP_SVE defineJeff Johnston2017-11-221-0/+1
| | | | | | Checking in change from Alan Hayward <Alan.Hayward@arm.com> Signed-off-by: Jeff Johnston <jjohnstn@redhat.com>
* RTEMS: Add missing __getreent() to crt0Sebastian Huber2017-11-201-0/+1
| | | | | | | Default implementation was removed for RTEMS by b1a388799dc98e6d1451fb73aa71097cbf9f37d9. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* RTEMS: Add missing functions to crt0Sebastian Huber2017-11-201-5/+10
| | | | | | This helps to get some more features from libstdc++. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Cygwin: pipe_data_available: cleanup codeCorinna Vinschen2017-11-151-27/+40
| | | | | | | | * Don't use a bool var to store three states (-1, 0, 1). * Correctly check for NT_SUCCESS of a function returning NTSTATUS. * Straighten out code for better readability. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: Add FAQ How do I fix find_fast_cwd warnings?Brian Inglis2017-11-151-0/+50
|
* Cygwin: open: Remove unused code to handle HIDDEN and SYSTEM filesCorinna Vinschen2017-11-141-8/+0
| | | | | | | | | | | | Commit 603ef545bdbdbf7495e1a0bbabffb8741fc2a5bb broke this snippet and commit 5b312b4747cc4acda39c187369c02fcea456513b didn't help at all since FILE_CREATE is exactly *not* the situation the test was originally supposed to handle. In fact, none of the open flags used by fhandler_base::open actually hits this problem anymore, so just drop the code. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: link: Simplify an expressionCorinna Vinschen2017-11-141-9/+4
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: Bump DLL version to 2.10.0, bump API minor to 319Corinna Vinschen2017-11-142-3/+6
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: fcntl.h: Use test macros to guard non-standard open flagsCorinna Vinschen2017-11-141-4/+12
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: fcntl.h: Define O_NOATIMECorinna Vinschen2017-11-141-0/+2
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: fcntl.h: Define O_TMPFILE and implement itCorinna Vinschen2017-11-144-3/+103
| | | | | | | | Difference to Linux: We can't create files which don't show up in the filesystem due to OS restrictions. As a kludge, make a (half-hearted) attempt to hide the file in the filesystem. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: open: cleanup code in preparation of O_TMPFILECorinna Vinschen2017-11-141-55/+53
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* newlib/libc/stdlib/realloc.c: fix variable nameFlorian Schmidt2017-11-141-1/+1
| | | | | | | | The variable doesn't follow the convention of having the same name as the function it's bundled with. Furthermore, it clashes with the variable of the same name in newlib/libc/stdlib/calloc.c. Signed-off-by: Florian Schmidt <florian.schmidt@neclab.eu>
* newlib/.../getreent.c: Allow to be provided by host and do so for RTEMSJoel Sherrill2017-11-132-2/+10
| | | | | | | RTEMS provides the option to have a global or per-thread reentrancy as part of application configuration. As part of this, RTEMS provides the implementation of __getreent() as appropriate. Allow the target to determine if this method is present in libc.a.
* cygwin: pread: Remove incorrect commentCorinna Vinschen2017-11-081-1/+1
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* cygwin: fhandler_disk_file::pread: always print debug info on returnCorinna Vinschen2017-11-081-2/+9
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* cygwin: pread() returns non-zero if read beyond EOFXiaofeng Liu2017-11-081-2/+5
| | | | | NtReadFile returns EOF status but doesn't set information to 0. Set return value explicitly on EOF.