summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Gilli <julien.gilli@joyent.com>2014-10-09 13:01:27 -0700
committerJulien Gilli <julien.gilli@joyent.com>2015-04-29 14:25:50 -0700
commit712cb4340b6c784779b986b0fcfe3564ee173ccf (patch)
tree2ecad5c3c7155b6797c7c4e4792a371fb288ea89
parent5b2bf92211278eba3ff1cc954cc42060b75b526f (diff)
downloadnode-new-712cb4340b6c784779b986b0fcfe3564ee173ccf.tar.gz
build: fix build for SmartOS
This change in V8: https://code.google.com/p/v8/source/detail?r=22210 has introduced a method named OS::GetCurrentThreadId which fails to compile on OSes where a "gettid" syscall does not exist. This build issue has been fixed upstream by several changes: - https://code.google.com/p/v8/source/detail?r=23459. - https://codereview.chromium.org/649553002 - https://codereview.chromium.org/642223003 Another minor fix to the upstream changes was also necessary. See https://code.google.com/p/v8/issues/detail?id=3620 for more information. The other build issue was due to the fact that alloca.h is not included by other system includes on SmartOS, which is assumed by V8. Built and tested on Linux, MacOS X, Windows and SmartOS. Reviewed-By: Trevor Norris <trev.norris@gmail.com> PR-URL: https://github.com/joyent/node/pull/18206
-rw-r--r--deps/v8/src/base/platform/platform-posix.cc10
-rw-r--r--deps/v8/src/base/platform/platform.h1
2 files changed, 8 insertions, 3 deletions
diff --git a/deps/v8/src/base/platform/platform-posix.cc b/deps/v8/src/base/platform/platform-posix.cc
index 252d213755..771634e24e 100644
--- a/deps/v8/src/base/platform/platform-posix.cc
+++ b/deps/v8/src/base/platform/platform-posix.cc
@@ -321,11 +321,15 @@ int OS::GetCurrentProcessId() {
int OS::GetCurrentThreadId() {
-#if defined(ANDROID)
+#if V8_OS_MACOSX
+ return static_cast<int>(pthread_mach_thread_np(pthread_self()));
+#elif V8_OS_LINUX
return static_cast<int>(syscall(__NR_gettid));
+#elif V8_OS_ANDROID
+ return static_cast<int>(gettid());
#else
- return static_cast<int>(syscall(SYS_gettid));
-#endif // defined(ANDROID)
+ return static_cast<int>(pthread_self());
+#endif
}
diff --git a/deps/v8/src/base/platform/platform.h b/deps/v8/src/base/platform/platform.h
index 8a54126268..9567572d80 100644
--- a/deps/v8/src/base/platform/platform.h
+++ b/deps/v8/src/base/platform/platform.h
@@ -35,6 +35,7 @@ namespace std {
int signbit(double x);
}
# endif
+#include <alloca.h>
#endif
#if V8_OS_QNX