summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Cygwin: fegetenv() should not disable exceptionsJ.H. van de Water2018-08-031-1/+5
| | | | | | | | | | | | | | | fnstenv MUST be followed by fldenv in fegetenv(), as the former disables all exceptions in the x87 FPU, which is not appropriate here (fegetenv() ). fldenv after fnstenv should reload the x87 FPU w/ the configuration that was saved by fnstenv, i.e. a configuration that might have exceptions enabled. Note: x86_64 uses SSE for floating-point, not the x87 FPU. However, because feraiseexcept() attempts to provoke an exception using the x87 FPU, the bug in fegetenv() will make this attempt futile here (x86_64). Note: WoW uses the x87 FPU for floating-point, not SSE. Here anything that would normally result in triggering an exception, not only feraiseexcept(), will not be able to, as result of the bug in fegetenv().
* Patch from Richard Earnshaw <Richard.Earnshaw@arm.com>newlib-snapshot-20180802Jeff Johnston2018-08-011-4/+8
| | | | | * aarch64/cpu-init/rdimon-aem-el3.S (cpu_init_hook): Simplify entry/exit sequences. Add CFI unwind rules.
* RISC-V: Do not use _init/_finiSebastian Huber2018-07-304-11/+16
| | | | | | | Introduce new host configuration variable "have_init_fini" which is set to "yes" by default. Override it for RISC-V to "no". Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Add attributes to allocator functionsSebastian Huber2018-07-301-4/+5
| | | | Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* FreeBSD compat. __alloc_size(), __alloc_align()Sebastian Huber2018-07-302-5/+5
| | | | | | | | Restore FreeBSD compatibility for __alloc_size() and __alloc_align(). This is a follow-up to commit e494b560350cabef94126a4478096aae89ae35a0. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Define a new __alloc_size2 attribute to complement the exiting support.pfg2018-07-301-0/+2
| | | | | | | | | | | | | At least on GCC7 calling __alloc_size(x) twice is not equivalent to calling using the attribute once with two arguments. The later is the documented use in GCC documentation so add a new alloc_size(n, x) alternative to cover for the few places where it is used: basically: calloc(3), reallocarray(3) and mallocarray(9). Submitted by: Mark Millard MFC after: 3 days Reference: http://docs.freebsd.org/cgi/mid.cgi?F227842D-6BE2-4680-82E7-07906AF61CD7
* Remove lint support from system headers and MD x86 headers.kib2018-07-301-15/+3
| | | | | | | Reviewed by: dim, jhb Discussed with: imp Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D13156
* sys: further adoption of SPDX licensing ID tags.pfg2018-07-301-0/+2
| | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. 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. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point.
* Make _Static_assert() work with GCC in older C++ standards.ed@FreeBSD.org2018-07-301-1/+1
| | | | | | | | | | | GCC only activates C11 keywords in C mode, not C++ mode. This means that when targeting an older C++ standard, we cannot fall back to using _Static_assert(). In this case, do define _Static_assert() as a macro that uses a typedef'ed array. Discussed in: r322875 commit thread Reported by: Mark MIllard MFC after: 1 month
* ctype: Avoid GCC note in towctrans_l.cSebastian Huber2018-07-301-2/+2
| | | | | | | | | | The previous version genenerated the following GCC note: towctrans_l.c:44:1: note: offset of packed bit-field 'diff' has changed in GCC 4.4 caseconv_table [] = { ^~~~~~~~~~~~~~ Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* ctype: Fix integer type for caseconv_entry::deltaSebastian Huber2018-07-301-1/+1
| | | | | | | | | | | | | | | The commit 46ba1675c457324b0eeef4670a09101ef3f34c50 accidently changed a bit-field from signed to unsigned. The caseconv_entry::delta must be a signed integer, see also "newlib/libc/ctype/caseconv.t". Unfortunately, a standard GCC/Newlib build is done without -Wsign-conversion. Using this warning option would have helped to avoid this bug: caseconv.t:2:22: warning: unsigned conversion from 'int' to 'unsigned int:17' changes value from '-32' to '131040' [-Wsign-conversion] {0x0061, 25, TOUP, -32}, Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Fix comparison between two character arraysJordi Sanfeliu2018-07-301-1/+1
| | | | | | | Hello, The member 'id' in the 'utmp' struct is not a numeric but a character array, hence the strncmp() function is needed to compare two members.
* Cygwin: fpathconf: update _PC_ASYNC_IO return valueYaakov Selkowitz2018-07-251-0/+1
| | | | Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* Cygwin: define _POSIX_ASYNCHRONOUS_IOYaakov Selkowitz2018-07-252-2/+2
| | | | | | This feature is now available as of the recent AIO commits. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* POSIX Asynchronous I/O support: other filesMark Geisert2018-07-2510-26/+44
| | | | | | Updates to misc files to integrate AIO into the Cygwin source tree. Much of it has to be done when adding any new syscalls. There are some updates to limits.h for AIO-specific limits. And some doc mods.
* POSIX Asynchronous I/O support: fhandler filesMark Geisert2018-07-254-34/+83
| | | | | | | | | | | This code is where the AIO implementation is wired into existing Cygwin mechanisms for file and device I/O: the fhandler* functions. It makes use of an existing internal routine prw_open to supply a "shadow fd" that permits asynchronous operations on a file the user app accesses via its own fd. This allows AIO to read or write at arbitrary locations within a file without disturbing the app's file pointer. (This was already the case with normal pread|pwrite; we're just adding "async" to the mix.)
* POSIX Asynchronous I/O support: aio filesMark Geisert2018-07-252-0/+1087
| | | | | | This is the core of the AIO implementation: aio.cc and aio.h. The latter is used within the Cygwin DLL by aio.cc and the fhandler* modules, as well as by user programs wanting the AIO functionality.
* getfacl: Simplify by using acl_to_any_textKen Brown2018-07-251-113/+41
|
* getfacl and setfacl: Align with LinuxKen Brown2018-07-232-9/+9
| | | | | | Make getfacl print two colons instead of one after "other" and "mask". Change the help text for setfacl to indicate that there can be either one colon or two.
* ctype: Fix bitfield types on 16-bit targetsnewlib-snapshot-20180720Sebastian Huber2018-07-202-6/+8
| | | | | | | | | | This prevents errors like this: newlib/libc/ctype/categories.c:6:3: error: width of 'first' exceeds its type unsigned int first: 24; ^ Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Cygwin: move FP environment exports to common.dinCorinna Vinschen2018-07-203-2/+5
| | | | | | We only have the symbols defined for i686 by accident since 2013... Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* RTEMS: Unconditionally define _off_t to int64_tSebastian Huber2018-07-201-4/+0
| | | | | | | Exotic RTEMS targets can define this back to int32_t as an exception if there are good reasons. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Remove myself from MAINTAINERSDJ Delorie2018-07-191-4/+1
| | | | Stepping down from target-specific maintainerships.
* fix duration handling in sigtimedwaitMark Geisert2018-07-192-0/+5
|
* Print sign of NaN values to nano-vfprintf.Kumar Gala2018-07-171-0/+2
| | | | Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
* Fix to stop a fall-through in a switch statementJordi Sanfeliu2018-07-131-0/+1
| | | | | The following fixes a fall-through that prevented from reading the next entry in the UTMP file and terminated the program with an abort().
* strcmp.S: Improve performance for misaligned stringsSiddhesh Poyarekar2018-07-131-11/+40
| | | | | | | | | | | Replace the simple byte-wise compare in the misaligned case with a dword compare with page boundary checks in place. For simplicity I've chosen a 4K page boundary so that we don't have to query the actual page size on the system. This results in up to 3x improvement in performance in the unaligned case on falkor and about 2.5x improvement on mustang as measured using bench-strcmp in glibc.
* memcmp.S: optimize for medium to large sizesSiddhesh Poyarekar2018-07-131-44/+100
| | | | | | | | | | This improved memcmp provides a fast path for compares up to 16 bytes and then compares 16 bytes at a time, thus optimizing loads from both sources. The glibc memcmp microbenchmark retains performance (with an error of ~1ns) for smaller compare sizes and reduces up to 31% of execution time for compares up to 4K on the APM Mustang. On Qualcomm Falkor this improves to almost 48%, i.e. it is almost 2x improvement for sizes of 2K and above.
* Improve strncmp for mutually misaligned inputsSiddhesh Poyarekar2018-07-131-17/+79
| | | | | | | | | | | | | | | | The mutually misaligned inputs on aarch64 are compared with a simple byte copy, which is not very efficient. Enhance the comparison similar to strcmp by loading a double-word at a time. The peak performance improvement (i.e. 4k maxlen comparisons) due to this on the strncmp microbenchmark in glibc is as follows: falkor: 3.5x (up to 72% time reduction) cortex-a73: 3.5x (up to 71% time reduction) cortex-a53: 3.5x (up to 71% time reduction) All mutually misaligned inputs from 16 bytes maxlen onwards show upwards of 15% improvement and there is no measurable effect on the performance of aligned/mutually aligned inputs.
* Cygwin: Treat PROCESSOR_ARCHITECTURE_INTEL as running under WOW64 on ARM64Corinna Vinschen2018-07-121-9/+24
| | | | | | | | | | Bug in current ARM64 WOW64: GetNativeSystemInfo returns PROCESSOR_ARCHITECTURE_INTEL rather than PROCESSOR_ARCHITECTURE_ARM64. Provide for this. Make code better readable. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Fix AArch32 semihosting SYS_EXIT call on semihosting v1.Tamar Christina2018-07-111-0/+6
| | | | | | | | | | | | | | | | | | | | | | The current SYS_EXIT has a bug that when making the call it always uses the v2 calling convention. This is undefined behavior according to the semihosting specification: https://developer.arm.com/docs/100863/latest/semihosting-operations/sys_exit-0x18 This patch fixes it by making sure v1 passes the argument directly in the register instead of in a block. And for v2 it does the same if the v2 extension isn't supported. The sequence generated now is 12424: ebfffecd bl 11f60 <_has_ext_exit_extended> 12428: e3500000 cmp r0, #0 1242c: 11a0500d movne r5, sp 12430: 059d5000 ldreq r5, [sp] 12434: e1a00004 mov r0, r4 12438: e1a01005 mov r1, r5 1243c: ef00f000 svc 0x0000f000 Signed-off-by: Tamar Christina <tamar.christina@arm.com>
* Remove float compare option from sincosfSzabolcs Nagy2018-07-111-10/+1
| | | | | | | | | PREFER_FLOAT_COMPARISON setting was not correct as it could raise spurious exceptions. Fixing it is easy: just use ISLESS(x, y) instead of abstop12(x) < abstop12(y) with appropriate non-signaling definition for ISLESS. However it seems this setting is not very useful (there is only minor performance difference on various architectures), so remove this option for now.
* Fix the documentation comments for log_inline in powSzabolcs Nagy2018-07-111-3/+3
| | | | There was a typo and the arguments were not explained clearly.
* Cygwin: Don't print FAST_CWD warning in WOW64 on ARM64 systemsCorinna Vinschen2018-07-101-1/+15
| | | | | | No way to test this, yet. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: fix a race in the FAST_CWD fallback codeCorinna Vinschen2018-07-101-22/+17
| | | | | | | | | | Guard the entire operation with the FastPebLock critical section used by RtlSetCurrentDirectory_U as well, thus eliminating the race between concurrent chdir/fchdir/SetCurrentDirectory calls. Streamline comment explaining the fallback method. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Update config.guess and config.subSebastian Huber2018-07-062-1129/+1144
| | | | | | | Update to the latest versions of config.sub (2018-07-03) and config.guess (2018-06-26). Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Fix a problem that connection to syslogd fails.Takashi Yano2018-07-062-19/+17
| | | | | | | * fhandler_socket_local.cc (get_inet_addr_local): Change type from 'static int' to 'int' to be callable from syslog.cc. * syslog.cc (connect_syslogd): Use get_inet_addr_local() instead of getsockname() to retrieve name information of the syslogd socket.
* Fix namespace issues in sinf, cosf and sincosfSzabolcs Nagy2018-07-065-18/+19
| | | | | | Use const sincos_t for clarity instead of making the typedef const. Use __inv_pi4 and __sincosf_table to avoid namespace issues with static linking.
* Fix large ulp error in pow without fma very near 1.0Szabolcs Nagy2018-07-061-2/+4
| | | | | | | | | | | The !HAVE_FAST_FMA code path split r = z/c - 1 into r = rhi + rlo such that when z = 1-tiny and c = 1 then rlo and rhi could have much larger magnitude than r which later caused large rounding errors. So do a nearest rounding instead of truncation at the split. In newlib with default settings this was observable on some arm targets that enable the new math code but has no fma.
* Change the return type of converttoint and document the semanticsSzabolcs Nagy2018-07-061-1/+9
| | | | | | | | | | | | | | | | | | | The roundtoint and converttoint internal functions are only called with small values, so 32 bit result is enough for converttoint and it is a signed int conversion so the natural return type is int32_t. The original idea was to help the compiler keeping the result in uint64_t, then it's clear that no sign extension is needed and there is no accidental undefined or implementation defined signed int arithmetics. But it turns out gcc does a good job with inlining so changing the type has no overhead and the semantics of the conversion is less surprising this way. Since we want to allow the asuint64 (x + 0x1.8p52) style conversion, the top bits were never usable and the existing code ensures that only the bottom 32 bits of the conversion result are used. In newlib with default settings only aarch64 is affected and there is no significant code generation change with gcc after the patch.
* Remove unused TOINT_RINT and TOINT_SHIFT macrosSzabolcs Nagy2018-07-062-10/+1
| | | | Only have separate code paths for TOINT_INTRINSICS and !TOINT_INTRINSICS.
* Move __HAVE_FAST_FMA to math_config.hSzabolcs Nagy2018-07-067-35/+21
| | | | | | Define it consistently with other HAVE_* macros that only affect code using math_config.h. This is also closer to the Arm Optimized Routines code.
* Fix code style and comments of new math codeSzabolcs Nagy2018-07-068-74/+134
| | | | | | | Synchronize code style and comments with Arm Optimized Routines, there are no code changes in this patch. This ensures different projects using the same code have consistent code style so bug fix patches can be applied more easily.
* Fix newlib functions perror()/psignal() not to use writev().Takashi Yano2018-07-052-37/+39
| | | | | | | | This fix is for some platforms which do not have writev(). *perror.c: Use _write_r() instead of writev(). *psignal.c: Use write() insetad of writev(). Revise commit: d4f4e7ae1be1bcf8c021f2b0865aafc16b338aa3
* Cygwin: Include local ntsecapi.hTakashi Yano2018-07-041-1/+1
| | | | | | | | | | Our local ntsecapi.h wrapper corrects a bug in the definition of SystemFunction036 which otherwise leads to crashes on 32 bit when using RtlGenRandom. The fhandler_socket_local.cc file accidentally included the incorrect w32api version of that file, rather than the local wrapper. Fix it. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Fix a bug of perror()/psignal() that changes the orientation of stderr.Takashi Yano2018-07-042-8/+54
| | | | | | * perror.c: Fix the problem that perror() changes the orientation of stderr to byte-oriented mode if stderr is not oriented yet. * psignal.c: Ditto.
* Fix a bug of psiginfo() that changes the orientation of stderr.Takashi Yano2018-07-031-6/+35
| | | | | | * strsig.cc (psiginfo): Fix the problem that psiginfo() changes the orientation of stderr to byte-oriented mode if stderr is not oriented yet.
* Introduce @unless/@endunless and postbootstrap Makefile targetsAlexandre Oliva2018-06-304-166/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch turns dependencies of non-bootstrap targets on bootstrap targets for bootstrap builds into dependencies on stage_last. This arrangement gets stage1-bubble to run from stage_last if we haven't started a bootstrap yet, and to use the current stage otherwise. This was already the case of target libs, just not of non-bootstrapped host modules. In order to retain preexisting dependencies in non-bootstrap builds, or in gcc-less builds, this introduces support for @unless/@endunless pairs in Makefile.in. There is a remaining possibility of problem if activating, in a tree configured for bootstrap, a parallel build of two or more modules, at least one bootstrapped and one not. In this case, make might decide to build stage_current and stage_last in parallel, the latter will start a submake to build stage1 while the initial make, having satisfied stage_current, proceeds to build the bootstrapped module in non-bootstrapped configurations. The two builds will overlap and will likely conflict. This situation does NOT arise in normal settings, however: a post-bootstrap build of all-host all-target will indeed activate such targets concurrently, but only after building all bootstrapped modules successfully, and it will have both stage_last and stage_current targets already satisfied, so the potential race between builds will not arise. Another remaining problem, that is slightly expanded with this patch, is that of an interrupted build in a tree configured for bootstrap, continued with a non-bootstrapped target. Target modules that were not bootstrapped would already fail to complete the current stage when activated explicitly in the command line for a retry; host modules, however, would attempt to build their bootstrapped dependencies, which is what led to the problem of concurrent builds addressed with this patch. An interrupted or failed build might still recover correctly, if the non-bootstrapped target is activated in both builds, because then make will remove stage_last when its build command is interrupted, so that it will attempt to recreate it with stage1-bubble in the second try. A bootstrap build, however, will not be attempting to build stage_last, so the file will remain and the retry won't go through stage1-bubble. We have lived with that for target modules, so we can probably live with that for host modules too. Another undesirable consequence of this change is that non-boostrapped host modules, in a tree configured for bootstrap, when activated as make all-<module>, will build all of stage1 instead of only the module's usual dependencies. This is intentional and necessary to fix the parallel-build problem. If it's not desirable, disabling the unnecessary bootstrap configuration will suffice to restore the original set of dependencies. for ChangeLog * configure.ac: Introduce support for @unless/@endunless. * Makefile.tpl (dep-kind): Rewrite with cond; return postbootstrap in some cases. (make-postboot-dep, postboot-targets): New. (dependencies): Do not output postbootstrap dependencies at first. Output non-target ones changed for configure to depend on stage_last @if gcc-bootstrap, and the original deps @unless gcc-bootstrap. * configure.in, Makefile.in: Rebuilt.
* Add OBJCOPY to Makefile.tpl too, to keep it on Makefile.in rebuildAlexandre Oliva2018-06-301-0/+1
| | | | | | | for ChangeLog * Makefile.tpl (OBJCOPY): Add it. * Makefile.in: Rebuilt, unchanged.
* Cygwin: tape: Handle non-standard "no medium" error codeCorinna Vinschen2018-06-292-5/+26
| | | | | | | | | | | | | | | | Certain tape drives (known example: QUANTUM_ULTRIUM-HH6) return the non-standard ERROR_NOT_READY rather than ERROR_NO_MEDIA_IN_DRIVE if no media is present. ERROR_NOT_READY is not documented as valid return code from GetTapeStatus. Without handling this error code Cygwin's tape code can't report an offline state to user space. Fix this by converting ERROR_NOT_READY to ERROR_NO_MEDIA_IN_DRIVE where appropriate. Add a debug_printf to mtinfo_drive::get_status to allow requesting user info without having to rebuild the DLL. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>