From 71fe7bde0755808e2ec05ac37e2da08b60eeac29 Mon Sep 17 00:00:00 2001 From: hootigger Date: Sun, 4 Oct 2020 13:07:03 +0800 Subject: [PATCH] node: update to v12.18.4 --- lang/node/Makefile | 6 +- lang/node/patches/003-path.patch | 2 +- lang/node/patches/006-mips64_support.patch | 6 +- ...necessary_libraries_for_host_execute.patch | 10 +- .../patches/999-localhost-no-addrconfig.patch | 29 +++ lang/node/patches/999-mips-fix.patch | 210 ++++++++++++++++++ lang/node/patches/999-mips-less-memory.patch | 26 +++ ...this_build_method_will_be_deprecated.patch | 14 +- 8 files changed, 279 insertions(+), 24 deletions(-) create mode 100644 lang/node/patches/999-localhost-no-addrconfig.patch create mode 100644 lang/node/patches/999-mips-fix.patch create mode 100644 lang/node/patches/999-mips-less-memory.patch diff --git a/lang/node/Makefile b/lang/node/Makefile index 5b368c13..9b7f85ed 100644 --- a/lang/node/Makefile +++ b/lang/node/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=node -PKG_VERSION:=v12.16.1 -PKG_RELEASE:=2 +PKG_VERSION:=v12.18.4 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://nodejs.org/dist/$(PKG_VERSION) -PKG_HASH:=0a95845ba02c46102b5671d0c5732460073f2d397488337e18d1fc30146d412d +PKG_HASH:=25f03cb18e53b6d0959d0c219e701a85eb4693f526bdda7c72bc6199b364f609 PKG_MAINTAINER:=John Crispin , Adrian Panella PKG_LICENSE:=MIT diff --git a/lang/node/patches/003-path.patch b/lang/node/patches/003-path.patch index 63fe78b6..c49fa791 100644 --- a/lang/node/patches/003-path.patch +++ b/lang/node/patches/003-path.patch @@ -1,6 +1,6 @@ --- a/lib/internal/modules/cjs/loader.js +++ b/lib/internal/modules/cjs/loader.js -@@ -1260,7 +1260,8 @@ +@@ -1239,7 +1239,8 @@ path.resolve(process.execPath, '..') : path.resolve(process.execPath, '..', '..'); diff --git a/lang/node/patches/006-mips64_support.patch b/lang/node/patches/006-mips64_support.patch index 5bd1b839..b4d72c30 100644 --- a/lang/node/patches/006-mips64_support.patch +++ b/lang/node/patches/006-mips64_support.patch @@ -9,7 +9,7 @@ 'ppc64', 'x32','x64', 'x86', 'x86_64', 's390x') valid_arm_float_abi = ('soft', 'softfp', 'hard') valid_arm_fpu = ('vfp', 'vfpv3', 'vfpv3-d16', 'neon') -@@ -896,6 +896,9 @@ +@@ -956,6 +956,9 @@ if rtn == 'mipsel' and '_LP64' in k: rtn = 'mips64el' @@ -19,12 +19,12 @@ return rtn -@@ -1001,7 +1004,7 @@ +@@ -1063,7 +1066,7 @@ if target_arch == 'arm': configure_arm(o) - elif target_arch in ('mips', 'mipsel', 'mips64el'): + elif target_arch in ('mips', 'mipsel', 'mips64', 'mips64el'): - configure_mips(o) + configure_mips(o, target_arch) if flavor == 'aix': diff --git a/lang/node/patches/999-delete_unnecessary_libraries_for_host_execute.patch b/lang/node/patches/999-delete_unnecessary_libraries_for_host_execute.patch index 36ef76f1..6564b177 100644 --- a/lang/node/patches/999-delete_unnecessary_libraries_for_host_execute.patch +++ b/lang/node/patches/999-delete_unnecessary_libraries_for_host_execute.patch @@ -34,7 +34,7 @@ '<@(icu_src_genccode)', --- a/tools/v8_gypfiles/v8.gyp 2019-06-27 19:12:20.000000000 +0900 +++ b/tools/v8_gypfiles/v8.gyp 2019-07-01 14:40:48.292020880 +0900 -@@ -1265,6 +1265,7 @@ +@@ -1255,6 +1255,7 @@ { 'target_name': 'bytecode_builtins_list_generator', 'type': 'executable', @@ -42,7 +42,7 @@ 'conditions': [ ['want_separate_host_toolset', { 'toolsets': ['host'], -@@ -1288,6 +1289,8 @@ +@@ -1278,6 +1279,8 @@ { 'target_name': 'mksnapshot', 'type': 'executable', @@ -51,7 +51,7 @@ 'dependencies': [ 'v8_base_without_compiler', 'v8_compiler_for_mksnapshot', -@@ -1310,6 +1313,7 @@ +@@ -1300,6 +1303,7 @@ { 'target_name': 'torque', 'type': 'executable', @@ -59,7 +59,7 @@ 'dependencies': [ 'torque_base', # "build/win:default_exe_manifest", -@@ -1348,6 +1352,7 @@ +@@ -1338,6 +1342,7 @@ { 'target_name': 'torque-language-server', 'type': 'executable', @@ -67,7 +67,7 @@ 'conditions': [ ['want_separate_host_toolset', { 'toolsets': ['host'], -@@ -1375,6 +1380,8 @@ +@@ -1365,6 +1370,8 @@ { 'target_name': 'gen-regexp-special-case', 'type': 'executable', diff --git a/lang/node/patches/999-localhost-no-addrconfig.patch b/lang/node/patches/999-localhost-no-addrconfig.patch new file mode 100644 index 00000000..4d119732 --- /dev/null +++ b/lang/node/patches/999-localhost-no-addrconfig.patch @@ -0,0 +1,29 @@ +Description: do not use dns.ADDRCONFIG for localhost + it fails on IPv6-only systems. Setting it with libc fails on linux. + https://github.com/nodejs/node/issues/33279 +Author: Jérémy Lal +Last-Update: 2020-06-11 +Bug-Debian: https://bugs.debian.org/962318 +Forwarded: https://github.com/nodejs/node/issues/33816 +--- a/lib/net.js ++++ b/lib/net.js +@@ -1,4 +1,5 @@ + // Copyright Joyent, Inc. and other Node contributors. ++ + // + // Permission is hereby granted, free of charge, to any person obtaining a + // copy of this software and associated documentation files (the +@@ -1028,13 +1029,6 @@ + hints: options.hints || 0 + }; + +- if (!isWindows && +- dnsopts.family !== 4 && +- dnsopts.family !== 6 && +- dnsopts.hints === 0) { +- dnsopts.hints = dns.ADDRCONFIG; +- } +- + debug('connect: find host', host); + debug('connect: dns options', dnsopts); + self._host = host; diff --git a/lang/node/patches/999-mips-fix.patch b/lang/node/patches/999-mips-fix.patch new file mode 100644 index 00000000..33a2eacf --- /dev/null +++ b/lang/node/patches/999-mips-fix.patch @@ -0,0 +1,210 @@ +Description: upstream mips fix +Origin: https://github.com/nodejs/node/issues/31118 +Last-Update: 2020-05-30 + +--- a/deps/v8/AUTHORS ++++ b/deps/v8/AUTHORS +@@ -106,6 +106,7 @@ + James M Snell + Jianghua Yang + Jiawen Geng ++Jiaxun Yang + Joel Stanley + Johan Bergström + Jonathan Liu +--- a/deps/v8/src/snapshot/embedded/platform-embedded-file-writer-aix.cc ++++ b/deps/v8/src/snapshot/embedded/platform-embedded-file-writer-aix.cc +@@ -94,10 +94,6 @@ + + void PlatformEmbeddedFileWriterAIX::DeclareFunctionEnd(const char* name) {} + +-int PlatformEmbeddedFileWriterAIX::HexLiteral(uint64_t value) { +- return fprintf(fp_, "0x%" PRIx64, value); +-} +- + void PlatformEmbeddedFileWriterAIX::FilePrologue() {} + + void PlatformEmbeddedFileWriterAIX::DeclareExternalFilename( +@@ -120,12 +116,6 @@ + return kLong; + } + +-int PlatformEmbeddedFileWriterAIX::WriteByteChunk(const uint8_t* data) { +- DCHECK_EQ(ByteChunkDataDirective(), kLong); +- const uint32_t* long_ptr = reinterpret_cast(data); +- return HexLiteral(*long_ptr); +-} +- + #undef SYMBOL_PREFIX + + } // namespace internal +--- a/deps/v8/src/snapshot/embedded/platform-embedded-file-writer-aix.h ++++ b/deps/v8/src/snapshot/embedded/platform-embedded-file-writer-aix.h +@@ -37,8 +37,6 @@ + void DeclareFunctionBegin(const char* name) override; + void DeclareFunctionEnd(const char* name) override; + +- int HexLiteral(uint64_t value) override; +- + void Comment(const char* string) override; + + void FilePrologue() override; +@@ -48,7 +46,6 @@ + int IndentedDataDirective(DataDirective directive) override; + + DataDirective ByteChunkDataDirective() const override; +- int WriteByteChunk(const uint8_t* data) override; + + private: + void DeclareSymbolGlobal(const char* name); +--- a/deps/v8/src/snapshot/embedded/platform-embedded-file-writer-base.cc ++++ b/deps/v8/src/snapshot/embedded/platform-embedded-file-writer-base.cc +@@ -24,6 +24,10 @@ + } + } + ++int PlatformEmbeddedFileWriterBase::HexLiteral(uint64_t value) { ++ return fprintf(fp_, "0x%" PRIx64, value); ++} ++ + int DataDirectiveSize(DataDirective directive) { + switch (directive) { + case kByte: +@@ -39,24 +43,37 @@ + } + + int PlatformEmbeddedFileWriterBase::WriteByteChunk(const uint8_t* data) { +- DCHECK_EQ(ByteChunkDataDirective(), kOcta); +- +- static constexpr size_t kSize = kInt64Size; +- +- uint64_t part1, part2; +- // Use memcpy for the reads since {data} is not guaranteed to be aligned. ++ size_t kSize = DataDirectiveSize(ByteChunkDataDirective()); ++ size_t kHalfSize = kSize / 2; ++ uint64_t high = 0, low = 0; ++ ++ switch (kSize) { ++ case 1: ++ low = *data; ++ break; ++ case 4: ++ low = *reinterpret_cast(data); ++ break; ++ case 8: ++ low = *reinterpret_cast(data); ++ break; ++ case 16: + #ifdef V8_TARGET_BIG_ENDIAN +- memcpy(&part1, data, kSize); +- memcpy(&part2, data + kSize, kSize); ++ memcpy(&high, data, kHalfSize); ++ memcpy(&low, data + kHalfSize, kHalfSize); + #else +- memcpy(&part1, data + kSize, kSize); +- memcpy(&part2, data, kSize); ++ memcpy(&high, data + kHalfSize, kHalfSize); ++ memcpy(&low, data, kHalfSize); + #endif // V8_TARGET_BIG_ENDIAN ++ break; ++ default: ++ UNREACHABLE(); ++ } + +- if (part1 != 0) { +- return fprintf(fp(), "0x%" PRIx64 "%016" PRIx64, part1, part2); ++ if (high != 0) { ++ return fprintf(fp(), "0x%" PRIx64 "%016" PRIx64, high, low); + } else { +- return fprintf(fp(), "0x%" PRIx64, part2); ++ return fprintf(fp(), "0x%" PRIx64, low); + } + } + +--- a/deps/v8/src/snapshot/embedded/platform-embedded-file-writer-base.h ++++ b/deps/v8/src/snapshot/embedded/platform-embedded-file-writer-base.h +@@ -67,7 +67,7 @@ + virtual void DeclareFunctionEnd(const char* name) = 0; + + // Returns the number of printed characters. +- virtual int HexLiteral(uint64_t value) = 0; ++ virtual int HexLiteral(uint64_t value); + + virtual void Comment(const char* string) = 0; + virtual void Newline() { fprintf(fp_, "\n"); } +--- a/deps/v8/src/snapshot/embedded/platform-embedded-file-writer-generic.cc ++++ b/deps/v8/src/snapshot/embedded/platform-embedded-file-writer-generic.cc +@@ -112,10 +112,6 @@ + + void PlatformEmbeddedFileWriterGeneric::DeclareFunctionEnd(const char* name) {} + +-int PlatformEmbeddedFileWriterGeneric::HexLiteral(uint64_t value) { +- return fprintf(fp_, "0x%" PRIx64, value); +-} +- + void PlatformEmbeddedFileWriterGeneric::FilePrologue() {} + + void PlatformEmbeddedFileWriterGeneric::DeclareExternalFilename( +@@ -142,6 +138,18 @@ + return fprintf(fp_, " %s ", DirectiveAsString(directive)); + } + ++DataDirective PlatformEmbeddedFileWriterGeneric::ByteChunkDataDirective() ++ const { ++#if defined(V8_TARGET_ARCH_MIPS) || defined(V8_TARGET_ARCH_MIPS64) ++ // MIPS uses a fixed 4 byte instruction set, using .long ++ // to prevent any unnecessary padding. ++ return kLong; ++#else ++ // Other ISAs just listen to the base ++ return PlatformEmbeddedFileWriterBase::ByteChunkDataDirective(); ++#endif ++} ++ + #undef SYMBOL_PREFIX + + } // namespace internal +--- a/deps/v8/src/snapshot/embedded/platform-embedded-file-writer-generic.h ++++ b/deps/v8/src/snapshot/embedded/platform-embedded-file-writer-generic.h +@@ -39,8 +39,6 @@ + void DeclareFunctionBegin(const char* name) override; + void DeclareFunctionEnd(const char* name) override; + +- int HexLiteral(uint64_t value) override; +- + void Comment(const char* string) override; + + void FilePrologue() override; +@@ -49,6 +47,8 @@ + + int IndentedDataDirective(DataDirective directive) override; + ++ DataDirective ByteChunkDataDirective() const override; ++ + private: + void DeclareSymbolGlobal(const char* name); + +--- a/deps/v8/src/snapshot/embedded/platform-embedded-file-writer-mac.cc ++++ b/deps/v8/src/snapshot/embedded/platform-embedded-file-writer-mac.cc +@@ -87,10 +87,6 @@ + + void PlatformEmbeddedFileWriterMac::DeclareFunctionEnd(const char* name) {} + +-int PlatformEmbeddedFileWriterMac::HexLiteral(uint64_t value) { +- return fprintf(fp_, "0x%" PRIx64, value); +-} +- + void PlatformEmbeddedFileWriterMac::FilePrologue() {} + + void PlatformEmbeddedFileWriterMac::DeclareExternalFilename( +--- a/deps/v8/src/snapshot/embedded/platform-embedded-file-writer-mac.h ++++ b/deps/v8/src/snapshot/embedded/platform-embedded-file-writer-mac.h +@@ -37,8 +37,6 @@ + void DeclareFunctionBegin(const char* name) override; + void DeclareFunctionEnd(const char* name) override; + +- int HexLiteral(uint64_t value) override; +- + void Comment(const char* string) override; + + void FilePrologue() override; diff --git a/lang/node/patches/999-mips-less-memory.patch b/lang/node/patches/999-mips-less-memory.patch new file mode 100644 index 00000000..605b9425 --- /dev/null +++ b/lang/node/patches/999-mips-less-memory.patch @@ -0,0 +1,26 @@ +Description: mksnapshot uses too much memory on 32-bit mipsel +Author: Jérémy Lal +Last-Update: 2020-06-03 +Forwarded: https://bugs.chromium.org/p/v8/issues/detail?id=10586 +--- a/deps/v8/src/common/globals.h ++++ b/deps/v8/src/common/globals.h +@@ -206,7 +206,7 @@ + constexpr size_t kMinExpectedOSPageSize = 64 * KB; // OS page on PPC Linux + #elif V8_TARGET_ARCH_MIPS + constexpr bool kRequiresCodeRange = false; +-constexpr size_t kMaximalCodeRangeSize = 2048LL * MB; ++constexpr size_t kMaximalCodeRangeSize = 512 * MB; + constexpr size_t kMinimumCodeRangeSize = 0 * MB; + constexpr size_t kMinExpectedOSPageSize = 4 * KB; // OS page. + #else +--- a/deps/v8/src/codegen/mips/constants-mips.h ++++ b/deps/v8/src/codegen/mips/constants-mips.h +@@ -137,7 +137,7 @@ + namespace v8 { + namespace internal { + +-constexpr size_t kMaxPCRelativeCodeRangeInMB = 4096; ++constexpr size_t kMaxPCRelativeCodeRangeInMB = 1024; + + // ----------------------------------------------------------------------------- + // Registers and FPURegisters. diff --git a/lang/node/patches/999-v8_this_build_method_will_be_deprecated.patch b/lang/node/patches/999-v8_this_build_method_will_be_deprecated.patch index ca81a5c5..c00891fb 100644 --- a/lang/node/patches/999-v8_this_build_method_will_be_deprecated.patch +++ b/lang/node/patches/999-v8_this_build_method_will_be_deprecated.patch @@ -1,7 +1,7 @@ diff -urN a/configure.py b/configure.py --- a/configure.py 2019-09-05 00:36:21.000000000 +0900 +++ b/configure.py 2019-09-27 11:49:55.445800884 +0900 -@@ -1223,6 +1223,25 @@ +@@ -1276,6 +1276,15 @@ options.build_v8_with_gn = FetchDeps(v8_path) o['variables']['build_v8_with_gn'] = b(options.build_v8_with_gn) @@ -14,20 +14,10 @@ diff -urN a/configure.py b/configure.py + + if target_arch in ('mips', 'mips64'): + o['variables']['v8_use_snapshot'] = 'false' -+ elif target_arch in ('mipsel', 'mips64el'): -+ o['variables']['v8_enable_embedded_builtins'] = 0 -+ elif target_arch == 'x64': -+ if options.with_intl in (None, 'none'): -+ o['variables']['v8_enable_embedded_builtins'] = 1 -+ elif target_arch == 'ia32': -+ if options.with_intl in (None, 'none'): -+ o['variables']['v8_use_snapshot'] = 'false' -+ else: -+ o['variables']['v8_enable_embedded_builtins'] = 0 def configure_openssl(o): variables = o['variables'] -@@ -1654,6 +1673,7 @@ +@@ -1713,6 +1732,7 @@ configure_intl(output) configure_static(output) configure_inspector(output)