node9.patch 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363
  1. Index: common.gypi
  2. --- common.gypi.orig 2017-10-06 20:33:19.000000000 +0200
  3. +++ common.gypi 2017-10-07 09:39:20.751676000 +0200
  4. @@ -123,7 +123,7 @@
  5. 'variables': {
  6. 'v8_enable_handle_zapping': 0,
  7. },
  8. - 'cflags': [ '-O3' ],
  9. + 'cflags': [ '-O2' ],
  10. 'conditions': [
  11. ['target_arch=="x64"', {
  12. 'msvs_configuration_platform': 'x64',
  13. @@ -280,7 +280,7 @@
  14. 'ldflags': [ '-pthread' ],
  15. }],
  16. [ 'OS in "linux freebsd openbsd solaris android aix"', {
  17. - 'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ],
  18. + 'cflags': [ '-Wno-unused-parameter', ],
  19. 'cflags_cc': [ '-fno-rtti', '-fno-exceptions', '-std=gnu++0x' ],
  20. 'ldflags': [ '-rdynamic' ],
  21. 'target_conditions': [
  22. @@ -371,10 +371,7 @@
  23. '-fno-strict-aliasing',
  24. ],
  25. 'WARNING_CFLAGS': [
  26. - '-Wall',
  27. - '-Wendif-labels',
  28. - '-W',
  29. - '-Wno-unused-parameter',
  30. + '-Wno-unused-parameter'
  31. ],
  32. },
  33. 'target_conditions': [
  34. Index: configure
  35. --- configure.orig 2017-10-06 20:33:19.000000000 +0200
  36. +++ configure 2017-10-07 09:39:20.752006000 +0200
  37. @@ -667,6 +667,8 @@
  38. if is_clang:
  39. o['variables']['llvm_version'] = get_llvm_version(CC)
  40. + else:
  41. + o['variables']['llvm_version'] = 0
  42. # Need xcode_version or gas_version when openssl asm files are compiled.
  43. if options.without_ssl or options.openssl_no_asm or options.shared_openssl:
  44. Index: deps/uv/common.gypi
  45. --- deps/uv/common.gypi.orig 2017-10-07 09:39:20.752192000 +0200
  46. +++ deps/uv/common.gypi 2017-10-07 09:39:44.201257000 +0200
  47. @@ -46,7 +46,7 @@
  48. 'Release': {
  49. 'defines': [ 'NDEBUG' ],
  50. 'cflags': [
  51. - '-O3',
  52. + '-O2',
  53. ],
  54. 'msvs_settings': {
  55. 'VCCLCompilerTool': {
  56. Index: deps/uv/uv.gyp
  57. --- deps/uv/uv.gyp.orig 2017-10-06 20:33:32.000000000 +0200
  58. +++ deps/uv/uv.gyp 2017-10-07 09:39:20.752463000 +0200
  59. @@ -167,7 +167,7 @@
  60. 'src/unix/udp.c',
  61. ],
  62. 'link_settings': {
  63. - 'libraries': [ '-lm' ],
  64. + 'libraries': [ '-lz', '-lm' ],
  65. 'conditions': [
  66. ['OS=="solaris"', {
  67. 'ldflags': [ '-pthreads' ],
  68. Index: deps/v8/gypfiles/toolchain.gypi
  69. --- deps/v8/gypfiles/toolchain.gypi.orig 2017-10-06 20:33:33.000000000 +0200
  70. +++ deps/v8/gypfiles/toolchain.gypi 2017-10-07 09:39:20.752724000 +0200
  71. @@ -1079,12 +1079,6 @@
  72. ['OS=="solaris"', {
  73. 'defines': [ '__C99FEATURES__=1' ], # isinf() etc.
  74. }],
  75. - ['OS=="freebsd" or OS=="openbsd"', {
  76. - 'cflags': [ '-I/usr/local/include' ],
  77. - }],
  78. - ['OS=="netbsd"', {
  79. - 'cflags': [ '-I/usr/pkg/include' ],
  80. - }],
  81. ['OS=="aix"', {
  82. 'defines': [
  83. # Support for malloc(0)
  84. @@ -1194,8 +1188,8 @@
  85. # Don't use -O3 with sanitizers.
  86. ['asan==0 and msan==0 and lsan==0 \
  87. and tsan==0 and ubsan==0 and ubsan_vptr==0', {
  88. - 'cflags': ['-O3'],
  89. - 'cflags!': ['-O2'],
  90. + 'cflags': ['-O2'],
  91. + 'cflags!': ['-O3'],
  92. }, {
  93. 'cflags': ['-O2'],
  94. 'cflags!': ['-O3'],
  95. @@ -1310,8 +1304,8 @@
  96. # Don't use -O3 with sanitizers.
  97. ['asan==0 and msan==0 and lsan==0 \
  98. and tsan==0 and ubsan==0 and ubsan_vptr==0', {
  99. - 'cflags': ['-O3'],
  100. - 'cflags!': ['-O2'],
  101. + 'cflags': ['-O2'],
  102. + 'cflags!': ['-O3'],
  103. }, {
  104. 'cflags': ['-O2'],
  105. 'cflags!': ['-O3'],
  106. Index: deps/v8/src/base/platform/platform-freebsd.cc
  107. --- deps/v8/src/base/platform/platform-freebsd.cc.orig 2017-10-06 20:33:34.000000000 +0200
  108. +++ deps/v8/src/base/platform/platform-freebsd.cc 2017-10-07 09:39:20.752865000 +0200
  109. @@ -25,6 +25,7 @@
  110. #include <strings.h> // index
  111. #include <cmath>
  112. +#include <cstdio>
  113. #undef MAP_TYPE
  114. Index: deps/v8/src/log-utils.cc
  115. --- deps/v8/src/log-utils.cc.orig 2017-10-06 20:33:40.000000000 +0200
  116. +++ deps/v8/src/log-utils.cc 2017-10-07 09:39:20.753082000 +0200
  117. @@ -2,6 +2,9 @@
  118. // Use of this source code is governed by a BSD-style license that can be
  119. // found in the LICENSE file.
  120. +#include <stdio.h>
  121. +#include <stdlib.h>
  122. +
  123. #include "src/log-utils.h"
  124. #include "src/assert-scope.h"
  125. Index: deps/v8/src/v8.gyp
  126. --- deps/v8/src/v8.gyp.orig 2017-10-06 20:33:43.000000000 +0200
  127. +++ deps/v8/src/v8.gyp 2017-10-07 09:39:20.753468000 +0200
  128. @@ -2028,7 +2028,7 @@
  129. ['OS=="freebsd"', {
  130. 'link_settings': {
  131. 'libraries': [
  132. - '-L/usr/local/lib -lexecinfo',
  133. + '-lexecinfo',
  134. ]},
  135. 'sources': [
  136. 'base/debug/stack_trace_posix.cc',
  137. @@ -2043,7 +2043,7 @@
  138. ['OS=="openbsd"', {
  139. 'link_settings': {
  140. 'libraries': [
  141. - '-L/usr/local/lib -lexecinfo',
  142. + '-lexecinfo',
  143. ]},
  144. 'sources': [
  145. 'base/platform/platform-openbsd.cc',
  146. @@ -2057,7 +2057,7 @@
  147. ['OS=="netbsd"', {
  148. 'link_settings': {
  149. 'libraries': [
  150. - '-L/usr/pkg/lib -Wl,-R/usr/pkg/lib -lexecinfo',
  151. + '-lexecinfo',
  152. ]},
  153. 'sources': [
  154. 'base/debug/stack_trace_posix.cc',
  155. Index: deps/v8/src/wasm/wasm-result.cc
  156. --- deps/v8/src/wasm/wasm-result.cc.orig 2017-10-06 20:33:43.000000000 +0200
  157. +++ deps/v8/src/wasm/wasm-result.cc 2017-10-07 09:39:20.753608000 +0200
  158. @@ -2,6 +2,8 @@
  159. // Use of this source code is governed by a BSD-style license that can be
  160. // found in the LICENSE file.
  161. +#include <cstdarg>
  162. +
  163. #include "src/wasm/wasm-result.h"
  164. #include "src/factory.h"
  165. Index: lib/dns.js
  166. --- lib/dns.js.orig 2017-10-06 20:34:01.000000000 +0200
  167. +++ lib/dns.js 2017-10-07 09:39:20.753785000 +0200
  168. @@ -187,6 +187,10 @@
  169. req.hostname = hostname;
  170. req.oncomplete = all ? onlookupall : onlookup;
  171. + /* FreeBSD getaddrinfo(3) knows AI_V4MAPPED, but dislikes it */
  172. + if (process.platform === "freebsd")
  173. + hints &= ~(exports.V4MAPPED);
  174. +
  175. var err = cares.getaddrinfo(req, hostname, family, hints, verbatim);
  176. if (err) {
  177. process.nextTick(callback, errnoException(err, 'getaddrinfo', hostname));
  178. Index: lib/module.js
  179. --- lib/module.js.orig 2017-10-06 20:34:02.000000000 +0200
  180. +++ lib/module.js 2017-10-07 09:39:20.753967000 +0200
  181. @@ -662,7 +662,10 @@
  182. } else {
  183. prefixDir = path.resolve(process.execPath, '..', '..');
  184. }
  185. - var paths = [path.resolve(prefixDir, 'lib', 'node')];
  186. + var paths = [
  187. + path.resolve(prefixDir, '..', 'lib', 'node', 'usr'),
  188. + path.resolve(prefixDir, '..', 'lib', 'node', 'pkg')
  189. + ];
  190. if (homeDir) {
  191. paths.unshift(path.resolve(homeDir, '.node_libraries'));
  192. Index: src/inspector_socket_server.cc
  193. --- src/inspector_socket_server.cc.orig 2017-10-06 20:34:03.000000000 +0200
  194. +++ src/inspector_socket_server.cc 2017-10-07 09:39:20.754182000 +0200
  195. @@ -36,7 +36,7 @@
  196. namespace {
  197. -static const uint8_t PROTOCOL_JSON[] = {
  198. +static uint8_t PROTOCOL_JSON[] = {
  199. #include "v8_inspector_protocol_json.h" // NOLINT(build/include_order)
  200. };
  201. Index: src/node_constants.cc
  202. --- src/node_constants.cc.orig 2017-10-06 20:34:03.000000000 +0200
  203. +++ src/node_constants.cc 2017-10-07 09:39:20.754391000 +0200
  204. @@ -35,10 +35,10 @@
  205. #include <limits>
  206. #if HAVE_OPENSSL
  207. -# include <openssl/ec.h>
  208. -# include <openssl/ssl.h>
  209. +# include "openssl/ec.h"
  210. +# include "openssl/ssl.h"
  211. # ifndef OPENSSL_NO_ENGINE
  212. -# include <openssl/engine.h>
  213. +# include "openssl/engine.h"
  214. # endif // !OPENSSL_NO_ENGINE
  215. #endif
  216. Index: src/node_crypto.cc
  217. --- src/node_crypto.cc.orig 2017-10-06 20:34:03.000000000 +0200
  218. +++ src/node_crypto.cc 2017-10-07 09:39:20.755195000 +0200
  219. @@ -51,6 +51,8 @@
  220. #include <stdlib.h>
  221. #include <string.h>
  222. +#include <cmath>
  223. +
  224. #define THROW_AND_RETURN_IF_NOT_STRING_OR_BUFFER(val, prefix) \
  225. do { \
  226. if (!Buffer::HasInstance(val) && !val->IsString()) { \
  227. @@ -5384,7 +5386,7 @@
  228. }
  229. raw_keylen = args[3]->NumberValue();
  230. - if (raw_keylen < 0.0 || isnan(raw_keylen) || isinf(raw_keylen) ||
  231. + if (raw_keylen < 0.0 || std::isnan(raw_keylen) || std::isinf(raw_keylen) ||
  232. raw_keylen > INT_MAX) {
  233. type_error = "Bad key length";
  234. goto err;
  235. Index: src/node_crypto.h
  236. --- src/node_crypto.h.orig 2017-10-06 20:34:03.000000000 +0200
  237. +++ src/node_crypto.h 2017-10-07 09:39:20.755399000 +0200
  238. @@ -38,20 +38,20 @@
  239. #include "v8.h"
  240. -#include <openssl/ssl.h>
  241. -#include <openssl/ec.h>
  242. -#include <openssl/ecdh.h>
  243. +#include "openssl/ssl.h"
  244. +#include "openssl/ec.h"
  245. +#include "openssl/ecdh.h"
  246. #ifndef OPENSSL_NO_ENGINE
  247. -# include <openssl/engine.h>
  248. +# include "openssl/engine.h"
  249. #endif // !OPENSSL_NO_ENGINE
  250. -#include <openssl/err.h>
  251. -#include <openssl/evp.h>
  252. -#include <openssl/pem.h>
  253. -#include <openssl/x509.h>
  254. -#include <openssl/x509v3.h>
  255. -#include <openssl/hmac.h>
  256. -#include <openssl/rand.h>
  257. -#include <openssl/pkcs12.h>
  258. +#include "openssl/err.h"
  259. +#include "openssl/evp.h"
  260. +#include "openssl/pem.h"
  261. +#include "openssl/x509.h"
  262. +#include "openssl/x509v3.h"
  263. +#include "openssl/hmac.h"
  264. +#include "openssl/rand.h"
  265. +#include "openssl/pkcs12.h"
  266. #define EVP_F_EVP_DECRYPTFINAL 101
  267. Index: src/node_internals.h
  268. --- src/node_internals.h.orig 2017-10-06 20:34:04.000000000 +0200
  269. +++ src/node_internals.h 2017-10-07 09:39:20.755546000 +0200
  270. @@ -172,6 +172,7 @@
  271. # define ROUND_UP(a, b) ((a) % (b) ? ((a) + (b)) - ((a) % (b)) : (a))
  272. #endif
  273. +# undef MUST_USE_RESULT
  274. #ifdef __GNUC__
  275. # define MUST_USE_RESULT __attribute__((warn_unused_result))
  276. #else
  277. Index: src/tls_wrap.h
  278. --- src/tls_wrap.h.orig 2017-10-06 20:34:05.000000000 +0200
  279. +++ src/tls_wrap.h 2017-10-07 09:39:20.755676000 +0200
  280. @@ -33,7 +33,7 @@
  281. #include "util.h"
  282. #include "v8.h"
  283. -#include <openssl/ssl.h>
  284. +#include "openssl/ssl.h"
  285. namespace node {
  286. Index: src/util.h
  287. --- src/util.h.orig 2017-10-06 20:34:06.000000000 +0200
  288. +++ src/util.h 2017-10-07 09:39:20.755832000 +0200
  289. @@ -84,9 +84,11 @@
  290. template <typename T> using remove_reference = std::remove_reference<T>;
  291. +#undef FIXED_ONE_BYTE_STRING
  292. #define FIXED_ONE_BYTE_STRING(isolate, string) \
  293. (node::OneByteString((isolate), (string), sizeof(string) - 1))
  294. +#undef DISALLOW_COPY_AND_ASSIGN
  295. #define DISALLOW_COPY_AND_ASSIGN(TypeName) \
  296. void operator=(const TypeName&) = delete; \
  297. void operator=(TypeName&&) = delete; \
  298. @@ -124,13 +126,20 @@
  299. } \
  300. } while (0)
  301. +#undef CHECK_EQ
  302. #define CHECK_EQ(a, b) CHECK((a) == (b))
  303. +#undef CHECK_GE
  304. #define CHECK_GE(a, b) CHECK((a) >= (b))
  305. +#undef CHECK_GT
  306. #define CHECK_GT(a, b) CHECK((a) > (b))
  307. +#undef CHECK_LE
  308. #define CHECK_LE(a, b) CHECK((a) <= (b))
  309. +#undef CHECK_LT
  310. #define CHECK_LT(a, b) CHECK((a) < (b))
  311. +#undef CHECK_NE
  312. #define CHECK_NE(a, b) CHECK((a) != (b))
  313. +#undef UNREACHABLE
  314. #define UNREACHABLE() ABORT()
  315. #define ASSIGN_OR_RETURN_UNWRAP(ptr, obj, ...) \
  316. Index: tools/install.py
  317. --- tools/install.py.orig 2017-10-06 20:34:29.000000000 +0200
  318. +++ tools/install.py 2017-10-07 09:39:20.755973000 +0200
  319. @@ -148,10 +148,7 @@
  320. action(['deps/v8/tools/lldbinit'], 'share/doc/node/')
  321. action(['deps/v8/tools/lldb_commands.py'], 'share/doc/node/')
  322. - if 'freebsd' in sys.platform or 'openbsd' in sys.platform:
  323. - action(['doc/node.1'], 'man/man1/')
  324. - else:
  325. - action(['doc/node.1'], 'share/man/man1/')
  326. + action(['doc/node.1'], 'man/man1/')
  327. if 'true' == variables.get('node_install_npm'): npm_files(action)