Commit Graph

189 Commits

Author SHA1 Message Date
Martin Jansa
dc01472dd9 nodejs: fix build without scrypt
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-11-01 05:45:17 -07:00
Khem Raj
354eca1043 nodejs: Upgrade to 16.11.1
* This is new LTS release
* Add patch to fix build on mips/mips64
* Add patch to build with new c-ares 2.17+
* Enhance native binaries patch to include additional native torque use
* Drop mips-warnings.patch and python 3.10 support patch which is
  already available in 16.x
* Refresh rest of patches against 16.x base

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-10-20 15:48:54 -07:00
Khem Raj
246b20b92c nodejs: Upgrade to 14.18.1
License-Update: Reflect new location of gtest sources
                remove node-inspect from license
		update Acorn to v8.4.1

Use internal openssl until nodejs is fixed to work with openssl3

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-10-17 16:15:21 -07:00
Khem Raj
ed3392fdb2 nodejs: add -fpermissive BUILD_CXXFLAGS
fixes build with openssl3-native

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-10-16 08:25:21 -07:00
Alexander Kanavin
e8214b76e4 nodejs: add a python 3.10 compatibility patch
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-10-14 07:16:58 -07:00
Alexander Kanavin
01d24acb40 nodejs: use -fpermissive
This resolves openssl 3.x errors until upstream addresses them properly.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-10-14 07:16:58 -07:00
Martin Jansa
c61dc077bb Convert to new override syntax
This is the result of automated script (0.9.1) conversion:

oe-core/scripts/contrib/convert-overrides.py .

converting the metadata to use ":" as the override character instead of "_".

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2021-08-03 10:21:25 -07:00
Khem Raj
94e54c209d nodejs: Update to 14.17.1
Drop upstreamed v8-call-new-ListFormatter-createInstance.patch patch
Add a patch for ppc64/clang to drop -mminimal-toc since clang does not
have this option

License-Update: URLs updated [1] and copyright owners too [2]

[1] 2d7e0b6912 (diff-c693279643b8cd5d248172d9c22cb7cf4ed163a3c98c8a3f69c2717edd3eacb7)
[2] b57785d89b (diff-c693279643b8cd5d248172d9c22cb7cf4ed163a3c98c8a3f69c2717edd3eacb7)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-06-18 08:33:07 -07:00
Khem Raj
440f11c497 nodejs: Enable snapshot
New build method lets mksnaphot run so thsi is no longer needed

Reported-by: Kory Maincent <kory.maincent@bootlin.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-04-23 21:41:26 -07:00
Khem Raj
37e0b6152c nodejs: Fix build with clang for x86 target
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-04-21 08:27:01 -07:00
Khem Raj
2f365001e2 nodejs: Fix build on mips
2G is too much for qemu-mips and perhaps also for real mips devices
as we use qemu-usermode during build to run host pieces like mksnapshot
they fail,  reducing the allocation range helps

