summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Fix issue with malloc_extend_topJeff Johnston2018-05-291-1/+6
| | | | | | | | | - when calculating a correction to align next brk to page boundary, ensure that the correction is less than a page size - if allocating the correction fails, ensure that the top size is set to brk + sbrk_size (minus any front alignment made) Signed-off-by: Jeff Johnston <jjohnstn@redhat.com>
* fix llrint and lrint for 52 <= exponent <= 62Matthias Kannwischer2018-05-292-4/+4
|
* Fix 32-bit overflow in mktime() when time_t is 64-bits longFreddie Chopin2018-05-291-1/+1
| | | | | | | | | When converting number of days since epoch (32-bits) to seconds, calculations using 32-bit `long` overflow for years above 2038. Solve this by casting number of days to `time_t` just before final multiplication. Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
* Use _LDBL_EQ_DBL in nexttowardf.cJeff Johnston2018-05-071-2/+2
| | | | | | | 2018-05-07 Tom de Vries <tom@codesourcery.com> * libm/common/nexttowardf.c: Use _LDBL_EQ_DBL instead of _LDBL_EQ_DOUBLE.
* libgloss: microblaze: adjust handlers to be weak.Ben Levinsky2018-05-032-2/+4
| | | | | | | Previously, hw exception handler stub and interrupt handler stub for microbaze were unable to be overwritten. Change to weak to fix this. Signed-off-by: Ben Levinsky <ben.levinsky@xilinx.com>
* Cygwin: fix build with GCC 7Yaakov Selkowitz2018-04-161-9/+5
| | | | | | | GCC 7 is able to see straight through this trick, so use a more formal method to avoid the warning. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* Add nvptx port.Jeff Johnston2018-04-13132-113/+7504
| | | | | | | | | - From: Cesar Philippidis <cesar@codesourcery.com> Date: Tue, 10 Apr 2018 14:43:42 -0700 Subject: [PATCH] nvptx port This port adds support for Nvidia GPU's, which are primarily used as offload accelerators in OpenACC and OpenMP.
* Cygwin: fix guard checking for current user's AuthZ contextCorinna Vinschen2018-04-121-3/+7
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: add cuinof changes to release textCorinna Vinschen2018-04-111-0/+5
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: cpuinfo: Use active CPU count per groupCorinna Vinschen2018-04-111-20/+36
| | | | | | | | | There are systems with a MaximumProcessorCount not reflecting the actually available CPUs. The ActiveProcessorCount is correct though. So we use ActiveProcessorCount rather than MaximumProcessorCount per group to set group affinity correctly. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: wincap: expose more SYSTEM_INFO members and use as appropriateCorinna Vinschen2018-04-113-12/+10
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: cpuinfo: report L3 cache on Intel CPUsCorinna Vinschen2018-04-111-2/+3
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: add strtod fix to release notesCorinna Vinschen2018-04-091-0/+4
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* strtod: Convert 64 bit double to 64 bit int during computationCorinna Vinschen2018-04-091-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The gdtoa implementation uses the type long, defined as Long, in lots of code. For historical reason newlib defines Long as int32_t instead. This works fine, as long as floating point exceptions are not enabled. The conversion to 32 bit int can lead to a FE_INVALID situation. Example: const char *str = "121645100408832000.0"; char *ptr; feenableexcept (FE_INVALID); strtod (str, &ptr); This leads to the following situation in strtod double aadj; Long L; [...] L = (Long)aadj; For instance, on x86_64 the code here is cvttsd2si %xmm0,%eax At this point, aadj is 2529648000.0 in our example. The conversion to 32 bit %eax results in a negative int value, thus the conversion is invalid. With feenableexcept (FE_INVALID), a SIGFPE is raised. Fix this by always using 64 bit ints here if double is not a 32 bit type to avoid this type of FP exceptions. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* newlib: fix iswupper_l in !_MB_CAPABLE caseCorinna Vinschen2018-03-271-1/+1
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: AF_LOCAL: fix identifing abstract sockets in FS-related functionsCorinna Vinschen2018-03-261-6/+6
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: fix typo in accept on inet and local socketsCorinna Vinschen2018-03-262-2/+2
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* comments to document struct caseconv_entryThomas Wolff2018-03-261-3/+33
| | | | | explain design of compact (packed) struct caseconv_entry, in case it needs to be modified for future Unicode versions
* newlib: fix indentation in toulowerThomas Wolff2018-03-261-10/+10
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: delete /dev/kmsg and thus fhandler_mailslot without substitutionCorinna Vinschen2018-03-2513-1042/+623
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: AF_UNIX: Redesign various aspectsCorinna Vinschen2018-03-182-190/+442
| | | | | | | | | | | | | | | | | * Change set_socket_type/get_socket_type to virtual methods * Move various variables into af_unix_shmem_t * Change sun_name_t to match new usage pattern * Move shut_state definition and add a name for the 0 value * Allow marking packet as administrative packet. This allows filtering out info packets exchange between peers and tweak data accordingly. * Rename send_my_name to send_sock_info and send credentials if not called from bind (so the socket was already connected) * Handle SO_PASSCRED in setsockopt/getsockopt * Add input size checking to setsockopt/getsockopt * Use NT functions where appropriate Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: ntdll.h: Define FSCTL_PIPE_PEEK and NtWaitForSingleObjectCorinna Vinschen2018-03-181-1/+4
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: AF_UNIX: Add state_lock to guard manipulating shared state infoCorinna Vinschen2018-03-182-0/+9
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: AF_UNIX: Use spinlock rather than SRWLOCKsCorinna Vinschen2018-03-181-17/+39
| | | | | | | | We need to share socket info between threads *and* processes. SRWLOCKs are single-process only, unfortunately. Provide a sharable low-profile spinlock instead. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: tags: drop _EXFUN regexCorinna Vinschen2018-03-171-2/+0
| | | | | | _EXFUN has been removed a while back Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Reduce qsort stack consumptionHakan Lindqvist2018-03-161-6/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Classical function call recursion wastes a lot of stack space. Each recursion level requires a full stack frame comprising all local variables and additional space as dictated by the processor calling convention. This implementation instead stores the variables that are unique for each recursion level in a parameter stack array, and uses iteration to emulate recursion. Function call recursion is not used until the array is full. To ensure the stack consumption isn't worsened by this design, the size of the parameter stack array is chosen to be similar to the stack frame excluding the array. Each function call recursion level can handle 8 iterative recursion levels. Stack consumption will worsen when sorting tiny arrays that do not need recursion (of 6 elements or less). It will be about equal for up to 15 elements, and be an improvement for larger arrays. The best case improvement is a stack size reduction down to about one quarter of the stack consumption before the change. A design where the parameter stack array is large enough for the worst case recursion level was rejected because it would worsen the stack consumption when sorting arrays smaller than about 1500 elements. The worst case is 31 levels on a 32-bit system. A design with a dynamic parameter array size was rejected because of limitations in some compilers.
* Ensure qsort recursion depth is boundedHakan Lindqvist2018-03-161-12/+56
| | | | | | | | | | | | | | The qsort algorithm splits the input array in three parts. The left and right parts may need further sorting. One of them is sorted by recursion, the other by iteration. This update ensures that it is the smaller part that is chosen for recursion. By choosing the smaller part, each recursion level will handle less than half the array of the previous recursion level. Hence the recursion depth is bounded to be less than log2(n) i.e. 1 level per significant bit in the array size n. The update also includes code comments explaining the algorithm.
* Correct prototypes of pthread_mutex_getprioceiling() and pthread_setschedparam()Joel Sherrill2018-03-151-2/+2
|
* [arm] Fix syscalls.c for newlib embedded syscalls buildsRichard Earnshaw2018-03-151-119/+126
| | | | | | | | | | | | | | | | | | Newlib has a build configuration where syscalls can be directly embedded in the newlib library rather than relying on libgloss. This configuration was broken recently by an update to the libgloss support for Arm that was not propagated to the syscalls interface in newlib itself. This patch restores the build. It's essentially a copy of https://sourceware.org/ml/newlib/2018/msg00128.html but there are some other minor cleanups and changes that I've made at the same time. None of those cleanups affect functionality. The prototypes of the following functions have been updated: _link, _sbrk, _getpid, _write, _swiwrite, _lseek, _swilseek, _read and _swiread. Signed-off-by: Richard Earnshaw <Richard.Earnshaw@arm.com>
* ssp: fix wchar.h with -std=c99Yaakov Selkowitz2018-03-141-2/+2
| | | | | | https://sourceware.org/ml/newlib/2018/msg00261.html Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* Fix alloc_align and alloc_size macros for multiple argumentsYaakov Selkowitz2018-03-142-4/+4
| | | | | | | | https://sourceware.org/ml/newlib/2018/msg00263.html This is a follow-up to commit 4564b30f331a067e71b25308ac7c8a85ceb4b122. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* ctype: align size of category bit fields to small targets needsCorinna Vinschen2018-03-141-2/+2
| | | | | | | | | | | | | | | | E.g. arm ABI requires -fshort-enums for bare-metal toolchains. Given there are only 29 category enums, the compiler chooses an 8 bit enum type, so a size of 11 bits for the bitfield leads to a compile time error: error: width of 'cat' exceeds its type enum category cat: 11; ^~~ Fix this by aligning the size of the category members to byte borders. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Revert "ctype: align size of category bit fields to small targets needs"Corinna Vinschen2018-03-143-214/+136
| | | | | | This reverts commit e98d3eb3eb9b6abd897e102031a14b7057641a65. It has accidentally included some work in progress.
* fix/enhance Unicode table generation scriptsThomas Wolff2018-03-142-18/+53
| | | | | | | | | | | Scripts do not try to acquire Unicode data by best-effort magic anymore. Options supported: -h for help -i to copy Unicode data from /usr/share/unicode/ucd first -u to download Unicode data from unicode.org first If (despite of -i or -u if given) the necessary Unicode files are not available locally, table generation is skipped, but no error code is returned, so not to obstruct the build process if called from a Makefile.
* ctype: align size of category bit fields to small targets needsCorinna Vinschen2018-03-143-136/+214
| | | | | | | | | | | | | | | | E.g. arm ABI requires -fshort-enums for bare-metal toolchains. Given there are only 29 category enums, the compiler chooses an 8 bit enum type, so a size of 11 bits for the bitfield leads to a compile time error: error: width of 'cat' exceeds its type enum category cat: 11; ^~~ Fix this by aligning the size of the category members to byte borders. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* towctrans_l: Always return a value from helper functionsCorinna Vinschen2018-03-131-19/+49
| | | | | | | | | | | | touupper and toulower didn't return a value in all cases. Worse, this only broke Cygwin when building without optimization for debug purposes. Why GCC neglects to notice this is a mystery. While at it, fix formatting. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* rtems/.../dirent.h: Add alphasort() prototypeJoel Sherrill2018-03-131-0/+1
|
* Correct alloc_size annotation on reallocarray()Jon Turney2018-03-131-2/+1
| | | | Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
* Cygwin: mark muto object as NO_COPYCorinna Vinschen2018-03-121-1/+1
| | | | | | muto in smallprint.cc is missing a NO_COPY. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: AF_UNIX: store per-socket info in shared memoryCorinna Vinschen2018-03-124-80/+238
| | | | | | | | | | | | | | | Per-socket info in fhandler isn't correctly shared between multiple instances of th same descriptor. Implement a basic shared info which is shared between all instances of a socket. This also requires to move the fhandler_socket status bits into fhandler_socket_wsock since the data is moved to the shared region for AF_UNIX sockets. Also, drop backing file requirement for socketpair server socket. This will be handled differently in recvmsg/sendmsg. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* make target for explicit Unicode data tables generationThomas Wolff2018-03-121-0/+9
| | | | | Run 'make unidata' in newlib target directory to generate Unicode data tables for libc functions wcwidth, tow* and isw*.
* character data generationThomas Wolff2018-03-123-0/+237
|
* use generated character dataThomas Wolff2018-03-1238-2681/+439
| | | | | | | | | | | The tow* functions use an included case conversion table which can be generated from Unicode data. The isw* functions use a character categories table (provided by categories.c) which can be generated from Unicode data. Delegation between current-locale and specific-locale-dependent functions was reverted towards the generic locale-dependent functions (*_l.c); this is however only relevant on systems with non-Unicode wide character locales, thus not on Cygwin.
* generated character category data, Unicode 10.0Thomas Wolff2018-03-122-0/+2115
| | | | | | Table categories.t and tag enumeration categories.cat provide character class data for most of the isw* functions. These data are generated from Unicode data.
* generated case conversion data, Unicode 10.0Thomas Wolff2018-03-121-0/+304
| | | | | | Table caseconv.t provides case conversion data for the tow* functions, especially towupper and towlower. These data are generated from Unicode data.
* width data generationThomas Wolff2018-03-125-0/+1388
|
* use generated width dataThomas Wolff2018-03-121-126/+24
|
* generated width data, Unicode 10.0Thomas Wolff2018-03-123-0/+201
| | | | | These tables provide character width properties for use by the wcwidth/wcswidth functions. They are generated from Unicode.
* Cygwin: AF_UNIX: fix up thread parameter block allocationCorinna Vinschen2018-03-111-3/+4
| | | | | | | * don't abort on failing allocation, just return with error * make sure the allocation is restricted to a single process Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: AF_UNIX: use get_unique_id to create pipe nameCorinna Vinschen2018-03-111-1/+1
| | | | | | | It's the same as get_plain_ino in this case, but it's cleaner and easier to understand. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>