diff options
| author | Polampalli, Archana <archana.polampalli@windriver.com> | 2023-08-10 13:42:24 +0000 |
|---|---|---|
| committer | Armin Kuster <akuster808@gmail.com> | 2023-08-11 10:32:04 -0400 |
| commit | 529620141e773080a6a7be4615fb7993204af883 (patch) | |
| tree | 010834e48e2349422743b0e95da49695bbcf838b /meta-oe/recipes-devtools/nodejs/nodejs_16.20.2.bb | |
| parent | 3e80d586ef0cff70a1db1a839cbd6a7f10f8a724 (diff) | |
| download | meta-openembedded-529620141e773080a6a7be4615fb7993204af883.tar.gz | |
nodejs: upgrade 16.20.1 -> 16.20.2
This release contains bug fixes only.
The following CVEs have been addressed:
CVE-2023-32002
CVE-2023-32006
CVE-2023-32559
$ git log --oneline v16.20.1..v16.20.2
dadbde963f (tag: v16.20.2) 2023-08-09, Version 16.20.2 'Gallium' (LTS)
d8ccfe9ad4 policy: handle Module.constructor and main.extensions bypass
242aaa0caa policy: disable process.binding() when enabled
40c3958a5a deps: update archs files for OpenSSL-1.1.1v
a9ac9da89a deps: fix openssl crypto clean
362d4c7494 deps: upgrade openssl sources to OpenSSL_1_1_1v
7447de2794 Working on v16.20.2
https://github.com/nodejs/node/releases/tag/v16.20.2
Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Diffstat (limited to 'meta-oe/recipes-devtools/nodejs/nodejs_16.20.2.bb')
| -rw-r--r-- | meta-oe/recipes-devtools/nodejs/nodejs_16.20.2.bb | 185 |
1 files changed, 185 insertions, 0 deletions
diff --git a/meta-oe/recipes-devtools/nodejs/nodejs_16.20.2.bb b/meta-oe/recipes-devtools/nodejs/nodejs_16.20.2.bb new file mode 100644 index 0000000000..4761bfb14f --- /dev/null +++ b/meta-oe/recipes-devtools/nodejs/nodejs_16.20.2.bb | |||
| @@ -0,0 +1,185 @@ | |||
| 1 | DESCRIPTION = "nodeJS Evented I/O for V8 JavaScript" | ||
| 2 | HOMEPAGE = "http://nodejs.org" | ||
| 3 | LICENSE = "MIT & ISC & BSD-2-Clause & BSD-3-Clause & Artistic-2.0 & OpenSSL" | ||
| 4 | LIC_FILES_CHKSUM = "file://LICENSE;md5=ab4d0d45e717c9978737499a3489e515" | ||
| 5 | |||
| 6 | DEPENDS = "openssl" | ||
| 7 | DEPENDS:append:class-target = " qemu-native" | ||
| 8 | DEPENDS:append:class-native = " c-ares-native" | ||
| 9 | |||
| 10 | inherit pkgconfig python3native qemu setuptools3 | ||
| 11 | |||
| 12 | COMPATIBLE_MACHINE:armv4 = "(!.*armv4).*" | ||
| 13 | COMPATIBLE_MACHINE:armv5 = "(!.*armv5).*" | ||
| 14 | COMPATIBLE_MACHINE:mips64 = "(!.*mips64).*" | ||
| 15 | |||
| 16 | COMPATIBLE_HOST:riscv64 = "null" | ||
| 17 | COMPATIBLE_HOST:riscv32 = "null" | ||
| 18 | COMPATIBLE_HOST:powerpc = "null" | ||
| 19 | |||
| 20 | SRC_URI = "http://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz \ | ||
| 21 | file://0001-Disable-running-gyp-files-for-bundled-deps.patch \ | ||
| 22 | file://0004-v8-don-t-override-ARM-CFLAGS.patch \ | ||
| 23 | file://big-endian.patch \ | ||
| 24 | file://mips-less-memory.patch \ | ||
| 25 | file://system-c-ares.patch \ | ||
| 26 | file://0001-liftoff-Correct-function-signatures.patch \ | ||
| 27 | file://0001-mips-Use-32bit-cast-for-operand-on-mips32.patch \ | ||
| 28 | file://0001-Nodejs-Fixed-pipes-DeprecationWarning.patch \ | ||
| 29 | " | ||
| 30 | SRC_URI:append:class-target = " \ | ||
| 31 | file://0001-Using-native-binaries.patch \ | ||
| 32 | " | ||
| 33 | SRC_URI:append:toolchain-clang:x86 = " \ | ||
| 34 | file://libatomic.patch \ | ||
| 35 | " | ||
| 36 | SRC_URI:append:toolchain-clang:powerpc64le = " \ | ||
| 37 | file://0001-ppc64-Do-not-use-mminimal-toc-with-clang.patch \ | ||
| 38 | " | ||
| 39 | SRC_URI[sha256sum] = "576f1a03c455e491a8d132b587eb6b3b84651fc8974bb3638433dd44d22c8f49" | ||
| 40 | |||
| 41 | S = "${WORKDIR}/node-v${PV}" | ||
| 42 | |||
| 43 | # v8 errors out if you have set CCACHE | ||
| 44 | CCACHE = "" | ||
| 45 | |||
| 46 | def map_nodejs_arch(a, d): | ||
| 47 | import re | ||
| 48 | |||
| 49 | if re.match('i.86$', a): return 'ia32' | ||
| 50 | elif re.match('x86_64$', a): return 'x64' | ||
| 51 | elif re.match('aarch64$', a): return 'arm64' | ||
| 52 | elif re.match('(powerpc64|powerpc64le|ppc64le)$', a): return 'ppc64' | ||
| 53 | elif re.match('powerpc$', a): return 'ppc' | ||
| 54 | return a | ||
| 55 | |||
| 56 | ARCHFLAGS:arm = "${@bb.utils.contains('TUNE_FEATURES', 'callconvention-hard', '--with-arm-float-abi=hard', '--with-arm-float-abi=softfp', d)} \ | ||
| 57 | ${@bb.utils.contains('TUNE_FEATURES', 'neon', '--with-arm-fpu=neon', \ | ||
| 58 | bb.utils.contains('TUNE_FEATURES', 'vfpv3d16', '--with-arm-fpu=vfpv3-d16', \ | ||
| 59 | bb.utils.contains('TUNE_FEATURES', 'vfpv3', '--with-arm-fpu=vfpv3', \ | ||
| 60 | '--with-arm-fpu=vfp', d), d), d)}" | ||
| 61 | ARCHFLAGS:append:mips = " --v8-lite-mode" | ||
| 62 | ARCHFLAGS:append:mipsel = " --v8-lite-mode" | ||
| 63 | ARCHFLAGS ?= "" | ||
| 64 | |||
| 65 | PACKAGECONFIG ??= "ares brotli icu zlib" | ||
| 66 | |||
| 67 | PACKAGECONFIG[ares] = "--shared-cares,,c-ares" | ||
| 68 | PACKAGECONFIG[brotli] = "--shared-brotli,,brotli" | ||
| 69 | PACKAGECONFIG[icu] = "--with-intl=system-icu,--without-intl,icu" | ||
| 70 | PACKAGECONFIG[libuv] = "--shared-libuv,,libuv" | ||
| 71 | PACKAGECONFIG[nghttp2] = "--shared-nghttp2,,nghttp2" | ||
| 72 | PACKAGECONFIG[shared] = "--shared" | ||
| 73 | PACKAGECONFIG[zlib] = "--shared-zlib,,zlib" | ||
| 74 | |||
| 75 | # We don't want to cross-compile during target compile, | ||
| 76 | # and we need to use the right flags during host compile, | ||
| 77 | # too. | ||
| 78 | EXTRA_OEMAKE = "\ | ||
| 79 | CC.host='${CC}' \ | ||
| 80 | CFLAGS.host='${CPPFLAGS} ${CFLAGS}' \ | ||
| 81 | CXX.host='${CXX}' \ | ||
| 82 | CXXFLAGS.host='${CPPFLAGS} ${CXXFLAGS}' \ | ||
| 83 | LDFLAGS.host='${LDFLAGS}' \ | ||
| 84 | AR.host='${AR}' \ | ||
| 85 | \ | ||
| 86 | builddir_name=./ \ | ||
| 87 | " | ||
| 88 | |||
| 89 | python do_unpack() { | ||
| 90 | import shutil | ||
| 91 | |||
| 92 | bb.build.exec_func('base_do_unpack', d) | ||
| 93 | shutil.rmtree(d.getVar('S') + '/deps/openssl', True) | ||
| 94 | if 'ares' in d.getVar('PACKAGECONFIG'): | ||
| 95 | shutil.rmtree(d.getVar('S') + '/deps/cares', True) | ||
| 96 | if 'brotli' in d.getVar('PACKAGECONFIG'): | ||
| 97 | shutil.rmtree(d.getVar('S') + '/deps/brotli', True) | ||
| 98 | if 'libuv' in d.getVar('PACKAGECONFIG'): | ||
| 99 | shutil.rmtree(d.getVar('S') + '/deps/uv', True) | ||
| 100 | if 'nghttp2' in d.getVar('PACKAGECONFIG'): | ||
| 101 | shutil.rmtree(d.getVar('S') + '/deps/nghttp2', True) | ||
| 102 | if 'zlib' in d.getVar('PACKAGECONFIG'): | ||
| 103 | shutil.rmtree(d.getVar('S') + '/deps/zlib', True) | ||
| 104 | } | ||
| 105 | |||
| 106 | # V8's JIT infrastructure requires binaries such as mksnapshot and | ||
| 107 | # mkpeephole to be run in the host during the build. However, these | ||
| 108 | # binaries must have the same bit-width as the target (e.g. a x86_64 | ||
| 109 | # host targeting ARMv6 needs to produce a 32-bit binary). Instead of | ||
| 110 | # depending on a third Yocto toolchain, we just build those binaries | ||
| 111 | # for the target and run them on the host with QEMU. | ||
| 112 | python do_create_v8_qemu_wrapper () { | ||
| 113 | """Creates a small wrapper that invokes QEMU to run some target V8 binaries | ||
| 114 | on the host.""" | ||
| 115 | qemu_libdirs = [d.expand('${STAGING_DIR_HOST}${libdir}'), | ||
| 116 | d.expand('${STAGING_DIR_HOST}${base_libdir}')] | ||
| 117 | qemu_cmd = qemu_wrapper_cmdline(d, d.getVar('STAGING_DIR_HOST', True), | ||
| 118 | qemu_libdirs) | ||
| 119 | wrapper_path = d.expand('${B}/v8-qemu-wrapper.sh') | ||
| 120 | with open(wrapper_path, 'w') as wrapper_file: | ||
| 121 | wrapper_file.write("""#!/bin/sh | ||
| 122 | |||
| 123 | # This file has been generated automatically. | ||
| 124 | # It invokes QEMU to run binaries built for the target in the host during the | ||
| 125 | # build process. | ||
| 126 | |||
| 127 | %s "$@" | ||
| 128 | """ % qemu_cmd) | ||
| 129 | os.chmod(wrapper_path, 0o755) | ||
| 130 | } | ||
| 131 | |||
| 132 | do_create_v8_qemu_wrapper[dirs] = "${B}" | ||
| 133 | addtask create_v8_qemu_wrapper after do_configure before do_compile | ||
| 134 | |||
| 135 | LDFLAGS:append:x86 = " -latomic" | ||
| 136 | |||
| 137 | # Node is way too cool to use proper autotools, so we install two wrappers to forcefully inject proper arch cflags to workaround gypi | ||
| 138 | do_configure () { | ||
| 139 | export LD="${CXX}" | ||
| 140 | GYP_DEFINES="${GYP_DEFINES}" export GYP_DEFINES | ||
| 141 | # $TARGET_ARCH settings don't match --dest-cpu settings | ||
| 142 | python3 configure.py --prefix=${prefix} --cross-compiling \ | ||
| 143 | --shared-openssl \ | ||
| 144 | --without-dtrace \ | ||
| 145 | --without-etw \ | ||
| 146 | --dest-cpu="${@map_nodejs_arch(d.getVar('TARGET_ARCH'), d)}" \ | ||
| 147 | --dest-os=linux \ | ||
| 148 | --libdir=${D}${libdir} \ | ||
| 149 | ${ARCHFLAGS} \ | ||
| 150 | ${PACKAGECONFIG_CONFARGS} | ||
| 151 | } | ||
| 152 | |||
| 153 | do_compile () { | ||
| 154 | export LD="${CXX}" | ||
| 155 | install -D ${B}/v8-qemu-wrapper.sh ${B}/out/Release/v8-qemu-wrapper.sh | ||
| 156 | oe_runmake BUILDTYPE=Release | ||
| 157 | } | ||
| 158 | |||
| 159 | do_install () { | ||
| 160 | oe_runmake install DESTDIR=${D} | ||
| 161 | } | ||
| 162 | |||
| 163 | BINARIES = " \ | ||
| 164 | bytecode_builtins_list_generator \ | ||
| 165 | ${@bb.utils.contains('PACKAGECONFIG', 'icu', 'gen-regexp-special-case', '', d)} \ | ||
| 166 | mkcodecache \ | ||
| 167 | node_mksnapshot \ | ||
| 168 | torque \ | ||
| 169 | " | ||
| 170 | |||
| 171 | do_install:append:class-native() { | ||
| 172 | # Install the native binaries to provide it within sysroot for the target compilation | ||
| 173 | install -d ${D}${bindir} | ||
| 174 | (cd ${S}/out/Release && install ${BINARIES} ${D}${bindir}) | ||
| 175 | } | ||
| 176 | |||
| 177 | PACKAGES =+ "${PN}-npm" | ||
| 178 | FILES:${PN}-npm = "${nonarch_libdir}/node_modules ${bindir}/npm ${bindir}/npx" | ||
| 179 | RDEPENDS:${PN}-npm = "bash python3-core python3-shell python3-datetime \ | ||
| 180 | python3-misc python3-multiprocessing" | ||
| 181 | |||
| 182 | PACKAGES =+ "${PN}-systemtap" | ||
| 183 | FILES:${PN}-systemtap = "${datadir}/systemtap" | ||
| 184 | |||
| 185 | BBCLASSEXTEND = "native" | ||
