summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xUtilities/Scripts/update-libuv.bash4
-rw-r--r--Utilities/cmlibuv/CMakeLists.txt24
-rw-r--r--Utilities/cmlibuv/src/win/process.c29
-rwxr-xr-xbootstrap2
4 files changed, 22 insertions, 37 deletions
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 <libuv@googlegroups.com>"
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="
diff --git a/Utilities/cmlibuv/CMakeLists.txt b/Utilities/cmlibuv/CMakeLists.txt
index 9df0c7f..a0b161b 100644
--- a/Utilities/cmlibuv/CMakeLists.txt
+++ b/Utilities/cmlibuv/CMakeLists.txt
@@ -294,27 +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)
- 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
- )
- else()
- 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
- )
+ list(APPEND uv_defines SUNOS_NO_IFADDRS)
endif()
list(APPEND uv_sources
src/unix/no-proctitle.c
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;
+ }
}
}
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"
;;