Fixes
|   LD_LIBRARY_PATH=/mnt/b/yoe/master/build/tmp/work/mips32r2-yoe-linux/nodejs/14.16.1-r0/node-v14.16.1/out/Release/lib.host:/mnt/b/yoe/master/build/tmp/work/mips32r2-yoe-linux/nodejs/14.16.1-r0/node-v14.16.1
/out/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../tools/v8_gypfiles; mkdir -p /mnt/b/yoe/master/build/tmp/work/mips32r2-yoe-linux/nodejs/14.16.1-r0/node-v14.16.1/out/Release/obj.target/v
8_snapshot/geni; "/mnt/b/yoe/master/build/tmp/work/mips32r2-yoe-linux/nodejs/14.16.1-r0/node-v14.16.1/out/Release/v8-qemu-wrapper.sh" "/mnt/b/yoe/master/build/tmp/work/mips32r2-yoe-linux/nodejs/14.16.1-r0/nod
e-v14.16.1/out/Release/mksnapshot" --turbo_instruction_scheduling "--target_os=linux" "--target_arch=mips" --startup_src "/mnt/b/yoe/master/build/tmp/work/mips32r2-yoe-linux/nodejs/14.16.1-r0/node-v14.16.1/ou
t/Release/obj.target/v8_snapshot/geni/snapshot.cc" --embedded_variant Default --embedded_src "/mnt/b/yoe/master/build/tmp/work/mips32r2-yoe-linux/nodejs/14.16.1-r0/node-v14.16.1/out/Release/obj.target/v8_snap
shot/geni/embedded.S" --no-native-code-counters
|
| #
| # Fatal process OOM in CodeRange setup: allocate virtual memory
| #
|
| /mnt/b/yoe/master/build/tmp/work/mips32r2-yoe-linux/nodejs/14.16.1-r0/node-v14.16.1/out/Release/v8-qemu-wrapper.sh: line 7: 2292880 Trace/breakpoint trap   (core dumped) PSEUDO_UNLOAD=1 qemu-mips -r 3.2.0 -

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-04-21 08:27:01 -07:00
Khem Raj
f52863f02c nodejs: Use qemu usermode to run target binaries during build
So far, we have been trying to build nodejs-native and use the native
host binaries from there, which has worked out ok but always changes
when major upgrade is done, since more binaries or places are required
to be captured. This patch changes this approach to use qemu-user to run
these binaries under during cross build. This lets them run closer to
upstream build process and also removes dependency on nodejs-native

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-04-21 08:27:01 -07:00
Khem Raj
3f61a4c881 nodejs: Fix build with icu-69
backport relevant v8 patch to fix the build issue

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-04-21 08:27:01 -07:00
Khem Raj
3cb00800f5 nodejs: Update to 14.16.1
This is latest maintained LTS release
Forward patches and drop backported patch

License-Update: Update  copyright year and drop license of
deps/http_parser as this component is  removed in this version

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-04-21 08:27:01 -07:00
Andrew Geissler
649fb54245 nodejs: ppc64le machine support
Commit 836912ab changed the logic in this recipe to stop looking for
"ppc64le". This caused the ppc64le systems used by me to stop working.
There wasn't much in the commit message on why this change occurred but
ppc64le is definitely still needed.

Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-04-02 02:03:57 -07:00
Clément Péron
02feb1d932 nodejs: 12.20.2 -> 12.21.0
Fixes :
 - CVE-2021-22883
 - CVE-2021-22884
 - CVE-2021-23840

Signed-off-by: Clément Péron <peron.clem@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-03-30 09:04:34 -07:00
Khem Raj
836912ab9f nodejs: Set correct nodejs arch for ppc64le
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-03-12 17:22:09 -08:00
Sean Nyekjaer
6322c63987 nodejs: 12.20.1 -> 12.20.2
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-02-20 10:40:53 -08:00
Sean Nyekjaer
cde1019804 nodejs: 12.19.1 -> 12.20.1
Signed-off-by: Sean Nyekjaer <sean@geanix.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-01-07 22:57:45 -08:00
Stacy Gaikovaia
a440154082 nodejs: 12.19.0 -> 12.19.1
Uprev nodejs in order to fix CVE-2020-8277.
This CVE allows an attacker to trigger a DNS request for a host
of their choice, which could trigger a Denial of Service in
nodejs versions < 12.19.1.

See https://nvd.nist.gov/vuln/detail/CVE-2020-8277 for details.

CVE: CVE-2020-8277
Signed-off-by: Stacy Gaikovaia <Stacy.Gaikovaia@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2020-12-15 21:29:34 -08:00
Khem Raj
a10f894a8e nodejs: Update to 12.19.0
This perhaps is last release in 12.x LTS

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2020-11-02 09:00:52 -08:00
Khem Raj
45a2dfdd0f nodejs: Fix arm32/thumb builds with clang
Backport a patch from upstream to take care of build failure e.g.

