Index: common.gypi --- common.gypi.orig 2021-11-30 13:04:55.000000000 +0100 +++ common.gypi 2021-12-01 17:42:00.514067000 +0100 @@ -177,7 +177,7 @@ }], ], }, - 'cflags': [ '-O3' ], + 'cflags': [ '-O2' ], 'conditions': [ ['enable_lto=="true"', { 'cflags': ['<(lto)'], @@ -380,7 +380,7 @@ 'ldflags': [ '-pthread' ], }], [ 'OS in "linux freebsd openbsd solaris android aix cloudabi"', { - 'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ], + 'cflags': [ '-Wno-unused-parameter', ], 'cflags_cc': [ '-fno-rtti', '-fno-exceptions', '-std=gnu++1y' ], 'defines': [ '__STDC_FORMAT_MACROS' ], 'ldflags': [ '-rdynamic' ], @@ -492,10 +492,7 @@ '-fno-strict-aliasing', ], 'WARNING_CFLAGS': [ - '-Wall', - '-Wendif-labels', - '-W', - '-Wno-unused-parameter', + '-Wno-unused-parameter' ], }, 'target_conditions': [ Index: deps/uv/common.gypi --- deps/uv/common.gypi.orig 2021-11-30 13:04:57.000000000 +0100 +++ deps/uv/common.gypi 2021-12-01 17:42:00.514415000 +0100 @@ -46,7 +46,7 @@ 'Release': { 'defines': [ 'NDEBUG' ], 'cflags': [ - '-O3', + '-O2', ], 'msvs_settings': { 'VCCLCompilerTool': { Index: deps/uv/uv.gyp --- deps/uv/uv.gyp.orig 2021-11-30 13:04:57.000000000 +0100 +++ deps/uv/uv.gyp 2021-12-01 17:42:00.514543000 +0100 @@ -178,7 +178,7 @@ 'src/unix/udp.c', ], 'link_settings': { - 'libraries': [ '-lm' ], + 'libraries': [ '-lz', '-lm' ], 'conditions': [ ['OS=="solaris"', { 'ldflags': [ '-pthreads' ], Index: deps/v8/src/base/platform/platform-freebsd.cc --- deps/v8/src/base/platform/platform-freebsd.cc.orig 2021-11-30 13:04:57.000000000 +0100 +++ deps/v8/src/base/platform/platform-freebsd.cc 2021-12-01 17:42:00.514666000 +0100 @@ -28,6 +28,7 @@ #include // index #include +#include #undef MAP_TYPE Index: deps/v8/src/builtins/base.tq --- deps/v8/src/builtins/base.tq.orig 2021-11-30 13:04:57.000000000 +0100 +++ deps/v8/src/builtins/base.tq 2021-12-01 17:42:00.514929000 +0100 @@ -1089,10 +1089,6 @@ return UnsafeCast(LoadNativeContext( context)[NativeContextSlot::JS_ARRAY_PACKED_ELEMENTS_MAP_INDEX]); } -macro GetFastPackedSmiElementsJSArrayMap(implicit context: Context)(): Map { - return UnsafeCast(LoadNativeContext( - context)[NativeContextSlot::JS_ARRAY_PACKED_SMI_ELEMENTS_MAP_INDEX]); -} macro GetProxyRevocableResultMap(implicit context: Context)(): Map { return UnsafeCast(LoadNativeContext( context)[NativeContextSlot::PROXY_REVOCABLE_RESULT_MAP_INDEX]); Index: deps/v8/src/objects/js-array.tq --- deps/v8/src/objects/js-array.tq.orig 2021-11-30 13:04:57.000000000 +0100 +++ deps/v8/src/objects/js-array.tq 2021-12-01 17:42:00.515072000 +0100 @@ -9,9 +9,6 @@ } extern class JSArray extends JSObject { - macro IsEmpty(): bool { - return this.length == 0; - } length: Number; } @@ -25,15 +22,6 @@ }; } -macro NewJSArray(implicit context: Context)(): JSArray { - return new JSArray{ - map: GetFastPackedSmiElementsJSArrayMap(), - properties_or_hash: kEmptyFixedArray, - elements: kEmptyFixedArray, - length: 0 - }; -} - // A HeapObject with a JSArray map, and either fast packed elements, or fast // holey elements when the global NoElementsProtector is not invalidated. transient type FastJSArray extends JSArray; Index: deps/v8/src/wasm/wasm-result.cc --- deps/v8/src/wasm/wasm-result.cc.orig 2021-11-30 13:04:57.000000000 +0100 +++ deps/v8/src/wasm/wasm-result.cc 2021-12-01 17:42:00.515194000 +0100 @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include + #include "src/wasm/wasm-result.h" #include "src/execution/isolate-inl.h" Index: lib/dns.js --- lib/dns.js.orig 2021-11-30 13:04:59.000000000 +0100 +++ lib/dns.js 2021-12-01 17:42:00.515519000 +0100 @@ -150,6 +150,10 @@ req.hostname = hostname; req.oncomplete = all ? onlookupall : onlookup; + /* FreeBSD getaddrinfo(3) knows AI_V4MAPPED, but dislikes it */ + if (process.platform === "freebsd") + hints &= ~(exports.V4MAPPED); + const err = cares.getaddrinfo( req, toASCII(hostname), family, hints, verbatim ); Index: lib/internal/modules/cjs/loader.js --- lib/internal/modules/cjs/loader.js.orig 2021-11-30 13:04:59.000000000 +0100 +++ lib/internal/modules/cjs/loader.js 2021-12-01 17:42:00.515720000 +0100 @@ -1202,7 +1202,10 @@ path.resolve(process.execPath, '..') : path.resolve(process.execPath, '..', '..'); - let paths = [path.resolve(prefixDir, 'lib', 'node')]; + let paths = [ + path.resolve(prefixDir, '..', 'lib', 'node', 'usr'), + path.resolve(prefixDir, '..', 'lib', 'node', 'pkg') + ]; if (homeDir) { ArrayPrototypeUnshift(paths, path.resolve(homeDir, '.node_libraries')); Index: src/inspector_socket_server.cc --- src/inspector_socket_server.cc.orig 2021-11-30 13:04:59.000000000 +0100 +++ src/inspector_socket_server.cc 2021-12-01 17:42:00.515859000 +0100 @@ -20,7 +20,7 @@ bool include_protocol); namespace { -static const uint8_t PROTOCOL_JSON[] = { +static uint8_t PROTOCOL_JSON[] = { #include "v8_inspector_protocol_json.h" // NOLINT(build/include_order) }; Index: src/node_constants.cc --- src/node_constants.cc.orig 2021-11-30 13:04:59.000000000 +0100 +++ src/node_constants.cc 2021-12-01 17:42:00.516024000 +0100 @@ -36,10 +36,10 @@ #if HAVE_OPENSSL -#include -#include +#include "openssl/ec.h" +#include "openssl/ssl.h" #ifndef OPENSSL_NO_ENGINE -#include +#include "openssl/engine.h" #endif // !OPENSSL_NO_ENGINE #endif // HAVE_OPENSSL Index: src/node_crypto.cc --- src/node_crypto.cc.orig 2021-11-30 13:04:59.000000000 +0100 +++ src/node_crypto.cc 2021-12-01 17:42:00.516675000 +0100 @@ -40,17 +40,17 @@ #include "util-inl.h" #include "v8.h" -#include -#include +#include "openssl/ec.h" +#include "openssl/ecdh.h" #ifndef OPENSSL_NO_ENGINE -# include +# include "openssl/engine.h" #endif // !OPENSSL_NO_ENGINE -#include -#include -#include -#include -#include -#include +#include "openssl/evp.h" +#include "openssl/pem.h" +#include "openssl/x509v3.h" +#include "openssl/hmac.h" +#include "openssl/rand.h" +#include "openssl/pkcs12.h" #include #include // INT_MAX Index: src/tls_wrap.h --- src/tls_wrap.h.orig 2021-11-30 13:04:59.000000000 +0100 +++ src/tls_wrap.h 2021-12-01 17:42:00.516787000 +0100 @@ -31,7 +31,7 @@ #include "stream_wrap.h" #include "v8.h" -#include +#include "openssl/ssl.h" #include Index: src/util.h --- src/util.h.orig 2021-11-30 13:04:59.000000000 +0100 +++ src/util.h 2021-12-01 17:42:00.516948000 +0100 @@ -157,14 +157,23 @@ } \ } while (0) +#undef CHECK_EQ #define CHECK_EQ(a, b) CHECK((a) == (b)) +#undef CHECK_GE #define CHECK_GE(a, b) CHECK((a) >= (b)) +#undef CHECK_GT #define CHECK_GT(a, b) CHECK((a) > (b)) +#undef CHECK_LE #define CHECK_LE(a, b) CHECK((a) <= (b)) +#undef CHECK_LT #define CHECK_LT(a, b) CHECK((a) < (b)) +#undef CHECK_NE #define CHECK_NE(a, b) CHECK((a) != (b)) +#undef CHECK_NULL #define CHECK_NULL(val) CHECK((val) == nullptr) +#undef CHECK_NOT_NULL #define CHECK_NOT_NULL(val) CHECK((val) != nullptr) +#undef CHECK_IMPLIES #define CHECK_IMPLIES(a, b) CHECK(!(a) || (b)) #ifdef DEBUG @@ -192,6 +201,7 @@ #endif +#undef UNREACHABLE #define UNREACHABLE(...) \ ERROR_AND_ABORT("Unreachable code reached" __VA_OPT__(": ") __VA_ARGS__) Index: tools/install.py --- tools/install.py.orig 2021-11-30 13:05:00.000000000 +0100 +++ tools/install.py 2021-12-01 17:42:00.517234000 +0100 @@ -147,10 +147,7 @@ action(['deps/v8/tools/gdbinit'], 'share/doc/node/') action(['deps/v8/tools/lldb_commands.py'], 'share/doc/node/') - if 'freebsd' in sys.platform or 'openbsd' in sys.platform: - action(['doc/node.1'], 'man/man1/') - else: - action(['doc/node.1'], 'share/man/man1/') + action(['doc/node.1'], 'man/man1/') if 'true' == variables.get('node_install_npm'): npm_files(action) Index: tools/v8_gypfiles/toolchain.gypi --- tools/v8_gypfiles/toolchain.gypi.orig 2021-11-30 13:05:00.000000000 +0100 +++ tools/v8_gypfiles/toolchain.gypi 2021-12-01 17:42:00.517427000 +0100 @@ -1080,12 +1080,6 @@ ['OS=="solaris"', { 'defines': [ '__C99FEATURES__=1' ], # isinf() etc. }], - ['OS=="freebsd" or OS=="openbsd"', { - 'cflags': [ '-I/usr/local/include' ], - }], - ['OS=="netbsd"', { - 'cflags': [ '-I/usr/pkg/include' ], - }], ['OS=="aix"', { 'defines': [ # Support for malloc(0) @@ -1233,8 +1227,8 @@ # Don't use -O3 with sanitizers. ['asan==0 and msan==0 and lsan==0 \ and tsan==0 and ubsan==0 and ubsan_vptr==0', { - 'cflags': ['-O3'], - 'cflags!': ['-O2'], + 'cflags': ['-O2'], + 'cflags!': ['-O3'], }, { 'cflags': ['-O2'], 'cflags!': ['-O3'], @@ -1282,8 +1276,8 @@ # Don't use -O3 with sanitizers. ['asan==0 and msan==0 and lsan==0 \ and tsan==0 and ubsan==0 and ubsan_vptr==0', { - 'cflags': ['-O3'], - 'cflags!': ['-O2'], + 'cflags': ['-O2'], + 'cflags!': ['-O3'], }, { 'cflags': ['-O2'], 'cflags!': ['-O3'], Index: tools/v8_gypfiles/v8.gyp --- tools/v8_gypfiles/v8.gyp.orig 2021-11-30 13:05:00.000000000 +0100 +++ tools/v8_gypfiles/v8.gyp 2021-12-01 17:42:00.517642000 +0100 @@ -173,7 +173,6 @@ "<(V8_ROOT)/src/objects/template-objects.tq", "<(V8_ROOT)/src/objects/template.tq", "<(V8_ROOT)/src/wasm/wasm-objects.tq", - "<(V8_ROOT)/test/torque/test-torque.tq", "<(V8_ROOT)/third_party/v8/builtins/array-sort.tq", ], 'torque_output_root': '<(SHARED_INTERMEDIATE_DIR)/torque-output-root',