Skip to contentSkip to conversation

package/nodejs: rework cross-building

PATCH In review Alexandru Ardelean 3 participants 25 messages Aug 9, 2022 – Sep 26, 2022

lore
Share & tools
lore
#0 lore raw

cover package/nodejs: rework cross-building

A bit of introduction here.

I tried to build nodejs from Buildroot master, but I couldn't. It could be that I did not setup something properly with regards to the 'v8-qemu-wrapper' stuff. I kept getting execution errors, when trying to run the nodejs build-tools scripts (see details in the patches). Either the host-qemu stuff isn't working correctly, or it needs some extra setup.

That eventually sent me down the rabbit-hole of trying to get nodejs to build for ARM64 (where I wanted it). It seems that nodejs cross-building can be done via their own infra-structure, which isn't perfect, but it seems usable; and it also looks like a good idea.

Using their cross-building stuff, has some issues/considerations:
* it's easiest when building a 32/64-bit target on a (same bit-width) 32/64-bit host; the host-{c-ares,icu,libuv,zlib} tools can be used for nodejs' host tools (in their cross-build infrastructure/tools)
* when building a 32-bit target on a 64-bit host, the nodejs cross-building logic will add the -m32 CFLAG, which will mean that the host-{c-ares,icu,libuv,zlib} tools will be unusable (they got compiled for 64-bit and are un-linkable to 32-bit binaries)
This requires that the user install on their system the host-{c-ares,icu,libuv,zlib} 32 bit versions. I suspect that the BR2_HOSTARCH_NEEDS_IA32_{LIBS,COMPILER} symbols are intented for this
* I haven't tried to build 64-bit targets on 32-bit hosts, though I'd guess this is a rare corner case.

I eventually got nodejs to build & run on an RPi4 32 & 64 bit.

I'm not sure if this patchset is fully correct.

But some things can be useful from it:
* the host-libuv and host-nghttp2 packages (for other potential users)
* the 'fix ARM build with VFP3 instruction' patch (maybe)
* the 'build host-nodejs only if we're installing modules with NPM' patch looks to me that even without this rework, if we don't install any node modules on the target, we don't really need the host-nodejs build

Alexandru Ardelean (13):
package/libuv: add host-build
package/nghttp2: add host-build
nodejs: remove v8-qemu-wrapper stuff
nodejs: fix 'Duplicate v8 target errors when cross-compiling' error package/nodejs: add host-{c-ares,libuv,nghttp2} to deps package/nodejs: provide {CC,CXX,CFLAGS,CXXFLAGS,LDFLAGS}_host env vars
to target-build
package/nodejs: don't install nodejs host-tools package/nodejs: rename LDFLAGS.host -> LDFLAGS opt package/nodejs: impose dep on ia32 libs/compiler if target arch not 64
bits
package/nodejs: add host-zlib depedency to target package package/nodejs: fix ARM build with VFP3 instruction package/nodejs: add a hack to cross-compile 32-bit targets on x64
hosts
package/nodejs: build host-nodejs only if we're installing modules
with NPM

 package/libuv/libuv.mk                        |  3 +
 package/nghttp2/nghttp2.mk                    |  1 +
 .../0001-add-qemu-wrapper-support.patch       | 88 -------------------
 ...lude-obj-name-in-shared-intermediate.patch | 24 +++++
 ...-x64-cross-compile-for-32-bit-target.patch | 71 +++++++++++++++
 package/nodejs/Config.in                      |  7 +-
 package/nodejs/Config.in.host                 |  5 +-
 package/nodejs/nodejs.mk                      | 67 +++++---------
 package/nodejs/v8-qemu-wrapper.in             |  9 --
 9 files changed, 129 insertions(+), 146 deletions(-)
 delete mode 100644 package/nodejs/0001-add-qemu-wrapper-support.patch
 create mode 100644 package/nodejs/0002-include-obj-name-in-shared-intermediate.patch
 create mode 100644 package/nodejs/0003-fix-host-x64-cross-compile-for-32-bit-target.patch
 delete mode 100644 package/nodejs/v8-qemu-wrapper.in
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

PATCH 1/13 package/libuv: add host-build

Useful for nodejs cross-building to build some of the host-tools of nodejs.

---
 package/libuv/libuv.mk | 3 +++
 1 file changed, 3 insertions(+)
package/libuv/libuv.mk +3 -0
index ed51fc92f9..033390e318 100644
@@ -27,4 +27,7 @@ define LIBUV_FIXUP_AUTOGEN
 endef
 LIBUV_POST_PATCH_HOOKS += LIBUV_FIXUP_AUTOGEN
 
+HOST_LIBUV_POST_PATCH_HOOKS += LIBUV_FIXUP_AUTOGEN
+
 $(eval $(autotools-package))
+$(eval $(host-autotools-package))
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

PATCH 2/13 package/nghttp2: add host-build

In reply to Alexandru Ardelean

Useful for nodejs cross-building to build some of the host-tools of nodejs.

---
 package/nghttp2/nghttp2.mk | 1 +
 1 file changed, 1 insertion(+)
package/nghttp2/nghttp2.mk +1 -0
index 9190fa30d6..5f46f24431 100644
@@ -21,3 +21,4 @@ endef
 NGHTTP2_POST_INSTALL_TARGET_HOOKS += NGHTTP2_INSTALL_CLEAN_HOOK
 
 $(eval $(autotools-package))
+$(eval $(host-autotools-package))
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#3 lore raw

PATCH 3/13 nodejs: remove v8-qemu-wrapper stuff

In reply to Alexandru Ardelean

It's pretty broken, so we won't use it.

Even with this wrapper, I get:

```
debug-wasm-objects.tq src/wasm/wasm-objects.tq
/bin/sh: 1: ../../out/Release/torque: Exec format error
[324/2786] CXX obj/src/libnode.node_wasi.o
ninja: build stopped: subcommand failed.
make[2]: *** [Makefile:127: node] Error 1
```
---
 .../0001-add-qemu-wrapper-support.patch       | 88 -------------------
 package/nodejs/Config.in.host                 |  2 -
 package/nodejs/nodejs.mk                      | 32 -------
 package/nodejs/v8-qemu-wrapper.in             |  9 --
 4 files changed, 131 deletions(-)
 delete mode 100644 package/nodejs/0001-add-qemu-wrapper-support.patch
 delete mode 100644 package/nodejs/v8-qemu-wrapper.in