| ../deps/v8/src/codegen/arm/cpu-arm.cc:38:16: error: write to reserved register 'R7'
|   asm volatile("svc 0\n"
|                ^
| 1 error generated.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2020-11-02 09:00:52 -08:00
Khem Raj
bda3ee6276 nodejs: Upgrade to 12.18.3
Drop already upstreamed patches
use builtin uv, it does not build without it

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2020-08-13 22:37:48 -07:00
Khem Raj
7910f2b645 nodejs: Fix build with icu 67.1
Remove soon-to-be removed getAllFieldPositions

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Andrej Valek <andrej.valek@siemens.com>
2020-05-06 23:20:29 -07:00
Khem Raj
db0075f503 nodejs: Fix -Wc++11-narrowing on mips
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2020-04-15 23:10:02 -07:00
Khem Raj
1f457c22c8 node: Enable cross-compiling options and disable dtrace and etw
dtrace and etw are hardly used for embedded usecase

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2020-03-20 07:44:29 -07:00
Jaga
e331ce08e4 nodejs: install gen-regexp-special-case only when icu is enabled
Fixes install errors when icu packageconfig is disabled

Signed-off-by: Jaga <jagadheesan_duraisamy@comcast.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2020-03-12 09:58:05 -07:00
André Draszik
b3b81507b7 nodejs: allow use of system brotli (and make default)
Use system brotli via PACKAGECONFIG by default. So far,
nodejs had been built using its embedded copy of brotli,
which we generally try to avoid, for the known reasons
(independent updates, cve & license checks, etc).

The nodejs patches to enable this have been submitted.
brotli is in meta-oe, so enabling this by default should
not be a problem.

Signed-off-by: André Draszik <andre.draszik@jci.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2020-03-03 11:40:40 -08:00
André Draszik
754b54699b nodejs: drop 'gyp' PACKAGECONFIG
During the python3 / nodejs update, the dependencies weren't updated, so
using system-gyp ends up trying to use the python2 version of system-
gyp, which will of course fail.
Fixing this to depend on the python3 version of gyp still doesn't
doesn't make things work, though:
    ERROR: nodejs-native-12.14.1-r0 do_configure: Execution of '.../nodejs-native/12.14.1-r0/temp/run.do_configure.26054' failed with exit code 1:
    gyp: Error importing pymod_do_mainmodule (ForEachFormat): No module named 'ForEachFormat' while loading dependencies of .../nodejs-native/12.14.1-r0/node-v12.14.1/node.gyp while trying to load .../nodejs-native/12.14.1-r0/node-v12.14.1/node.gyp
    Error running GYP

The reason is commit fff922afee6e ("deps,build: compute torque_outputs in v8.gyp")
in NodeJS v12, where they modified their bundled version of gyp to
become incompatible with the upstream version of gyp by adding extra /
unusual search paths to gyp.

Since I'm not sure how to deal with that when using system-gyp, and because
the original intention for using system-gyp was to make the previous nodejs
version compatible with python3 by ultimately switching to the python3 version
of system-gyp which isn't necessary anymore, and given nobody else seems to
be using this PACKAGECONFIG, just drop it.

Signed-off-by: André Draszik <andre.draszik@jci.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2020-03-03 11:40:40 -08:00
Khem Raj
354bedc9ab nodejs: Fix build on big-endian targets
Fixes
../deps/v8/src/runtime/runtime-utils.h:129:11: error: base operand of '->' has non-pointer type 'v8::internal::Object'
  129 |   return y->ptr() | (static_cast<ObjectPair>(x->ptr()) << 32);
      |           ^~

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Martin Jansa <Martin.Jansa@gmail.com>
Cc: Guillaume Burel <guillaume.burel@stormshield.eu>
2020-01-23 14:16:25 -08:00
Martin Jansa
50d550aa4e nodejs: upgrade to 12.14.1
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2020-01-23 14:16:25 -08:00
Martin Jansa
eaf9cfb018 nodejs: use python3native
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2020-01-23 14:16:25 -08:00
Guillaume Burel
feeb172d1a nodejs: 10.17.0 -> 12.14.0
- update Node.js to active 12.x LTS release 12.14.0.
- remove compatibility with gcc 4.8 (has been removed upstream)

Signed-off-by: Guillaume Burel <guillaume.burel@stormshield.eu>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2020-01-23 14:16:25 -08:00
Khem Raj
e4a2593a21 recipes: Replace using BBPATH with BBFILE_COLLECTIONS for meta-python2 check
BBPATH check actually does not work

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2020-01-22 19:21:39 -08:00
Khem Raj
8c0c7f0a37 recipes: Turn inherit classes from meta-py2 to conditional constructs
helps parsing without meta-py2 in mix

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2020-01-22 14:20:35 -08:00
Khem Raj
0a4faceed6 nodejs: Build only when meta-py2 is included
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2020-01-22 09:56:35 -08:00
Khem Raj
5057746583 meta-oe: Remove using python2
This change makes the parsing go though, we still might have build
issues, which will be reported in world builds seprately

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2020-01-22 09:56:34 -08:00
Andreas Müller
f0f6c0174d nodejs: Add PACKAGECONFIG share to allow other projects to use node as library
There are so many useful modules written for node.js I would like to use in
C++/Qt projects.

Run-tested both variants by installing node-red with npm and running it.

Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2019-12-01 22:29:59 -08:00
Khem Raj
86d4131dfa nodejs: libatomic patch should be target specific
host usually are using gcc/x86_64/aarch64 and all of them have gcc which
can support atomic intrinsics, but not all of them install libatomic by
default e.g. centos-7, so asking for libatomic unconditionally may not
work always

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Acked-by: Andreas Müller <schnitzeltony@gmail.com>
Acked-by: Tim Orling <timothy.t.orling@linux.intel.com>
2019-11-21 17:52:26 -08:00
André Draszik
5734546728 nodejs: support long directory names for ${B} / ${S}
Part of the NodeJS build builds V8, which at some stage tries to call
ar with all objects with *absolute* paths (and printf the command line
first).

This will fail if the build path is too long:
    make[1]: execvp: printf: Argument list too long
when trying to create Release/obj.target/deps/v8/gypfiles/libv8_base.a
via below gyp-generated out/Makefile rule:
    cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^)
