51 Commits

Author SHA1 Message Date
Brad King
db4667cc72 libuv: fix compilation with macOS 10.10 SDK
The `F_BARRIERFSYNC` constant was not added until the macOS 10.11 SDK.
Hard-code its value instead.  This approach is backported from upstream
libuv PR 2334.
2019-06-19 06:57:38 -04:00
Kyle Edwards
cee57246ef libuv: Add uv__statx() stub to cmake-bootstrap.c 2019-06-18 07:46:08 -04:00
Brad King
69b139cfca Merge branch 'upstream-libuv' into update-libuv
* upstream-libuv:
  libuv 2019-06-10 (ee24ce90)
2019-06-18 07:45:53 -04:00
Brad King
0d489fab19 libuv: fix atomic ops compilation with xlclang 2019-02-25 08:26:20 -05:00
Brad King
1699f5c231 Utilities: Suppress warnings in third-party code when using XLClang 2019-02-25 08:26:17 -05:00
Brad King
214fcefa52 Remove now-unused code once used for MIPSpro on IRIX
In commit beb991110d (Remove now-unused code once used on IRIX,
2019-01-11, v3.14.0-rc1~167^2) we removed remnants of IRIX support.
Also remove remnants of MIPSpro compiler support.
2019-02-21 11:12:51 -05:00
Brad King
5b3af28e45 libuv: Update CMake-internal buildsystem 2019-01-17 11:29:44 -05:00
Brad King
1136275ae1 libuv: Include uv/ headers from each other without any path
Headers in `uv/` can include each other without the `uv/` prefix.  Using
the prefix assumes that the location of `uv/` is in the include file
search path, but it is possible to include `uv.h` via a longer path.
2019-01-17 10:27:14 -05:00
Brad King
1e1209729b Merge branch 'upstream-libuv' into update-libuv
* upstream-libuv:
  libuv 2019-01-15 (f84c5e69)
2019-01-17 10:26:32 -05:00
Kyle Edwards
ee555c2a33 libuv: fix clang scan-build warning 2019-01-14 09:53:12 -05:00
Brad King
a4b9e59568 Merge topic 'libuv-gnu-hurd'
3c0bfb596f libuv: do not require PATH_MAX to be defined

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2422
2018-10-03 08:03:47 -04:00
Brad King
3c0bfb596f libuv: do not require PATH_MAX to be defined
Some platforms (e.g. GNU/Hurd) do not define PATH_MAX.  Add a few other
variants and a fallback constant.  Also use alternatives where possible:

* For readlink(), use lstat() to read the length of the link first.
  If it is not a symlink, report EINVAL before trying to allocate.
  If the size reports as zero, fall back one of the PATH_MAX variants.

* For realpath(), POSIX 2008 allows us to pass a NULL buffer
  to tell it to malloc() internally.

This patch was inspired by downstream patches in Debian packaging
for issues 897061 and 909011.

Issue: #18337
2018-10-01 08:22:38 -04:00
Gregor Jasny
7e33050558 libuv: Add kFreeBSD platform-specific files
Issue 18375
2018-09-18 20:22:55 +02:00
Brad King
0d389d175a libuv: Revert local linux/sparc64 fix now that we have upstream fix 2018-05-07 11:49:25 -04:00
Brad King
42fbb28516 Merge branch 'upstream-libuv' into update-libuv
* upstream-libuv:
  libuv 2018-05-06 (bf605bd7)
2018-05-07 11:48:01 -04:00
Brad King
593c409a65 Merge topic 'ctest-libuv-linux-sparc64'
1c22fdf360 libuv: linux/sparc64: use fcntl to set and clear O_NONBLOCK

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2029
2018-05-03 08:13:16 -04:00
Brad King
1c22fdf360 libuv: linux/sparc64: use fcntl to set and clear O_NONBLOCK
Upstream libuv commits:

* node-v0.6.0~28 (linux: use ioctl(FIONBIO) to set O_NONBLOCK, saves a syscall, 2011-10-29)
* v1.11.0~11 (unix: use async-signal safe functions between fork and exec, 2016-12-12)