package/nodejs/0001-add-qemu-wrapper-support.patch deleted +0 -88
deleted file mode 100644
index 1368ca5a38..0000000000
@@ -1,88 +0,0 @@
-From fa09fa3ad6a21ae0b35fb860f76d1762e5f29972 Mon Sep 17 00:00:00 2001
-From: Adam Duskett <[email protected]>
-Date: Mon, 27 Sep 2021 12:55:09 -0700
-Subject: [PATCH] add qemu-wrapper support
-
-V8's JIT infrastructure requires binaries such as mksnapshot and mkpeephole to
-be run in the host during the build. However, these binaries must have the
-same bit-width as the target (e.g. a x86_64 host targeting ARMv6 needs to
-produce a 32-bit binary). To work around this issue, cross-compile the
-binaries for the target and run them on the host with QEMU, much like
-gobject-introspection.
-
-However, for the host-variant we do not want to use a
-qemu-wrapper, so add @MAYBE_WRAPPER@ to the needed files and sed the path to
-the qemu-wrapper on target builds, and remove @MAYBE_WRAPPER@ entirely on
-host-builds.
-
-Signed-off-by: Adam Duskett <[email protected]>
----
- node.gyp                 | 4 ++--
- tools/v8_gypfiles/v8.gyp | 8 ++++----
- 2 files changed, 6 insertions(+), 6 deletions(-)
-
-diff --git a/node.gyp b/node.gyp
-index 8ba0dfeb..c77f6f7d 100644
---- a/node.gyp
-+++ b/node.gyp
-@@ -491,7 +491,7 @@
-               'action_name': 'run_mkcodecache',
-               'process_outputs_as_sources': 1,
-               'inputs': [
--                '<(mkcodecache_exec)',
-+                @MAYBE_WRAPPER@ '<(mkcodecache_exec)',
-               ],
-               'outputs': [
-                 '<(SHARED_INTERMEDIATE_DIR)/node_code_cache.cc',
-@@ -516,7 +516,7 @@
-               'action_name': 'node_mksnapshot',
-               'process_outputs_as_sources': 1,
-               'inputs': [
--                '<(node_mksnapshot_exec)',
-+                @MAYBE_WRAPPER@ '<(node_mksnapshot_exec)',
-               ],
-               'outputs': [
-                 '<(SHARED_INTERMEDIATE_DIR)/node_snapshot.cc',
-diff --git a/tools/v8_gypfiles/v8.gyp b/tools/v8_gypfiles/v8.gyp
-index 48ec392b..f9bb0fbe 100644
---- a/tools/v8_gypfiles/v8.gyp
-+++ b/tools/v8_gypfiles/v8.gyp
-@@ -220,7 +220,7 @@
-         {
-           'action_name': 'run_torque_action',
-           'inputs': [  # Order matters.
--            '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)torque<(EXECUTABLE_SUFFIX)',
-+            @MAYBE_WRAPPER@ '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)torque<(EXECUTABLE_SUFFIX)',
-             '<@(torque_files)',
-           ],
-           'outputs': [
-@@ -351,7 +351,7 @@
-         {
-           'action_name': 'generate_bytecode_builtins_list_action',
-           'inputs': [
--            '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)bytecode_builtins_list_generator<(EXECUTABLE_SUFFIX)',
-+            @MAYBE_WRAPPER@ '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)bytecode_builtins_list_generator<(EXECUTABLE_SUFFIX)',
-           ],
-           'outputs': [
-             '<(generate_bytecode_builtins_list_output)',
-@@ -533,7 +533,7 @@
-             ],
-           },
-           'inputs': [
--            '<(mksnapshot_exec)',
-+            @MAYBE_WRAPPER@ '<(mksnapshot_exec)',
-           ],
-           'outputs': [
-             '<(INTERMEDIATE_DIR)/snapshot.cc',
-@@ -1448,7 +1448,7 @@
-         {
-           'action_name': 'run_gen-regexp-special-case_action',
-           'inputs': [
--            '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)gen-regexp-special-case<(EXECUTABLE_SUFFIX)',
-+            @MAYBE_WRAPPER@ '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)gen-regexp-special-case<(EXECUTABLE_SUFFIX)',
-           ],
-           'outputs': [
-             '<(SHARED_INTERMEDIATE_DIR)/src/regexp/special-case.cc',
---
-2.31.1
-
package/nodejs/Config.in.host +0 -2
index 4ceaf0c73e..d023ffc36d 100644
@@ -5,8 +5,6 @@ config BR2_PACKAGE_HOST_NODEJS
 	select BR2_PACKAGE_HOST_PYTHON3
 	select BR2_PACKAGE_HOST_PYTHON3_BZIP2
 	select BR2_PACKAGE_HOST_PYTHON3_SSL
-	select BR2_PACKAGE_HOST_QEMU
-	select BR2_PACKAGE_HOST_QEMU_LINUX_USER_MODE
 	help
 	  Event-driven I/O server-side JavaScript environment based on
 	  V8.
package/nodejs/nodejs.mk +0 -32
index 3154dcd7ec..a8229eb4b1 100644
@@ -12,7 +12,6 @@ NODEJS_DEPENDENCIES = \
 	host-ninja \
 	host-pkgconf \
 	host-python3 \
-	host-qemu \
 	c-ares \
 	libuv \
 	nghttp2 \
@@ -174,37 +173,6 @@ ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
 NODEJS_LDFLAGS += -latomic
 endif
 
-# V8's JIT infrastructure requires binaries such as mksnapshot and
-# mkpeephole to be run in the host during the build. However, these
-# binaries must have the same bit-width as the target (e.g. a x86_64
-# host targeting ARMv6 needs to produce a 32-bit binary). To work around this
-# issue, cross-compile the binaries for the target and run them on the
-# host with QEMU, much like gobject-introspection.
-define NODEJS_INSTALL_V8_QEMU_WRAPPER
-	$(INSTALL) -D -m 755 $(NODEJS_PKGDIR)/v8-qemu-wrapper.in \
-		$(@D)/out/Release/v8-qemu-wrapper
-	$(SED) "s%@QEMU_USER@%$(QEMU_USER)%g" \
-		$(@D)/out/Release/v8-qemu-wrapper
-	$(SED) "s%@TOOLCHAIN_HEADERS_VERSION@%$(BR2_TOOLCHAIN_HEADERS_AT_LEAST)%g" \
-		$(@D)/out/Release/v8-qemu-wrapper
-	$(SED) "s%@QEMU_USERMODE_ARGS@%$(call qstrip,$(BR2_PACKAGE_HOST_QEMU_USER_MODE_ARGS))%g" \
-		$(@D)/out/Release/v8-qemu-wrapper
-endef
-NODEJS_PRE_CONFIGURE_HOOKS += NODEJS_INSTALL_V8_QEMU_WRAPPER
-
-define NODEJS_WRAPPER_FIXUP
-	$(SED) "s%@MAYBE_WRAPPER@%'<(PRODUCT_DIR)/v8-qemu-wrapper',%g" $(@D)/node.gyp
-	$(SED) "s%@MAYBE_WRAPPER@%'<(PRODUCT_DIR)/v8-qemu-wrapper',%g" $(@D)/tools/v8_gypfiles/v8.gyp
-endef
-NODEJS_PRE_CONFIGURE_HOOKS += NODEJS_WRAPPER_FIXUP
-
-# Do not run the qemu-wrapper for the host build.
-define HOST_NODEJS_WRAPPER_FIXUP
-	$(SED) "s%@MAYBE_WRAPPER@%%g" $(@D)/node.gyp
-	$(SED) "s%@MAYBE_WRAPPER@%%g" $(@D)/tools/v8_gypfiles/v8.gyp
-endef
-HOST_NODEJS_PRE_CONFIGURE_HOOKS += HOST_NODEJS_WRAPPER_FIXUP
-
 define NODEJS_CONFIGURE_CMDS
 	(cd $(@D); \
 		$(TARGET_CONFIGURE_OPTS) \
package/nodejs/v8-qemu-wrapper.in deleted +0 -9
deleted file mode 100644
index e1083f47f7..0000000000
@@ -1,9 +0,0 @@
-#!/usr/bin/env sh
-
-# Pass -r to qemu-user as to trick glibc into not errorings out if the host kernel
-# is older than the target kernel.
-exec @QEMU_USER@ -r @TOOLCHAIN_HEADERS_VERSION@ \
-    @QEMU_USERMODE_ARGS@ \
-   -L "${STAGING_DIR}/" \
-    "$@"
-
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#4 lore raw

Re: [Buildroot] [PATCH 03/13] nodejs: remove v8-qemu-wrapper stuff

Hello,

Quoted 9 lines · On Tue, 9 Aug 2022 10:56:54 +0300 Alexandru Ardelean <[email protected]>…

It's pretty broken, so we won't use it.

Even with this wrapper, I get:
```
debug-wasm-objects.tq src/wasm/wasm-objects.tq /bin/sh: 1: ../../out/Release/torque: Exec format error [324/2786] CXX obj/src/libnode.node_wasi.o
ninja: build stopped: subcommand failed. make[2]: *** [Makefile:127: node] Error 1

This is odd. Did you debug this a bit?

On my side, trying to build:

BR2_aarch64=y
BR2_TOOLCHAIN_EXTERNAL=y BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_AARCH64_GLIBC_STABLE=y BR2_INIT_NONE=y
BR2_SYSTEM_BIN_SH_NONE=y
# BR2_PACKAGE_BUSYBOX is not set BR2_PACKAGE_NODEJS=y
# BR2_TARGET_ROOTFS_TAR is not set

before applying your patch series, leads to a different error:

ninja: error: obj.host/tools/v8_gypfiles/run_torque.ninja:1271: multiple rules generate gen/torque-generated/bit-fields.h [-w dupbuild=err]

The issue was reported at https://github.com/nodejs/node/issues/37441 a while ago, it is not fixed apparently.

Best regards,

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#5 lore raw

Re: [Buildroot] [PATCH 03/13] nodejs: remove v8-qemu-wrapper stuff

Quoted 16 lines · Thomas Petazzoni

Hello,

Quoted 9 lines · On Tue, 9 Aug 2022 10:56:54 +0300 Alexandru Ardelean <[email protected]>…

It's pretty broken, so we won't use it.

Even with this wrapper, I get:
```
debug-wasm-objects.tq src/wasm/wasm-objects.tq /bin/sh: 1: ../../out/Release/torque: Exec format error [324/2786] CXX obj/src/libnode.node_wasi.o
ninja: build stopped: subcommand failed. make[2]: *** [Makefile:127: node] Error 1

Quoted 1 line

This is odd. Did you debug this a bit?

not really, no
i can try again
but the error is so weird, that it discouraged me to check;

Quoted 13 lines

On my side, trying to build:

BR2_aarch64=y
BR2_TOOLCHAIN_EXTERNAL=y BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_AARCH64_GLIBC_STABLE=y BR2_INIT_NONE=y
BR2_SYSTEM_BIN_SH_NONE=y
# BR2_PACKAGE_BUSYBOX is not set BR2_PACKAGE_NODEJS=y
# BR2_TARGET_ROOTFS_TAR is not set

Quoted 3 lines

before applying your patch series, leads to a different error:

ninja: error: obj.host/tools/v8_gypfiles/run_torque.ninja:1271: multiple rules generate gen/torque-generated/bit-fields.h [-w dupbuild=err]

i think this is fixed in patch [4/13]:

https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/

apologies if the patches are not quite in the proper order yet; i can try to make the order better, so as to keep the principle that each patch doesn't break stuff as much as possible;

Quoted 11 lines

The issue was reported at https://github.com/nodejs/node/issues/37441 a while ago, it is not fixed apparently.

Best regards,

Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin Embedded Linux and Kernel engineering and training
https://bootlin.com

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#6 lore raw

PATCH 4/13 nodejs: fix 'Duplicate v8 target errors when cross-compiling' error

In reply to Alexandru Ardelean

Reported also via:
https://github.com/nodejs/node/issues/37441

Patched in:
https://github.com/minrk/node/commit/5e533cb943eef68b270f55f0cba02c0ec67c699d

The error is:

```
>>> nodejs 16.15.0 Building
PATH="<buildroot>/output/host/bin:<buildroot>/output/host/sbin:/home/aardelean/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin" PYTHON=<buildroot>/output/host/bin/python3 /usr/bin/make  -C <buildroot>/output/build/nodejs-16.15.0 PATH="<buildroot>/output/host/bin:<buildroot>/output/host/sbin:/home/aardelean/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin" AR="<buildroot>/output/host/bin/aarch64-none-linux-gnu-gcc-ar" AS="<buildroot>/output/host/bin/aarch64-none-linux-gnu-as" LD="<buildroot>/output/host/bin/aarch64-none-linux-gnu-ld" NM="<buildroot>/output/host/bin/aarch64-none-linux-gnu-gcc-nm" CC="<buildroot>/output/host/bin/aarch64-none-linux-gnu-gcc" GCC="<buildroot>/output/host/bin/aarch64-none-linux-gnu-gcc" CPP="<buildroot>/output/host/bin/aarch64-none-linux-gnu-cpp" CXX="<buildroot>/output/host/bin/aarch64-none-linux-gnu-g++" FC="<buildroot>/output/h
 ost/bin/aarch64-none-linux-gnu-gfortran" F77="<buildroot>/output/host/bin/aarch64-none-linux-gnu-gfortran" RANLIB="<buildroot>/output/host/bin/aarch64-none-linux-gnu-gcc-ranlib" READELF="<buildroot>/output/host/bin/aarch64-none-linux-gnu-readelf" STRIP="<buildroot>/output/host/bin/aarch64-none-linux-gnu-strip" OBJCOPY="<buildroot>/output/host/bin/aarch64-none-linux-gnu-objcopy" OBJDUMP="<buildroot>/output/host/bin/aarch64-none-linux-gnu-objdump" AR_FOR_BUILD="/usr/bin/ar" AS_FOR_BUILD="/usr/bin/as" CC_FOR_BUILD="<buildroot>/output/host/bin/ccache /usr/bin/gcc" GCC_FOR_BUILD="<buildroot>/output/host/bin/ccache /usr/bin/gcc" CXX_FOR_BUILD="<buildroot>/output/host/bin/ccache /usr/bin/g++" LD_FOR_BUILD="/usr/bin/ld" CPPFLAGS_FOR_BUILD="-I<buildroot>/output/host/include" CFLAGS_FOR_BUILD="-O2 -I<buildroot>/output/host/include" CXXFLAGS_FOR_BUILD="-O2 -I<buildroot>/output/host/include" LDFLAGS_FOR_BUILD="-L<buildroot>/output/host/lib -Wl,-rpath,<buildroot>/output/host/lib" FCFLAGS_FOR_BUI
 LD="" DEFAULT_ASSEMBLER="<buildroot>/output/host/bin/aarch64-none-linux-gnu-as" DEFAULT_LINKER="<buildroot>/output/host/bin/aarch64-none-linux-gnu-ld" CPPFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" CFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Os -g0 -D_FORTIFY_SOURCE=1" CXXFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Os -g0 -D_FORTIFY_SOURCE=1" LDFLAGS="" FCFLAGS=" -Os -g0" FFLAGS=" -Os -g0" PKG_CONFIG="<buildroot>/output/host/bin/pkg-config" STAGING_DIR="<buildroot>/output/host/aarch64-buildroot-linux-gnu/sysroot" INTLTOOL_PERL=/usr/bin/perl NO_LOAD=cctest.target.mk PATH=<buildroot>/output/build/nodejs-16.15.0/bin:"<buildroot>/output/host/bin:<buildroot>/output/host/sbin:/home/aardelean/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin" LDFLAGS=" -latomic" LD="<buildroot>/output/host/bin/aarch64-none-linux-gnu-g++"
ninja -C out/Release
ninja: Entering directory `out/Release'
ninja: error: obj.host/tools/v8_gypfiles/run_torque.ninja:1356: multiple rules generate gen/torque-generated/bit-fields.h [-w dupbuild=err]

make[2]: *** [Makefile:127: node] Error 1
make[1]: *** [package/pkg-generic.mk:293: <buildroot>/output/build/nodejs-16.15.0/.stamp_built] Error 2
make: *** [Makefile:84: _all] Error 2

```

Maybe it's not the final patch, but it's good enough to get us going.

---
 ...lude-obj-name-in-shared-intermediate.patch | 24 +++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 package/nodejs/0002-include-obj-name-in-shared-intermediate.patch
package/nodejs/0002-include-obj-name-in-shared-intermediate.patch new file +24 -0
new file mode 100644
index 0000000000..6628499362
@@ -0,0 +1,24 @@
+--- a/tools/gyp/pylib/gyp/generator/ninja.py	2022-04-27 01:03:31.000000000 +0300
++++ b/tools/gyp/pylib/gyp/generator/ninja.py	2022-07-13 10:20:33.573771172 +0300
+@@ -42,7 +42,7 @@
+     # the start of a string, while $| is used for variables that can appear
+     # anywhere in a string.
+     "INTERMEDIATE_DIR": "$!INTERMEDIATE_DIR",
+-    "SHARED_INTERMEDIATE_DIR": "$!PRODUCT_DIR/gen",
++    "SHARED_INTERMEDIATE_DIR": "$!PRODUCT_DIR/$|OBJ/gen",
+     "PRODUCT_DIR": "$!PRODUCT_DIR",
+     "CONFIGURATION_NAME": "$|CONFIGURATION_NAME",
+     # Special variables that may be used by gyp 'rule' targets.
+@@ -285,6 +285,12 @@
+         CONFIGURATION_NAME = "$|CONFIGURATION_NAME"
+         path = path.replace(CONFIGURATION_NAME, self.config_name)
+ 
++        obj = "obj"
++        if self.toolset != "target":
++            obj += "." + self.toolset
++
++        path = path.replace("$|OBJ", obj)
++
+         return path
+ 
+     def ExpandRuleVariables(self, path, root, dirname, source, ext, name):
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#7 lore raw

PATCH 5/13 package/nodejs: add host-{c-ares, libuv, nghttp2} to deps

In reply to Alexandru Ardelean

Required for the host-tools when cross-building.
The nodejs target-build requires some host tool support to be able to properly build.

Unfortunately, when building a 32-bit target on a 64-bit host, uses will need to install on the host the 32-bit bi-arch libs for 'libicu libc-ares libuv1 libnghttp2 zlib1g', but that seems that is also the case (already) for some other packages that select symbols BR2_HOSTARCH_NEEDS_IA32_LIBS & BR2_HOSTARCH_NEEDS_IA32_COMPILER.

So, we'll need to do the same later.

---
 package/nodejs/Config.in      | 3 +++
 package/nodejs/Config.in.host | 3 +++
 package/nodejs/nodejs.mk      | 6 ++++++
 3 files changed, 12 insertions(+)
package/nodejs/Config.in +3 -0
index 016aeb4e1a..fad211b750 100644
@@ -28,6 +28,9 @@ config BR2_PACKAGE_NODEJS
 	# linking, but that's too much of a corner case to support it.
 	depends on !BR2_STATIC_LIBS
 	select BR2_PACKAGE_HOST_NODEJS
+	select BR2_PACKAGE_HOST_C_ARES
+	select BR2_PACKAGE_HOST_LIBUV
+	select BR2_PACKAGE_HOST_NGHTTP2
 	select BR2_PACKAGE_C_ARES
 	select BR2_PACKAGE_LIBUV
 	select BR2_PACKAGE_ZLIB
package/nodejs/Config.in.host +3 -0
index d023ffc36d..328c8872d3 100644
@@ -2,6 +2,9 @@ config BR2_PACKAGE_HOST_NODEJS
 	bool "host nodejs"
 	depends on BR2_PACKAGE_HOST_QEMU_USER_ARCH_SUPPORTS
 	depends on BR2_HOST_GCC_AT_LEAST_8
+	select BR2_PACKAGE_HOST_C_ARES
+	select BR2_PACKAGE_HOST_LIBUV
+	select BR2_PACKAGE_HOST_NGHTTPS2
 	select BR2_PACKAGE_HOST_PYTHON3
 	select BR2_PACKAGE_HOST_PYTHON3_BZIP2
 	select BR2_PACKAGE_HOST_PYTHON3_SSL
package/nodejs/nodejs.mk +6 -0
index a8229eb4b1..d15c027c70 100644
@@ -9,6 +9,9 @@ NODEJS_SOURCE = node-v$(NODEJS_VERSION).tar.xz
 NODEJS_SITE = http://nodejs.org/dist/v$(NODEJS_VERSION)
 NODEJS_DEPENDENCIES = \
 	host-nodejs \
+	host-c-ares \
+	host-libuv \
+	host-nghttp2 \
 	host-ninja \
 	host-pkgconf \
 	host-python3 \
@@ -18,6 +21,9 @@ NODEJS_DEPENDENCIES = \
 	zlib \
 	$(call qstrip,$(BR2_PACKAGE_NODEJS_MODULES_ADDITIONAL_DEPS))
 HOST_NODEJS_DEPENDENCIES = \
+	host-c-ares \
+	host-libuv \
+	host-nghttp2 \
 	host-icu \
 	host-libopenssl \
 	host-ninja \
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#8 lore raw

PATCH 6/13 package/nodejs: provide {CC, CXX, CFLAGS, CXXFLAGS, LDFLAGS}_host env vars to target-build

In reply to Alexandru Ardelean

nodejs has some cross-build infrastructure in place.
When we want to build for the target, we need to use it. Previously, the logic was trying to use the v8-qemu-wrapper stuff, but that wasn't working.

The proper way (or recommended by nodejs) is to provide these {CC,CXX,CFLAGS,CXXFLAGS,LDFLAGS}_host env vars, so that it builds the host tools to generate some code stuff.

---
 package/nodejs/nodejs.mk | 11 +++++++++++
 1 file changed, 11 insertions(+)
package/nodejs/nodejs.mk +11 -0
index d15c027c70..4713971169 100644
@@ -47,6 +47,13 @@ NODEJS_CONF_OPTS = \
 	--dest-os=linux \
 	--ninja
 
+NODEJS_CROSS_BUILD_ENV_VARS = \
+	CC_host="$(HOSTCC)" \
+	CXX_host="$(HOSTCXX)" \
+	CFLAGS_host="$(HOST_CFLAGS)" \
+	CXXFLAGS_host="$(HOST_CXXFLAGS)" \
+	LDFLAGS_host="$(HOST_LDFLAGS)"
+
 HOST_NODEJS_MAKE_OPTS = \
 	$(HOST_CONFIGURE_OPTS) \
 	CXXFLAGS="$(HOST_NODEJS_CXXFLAGS)" \
@@ -182,6 +189,7 @@ endif
 define NODEJS_CONFIGURE_CMDS
 	(cd $(@D); \
 		$(TARGET_CONFIGURE_OPTS) \
+		$(NODEJS_CROSS_BUILD_ENV_VARS) \
 		PATH=$(@D)/bin:$(BR_PATH) \
 		LDFLAGS="$(NODEJS_LDFLAGS)" \
 		LD="$(TARGET_CXX)" \
@@ -199,6 +207,7 @@ endef
 
 define NODEJS_BUILD_CMDS
 	$(TARGET_MAKE_ENV) PYTHON=$(HOST_DIR)/bin/python3 \
+		$(NODEJS_CROSS_BUILD_ENV_VARS) \
 		$(MAKE) -C $(@D) \
 		$(NODEJS_MAKE_OPTS)
 endef
@@ -235,6 +244,7 @@ endif
 
 define NODEJS_INSTALL_STAGING_CMDS
 	$(TARGET_MAKE_ENV) PYTHON=$(HOST_DIR)/bin/python3 \
+		$(NODEJS_CROSS_BUILD_ENV_VARS) \
 		$(MAKE) -C $(@D) install \
 		DESTDIR=$(STAGING_DIR) \
 		$(NODEJS_MAKE_OPTS)
@@ -242,6 +252,7 @@ endef
 
 define NODEJS_INSTALL_TARGET_CMDS
 	$(TARGET_MAKE_ENV) PYTHON=$(HOST_DIR)/bin/python3 \
+		$(NODEJS_CROSS_BUILD_ENV_VARS) \
 		$(MAKE) -C $(@D) install \
 		DESTDIR=$(TARGET_DIR) \
 		$(NODEJS_MAKE_OPTS)
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#9 lore raw

PATCH 7/13 package/nodejs: don't install nodejs host-tools

In reply to Alexandru Ardelean

The target-build should build these host-tools now.

---
 package/nodejs/nodejs.mk | 11 -----------
 1 file changed, 11 deletions(-)
package/nodejs/nodejs.mk +0 -11
index 4713971169..e07e958407 100644
@@ -114,13 +114,6 @@ define HOST_NODEJS_CONFIGURE_CMDS
 		--ninja
 endef
 
-NODEJS_HOST_TOOLS_V8 = \
-	torque \
-	gen-regexp-special-case \
-	bytecode_builtins_list_generator
-NODEJS_HOST_TOOLS_NODE = mkcodecache
-NODEJS_HOST_TOOLS = $(NODEJS_HOST_TOOLS_V8) $(NODEJS_HOST_TOOLS_NODE)
-
 HOST_NODEJS_CXXFLAGS = $(HOST_CXXFLAGS)
 
 define HOST_NODEJS_BUILD_CMDS
@@ -133,10 +126,6 @@ define HOST_NODEJS_INSTALL_CMDS
 	$(HOST_MAKE_ENV) PYTHON=$(HOST_DIR)/bin/python3 \
 		$(MAKE) -C $(@D) install \
 		$(HOST_NODEJS_MAKE_OPTS)
-
-	$(foreach f,$(NODEJS_HOST_TOOLS), \
-		$(INSTALL) -m755 -D $(@D)/out/Release/$(f) $(HOST_DIR)/bin/$(f)
-	)
 endef
 
 ifeq ($(BR2_i386),y)
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#10 lore raw

PATCH 8/13 package/nodejs: rename LDFLAGS.host -> LDFLAGS opt

In reply to Alexandru Ardelean

This is a host-build, so we should pass LDFLAGS.
And the correct opt would be LDFLAGS_host, so this is incorrect.

---
 package/nodejs/nodejs.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/nodejs/nodejs.mk +1 -1
index e07e958407..7ffbdcf790 100644
@@ -57,7 +57,7 @@ NODEJS_CROSS_BUILD_ENV_VARS = \
 HOST_NODEJS_MAKE_OPTS = \
 	$(HOST_CONFIGURE_OPTS) \
 	CXXFLAGS="$(HOST_NODEJS_CXXFLAGS)" \
-	LDFLAGS.host="$(HOST_LDFLAGS)" \
+	LDFLAGS="$(HOST_LDFLAGS)" \
 	NO_LOAD=cctest.target.mk \
 	PATH=$(@D)/bin:$(BR_PATH)
 
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#11 lore raw

PATCH 9/13 package/nodejs: impose dep on ia32 libs/compiler if target arch not 64 bits

In reply to Alexandru Ardelean

This addresses the situation of a host-64 (usually x86_64 host) building for a 32 bit target.

nodejs cross-compilation also requires (for the JIT stuff) that a 64-bit target be built with a 64-bit host + target compiler). And likely the same is true for 32-bit.

Hopefully, we wouldn't have the case of 32-bit hosts building for 64-bit targets.

But, with this, users require to install the 32-bit libs for 'libicu libc-ares libuv1 libnghttp2 zlib1g' to be able to build the host-tools during build.

---
 package/nodejs/Config.in | 2 ++
 1 file changed, 2 insertions(+)
package/nodejs/Config.in +2 -0
index fad211b750..0b6ded6562 100644
@@ -27,6 +27,8 @@ config BR2_PACKAGE_NODEJS
 	# uses dlopen(). On ARMv5, we could technically support static
 	# linking, but that's too much of a corner case to support it.
 	depends on !BR2_STATIC_LIBS
+	select BR2_HOSTARCH_NEEDS_IA32_COMPILER if !BR2_ARCH_IS_64
+	select BR2_HOSTARCH_NEEDS_IA32_LIBS if !BR2_ARCH_IS_64
 	select BR2_PACKAGE_HOST_NODEJS
 	select BR2_PACKAGE_HOST_C_ARES
 	select BR2_PACKAGE_HOST_LIBUV
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#12 lore raw

PATCH 10/13 package/nodejs: add host-zlib depedency to target package

In reply to Alexandru Ardelean

Required by some of the host-side tools when cross-compiling.

---
 package/nodejs/nodejs.mk | 1 +
 1 file changed, 1 insertion(+)
package/nodejs/nodejs.mk +1 -0
index 7ffbdcf790..3cbae8cb61 100644
@@ -12,6 +12,7 @@ NODEJS_DEPENDENCIES = \
 	host-c-ares \
 	host-libuv \
 	host-nghttp2 \
+	host-zlib \
 	host-ninja \
 	host-pkgconf \
 	host-python3 \
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#13 lore raw

PATCH 11/13 package/nodejs: fix ARM build with VFP3 instruction

In reply to Alexandru Ardelean

Error is:

```
../../deps/v8/src/codegen/arm/assembler-arm.cc:179:2: error: #error "CAN_USE_ARMV7_INSTRUCTIONS should match CAN_USE_VFP3_INSTRUCTIONS"
  179 | #error "CAN_USE_ARMV7_INSTRUCTIONS should match CAN_USE_VFP3_INSTRUCTIONS"
```
---
 package/nodejs/nodejs.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/nodejs/nodejs.mk +1 -1
index 3cbae8cb61..6988df3d84 100644
@@ -146,7 +146,7 @@ NODEJS_ARM_FP = $(GCC_TARGET_FLOAT_ABI)
 ifeq ($(BR2_ARM_FPU_VFPV2),y)
 NODEJS_ARM_FPU = vfp
 # vfpv4 is a superset of vfpv3
-else ifeq ($(BR2_ARM_FPU_VFPV3)$(BR2_ARM_FPU_VFPV4),y)
+else ifeq ($(BR2_ARM_FPU_VFPV3)$(BR2_ARM_FPU_VFPV4)$(BR2_ARM_FPU_NEON_VFPV4),y)
 NODEJS_ARM_FPU = vfpv3
 # vfpv4-d16 is a superset of vfpv3-d16
 else ifeq ($(BR2_ARM_FPU_VFPV3D16)$(BR2_ARM_FPU_VFPV4D16),y)
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#14 lore raw

PATCH 12/13 package/nodejs: add a hack to cross-compile 32-bit targets on x64 hosts

In reply to Alexandru Ardelean

When gcc is run with -m32, the IA32 assembler doesn't understand 64-bit assembly.

What happens is, that the bi-arch stuff won't seem to select the ia32 assembly-code when cross-building for a 32 bit target.
It will try to build the host-tools with 'gcc -m32', but it still will try to compile the x64 assembly push_registers.

This patch adds a 'ARCH_IS_32BIT' #define along side the -m32 flag and will select the code in the x64 push_registers assembly file. The undesired part is that we'll need to copy+paste the assembly code into the x64 file.

---
 ...-x64-cross-compile-for-32-bit-target.patch | 71 +++++++++++++++++++
 1 file changed, 71 insertions(+)
 create mode 100644 package/nodejs/0003-fix-host-x64-cross-compile-for-32-bit-target.patch
package/nodejs/0003-fix-host-x64-cross-compile-for-32-bit-target.patch new file +71 -0
new file mode 100644
index 0000000000..533105ec22
@@ -0,0 +1,71 @@
+diff --git a/deps/v8/src/heap/base/asm/x64/push_registers_asm.cc b/deps/v8/src/heap/base/asm/x64/push_registers_asm.cc
+index 9780b877..bffc8516 100644
+--- a/deps/v8/src/heap/base/asm/x64/push_registers_asm.cc
++++ b/deps/v8/src/heap/base/asm/x64/push_registers_asm.cc
+@@ -16,6 +16,45 @@
+ // GN toolchain (e.g. ChromeOS) and not provide them.
+ // _WIN64 Defined as 1 when the compilation target is 64-bit ARM or x64.
+ // Otherwise, undefined.
++#ifdef ARCH_IS_32BIT
++// stuff copied from 'deps/v8/src/heap/base/asm/ia32/push_registers_asm.cc'
++
++asm(
++#ifdef _WIN32
++    ".globl _PushAllRegistersAndIterateStack            \n"
++    "_PushAllRegistersAndIterateStack:                  \n"
++#else   // !_WIN32
++    ".globl PushAllRegistersAndIterateStack             \n"
++    ".type PushAllRegistersAndIterateStack, %function   \n"
++    ".hidden PushAllRegistersAndIterateStack            \n"
++    "PushAllRegistersAndIterateStack:                   \n"
++#endif  // !_WIN32
++    // [ IterateStackCallback ]
++    // [ StackVisitor*        ]
++    // [ Stack*               ]
++    // [ ret                  ]
++    // ebp is callee-saved. Maintain proper frame pointer for debugging.
++    "  push %ebp                                        \n"
++    "  movl %esp, %ebp                                  \n"
++    "  push %ebx                                        \n"
++    "  push %esi                                        \n"
++    "  push %edi                                        \n"
++    // Save 3rd parameter (IterateStackCallback).
++    "  movl 28(%esp), %ecx                              \n"
++    // Pass 3rd parameter as esp (stack pointer).
++    "  push %esp                                        \n"
++    // Pass 2nd parameter (StackVisitor*).
++    "  push 28(%esp)                                    \n"
++    // Pass 1st parameter (Stack*).
++    "  push 28(%esp)                                    \n"
++    "  call *%ecx                                       \n"
++    // Pop the callee-saved registers.
++    "  addl $24, %esp                                   \n"
++    // Restore rbp as it was used as frame pointer.
++    "  pop %ebp                                         \n"
++    "  ret                                              \n");
++#else
++
+ #ifdef _WIN64
+ 
+ // We maintain 16-byte alignment at calls. There is an 8-byte return address
+@@ -104,3 +143,5 @@ asm(
+     "  ret                                              \n");
+ 
+ #endif  // !_WIN64
++
++#endif // ! ARCH_IS_32BIT
+diff --git a/tools/v8_gypfiles/toolchain.gypi b/tools/v8_gypfiles/toolchain.gypi
+index ecbd63b5..0dfda084 100644
+--- a/tools/v8_gypfiles/toolchain.gypi
++++ b/tools/v8_gypfiles/toolchain.gypi
+@@ -1034,8 +1034,8 @@
+                     'cflags': [ '-m31' ],
+                     'ldflags': [ '-m31' ]
+                   },{
+-                   'cflags': [ '-m32' ],
+-                   'ldflags': [ '-m32' ]
++                   'cflags': [ '-m32', '-DARCH_IS_32BIT' ],
++                   'ldflags': [ '-m32', '-DARCH_IS_32BIT' ]
+                   }],
+                 ],
+               }],
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#15 lore raw

PATCH 13/13 package/nodejs: build host-nodejs only if we're installing modules with NPM

In reply to Alexandru Ardelean

At this point in time, we only need the host-nodejs build if we want to npm tool to install node_modules on the target.

---
 package/nodejs/Config.in | 2 +-
 package/nodejs/nodejs.mk | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
package/nodejs/Config.in +1 -1
index 0b6ded6562..551cecc0b8 100644
@@ -29,7 +29,7 @@ config BR2_PACKAGE_NODEJS
 	depends on !BR2_STATIC_LIBS
 	select BR2_HOSTARCH_NEEDS_IA32_COMPILER if !BR2_ARCH_IS_64
 	select BR2_HOSTARCH_NEEDS_IA32_LIBS if !BR2_ARCH_IS_64
-	select BR2_PACKAGE_HOST_NODEJS
+	select BR2_PACKAGE_HOST_NODEJS if BR2_PACKAGE_NODEJS_MODULES_ADDITIONAL != ""
 	select BR2_PACKAGE_HOST_C_ARES
 	select BR2_PACKAGE_HOST_LIBUV
 	select BR2_PACKAGE_HOST_NGHTTP2
package/nodejs/nodejs.mk +1 -1
index 6988df3d84..43ca636312 100644
@@ -8,7 +8,6 @@ NODEJS_VERSION = 16.16.0
 NODEJS_SOURCE = node-v$(NODEJS_VERSION).tar.xz
 NODEJS_SITE = http://nodejs.org/dist/v$(NODEJS_VERSION)
 NODEJS_DEPENDENCIES = \
-	host-nodejs \
 	host-c-ares \
 	host-libuv \
 	host-nghttp2 \
@@ -224,6 +223,7 @@ NPM = $(TARGET_CONFIGURE_OPTS) \
 # We can only call NPM if there's something to install.
 #
 ifneq ($(NODEJS_MODULES_LIST),)
+NODEJS_DEPENDENCIES += host-nodejs
 define NODEJS_INSTALL_MODULES
 	# If you're having trouble with module installation, adding -d to the
 	# npm install call below and setting npm_config_rollback=false can both
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#16 lore raw
In reply to Alexandru Ardelean

Hello Alexandru,

First of all, thanks a lot for your work on NodeJS. It is obviously a complex package, which has already seen quite a lot of effort, so we need to be careful when changing it.

Quoted 6 lines · On Tue, 9 Aug 2022 10:56:51 +0300 Alexandru Ardelean <[email protected]>…

I tried to build nodejs from Buildroot master, but I couldn't. It could be that I did not setup something properly with regards to the 'v8-qemu-wrapper' stuff. I kept getting execution errors, when trying to run the nodejs build-tools scripts (see details in the patches). Either the host-qemu stuff isn't working correctly, or it needs some extra setup.

I will give a test to your patch series and report back, but I'm fearing that PATCH 03/18 will break the build.

Quoted 5 lines

That eventually sent me down the rabbit-hole of trying to get nodejs to build for ARM64 (where I wanted it). It seems that nodejs cross-building can be done via their own infra-structure, which isn't perfect, but it seems usable; and it also looks like a good idea.

Quoted 13 lines

Using their cross-building stuff, has some issues/considerations:
* it's easiest when building a 32/64-bit target on a (same bit-width) 32/64-bit host; the host-{c-ares,icu,libuv,zlib} tools can be used for nodejs' host tools (in their cross-build infrastructure/tools)
* when building a 32-bit target on a 64-bit host, the nodejs cross-building logic will add the -m32 CFLAG, which will mean that the host-{c-ares,icu,libuv,zlib} tools will be unusable (they got compiled for 64-bit and are un-linkable to 32-bit binaries)
This requires that the user install on their system the host-{c-ares,icu,libuv,zlib} 32 bit versions. I suspect that the BR2_HOSTARCH_NEEDS_IA32_{LIBS,COMPILER} symbols are intented for this
* I haven't tried to build 64-bit targets on 32-bit hosts, though I'd guess this is a rare corner case.

No, unfortunately it is not. A solution that doesn't support building a 64-bit target on a 32-bit host is not going to be acceptable for Buildroot at this point I'm afraid.

I will try to have a look in more details, even though I must say I'm pretty hermetic to the overall NodeJS build system :-/

Best regards,

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#17 lore raw
Quoted 39 lines · Thomas Petazzoni

Hello Alexandru,

First of all, thanks a lot for your work on NodeJS. It is obviously a complex package, which has already seen quite a lot of effort, so we need to be careful when changing it.

Quoted 6 lines · On Tue, 9 Aug 2022 10:56:51 +0300 Alexandru Ardelean <[email protected]>…

I tried to build nodejs from Buildroot master, but I couldn't. It could be that I did not setup something properly with regards to the 'v8-qemu-wrapper' stuff. I kept getting execution errors, when trying to run the nodejs build-tools scripts (see details in the patches). Either the host-qemu stuff isn't working correctly, or it needs some extra setup.

I will give a test to your patch series and report back, but I'm fearing that PATCH 03/18 will break the build.

Quoted 5 lines

That eventually sent me down the rabbit-hole of trying to get nodejs to build for ARM64 (where I wanted it). It seems that nodejs cross-building can be done via their own infra-structure, which isn't perfect, but it seems usable; and it also looks like a good idea.

Quoted 13 lines

Using their cross-building stuff, has some issues/considerations:
* it's easiest when building a 32/64-bit target on a (same bit-width) 32/64-bit host; the host-{c-ares,icu,libuv,zlib} tools can be used for nodejs' host tools (in their cross-build infrastructure/tools)
* when building a 32-bit target on a 64-bit host, the nodejs cross-building logic will add the -m32 CFLAG, which will mean that the host-{c-ares,icu,libuv,zlib} tools will be unusable (they got compiled for 64-bit and are un-linkable to 32-bit binaries)
This requires that the user install on their system the host-{c-ares,icu,libuv,zlib} 32 bit versions. I suspect that the BR2_HOSTARCH_NEEDS_IA32_{LIBS,COMPILER} symbols are intented for this
* I haven't tried to build 64-bit targets on 32-bit hosts, though I'd guess this is a rare corner case.

Quoted 3 lines

No, unfortunately it is not. A solution that doesn't support building a 64-bit target on a 32-bit host is not going to be acceptable for Buildroot at this point I'm afraid.

There may be a chance that this could automagically work (64 bit target to 32 bit host).
I did not test it. I will try to make some time for testing it in a 32-bit x86 docker image.

I figured this may be unacceptable.
The least I was hoping to get here, is someone to tell me what I am doing wrong with that v8-qemu-wrapper stuff.

Quoted 11 lines

I will try to have a look in more details, even though I must say I'm pretty hermetic to the overall NodeJS build system :-/

Best regards,

Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin Embedded Linux and Kernel engineering and training
https://bootlin.com

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#18 lore raw
In reply to Alexandru Ardelean

Hello,

Quoted 11 lines · On Tue, 9 Aug 2022 10:56:51 +0300 Alexandru Ardelean <[email protected]>…

I tried to build nodejs from Buildroot master, but I couldn't. It could be that I did not setup something properly with regards to the 'v8-qemu-wrapper' stuff. I kept getting execution errors, when trying to run the nodejs build-tools scripts (see details in the patches). Either the host-qemu stuff isn't working correctly, or it needs some extra setup.

That eventually sent me down the rabbit-hole of trying to get nodejs to build for ARM64 (where I wanted it). It seems that nodejs cross-building can be done via their own infra-structure, which isn't perfect, but it seems usable; and it also looks like a good idea.

You could also have a look at the OpenEmbedded packaging of NodeJS:

https://git.openembedded.org/meta-openembedded/tree/meta-oe/recipes-devtools/nodejs?h=kirkstone

The idea and some of the logic for the Qemu wrapper comes from OpenEmbedded.

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#19 lore raw
Quoted 18 lines · Thomas Petazzoni

Hello,

Quoted 11 lines · On Tue, 9 Aug 2022 10:56:51 +0300 Alexandru Ardelean <[email protected]>…

I tried to build nodejs from Buildroot master, but I couldn't. It could be that I did not setup something properly with regards to the 'v8-qemu-wrapper' stuff. I kept getting execution errors, when trying to run the nodejs build-tools scripts (see details in the patches). Either the host-qemu stuff isn't working correctly, or it needs some extra setup.

That eventually sent me down the rabbit-hole of trying to get nodejs to build for ARM64 (where I wanted it). It seems that nodejs cross-building can be done via their own infra-structure, which isn't perfect, but it seems usable; and it also looks like a good idea.

Quoted 6 lines

You could also have a look at the OpenEmbedded packaging of NodeJS:

https://git.openembedded.org/meta-openembedded/tree/meta-oe/recipes-devtools/nodejs?h=kirkstone

The idea and some of the logic for the Qemu wrapper comes from OpenEmbedded.

I'll take a look.
Thanks for the hint.

At this point, I am also curious if we could get away without this wrapper. Maybe we're entering a point where nodejs' build system is becoming good/mature enough to not have to use QEMU.

Alexandru

Quoted 6 lines

Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin Embedded Linux and Kernel engineering and training
https://bootlin.com

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#20 lore raw
In reply to Alexandru Ardelean

Hello Alexandru,

Quoted 10 lines · On Tue, 9 Aug 2022 10:56:51 +0300 Alexandru Ardelean <[email protected]>…

Alexandru Ardelean (13):
package/libuv: add host-build
package/nghttp2: add host-build
nodejs: remove v8-qemu-wrapper stuff
nodejs: fix 'Duplicate v8 target errors when cross-compiling' error package/nodejs: add host-{c-ares,libuv,nghttp2} to deps package/nodejs: provide {CC,CXX,CFLAGS,CXXFLAGS,LDFLAGS}_host env vars
to target-build
package/nodejs: don't install nodejs host-tools package/nodejs: rename LDFLAGS.host -> LDFLAGS opt

Quoted 8 lines

package/nodejs: impose dep on ia32 libs/compiler if target arch not 64
bits
package/nodejs: add host-zlib depedency to target package package/nodejs: fix ARM build with VFP3 instruction package/nodejs: add a hack to cross-compile 32-bit targets on x64
hosts
package/nodejs: build host-nodejs only if we're installing modules
with NPM

So I finally took some time to look into this, and managed to get NodeJS to build, but keeping the Qemu logic. Here is what I have pushed to the Buildroot Git repo:

https://gitlab.com/buildroot.org/buildroot/-/commit/f85e2cfc6e587d50b86f49b28469eae58a2ea2c7

Just renumbering an existing patch

https://gitlab.com/buildroot.org/buildroot/-/commit/5708c5b04f09f49a99c2c9d7a1894d24bce6a3e7

Your patch to fix the duplicate v8 target error, just slightly improved by me.

https://gitlab.com/buildroot.org/buildroot/-/commit/cf0ddc89705af989393b1601bbf57d567a9a1b13

A patch from me which is fixing the issue with the Qemu approach. Basically, since the bump from 14.x to 16.x, one call to a tool that should be run under Qemu was not done through the wrapper, causing the build failure. With this fixed, NodeJS builds just fine with the current approach.

Even though I dislike having to build Qemu, it is what OpenEmbedded is also doing to build NodeJS, and we don't have much choice as we need those tools to have the same bitness as the target.

https://gitlab.com/buildroot.org/buildroot/-/commit/ec5589611ad79664bc5bf238cc786a65458f3c93

Your patch to not install the extra tools of host-nodejs, as they are no longer needed: we use the target tools, and run them under Qemu.

https://gitlab.com/buildroot.org/buildroot/-/commit/1facb09b94bf806b301868539185c0ff9ddffee2

Your patch to no longer build host-nodejs as a dependency of nodejs, unless some extra NPM modules need to be installed, in which case npm is needed.

So here, NodeJS now builds/runs fine. Could you check on your side if that also solves your problems?

Best regards,

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#21 lore raw
Quoted 55 lines · Thomas Petazzoni

Hello Alexandru,

Quoted 10 lines · On Tue, 9 Aug 2022 10:56:51 +0300 Alexandru Ardelean <[email protected]>…

Alexandru Ardelean (13):
package/libuv: add host-build
package/nghttp2: add host-build
nodejs: remove v8-qemu-wrapper stuff
nodejs: fix 'Duplicate v8 target errors when cross-compiling' error package/nodejs: add host-{c-ares,libuv,nghttp2} to deps package/nodejs: provide {CC,CXX,CFLAGS,CXXFLAGS,LDFLAGS}_host env vars
to target-build
package/nodejs: don't install nodejs host-tools package/nodejs: rename LDFLAGS.host -> LDFLAGS opt

Quoted 8 lines

package/nodejs: impose dep on ia32 libs/compiler if target arch not 64
bits
package/nodejs: add host-zlib depedency to target package package/nodejs: fix ARM build with VFP3 instruction package/nodejs: add a hack to cross-compile 32-bit targets on x64
hosts
package/nodejs: build host-nodejs only if we're installing modules
with NPM

So I finally took some time to look into this, and managed to get NodeJS to build, but keeping the Qemu logic. Here is what I have pushed to the Buildroot Git repo:

https://gitlab.com/buildroot.org/buildroot/-/commit/f85e2cfc6e587d50b86f49b28469eae58a2ea2c7

Just renumbering an existing patch

https://gitlab.com/buildroot.org/buildroot/-/commit/5708c5b04f09f49a99c2c9d7a1894d24bce6a3e7

Your patch to fix the duplicate v8 target error, just slightly improved by me.

https://gitlab.com/buildroot.org/buildroot/-/commit/cf0ddc89705af989393b1601bbf57d567a9a1b13

A patch from me which is fixing the issue with the Qemu approach. Basically, since the bump from 14.x to 16.x, one call to a tool that should be run under Qemu was not done through the wrapper, causing the build failure. With this fixed, NodeJS builds just fine with the current approach.

Even though I dislike having to build Qemu, it is what OpenEmbedded is also doing to build NodeJS, and we don't have much choice as we need those tools to have the same bitness as the target.

https://gitlab.com/buildroot.org/buildroot/-/commit/ec5589611ad79664bc5bf238cc786a65458f3c93

Your patch to not install the extra tools of host-nodejs, as they are no longer needed: we use the target tools, and run them under Qemu.

Quoted 8 lines

https://gitlab.com/buildroot.org/buildroot/-/commit/1facb09b94bf806b301868539185c0ff9ddffee2

Your patch to no longer build host-nodejs as a dependency of nodejs, unless some extra NPM modules need to be installed, in which case npm is needed.

So here, NodeJS now builds/runs fine. Could you check on your side if that also solves your problems?

Hey,

I'll take a look.
Apologies for going silent on this. I need to scale down my work maybe.

Funny story (or... maybe not so funny), the project switched to AOSP, which is ¯\_(ツ)_/¯ (new to me).

In the old context (when we were using BR), we were basing some work on top of RPi4.
And when I sent the initial set upstream, I was testing/validating with RPi4 (32 & 64 bit builds) directly on the BR upstream/master tree.
i.e. i was using "raspberrypi4{_64}_defconfig" + manually enabling nodejs (and using the external Linaro ARM toolchains to gain some speed).

I'll do some builds with these 2 configurations and come back.

Thanks
Alexandru

Quoted 8 lines

Best regards,

Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin Embedded Linux and Kernel engineering and training
https://bootlin.com

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#22 lore raw
Quoted 84 lines · Alexandru Ardelean
Quoted 55 lines · Thomas Petazzoni

Hello Alexandru,

Quoted 10 lines · On Tue, 9 Aug 2022 10:56:51 +0300 Alexandru Ardelean <[email protected]>…

Alexandru Ardelean (13):
package/libuv: add host-build
package/nghttp2: add host-build
nodejs: remove v8-qemu-wrapper stuff
nodejs: fix 'Duplicate v8 target errors when cross-compiling' error package/nodejs: add host-{c-ares,libuv,nghttp2} to deps package/nodejs: provide {CC,CXX,CFLAGS,CXXFLAGS,LDFLAGS}_host env vars
to target-build
package/nodejs: don't install nodejs host-tools package/nodejs: rename LDFLAGS.host -> LDFLAGS opt

Quoted 8 lines

package/nodejs: impose dep on ia32 libs/compiler if target arch not 64
bits
package/nodejs: add host-zlib depedency to target package package/nodejs: fix ARM build with VFP3 instruction package/nodejs: add a hack to cross-compile 32-bit targets on x64
hosts
package/nodejs: build host-nodejs only if we're installing modules
with NPM

So I finally took some time to look into this, and managed to get NodeJS to build, but keeping the Qemu logic. Here is what I have pushed to the Buildroot Git repo:

https://gitlab.com/buildroot.org/buildroot/-/commit/f85e2cfc6e587d50b86f49b28469eae58a2ea2c7

Just renumbering an existing patch

https://gitlab.com/buildroot.org/buildroot/-/commit/5708c5b04f09f49a99c2c9d7a1894d24bce6a3e7

Your patch to fix the duplicate v8 target error, just slightly improved by me.

https://gitlab.com/buildroot.org/buildroot/-/commit/cf0ddc89705af989393b1601bbf57d567a9a1b13

A patch from me which is fixing the issue with the Qemu approach. Basically, since the bump from 14.x to 16.x, one call to a tool that should be run under Qemu was not done through the wrapper, causing the build failure. With this fixed, NodeJS builds just fine with the current approach.

Even though I dislike having to build Qemu, it is what OpenEmbedded is also doing to build NodeJS, and we don't have much choice as we need those tools to have the same bitness as the target.

https://gitlab.com/buildroot.org/buildroot/-/commit/ec5589611ad79664bc5bf238cc786a65458f3c93

Your patch to not install the extra tools of host-nodejs, as they are no longer needed: we use the target tools, and run them under Qemu.

Quoted 8 lines

https://gitlab.com/buildroot.org/buildroot/-/commit/1facb09b94bf806b301868539185c0ff9ddffee2

Your patch to no longer build host-nodejs as a dependency of nodejs, unless some extra NPM modules need to be installed, in which case npm is needed.

So here, NodeJS now builds/runs fine. Could you check on your side if that also solves your problems?

Hey,

I'll take a look.
Apologies for going silent on this. I need to scale down my work maybe.

Funny story (or... maybe not so funny), the project switched to AOSP, which is ¯\_(ツ)_/¯ (new to me).

In the old context (when we were using BR), we were basing some work on top of RPi4.
And when I sent the initial set upstream, I was testing/validating with RPi4 (32 & 64 bit builds) directly on the BR upstream/master tree.
i.e. i was using "raspberrypi4{_64}_defconfig" + manually enabling nodejs (and using the external Linaro ARM toolchains to gain some speed).

Quoted 1 line

I'll do some builds with these 2 configurations and come back.

So, still fails on my side.
I'm using Ubuntu 22.04

Steps to reproduce:
1. make raspberrypi4_defconfig ( or raspberrypi4_64_defconfig )
2 make menuconfig # to enable nodejs (or external toolchain)
3. make V=s -j12
4. fail

I initially got tried with ARM{64} external toolchains I decided to give it a try with BR's ARM toolchain (I did not try ARM64 with BR's toolchain)

Seems the /workdir/buildroot/output/host/bin/qemu-arm{64} files aren't present.

[1] https://gitlab.com/buildroot.org/buildroot/-/commit/1facb09b94bf806b301868539185c0ff9ddffee2

Luckily with patch [1] I get the errors way sooner (than waiting for host-nodejs to be built)

[1] ARM64 (with external toolchain) did this:

[5/2481] ACTION generate_bytecode_builtins_list:
generate_bytecode_builtins_list_action_3931b343a4cb0bd98da4e581f6ce90fe
FAILED: obj/gen/generate-bytecode-output-root/builtins-generated/bytecodes-builtins-list.h cd ../../tools/v8_gypfiles; python ../../deps/v8/tools/run.py ../../out/Release/v8-qemu-wrapper
../../out/Release/bytecode_builtins_list_generator ../../out/Release/obj/gen/generate-bytecode-output-root/builtins-generated/bytecodes-builtins-list.h ../../out/Release/v8-qemu-wrapper: 5: exec:
/home/aardelean/work/upstream/buildroot/output/host/bin/qemu-aarch64:
not found
Return code is 127
[6/2481] ACTION(host) generate_bytecode_builtins_list:
generate_bytecode_builtins_list_action_33373b52e07ceb63cab644698db39dd6
FAILED: obj.host/gen/generate-bytecode-output-root/builtins-generated/bytecodes-builtins-list.h cd ../../tools/v8_gypfiles; python ../../deps/v8/tools/run.py ../../out/Release/v8-qemu-wrapper
../../out/Release/bytecode_builtins_list_generator ../../out/Release/obj.host/gen/generate-bytecode-output-root/builtins-generated/bytecodes-builtins-list.h ../../out/Release/v8-qemu-wrapper: 5: exec:
/home/aardelean/work/upstream/buildroot/output/host/bin/qemu-aarch64:
not found
Return code is 127
[22/2481] CXX obj/deps/googletest/src/gtest.gtest.o
ninja: build stopped: subcommand failed.
make[2]: *** [Makefile:127: node] Error 1
make[1]: *** [package/pkg-generic.mk:293:
/home/aardelean/work/upstream/buildroot/output/build/nodejs-16.16.0/.stamp_built]
Error 2
make: *** [Makefile:84: _all] Error 2

[2] ARM64 (with external toolchain) did this:

      |     ^~~~~~~~~~~

In file included from /home/aardelean/work/upstream/buildroot/output/host/opt/ext-toolchain/arm-none-linux-gnueabihf/include/c++/10.3.1/vector:72,
from
/home/aardelean/work/upstream/buildroot/output/host/opt/ext-toolchain/arm-none-linux-gnueabihf/include/c++/10.3.1/queue:61,
from
../../deps/v8/src/libplatform/default-foreground-task-runner.h:9,
from
../../deps/v8/src/libplatform/default-foreground-task-runner.cc:5:
/home/aardelean/work/upstream/buildroot/output/host/opt/ext-toolchain/arm-none-linux-gnueabihf/include/c++/10.3.1/bits/vector.tcc:
In member function ‘void std::vector<_Tp,
_Alloc>::_M_realloc_insert(std::vector<_Tp, _Alloc>::iterator, _Args&&
...) [with _Args =
{v8::platform::DefaultForegroundTaskRunner::DelayedEntry}; _Tp = v8::platform::DefaultForegroundTaskRunner::DelayedEntry; _Alloc = std::allocator<v8::platform::DefaultForegroundTaskRunner::DelayedEntry>]’:
/home/aardelean/work/upstream/buildroot/output/host/opt/ext-toolchain/arm-none-linux-gnueabihf/include/c++/10.3.1/bits/vector.tcc:426:7:
note: parameter passing for argument of type ‘std::vector<v8::platform::DefaultForegroundTaskRunner::DelayedEntry>::iterator’
changed in GCC 7.1

  426 |       vector<_Tp, _Alloc>::
      |       ^~~~~~~~~~~~~~~~~~~

/home/aardelean/work/upstream/buildroot/output/host/opt/ext-toolchain/arm-none-linux-gnueabihf/include/c++/10.3.1/bits/vector.tcc:
In function ‘void
v8::platform::DefaultForegroundTaskRunner::PostDelayedTaskLocked(std::unique_ptr<v8::Task>,
double, v8::platform::DefaultForegroundTaskRunner::Nestability, const
MutexGuard&)’:
/home/aardelean/work/upstream/buildroot/output/host/opt/ext-toolchain/arm-none-linux-gnueabihf/include/c++/10.3.1/bits/vector.tcc:121:21:
note: parameter passing for argument of type ‘__gnu_cxx::__normal_iterator<v8::platform::DefaultForegroundTaskRunner::DelayedEntry*, std::vector<v8::platform::DefaultForegroundTaskRunner::DelayedEntry>

Quoted 1 line

’ changed in GCC 7.1

  121 |    _M_realloc_insert(end(), std::forward<_Args>(__args)...);
      |    ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

[145/2633] ACTION(host) generate_bytecode_builtins_list:
generate_bytecode_builtins_list_action_33373b52e07ceb63cab644698db39dd6
FAILED: obj.host/gen/generate-bytecode-output-root/builtins-generated/bytecodes-builtins-list.h cd ../../tools/v8_gypfiles; python ../../deps/v8/tools/run.py ../../out/Release/v8-qemu-wrapper
../../out/Release/bytecode_builtins_list_generator ../../out/Release/obj.host/gen/generate-bytecode-output-root/builtins-generated/bytecodes-builtins-list.h ../../out/Release/v8-qemu-wrapper: 5: exec:
/home/aardelean/work/upstream/buildroot/output/host/bin/qemu-arm: not
found
Return code is 127
[162/2633] CXX obj.host/deps/v8/src/torque/torque_base.torque-parser.o
ninja: build stopped: subcommand failed.
make[2]: *** [Makefile:127: node] Error 1
make[1]: *** [package/pkg-generic.mk:293:
/home/aardelean/work/upstream/buildroot/output/build/nodejs-16.16.0/.stamp_built]
Error 2
make: *** [Makefile:84: _all] Error 2

[3] With the BR ARM{64} toolchain I get this here:

er_libcdep.lo -MD -MP -MF .deps/sanitizer_symbolizer_libcdep.Tpo -c ../../../../libsanitizer/sanitizer_common/sanitizer_symbolizer_libcdep.cpp -o sanitizer_symbolizer_libcdep.o >/dev/null 2>&1
mv -f .deps/sanitizer_tls_get_addr.Tpo .deps/sanitizer_tls_get_addr.Plo
mv -f .deps/sanitizer_symbolizer_libbacktrace.Tpo .deps/sanitizer_symbolizer_libbacktrace.Plo
mv -f .deps/sanitizer_stacktrace_libcdep.Tpo .deps/sanitizer_stacktrace_libcdep.Plo
mv -f .deps/sanitizer_suppressions.Tpo .deps/sanitizer_suppressions.Plo
mv -f .deps/sanitizer_symbolizer_report.Tpo .deps/sanitizer_symbolizer_report.Plo
mv -f .deps/sanitizer_stackdepot.Tpo .deps/sanitizer_stackdepot.Plo
mv -f .deps/sanitizer_thread_registry.Tpo .deps/sanitizer_thread_registry.Plo mv -f .deps/sanitizer_stoptheworld_linux_libcdep.Tpo .deps/sanitizer_stoptheworld_linux_libcdep.Plo
mv -f .deps/sanitizer_symbolizer_posix_libcdep.Tpo .deps/sanitizer_symbolizer_posix_libcdep.Plo
mv -f .deps/sanitizer_symbolizer_libcdep.Tpo .deps/sanitizer_symbolizer_libcdep.Plo
make[5]: *** [Makefile:531: all-recursive] Error 1
make[4]: *** [Makefile:418: all] Error 2
make[3]: *** [Makefile:12663: all-target-libsanitizer] Error 2
make[2]: *** [Makefile:974: all] Error 2
make[1]: *** [package/pkg-generic.mk:293:
/home/aardelean/work/upstream/buildroot/output/build/host-gcc-final-11.3.0/.stamp_built] Error 2
make: *** [Makefile:84: _all] Error 2

Quoted 12 lines

Thanks
Alexandru

Quoted 8 lines

Best regards,

Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin Embedded Linux and Kernel engineering and training
https://bootlin.com

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#23 lore raw

Hello Alexandru,

Quoted 3 lines · On Sun, 25 Sep 2022 19:15:56 +0300 Alexandru Ardelean <[email protected]>…

/home/aardelean/work/upstream/buildroot/output/host/bin/qemu-arm: not found
Return code is 127

Could you try again with the latest master? Yann just pushed the patch I submitted a few hours ago to fix this. You need to make sure you have at least commit:

https://gitlab.com/buildroot.org/buildroot/-/commit/a88ba1548a50d5599e0156d66063dd71545f910b

Thanks!

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#24 lore raw
Quoted 10 lines · Thomas Petazzoni

Hello Alexandru,

Quoted 3 lines · On Sun, 25 Sep 2022 19:15:56 +0300 Alexandru Ardelean <[email protected]>…

/home/aardelean/work/upstream/buildroot/output/host/bin/qemu-arm: not found
Return code is 127

Quoted 6 lines

Could you try again with the latest master? Yann just pushed the patch I submitted a few hours ago to fix this. You need to make sure you have at least commit:

https://gitlab.com/buildroot.org/buildroot/-/commit/a88ba1548a50d5599e0156d66063dd71545f910b

[ So, as I mentioned earlier, this message was in my Draft folder for a bit ]

Tested succesfully with master at this hash
https://gitlab.com/buildroot.org/buildroot/-/commit/a8a65d0951e4c93fbba8041ce8e7db1ba8809edc

Tested on ARM64 & ARM (RPi4), but with external ARM toolchain (to save some time).
I believe that ARM{64} BR toolchains should work just the same.

Thanks
Alexandru

Alexandru

Quoted 7 lines

Thanks!

Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin Embedded Linux and Kernel engineering and training
https://bootlin.com

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot