Commit Graph

70 Commits

Author SHA1 Message Date
Brad King
096450f808 libuv: Include BSD sys/cpuset.h only on platforms where we use it
Since commit 43d6e5a71f (libuv: misc: add function to get CPU affinity
mask size, 2017-09-06, v3.12.0-rc1~412^2~3) we include `<sys/cpuset.h>`
on several BSD platforms but only use it on FreeBSD.
2021-09-29 12:31:49 -04:00
Brad King
7d1f353a6f Merge topic 'libuv-mingw-arm'
1aba3a8367 libuv: Fix building with mingw toolchains for ARM/AArch64

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6354
2021-07-19 12:48:40 -04:00
Martin Storsjö
1aba3a8367 libuv: Fix building with mingw toolchains for ARM/AArch64
This is a backport of f9ad802fa5dd5afe6730f8e00cfdbf98f1d7a969
from the v1.x branch from upstream libuv:

    mingw: fix building for ARM/AArch64

    Don't use x86 inline assembly in these cases, but fall back to
    __sync_fetch_and_or, similar to _InterlockedOr8 in the MSVC case.

    This corresponds to what is done in src/unix/atomic-ops.h, where
    ARM/AArch64 cases end up implementing cmpxchgi with
    __sync_val_compare_and_swap.

    PR-URL: https://github.com/libuv/libuv/pull/3236
    Reviewed-By: Jameson Nash <vtjnash@gmail.com>
2021-07-15 10:59:07 -04:00
earnal
113cc4c684 libuv: Allow windows UNC path with forward slashes
Fix libuv issue 3159 in CMake while integration in upstream libuv is
pending.

Fixes: #22141
2021-07-12 11:24:29 -04:00
Orgad Shaneh
ddcd1469e8 MSYS: Add support for running under MSYS runtime environment
Detect MSYS as CYGWIN, with the required adaptations.
2021-04-26 14:27:34 -04:00
Brad King
408e6d6185 Utilities: Suppress warnings in third-party code with NVHPC 2021-04-20 11:44:25 -04:00
Brad King
87909f0600 Utilities: Suppress warnings in third-party code when using IntelLLVM 2021-01-28 09:07:00 -05:00
Elad Lahav
f9e950d4c5 libuv: Add support for building for QNX within CMake 2020-09-25 11:53:44 -04:00
Brad King
7a0506bafe libuv: Suppress conversion warning on Windows
Add a cast to avoid the conversion warning with minimal changes to
third-party code.
2020-09-23 12:32:54 -04:00
Brad King
2269ad6a0a libuv: Add fs_copy stub to cmake-bootstrap.c
This is now called by `uv__fs_sendfile` in `src/unix/fs.c` but we do not
need that feature during CMake bootstrap.
2020-09-23 12:28:48 -04:00
Brad King
e21325c2c6 Merge branch 'upstream-libuv' into update-libuv
* upstream-libuv:
  libuv 2020-09-22 (ed5b42d5)
2020-09-23 12:13:59 -04:00
Brad King
e771330dd4 bootstrap: Fix libuv target platform conditions on macOS
In commit 714ce72882 (bootstrap: Make libuv available during bootstrap,
2017-09-13, v3.10.0-rc1~106^2) we modified libuv to use POSIX interfaces
during bootstrap.  However, some code still expects `TARGET_OS_IPHONE`
to be defined on Apple platforms to either `0` or `1`.  In order to
offer this, include `<TargetConditionals.h>` on Apple platforms even
when bootstrapping.
2020-07-22 14:42:04 -04:00
Brad King
2628eb7460 libuv: Add proctitle and threadpool cleanup stubs to cmake-bootstrap.c
These are now called by `uv_library_shutdown` in `src/uv-common.c` but
on UNIX we do not compile those features during CMake bootstrap.
2020-04-29 08:50:11 -04:00
Brad King
efdd451f4b Merge branch 'upstream-libuv' into update-libuv
* upstream-libuv:
  libuv 2020-04-29 (e7ebae26)
2020-04-29 08:21:02 -04:00
Brad King
630e501f8b libuv: Restore compilation on Apple i386 architecture
libuv upstream commit `2475296c` (build: make code compilable for iOS on
Xcode, 2020-01-18, v1.35.0~47) added a `defined(TARGET_OS_IPHONE)`
preprocessor condition, but `TARGET_OS_IPHONE` is always defined on
Apple to either 0 or 1.
2020-04-07 07:49:50 -04:00
Brad King
02a28f1d44 libuv: Restore compilation with XLClang 16.1 on AIX
libuv upstream commit `4a972bf0` (aix: Fix broken cmpxchgi() XL C++
specialization., 2019-09-06, v1.32.0~5) broke compilation with this
compiler.  According to

    https://www.ibm.com/support/knowledgecenter/SSGH3R_16.1.0/com.ibm.xlcpp161.aix.doc/migrate/migrate_to_xlclang.html

XLClang 16.1 for AIX does not support `__sync_val_compare_and_swap`.
The documentation suggests using C++11 atomic operations instead, but
this is C code.  For now fall back to the non-atomic equivalent used
before so we can at least compile.  Add a FIXME comment for this.
2020-04-07 07:47:47 -04:00
Brad King
722d6b4105 Merge branch 'upstream-libuv' into update-libuv
* upstream-libuv:
  libuv 2020-04-06 (d21f5aea)
2020-04-06 11:58:14 -04:00
Jesse Gorzinski
7d6bd14dca libuv: Add support for building on IBM i (OS400) 2020-03-06 14:24:01 -05:00
Earle Lowe
5ffb2dbff6 libuv: Add partial port to HP-UX
Port enough of libuv to HP-UX 11.31 ia64 with GCC 4.9.3 to work for
CMake.
2019-09-20 10:30:01 -04:00
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