i.e. something like
    printf rm -f Release/obj.target/deps/v8/gypfiles/libv8_base.a && arm-poky-linux-musleabi-gcc-ar crsT Release/obj.target/deps/v8/gypfiles/libv8_base.a ...

The above failure happened on a build-directory S with 204 characters
on a Jenkins machine.

While one could probably increase the ulimit on that specific machine,
that would be a pretty specific build machine fix which would need to
be applied everywhere, or switch to non-verbose builds / compilation,
but fortunately we can change all object references to be relative to
the build directory itself by setting the builddir_name make variable
and thus avoid the other two possible work-arounds.

Signed-off-by: André Draszik <git@andred.net>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2019-11-13 07:17:03 -08:00
André Draszik
c174217540 nodejs: use OE-provided compiler flags (arm)
This overrides yocto-provided build flags with its own, e.g we get
    arm-poky-linux-musleabi-g++  -mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a7 \
                                 ... \
                                  -march=armv7-a -mfpu=neon -mfloat-abi=hard -marm

Causing the latter to override the former, and compiler warnings:
    cc1plus: warning: switch '-mcpu=cortex-a7' conflicts with '-march=armv7-a' switch

Patch this out, so that yocto-provided flags take precedence.
Note that in reality the same should probably be done for all the other
supported architectures, too.

Note that this also switches to Thumb(2) mode (in my case). No obvious
problems have been noted during compilation or runtime.