left an asymmetry in the way O_NONBLOCK is set and cleared.  Normally
ioctl/FIONBIO is used for both.  However, uv_spawn uses fcntl/O_NONBLOCK
to clear O_NONBLOCK between fork and exec.  This fails on Linux/sparc64
where setting via ioctl/FIONBIO actually sets two bits (in O_NDELAY)
that cause clearing via fcntl/O_NONBLOCK to be silently ignored (though
clearing via ioctl/FIONBIO or fcntl/O_NDELAY works).

Since CMake commit v3.11.0-rc1~117^2 (CTest: Re-implement test process
handling using libuv, 2017-12-10), CTest uses libuv.  On Linux/sparc64
child processes have been started with non-blocking output pipes.  This
can lead to write errors or lost output from children not prepared to
deal with `EAGAIN` on stdout or stderr.

Fix this for now by switching libuv back to fcntl/O_NONBLOCK to set and
clear O_NONBLOCK when compiled on Linux/sparc64.

LibUV-Issue: 1830
Fixes: #17941
2018-05-02 11:16:19 -04:00
Brad King
c5428d8db2 libuv: disable process affinity during CMake bootstrap
Avoid depending on platform-specific pthread features during bootstrap.
2018-03-05 09:21:31 -05:00
Brad King
24de561a1a libuv: unix,win: add uv_spawn option to set child CPU affinity mask
Implement it on Linux, FreeBSD, and Windows for now, and fail with
UV_ENOTSUP on other platforms.

Backported from upstream libuv PR 1527, scheduled for inclusion
in libuv 2.0.
2018-03-05 09:21:31 -05:00
Brad King
43d6e5a71f libuv: misc: add function to get CPU affinity mask size
Implement it on Linux, FreeBSD, and Windows for now, and return
UV_ENOTSUP on other platforms.

Backported from upstream libuv PR 1527, scheduled for inclusion
in libuv 2.0.
2018-03-05 09:21:31 -05:00
Brad King
6db7b35236 libuv: Update build within CMake
Update our CMake build rules to account for upstream changes.
2018-01-19 13:03:12 -05:00
Brad King
b58d48c15f Merge branch 'upstream-libuv' into update-libuv
* upstream-libuv:
  libuv 2018-01-19 (63de1eca)
2018-01-19 13:03:04 -05:00
Brad King
4ffb0f8b45 libuv: unix: restart syscalls interrupted by our signal handler
BSD `signal(2)` semantics make some system calls (e.g. for `write`)
restartable when interrupted by a signal handler.  Use `SA_RESTART` to
enable these semantics everywhere that supports them.

This is required by C++ stream libraries that interpret `EINTR` as any
other error, set `badbit`, and stop writing.  I've observed this with
`libstdc++` during a `std::cout.flush()` call interrupted by `SIGCHLD`.
2018-01-08 12:55:00 -05:00
Brad King
714ce72882 bootstrap: Make libuv available during bootstrap
On UNIX, build only the parts of libuv we need for the filesystem,
process, and poll abstractions using the POSIX poll() backend.  This
avoids many platform-specific conditions.  On Windows, build all of
libuv; there are no conditional alternatives anyway.
2017-09-17 11:10:18 -04:00
Brad King
a9eaefaa1e Build with libuv on Cygwin to enable server-mode
With our last update of libuv, Cygwin is now supported.
2017-05-28 09:05:57 -04:00
Brad King
478ce1c7b4 libuv: Update build within CMake
Update our CMake build rules to account for upstream changes.
2017-05-26 13:48:48 -04:00
Brad King
1ebb421bfc Merge branch 'upstream-libuv' into update-libuv
* upstream-libuv:
  libuv 2017-05-25 (dc596109)
2017-05-26 13:33:41 -04:00
Brad King
223d92e0f9 libuv: Update build within CMake
Update our CMake build rules to account for upstream changes.
2017-05-16 07:52:56 -04:00
Brad King
ed17516b31 Merge branch 'upstream-libuv' into update-libuv
* upstream-libuv:
  libuv 2017-05-09 (e11dcd43)

