From 703e3e03c30c6400602b1140140e254dc5d02c2d Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 18 Aug 2023 15:52:07 -0400 Subject: libuv: Comment why we cannot update past 1.44.2 libuv 1.45 and above have higher minimum requirements than we do. Until we raise ours, we will have to stick with 1.44.2 and backport any further changes we need. --- Utilities/Scripts/update-libuv.bash | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Utilities/Scripts/update-libuv.bash b/Utilities/Scripts/update-libuv.bash index 280c684..1027436 100755 --- a/Utilities/Scripts/update-libuv.bash +++ b/Utilities/Scripts/update-libuv.bash @@ -8,6 +8,10 @@ readonly name="libuv" readonly ownership="libuv upstream " readonly subtree="Utilities/cmlibuv" readonly repo="https://github.com/libuv/libuv.git" +# We cannot import libuv 1.45 or higher because it has higher +# minimum system requirements than we do: +# - It requires C11 atomics from GCC 4.9+. We support GCC 4.8. +# - It requires Windows 8, we support Windows 7. readonly tag="v1.44.2" readonly shortlog=false readonly paths=" -- cgit v0.12 From 5fb17a1410268d7341c1d4241e1eb174efbab10d Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Wed, 2 Aug 2023 12:36:27 -0400 Subject: libuv: win,spawn: allow %PATH% to be unset Backport libuv commit `c97017dd` (win,spawn: allow `%PATH%` to be unset, 2023-08-14). See https://github.com/libuv/libuv/pull/4116. --- Utilities/cmlibuv/src/win/process.c | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/Utilities/cmlibuv/src/win/process.c b/Utilities/cmlibuv/src/win/process.c index 248b7ea..3b5b2800 100644 --- a/Utilities/cmlibuv/src/win/process.c +++ b/Utilities/cmlibuv/src/win/process.c @@ -394,7 +394,7 @@ static WCHAR* search_path(const WCHAR *file, name_has_ext); while (result == NULL) { - if (*dir_end == L'\0') { + if (dir_end == NULL || *dir_end == L'\0') { break; } @@ -1027,22 +1027,19 @@ int uv_spawn(uv_loop_t* loop, DWORD path_len, r; path_len = GetEnvironmentVariableW(L"PATH", NULL, 0); - if (path_len == 0) { - err = GetLastError(); - goto done; - } - - alloc_path = (WCHAR*) uv__malloc(path_len * sizeof(WCHAR)); - if (alloc_path == NULL) { - err = ERROR_OUTOFMEMORY; - goto done; - } - path = alloc_path; + if (path_len != 0) { + alloc_path = (WCHAR*) uv__malloc(path_len * sizeof(WCHAR)); + if (alloc_path == NULL) { + err = ERROR_OUTOFMEMORY; + goto done; + } + path = alloc_path; - r = GetEnvironmentVariableW(L"PATH", path, path_len); - if (r == 0 || r >= path_len) { - err = GetLastError(); - goto done; + r = GetEnvironmentVariableW(L"PATH", path, path_len); + if (r == 0 || r >= path_len) { + err = GetLastError(); + goto done; + } } } -- cgit v0.12 From d6b4f6dd97e679a34aedda57cb3768842c74bcef Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 18 Aug 2023 16:09:04 -0400 Subject: libuv: Remove unused compatibility code for CMake < 3.9 We now require CMake 3.13 or higher anyway. --- Utilities/cmlibuv/CMakeLists.txt | 8 -------- 1 file changed, 8 deletions(-) diff --git a/Utilities/cmlibuv/CMakeLists.txt b/Utilities/cmlibuv/CMakeLists.txt index 9df0c7f..271e3cb 100644 --- a/Utilities/cmlibuv/CMakeLists.txt +++ b/Utilities/cmlibuv/CMakeLists.txt @@ -297,10 +297,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL "SunOS") ) if(CMAKE_SYSTEM_VERSION STREQUAL "5.10") set(CMAKE_C_STANDARD 90) - if(CMAKE_VERSION VERSION_LESS 3.8.20170504 AND CMAKE_C_COMPILER_ID STREQUAL "SunPro" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.14) - # The running version of CMake does not know how to add this flag. - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c90") - endif() list(APPEND uv_defines _XOPEN_SOURCE=500 ) @@ -308,10 +304,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL "SunOS") if(NOT CMAKE_C_STANDARD OR CMAKE_C_STANDARD EQUAL 90) set(CMAKE_C_STANDARD 11) endif() - if(CMAKE_VERSION VERSION_LESS 3.8.20170505 AND CMAKE_C_COMPILER_ID STREQUAL "SunPro" AND CMAKE_C_COMPILER_VERSION VERSION_LESS 5.14) - # The running version of CMake does not know how to add this flag. - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -xc99") - endif() list(APPEND uv_defines _XOPEN_SOURCE=600 ) -- cgit v0.12 From eee1dc10bea6d2528a08c4e844d96b1f45cfe2ff Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 18 Aug 2023 16:10:26 -0400 Subject: libuv: Compile as C11 on all Solaris versions Using `_XOPEN_SOURCE=600` on Solaris 5.10, as we do on Solaris 5.11+ already, allows the system headers to be included in C99 and C11 modes. --- Utilities/cmlibuv/CMakeLists.txt | 16 +++++----------- bootstrap | 2 -- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/Utilities/cmlibuv/CMakeLists.txt b/Utilities/cmlibuv/CMakeLists.txt index 271e3cb..a0b161b 100644 --- a/Utilities/cmlibuv/CMakeLists.txt +++ b/Utilities/cmlibuv/CMakeLists.txt @@ -294,19 +294,13 @@ if(CMAKE_SYSTEM_NAME STREQUAL "SunOS") ) list(APPEND uv_defines __EXTENSIONS__ + _XOPEN_SOURCE=600 ) + if(NOT CMAKE_C_STANDARD OR CMAKE_C_STANDARD EQUAL 90) + set(CMAKE_C_STANDARD 11) + endif() if(CMAKE_SYSTEM_VERSION STREQUAL "5.10") - set(CMAKE_C_STANDARD 90) - list(APPEND uv_defines - _XOPEN_SOURCE=500 - ) - else() - if(NOT CMAKE_C_STANDARD OR CMAKE_C_STANDARD EQUAL 90) - set(CMAKE_C_STANDARD 11) - endif() - list(APPEND uv_defines - _XOPEN_SOURCE=600 - ) + list(APPEND uv_defines SUNOS_NO_IFADDRS) endif() list(APPEND uv_sources src/unix/no-proctitle.c diff --git a/bootstrap b/bootstrap index 39c28bb..0e6b684 100755 --- a/bootstrap +++ b/bootstrap @@ -1762,8 +1762,6 @@ else libs="${libs} -lkvm" ;; *SunOS*) - # Normally libuv uses '-D_XOPEN_SOURCE=500 -std=c90' on Solaris 5.10, - # but we do not need to do that because we bootstrap using POSIX APIs. uv_c_flags="${uv_c_flags} -D__EXTENSIONS__ -D_XOPEN_SOURCE=600" libs="${libs} -lkstat -lnsl -lsendfile -lsocket -lrt" ;; -- cgit v0.12