Upstream-Status: Inappropriate [oe-specific]
Signed-off-by: André Draszik <git@andred.net>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2019-11-13 07:17:03 -08:00
André Draszik
0d4a59268c nodejs: allow use of system gyp
Now that there is a gyp (python2) recipe in meta-python,
allow its use instead of the bundled one for when
meta-python is enabled.

At the same time, unconditionally inherit pythonnative
as in either case gyp actually uses python, and the
build machine's python and installed modules should
never be used.

Signed-off-by: André Draszik <git@andred.net>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2019-11-13 07:17:03 -08:00
André Draszik
0c6cdbe3db nodejs: delete all bundled deps in do_unpack() if needed
We can delete bundled deps where system-provided counterparts
should be used instead.
Amongst others, this ensures they are not used accidentally.

Signed-off-by: André Draszik <git@andred.net>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2019-11-13 07:17:03 -08:00
André Draszik
08956bdd89 nodejs: ensure to use correct compiler & flags always
NodeJS comes with an embedded, patched, version of gyp.

Normally, gyp supports compiling for the build machine, e.g.
native tools that need to be compiled to run during the build,
and for the host, using different variables, e.g. CC and
CC.host, etc.
Most of this has been patched out in the NodeJS version of gyp,
and essentially it only supports compiling using one compiler -
${CC}. This modification excludes LDFLAGS for native tools, and
those still evaluate LDFLAGS.host (only).

While this modified behaviour is OK for the OE use-case of building
native and target tools separately, it means that this recipe can
not work as-is with standard gyp, and wrong LDFLAGS are being used
for some of the tools compiled (torque) in either case.

By setting the make variables that gyp-generated makefiles inspect,
we support use of unpatched gyp, and we ensure that all tools
are compiled with correct LDFLAGS in either case.

This now also allows us to drop the patch that had been applied to
work-around this problem.

Signed-off-by: André Draszik <git@andred.net>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2019-11-13 07:17:03 -08:00
André Draszik
5abd5bccd5 nodejs: allow use of system nghttp2
We can't enable this by default, though, as nghttp2 is
in the meta-networking layer, which might not be enabled.

At least this gives people a simple way to do so if
they want.

Signed-off-by: André Draszik <git@andred.net>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2019-11-07 17:43:44 -08:00
André Draszik
8337a8bb1a nodejs: allow use of system libuv (and make default)
Use system libuv via PACKAGECONFIG by default. So far,
nodejs had been built using its embedded copy of libuv,
which we generally try to avoid, for the known reasons
(independent updates, cve & license checks, etc).

Signed-off-by: André Draszik <git@andred.net>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2019-11-01 17:22:52 -07:00
Adrian Bunk
a0361dad8b nodejs: Upgrade 10.16.3 -> 10.17.0
Patch applied upstream removed.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2019-11-01 17:22:52 -07:00
André Draszik
76dd3dac1f nodejs: allow use of system c-ares (and make default)
Use system c-ares via PACKAGECONFIG by default. So far,
nodejs had been built using its embedded copy of c-ares,
which we generally try to avoid, for the known reasons
(independent updates, cve & license checks, etc).

Notes:
* otherwise nodejs uses its bundled version of c-ares
* the PACKAGECONFIG variable is 'ares' so as to be in
  line with other uses of this (wget & curl recipes in
  OE core)

Signed-off-by: André Draszik <git@andred.net>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2019-11-01 17:22:52 -07:00
Khem Raj
b4937b5d66 nodejs: Mark incompatible with risc-v
Arch is not yet supported

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2019-09-07 11:29:02 -07:00
Andrej Valek
a1a0e8d91e nodejs: 10.16.2 -> 10.16.3
- update nodejs to active 10.x LTS release 10.16.3
 - include fix multiple HTTP/2 vulnerabilities

Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2019-09-03 07:11:04 -07:00