Fixes: #16878
2017-05-15 10:43:50 -04:00
Brad King
6b0bc43281 libuv: Compile as C 99 on Solaris 5.11
SunPro 5.13 and below do not compile as c99 by default.
2017-05-05 09:52:25 -04:00
Brad King
b08d2d993c libuv: Compile as C 90 on Solaris 5.10 with SunPro 5.14 2017-05-05 09:52:24 -04:00
Brad King
e4ac7c2b4f libuv: Compile as C 90 on Solaris 10 2017-02-28 09:03:12 -05:00
Brad King
c9b3c5625a libuv: Link to 'rt' library on Solaris 10 to get semaphores 2017-02-26 10:48:26 -05:00
Brad King
f06986926a libuv: Implement mkdtemp on Solaris 10 2017-02-26 10:48:26 -05:00
Brad King
5651257fff libuv: automatically skip ifaddrs on Solaris 10 2017-02-26 10:48:26 -05:00
Brad King
741b7621b3 Merge branch 'upstream-libuv' into update-libuv
* upstream-libuv:
  libuv 2017-02-21 (52ae8264)
2017-02-21 19:40:27 -05:00
Eric Berge
b7f0b1240f libuv requires _XOPEN_SOURCE 600 on Solaris 11
This avoid build errors from the
    /usr/include/sys/feature_tests.h
include file which disallows setting XOpen
versions less than 6 when in C99 mode.
2016-12-21 22:11:28 -06:00
Brad King
f9cab9e38d Merge branch 'upstream-libuv' into update-libuv
* upstream-libuv:
  libuv 2016-09-27 (8221f9b3)
2016-09-29 14:19:51 -04:00
Brad King
c6d83a15d8 libuv: Link with kvm on NetBSD and OpenBSD
We include the `kvm.h` header on these platforms and call kvm APIs.
Link with the library to ensure they are available.
2016-09-09 11:11:40 -04:00
Roger Leigh
6a497bb0a3 libuv: Link with kvm on FreeBSD
Add it unconditionally.  It is present in FreeBSD 11, 10 and 9.
2016-09-09 11:07:46 -04:00
Brad King
3825a56493 libuv: Simplify variable initializations to satisfy Clang scan-build
The Clang scan-build tool warns about assignments whose values are never
used, so initialize local variables at declaration instead.
2016-09-01 11:10:18 -04:00
Brad King
551d5aedbf libuv: Fix unused variable warning in uv_loop_close 2016-08-31 09:05:14 -04:00
Brad King
f4f8074bec libuv: Avoid including macOS CoreServices header globally
We only need the availability macros in `unix/internal.h`.  We already
include CoreServices where needed in implementation files.
2016-08-31 09:05:13 -04:00
Brad King
a63aaaed05 libuv: Always include our own header first 2016-08-31 09:05:13 -04:00
Brad King
9130b53a5e libuv: Conditionally declare Windows APIs for VS 2008 and below 2016-08-31 09:05:13 -04:00
Brad King
b52afa4655 libuv: Fix anonymous union syntax 2016-08-31 09:05:13 -04:00
Brad King
05dbc204cd libuv: Fix Windows API function typedef syntax 2016-08-31 09:05:12 -04:00
Brad King
75139374f0 libuv: Install LICENSE file with CMake documentation
When we install using the bundled libuv source, notify users of its
license terms.
2016-08-31 09:05:12 -04:00
Brad King
95dcc4e474 libuv: Disable warnings to avoid changing 3rd party code
Add '-w' or equivalent flag on compilers supporting it.
Tell MSVC to use its lowest warning level inside libuv sources.
2016-08-31 09:05:12 -04:00
Brad King
13b7e7587d libuv: Build the library within CMake
Take logic from upstream `Makefile.am` and `configure.ac` to build libuv
sources.

Update `uv.h` to include KWSys Large File Support configuration so that
consistent stream libraries are used (on AIX with XL).

Add a `cm_uv.h` header to include the CMake-provided copy of the `uv.h`
header from CMake sources.
2016-08-31 09:02:19 -04:00