summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Cygwin: Restore setting CC and CXX Makefile variablesJon Turney2020-10-283-0/+10
| | | | | | | | | | | b55e3f19 was a bit too aggressive in dropping, rather than just un-exporting these Makefile variables. We need to set these to the configured host compiler if we are cross-compiling, otherwise they default to the build compiler. Also export CC to the mkvers.sh script (which requires it since 4eca5e6a). It's unclear why we can't just cause windres to use the build 'cpp' as the pre-processor there.
* libc/sys/rtems/include/machine/_types.h: Define daddr_t to be 64 bits for RTEMSJoel Sherrill2020-10-281-0/+3
| | | | | This type needs to be able to represent a position on a disk or file system.
* Cygwin: fix return value of sqrtl on negative infinityKen Brown2020-10-272-2/+8
| | | | | | | | | | | | The return value is now -NaN. This fixes a bug in the mingw-w64 code that was imported into Cygwin. The fix is consistent with Posix and Linux. It is also consistent with the current mingw-w64 code, with one exception: The mingw-w64 code sets errno to EDOM if the input is -NaN, but this appears to differ from Posix and Linux. Addresses: https://cygwin.com/pipermail/cygwin/2020-October/246606.html
* Cygwin: pty: Disable ResizePseudoConsole() if stdout is redirected.Takashi Yano via Cygwin-patches2020-10-273-2/+8
| | | | | | | | - Calling ResizePseudoConsole() generates some escape sequences. Due to this behaviour, if the output of non-cygwin app is piped to less, screen is sometimes distorted when the screen is resized. With this patch, ResizePseudoConsole() is not called if stdout is redirected.
* RISC-V: Implment finite and fpclassifyKito Cheng2020-10-279-3/+421
|
* RISC-V: Add fabs[f], fmax[f] and fmin[f].Kito Cheng2020-10-278-3/+345
|
* Define RB_SET_PARENT to do all assignmentsdougm2020-10-261-30/+28
| | | | | | | | | | | | | | | to rb parent pointers. Define RB_SWAP_CHILD to replace the child of a parent with its twin, and use it in 4 places. Use RB_SET in rb_link_node to remove the only linuxkpi reference to color, and then drop color- and parent-related definitions that are defined and used only in rbtree.h. This is intended to be entirely cosmetic, with no impact on program behavior, and leave RB_PARENT and RB_SET_PARENT as the only ways to read and write rb parent pointers. Reviewed by: markj, kib Tested by: pho Differential Revision: https://reviews.freebsd.org/D25264
* In concluding RB_REMOVE_COLOR, in the case whendougm2020-10-261-15/+11
| | | | | | | | | | | | the sibling of the root of the too-short tree is black and at least one of the children of that sibling is red, either one or two rotations finish the rebalancing. In the case when both of the children are red, the current implementation uses two rotations where only one is necessary. This change removes that extra rotation, and in that case also removes a needless black-to-red-to-black recoloring. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D25335
* Linuxkpi uses the rb-tree structuresdougm2020-10-261-148/+137
| | | | | | | | | without using their interfaces, making them break when the representation changes. Revert changes that eliminated the color field from rb-trees, leaving everything as it was before. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D25250
* Fixup r361997 by balancing parens. Duh.dougm2020-10-261-1/+1
|
* Restore an RB_COLOR macro, for the benefit ofdougm2020-10-261-0/+6
| | | | | | | | a bit of DIAGNOSTIC code that depends on it. Reported by: rpokala, mjguzik Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D25204
* To reduce the size of an rb_node, drop the colordougm2020-10-261-138/+143
| | | | | | | | | | | | | | field. Set the least significant bit in the pointer to the node from its parent to indicate that the node is red. Have the tree rotation macros leave the old-parent/new-child node red and the new-parent/old-child node black. This change makes RB_LEFT and RB_RIGHT no longer assignable, and RB_COLOR no longer defined. Any code that modifies the tree or examines a node color would have to be modified after this change. Reviewed by: markj Tested by: pho Differential Revision: https://reviews.freebsd.org/D25105
* Remove from RB_REMOVE_COLOR some null checksdougm2020-10-261-26/+20
| | | | | | | | | where the pointer checked is provably never null. Restructure the surrounding code just enough to make the non-nullness obvious. Reviewed by: markj Tested by: pho Differential Revision: https://reviews.freebsd.org/D25089
* RB_REMOVE invokes RB_REMOVE_COLOR either whendougm2020-10-261-72/+65
| | | | | | | | | | | | | | | | | child is red or child is null. In the first case, RB_REMOVE_COLOR just changes the child to black and returns. With this change, RB_REMOVE handles that case, and drops the child argument to RB_REMOVE_COLOR, since that value is always null. RB_REMOVE_COLOR is changed to remove a couple of unneeded tests, and to eliminate some deep indentation. RB_ISRED is defined to combine a null check with a test for redness, to replace that combination in several places. Reviewed by: markj Tested by: pho Differential Revision: https://reviews.freebsd.org/D25032
* For the case when RB_REMOVE requires a nontrivialdougm2020-10-261-28/+24
| | | | | | | | | | | | search to find the node to replace the one being removed, restructure to first remove the replacement node and correct the parent pointers around it, and then let the all-cases code at the end deal with the parent of the deleted node, making it point to the replacement node. This removes one or two conditional branches. Reviewed by: markj Tested by: pho Differential Revision: https://reviews.freebsd.org/D24845
* Correct the use of RB_AUGMENT in the RB_TREEdougm2020-10-261-50/+38
| | | | | | | | | | | | | macros so that is invoked at the root of every subtree that changes in an insert or delete, and only once, and ordered from the bottom of the tree to the top. For intel_gas.c, the only user of RB_AUGMENT I can find, change the augmenting routine so that it does not climb from entry to tree root on every call, and remove a 'tree correcting' function that can be supplanted by proper tree augmentation. Reviewed by: kib Tested by: pho Differential Revision: https://reviews.freebsd.org/D23189
* Add RB_REINSERT(3), a low overhead alternative totrasz2020-10-261-2/+24
| | | | | | | | | | | | removing a node and reinserting it back with an updated key. This is one of dependencies for the upcoming stats(3) code. Reviewed by: cem Obtained from: Netflix MFC after: 2 weeks Sponsored by: Klara Inc, Netflix Differential Revision: https://reviews.freebsd.org/D21786
* amd64: prevent KCSan false positives on LAPIC mappingjah2020-10-261-0/+2
| | | | | | | | | | | | | | | | | | | For configurations without x2APIC support (guests, older hardware), the global LAPIC MMIO mapping will trigger false-positive KCSan reports as it will appear that multiple CPUs are concurrently reading and writing the same address. This isn't actually true, as the underlying physical access will be performed on the local CPU's APIC. Additionally, because LAPIC access can happen during event timer configuration, the resulting KCSan printf can produce a panic due to attempted recursion on event timer resources. Add a __nosanitizethread preprocessor define to prevent the compiler from inserting TSan hooks, and apply it to the x86 LAPIC accessors. PR: 249149 Reported by: gbe Reviewed by: andrew, kib Tested by: gbe Differential Revision: https://reviews.freebsd.org/D26354
* sys: clean up empty lines in .c and .h filesmjg2020-10-261-1/+0
|
* gcc: quiet Wattribute for no_sanitize("address")rlibby2020-10-261-2/+6
| | | | | | | | | | | | This is an unfortunate instance where the __has_attribute check does not function usefully. Gcc does have the attribute, but for gcc it only applies to functions, not variables, and trying to apply it to a variable generates Wattribute. So far we only apply the attribute to variables. Only enable the attribute for clang, for now. Reviewed by: Anton Rang <rang at acm.org> Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D22875
* Don't sanitize linker_setdab2020-10-261-0/+7
| | | | | | | | | | | | | The assumptions of linker_set don't play nicely with AddressSanitizer. AddressSanitizer adds a 'redzone' of zeros around globals (including those in named sections), whereas linker_set assumes they are all packed consecutively like a pointer array. So: let's annotate linker_set so that AddressSanitizer ignores it. Submitted by: Matthew Bryan <matthew.bryan@isilon.com> Reviewed by: kib, rang_acm.org Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D22239
* Make the system C11 atomics headers fully compatible with external GCC.jhb2020-10-262-15/+12
| | | | | | | | | | | | | | | | | | | | The <sys/cdefs.h> and <stdatomic.h> headers already included support for C11 atomics via intrinsincs in modern versions of GCC, but these versions tried to "hide" atomic variables inside a wrapper structure. This wrapper is not compatible with GCC's internal <stdatomic.h> header, so that if GCC's <stdatomic.h> was used together with <sys/cdefs.h>, use of C11 atomics would fail to compile. Fix this by not hiding atomic variables in a structure for modern versions of GCC. The headers already avoid using a wrapper structure on clang. Note that this wrapper was only used if C11 was not enabled (e.g. via -std=c99), so this also fixes compile failures if a modern version of GCC was used with -std=c11 but with FreeBSD's <stdatomic.h> instead of GCC's <stdatomic.h> and this change fixes that case as well. Reported by: Mark Millard Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D16585
* Cygwin: pty: Fix race condition in initialization of pseudo console.Takashi Yano via Cygwin-patches2020-10-261-9/+0
| | | | | | - If output of non-cygwin process is piped to cygwin process, such as less, the non-cygwin process sometimes fails to start and hangs. This patch fixes the issue.
* Cygwin: AF_INET and AF_LOCAL: recv_internal: fix MSG_WAITALL supportKen Brown via Cygwin-patches2020-10-232-2/+2
| | | | | | If MSG_WAITALL is set, recv_internal calls WSARecv or WSARecvFrom in a loop, in an effort to fill all the scatter-gather buffers. The test for whether all the buffers are full was previously incorrect.
* Cygwin: Drop do-nothing install_target targetJon Turney2020-10-212-6/+3
|
* Cygwin: Drop do-nothing install_host targetJon Turney2020-10-216-22/+3
| | | | | Drop do-nothing install_host target, which is only used when not cross-compiling.
* Cygwin: Remove nostdlib Makefile variableJon Turney2020-10-212-3/+1
| | | | It's used in one place, and it's value is unconditional.
* Cygwin: gendef generates sigfe.s and cygwin.defJon Turney2020-10-211-5/+2
| | | | | Express that gendef generates sigfe.s and cygwin.def in a slightly less nutty way.
* Cygwin: Drop cygwin version.o from cygserverJon Turney2020-10-211-3/+1
| | | | The data it contains isn't referenced since 9e9bc3a4.
* Cygwin: Remove lsaauthJon Turney2020-10-218-5001/+0
| | | | Remove lsaauth, not built since 2741dd05.
* Cygwin: Use aclocal option --system-acdir rather than --acdirJon Turney2020-10-183-3/+3
| | | | | | In autogen.sh, use 'aclocal --system-acdir' rather than 'aclocal --acdir'. '--acdir' was deprecated in automake 1.11 and removed in automake 1.13.
* Cygwin: Remove --with-windows-{libs,headers}Jon Turney2020-10-1814-400/+2
|
* Cygwin: Remove ccwrapJon Turney2020-10-1816-166/+68
| | | | | | | | | | | | | | ccwrap massages the compiler's standard include directories to remove '/usr/include/w32api', with the intent of allowing it to be overriden by '--with-windows-headers' (See 4c36016b). I'm not 100% convinced that this is always working as desired, since in some places w32api includes are done using <w32api/something.h>, which will find them via the path /usr/include. If this does turn out to be needed, this could also be implemented by constructing the appropriate compiler flags once, rather than on every compiler invocation.
* Cygwin: Stop using c++wrap for MinGW-compiled utilitiesJon Turney2020-10-182-12/+3
| | | | | | Stop using c++wrap for MinGW-compiled utilities. (Partially reverts 96079146)
* libc/time: Move internal newlib tz-structs into own headerTorbjörn SVENSSON via Newlib2020-10-156-57/+26
| | | | | | | | | | | | | | As discussed in GCC bug 97088 (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97088), parameters in prototypes of library functions should use reserved names, or no name at all. This patch moves the internal struct __tzrule_struct to its own internal header sys/_tz_structs.h. This is included from newlib's time code as well as from Cygwin's localtime wrapper. Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@st.com> Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: Remove unused doc/ug-info.xmlJon Turney2020-10-141-36/+0
| | | | Remove doc/ug-info.xml, not used in any document.
* Cygwin: Remove empty MT_SAFE and MT_SAFE_OBJECTSJon Turney2020-10-141-4/+1
|
* Cygwin: Remove autoconf variable INSTALL_LICENSEJon Turney2020-10-143-12/+1
| | | | | Remove autoconf variable INSTALL_LICENSE, which has a constant value which is only used once.
* Cygwin: Drop AC_SUBST(LIBSERVER)Jon Turney2020-10-142-3/+0
| | | | | | The autoconf variable LIBSERVER isn't defined, and it's value isn't used. (The Makefile.in contains a literal value for the name of this library instead).
* Cygwin: Remove AC_ARG_PROGRAM/program_transform_nameJon Turney2020-10-146-40/+1
| | | | Not done consistently, and probably never used.
* Cygwin: Remove AC_PROG_MAKE_SETJon Turney2020-10-147-107/+0
| | | | | | | | This is only needed if we are using an ancient make which doesn't set ${MAKE}, but we say "This makefile requires GNU make." everywhere. It only has an effect if @SET_MAKE@ is used, which we aren't doing consistently.
* Cygwin: Drop STDINCFLAGS overridesJon Turney2020-10-141-4/+0
| | | | | This used to turn off -nostdinc on a per-file basis, but has no effect since 4c36016b5706.
* Cygwin: Drop looking for w32api in winsup/w32apiJon Turney2020-10-148-16/+0
| | | | | Stop looking for w32api headers in the (no longer existent) winsup/w32api directory (removed in commit 61746d6ae850).
* format_proc_cpuinfo: add enqcmd cpuinfo flagBrian Inglis2020-10-131-0/+1
| | | | | | | | | | | | Add linux-next 5.9 cpuinfo flag for Intel enqcmd/s instructions: x86/cpufeatures: Enumerate ENQCMD and ENQCMDS instructions: Work submission instruction comes in two flavors. ENQCMD can be called both in ring 3 and ring 0 and always uses the contents of a PASID MSR when shipping the command to the device. ENQCMDS allows a kernel driver to submit commands on behalf of a user process. The driver supplies the PASID value in ENQCMDS. There isn't any usage of ENQCMD in the kernel as of now. The CPU feature flag is shown as "enqcmd" in /proc/cpuinfo.
* drop ambiguous-wide behaviour from Unicode CJK localesThomas Wolff2020-10-131-13/+5
|
* Cygwin: AF_UNIX: open_pipe: call recv_peer_infoKen Brown2020-10-041-1/+5
| | | | | If open_pipe is called with xchg_sock_info true, call recv_peer_info in addition to send_sock_info.
* Cygwin: AF_UNIX: listen_pipe: check for STATUS_SUCCESSKen Brown2020-10-041-2/+5
| | | | | | A successful connection can be indicated by STATUS_SUCCESS or STATUS_PIPE_CONNECTED. Previously we were checking only for the latter.
* Cygwin: AF_UNIX: socket: set the O_RDWR flagKen Brown2020-10-041-0/+1
|
* Cygwin: always recognize AF_UNIX sockets as reparse pointsKen Brown2020-10-042-12/+15
| | | | | | | | | | | | | | | If __WITH_AF_UNIX is defined when Cygwin is built, then a named AF_UNIX socket is represented by a reparse point with a Cygwin-specific tag and GUID. Make such files recognizable as reparse points (but not as sockets) even if __WITH_AF_UNIX is not defined. That way utilities such as 'ls' and 'rm' still behave reasonably. This requires two changes: - Define the GUID __cygwin_socket_guid unconditionally. - Make check_reparse_point_target return PATH_REP on a reparse point of this type if __WITH_AF_UNIX is not defined.
* Cygwin: fix handling of known reparse points that are not symlinksKen Brown2020-10-041-5/+12
| | | | | | | | | | | | | | | | | | Commit aa467e6e, "Cygwin: add AF_UNIX reparse points to path handling", changed check_reparse_point_target so that it could return a positive value on a known reparse point that is not a symlink. But some of the code in check_reparse_point that handles this positive return value was executed unconditionally, when it should have been executed only for symlinks. As a result, posixify could be called on a buffer containing garbage, and check_reparse_point could erroneously return a positive value on a non-symlink. This is now fixed so that posixify is only called if the reparse point is a symlink, and check_reparse_point returns 0 if the reparse point is not a symlink. Also fix symlink_info::check to handle this last case, in which check_reparse_point returns 0 on a known reparse point.