node.patch 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  1. Index: common.gypi
  2. --- common.gypi.orig 2016-10-25 15:25:58.000000000 +0200
  3. +++ common.gypi 2016-10-25 20:51:36.807387368 +0200
  4. @@ -270,7 +270,7 @@
  5. 'ldflags': [ '-pthread' ],
  6. }],
  7. [ 'OS in "linux freebsd openbsd solaris android aix"', {
  8. - 'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ],
  9. + 'cflags': [ '-Wno-unused-parameter', ],
  10. 'cflags_cc': [ '-fno-rtti', '-fno-exceptions', '-std=gnu++0x' ],
  11. 'ldflags': [ '-rdynamic' ],
  12. 'target_conditions': [
  13. @@ -358,10 +358,7 @@
  14. '-fno-strict-aliasing',
  15. ],
  16. 'WARNING_CFLAGS': [
  17. - '-Wall',
  18. - '-Wendif-labels',
  19. - '-W',
  20. - '-Wno-unused-parameter',
  21. + '-Wno-unused-parameter'
  22. ],
  23. },
  24. 'target_conditions': [
  25. Index: deps/uv/uv.gyp
  26. --- deps/uv/uv.gyp.orig 2016-10-25 15:26:02.000000000 +0200
  27. +++ deps/uv/uv.gyp 2016-10-25 20:51:36.807387368 +0200
  28. @@ -157,7 +157,7 @@
  29. 'src/unix/udp.c',
  30. ],
  31. 'link_settings': {
  32. - 'libraries': [ '-lm' ],
  33. + 'libraries': [ '-lz', '-lm' ],
  34. 'conditions': [
  35. ['OS=="solaris"', {
  36. 'ldflags': [ '-pthreads' ],
  37. Index: deps/v8/gypfiles/toolchain.gypi
  38. --- deps/v8/gypfiles/toolchain.gypi.orig 2016-10-25 15:26:03.000000000 +0200
  39. +++ deps/v8/gypfiles/toolchain.gypi 2016-10-25 20:51:36.807387368 +0200
  40. @@ -1101,12 +1101,6 @@
  41. ['OS=="solaris"', {
  42. 'defines': [ '__C99FEATURES__=1' ], # isinf() etc.
  43. }],
  44. - ['OS=="freebsd" or OS=="openbsd"', {
  45. - 'cflags': [ '-I/usr/local/include' ],
  46. - }],
  47. - ['OS=="netbsd"', {
  48. - 'cflags': [ '-I/usr/pkg/include' ],
  49. - }],
  50. ['OS=="aix"', {
  51. 'defines': [
  52. # Support for malloc(0)
  53. Index: deps/v8/src/base/platform/platform-freebsd.cc
  54. --- deps/v8/src/base/platform/platform-freebsd.cc.orig 2016-10-25 15:26:03.000000000 +0200
  55. +++ deps/v8/src/base/platform/platform-freebsd.cc 2016-10-25 20:51:36.807387368 +0200
  56. @@ -25,6 +25,7 @@
  57. #include <strings.h> // index
  58. #include <cmath>
  59. +#include <cstdio>
  60. #undef MAP_TYPE
  61. Index: deps/v8/src/log-utils.cc
  62. --- deps/v8/src/log-utils.cc.orig 2016-10-25 15:26:04.000000000 +0200
  63. +++ deps/v8/src/log-utils.cc 2016-10-25 20:51:36.807387368 +0200
  64. @@ -2,6 +2,9 @@
  65. // Use of this source code is governed by a BSD-style license that can be
  66. // found in the LICENSE file.
  67. +#include <stdio.h>
  68. +#include <stdlib.h>
  69. +
  70. #include "src/log-utils.h"
  71. #include "src/assert-scope.h"
  72. Index: deps/v8/src/log-utils.h
  73. --- deps/v8/src/log-utils.h.orig 2016-10-25 15:26:04.000000000 +0200
  74. +++ deps/v8/src/log-utils.h 2016-10-25 20:51:36.807387368 +0200
  75. @@ -9,6 +9,7 @@
  76. #include <cstdarg>
  77. +#include <stdarg.h>
  78. #include "src/allocation.h"
  79. #include "src/base/compiler-specific.h"
  80. #include "src/base/platform/mutex.h"
  81. Index: deps/v8/src/v8.gyp
  82. --- deps/v8/src/v8.gyp.orig 2016-10-25 15:26:05.000000000 +0200
  83. +++ deps/v8/src/v8.gyp 2016-10-25 20:51:36.807387368 +0200
  84. @@ -1907,7 +1907,7 @@
  85. ['OS=="freebsd"', {
  86. 'link_settings': {
  87. 'libraries': [
  88. - '-L/usr/local/lib -lexecinfo',
  89. + '-lexecinfo',
  90. ]},
  91. 'sources': [
  92. 'base/debug/stack_trace_posix.cc',
  93. @@ -1919,7 +1919,7 @@
  94. ['OS=="openbsd"', {
  95. 'link_settings': {
  96. 'libraries': [
  97. - '-L/usr/local/lib -lexecinfo',
  98. + '-lexecinfo',
  99. ]},
  100. 'sources': [
  101. 'base/platform/platform-openbsd.cc',
  102. @@ -1930,7 +1930,7 @@
  103. ['OS=="netbsd"', {
  104. 'link_settings': {
  105. 'libraries': [
  106. - '-L/usr/pkg/lib -Wl,-R/usr/pkg/lib -lexecinfo',
  107. + '-lexecinfo',
  108. ]},
  109. 'sources': [
  110. 'base/debug/stack_trace_posix.cc',
  111. Index: lib/dns.js
  112. --- lib/dns.js.orig 2016-10-25 15:26:12.000000000 +0200
  113. +++ lib/dns.js 2016-10-25 20:51:36.817891845 +0200
  114. @@ -161,6 +161,10 @@
  115. req.hostname = hostname;
  116. req.oncomplete = all ? onlookupall : onlookup;
  117. + /* FreeBSD getaddrinfo(3) knows AI_V4MAPPED, but dislikes it */
  118. + if (process.platform === "freebsd")
  119. + hints &= ~(exports.V4MAPPED);
  120. +
  121. var err = cares.getaddrinfo(req, hostname, family, hints);
  122. if (err) {
  123. callback(errnoException(err, 'getaddrinfo', hostname));
  124. Index: lib/module.js
  125. --- lib/module.js.orig 2016-10-25 15:26:12.000000000 +0200
  126. +++ lib/module.js 2016-10-25 20:51:36.817891845 +0200
  127. @@ -619,7 +619,10 @@
  128. homeDir = process.env.HOME;
  129. }
  130. - var paths = [path.resolve(process.execPath, '..', '..', 'lib', 'node')];
  131. + var paths = [
  132. + path.resolve(process.execPath, '..', '..', '..', 'lib', 'node', 'usr'),
  133. + path.resolve(process.execPath, '..', '..', '..', 'lib', 'node', 'pkg')
  134. + ];
  135. if (homeDir) {
  136. paths.unshift(path.resolve(homeDir, '.node_libraries'));
  137. Index: src/inspector_agent.cc
  138. --- src/inspector_agent.cc.orig 2016-10-25 15:26:12.000000000 +0200
  139. +++ src/inspector_agent.cc 2016-10-25 20:51:36.817891845 +0200
  140. @@ -34,7 +34,7 @@
  141. const char TAG_CONNECT[] = "#connect";
  142. const char TAG_DISCONNECT[] = "#disconnect";
  143. -static const uint8_t PROTOCOL_JSON[] = {
  144. +static uint8_t PROTOCOL_JSON[] = {
  145. #include "v8_inspector_protocol_json.h" // NOLINT(build/include_order)
  146. };
  147. Index: src/node_constants.cc
  148. --- src/node_constants.cc.orig 2016-10-25 15:26:12.000000000 +0200
  149. +++ src/node_constants.cc 2016-10-25 20:51:36.817891845 +0200
  150. @@ -16,10 +16,10 @@
  151. #include <limits>
  152. #if HAVE_OPENSSL
  153. -# include <openssl/ec.h>
  154. -# include <openssl/ssl.h>
  155. +# include "openssl/ec.h"
  156. +# include "openssl/ssl.h"
  157. # ifndef OPENSSL_NO_ENGINE
  158. -# include <openssl/engine.h>
  159. +# include "openssl/engine.h"
  160. # endif // !OPENSSL_NO_ENGINE
  161. #endif
  162. Index: src/node_crypto.cc
  163. --- src/node_crypto.cc.orig 2016-10-25 15:26:12.000000000 +0200
  164. +++ src/node_crypto.cc 2016-10-25 20:51:36.817891845 +0200
  165. @@ -24,6 +24,8 @@
  166. #include <stdlib.h>
  167. #include <string.h>
  168. +#include <cmath>
  169. +
  170. #define THROW_AND_RETURN_IF_NOT_STRING_OR_BUFFER(val, prefix) \
  171. do { \
  172. if (!Buffer::HasInstance(val) && !val->IsString()) { \
  173. @@ -5281,7 +5283,7 @@
  174. }
  175. raw_keylen = args[3]->NumberValue();
  176. - if (raw_keylen < 0.0 || isnan(raw_keylen) || isinf(raw_keylen) ||
  177. + if (raw_keylen < 0.0 || std::isnan(raw_keylen) || std::isinf(raw_keylen) ||
  178. raw_keylen > INT_MAX) {
  179. type_error = "Bad key length";
  180. goto err;
  181. Index: src/node_crypto.h
  182. --- src/node_crypto.h.orig 2016-10-25 15:26:12.000000000 +0200
  183. +++ src/node_crypto.h 2016-10-25 20:51:36.817891845 +0200
  184. @@ -17,20 +17,20 @@
  185. #include "v8.h"
  186. -#include <openssl/ssl.h>
  187. -#include <openssl/ec.h>
  188. -#include <openssl/ecdh.h>
  189. +#include "openssl/ssl.h"
  190. +#include "openssl/ec.h"
  191. +#include "openssl/ecdh.h"
  192. #ifndef OPENSSL_NO_ENGINE
  193. -# include <openssl/engine.h>
  194. +# include "openssl/engine.h"
  195. #endif // !OPENSSL_NO_ENGINE
  196. -#include <openssl/err.h>
  197. -#include <openssl/evp.h>
  198. -#include <openssl/pem.h>
  199. -#include <openssl/x509.h>
  200. -#include <openssl/x509v3.h>
  201. -#include <openssl/hmac.h>
  202. -#include <openssl/rand.h>
  203. -#include <openssl/pkcs12.h>
  204. +#include "openssl/err.h"
  205. +#include "openssl/evp.h"
  206. +#include "openssl/pem.h"
  207. +#include "openssl/x509.h"
  208. +#include "openssl/x509v3.h"
  209. +#include "openssl/hmac.h"
  210. +#include "openssl/rand.h"
  211. +#include "openssl/pkcs12.h"
  212. #define EVP_F_EVP_DECRYPTFINAL 101
  213. Index: src/node_internals.h
  214. --- src/node_internals.h.orig 2016-10-25 15:26:12.000000000 +0200
  215. +++ src/node_internals.h 2016-10-25 20:51:36.817891845 +0200
  216. @@ -113,6 +113,7 @@
  217. # define ROUND_UP(a, b) ((a) % (b) ? ((a) + (b)) - ((a) % (b)) : (a))
  218. #endif
  219. +# undef MUST_USE_RESULT
  220. #ifdef __GNUC__
  221. # define MUST_USE_RESULT __attribute__((warn_unused_result))
  222. #else
  223. Index: src/tls_wrap.h
  224. --- src/tls_wrap.h.orig 2016-10-25 15:26:12.000000000 +0200
  225. +++ src/tls_wrap.h 2016-10-25 20:51:36.817891845 +0200
  226. @@ -12,7 +12,7 @@
  227. #include "util.h"
  228. #include "v8.h"
  229. -#include <openssl/ssl.h>
  230. +#include "openssl/ssl.h"
  231. namespace node {
  232. Index: src/util.h
  233. --- src/util.h.orig 2016-10-25 15:26:12.000000000 +0200
  234. +++ src/util.h 2016-10-25 20:51:36.817891845 +0200
  235. @@ -63,9 +63,11 @@
  236. template <typename T> using remove_reference = std::remove_reference<T>;
  237. +#undef FIXED_ONE_BYTE_STRING
  238. #define FIXED_ONE_BYTE_STRING(isolate, string) \
  239. (node::OneByteString((isolate), (string), sizeof(string) - 1))
  240. +#undef DISALLOW_COPY_AND_ASSIGN
  241. #define DISALLOW_COPY_AND_ASSIGN(TypeName) \
  242. void operator=(const TypeName&) = delete; \
  243. void operator=(TypeName&&) = delete; \
  244. @@ -111,12 +113,19 @@
  245. #define CHECK assert
  246. #endif
  247. +#undef ASSERT
  248. #ifdef NDEBUG
  249. #define ASSERT(expr)
  250. #else
  251. #define ASSERT(expr) CHECK(expr)
  252. #endif
  253. +#undef ASSERT_EQ
  254. +#undef ASSERT_GE
  255. +#undef ASSERT_GT
  256. +#undef ASSERT_LE
  257. +#undef ASSERT_LT
  258. +#undef ASSERT_NE
  259. #define ASSERT_EQ(a, b) ASSERT((a) == (b))
  260. #define ASSERT_GE(a, b) ASSERT((a) >= (b))
  261. #define ASSERT_GT(a, b) ASSERT((a) > (b))
  262. @@ -124,13 +133,20 @@
  263. #define ASSERT_LT(a, b) ASSERT((a) < (b))
  264. #define ASSERT_NE(a, b) ASSERT((a) != (b))
  265. +#undef CHECK_EQ
  266. #define CHECK_EQ(a, b) CHECK((a) == (b))
  267. +#undef CHECK_GE
  268. #define CHECK_GE(a, b) CHECK((a) >= (b))
  269. +#undef CHECK_GT
  270. #define CHECK_GT(a, b) CHECK((a) > (b))
  271. +#undef CHECK_LE
  272. #define CHECK_LE(a, b) CHECK((a) <= (b))
  273. +#undef CHECK_LT
  274. #define CHECK_LT(a, b) CHECK((a) < (b))
  275. +#undef CHECK_NE
  276. #define CHECK_NE(a, b) CHECK((a) != (b))
  277. +#undef UNREACHABLE
  278. #define UNREACHABLE() ABORT()
  279. #define ASSIGN_OR_RETURN_UNWRAP(ptr, obj, ...) \
  280. Index: tools/install.py
  281. --- tools/install.py.orig 2016-10-25 15:26:21.000000000 +0200
  282. +++ tools/install.py 2016-10-25 20:51:36.817891845 +0200
  283. @@ -134,10 +134,7 @@
  284. action(['deps/v8/tools/gdbinit'], 'share/doc/node/')
  285. - if 'freebsd' in sys.platform or 'openbsd' in sys.platform:
  286. - action(['doc/node.1'], 'man/man1/')
  287. - else:
  288. - action(['doc/node.1'], 'share/man/man1/')
  289. + action(['doc/node.1'], 'man/man1/')
  290. if 'true' == variables.get('node_install_npm'): npm_files(action)