From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: Adam Duskett <aduskett@gmail.com>
Cc: Daniel Price <daniel.price@gmail.com>,
Martin Bark <martin@barkynet.com>,
Asaf Kahlon <asafka7@gmail.com>,
buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH v3 2/2] package/nodejs: bump version to 14.17.6
Date: Fri, 8 Oct 2021 23:16:57 +0200 [thread overview]
Message-ID: <20211008231657.43d2f9aa@windsurf> (raw)
In-Reply-To: <20211008204342.370220-3-aduskett@gmail.com>
Hello,
On Fri, 8 Oct 2021 13:43:42 -0700
Adam Duskett <aduskett@gmail.com> wrote:
> Changes include:
> - Remove the dependency on Python2, as nodejs 14 supports Python 3.
> - Remove --without-snapshot as it's no longer a supported config option.
> - Remove /openssl to the shared-openssl-includes config option, as the build
> system automatically appends /openssl to the includes path.
>
> - Add a qemu wrapper. 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.
>
> Signed-off-by: Adam Duskett <aduskett@gmail.com>
> ---
> .../0001-add-qemu-wrapper-support.patch | 76 ++++++++++++++++++
> package/nodejs/Config.in | 15 +++-
> package/nodejs/nodejs.hash | 6 +-
> package/nodejs/nodejs.mk | 78 +++++++++++--------
> package/nodejs/v8-qemu-wrapper.in | 12 +++
> 5 files changed, 146 insertions(+), 41 deletions(-)
> create mode 100644 package/nodejs/0001-add-qemu-wrapper-support.patch
> create mode 100644 package/nodejs/v8-qemu-wrapper.in
>
> diff --git a/package/nodejs/0001-add-qemu-wrapper-support.patch b/package/nodejs/0001-add-qemu-wrapper-support.patch
> new file mode 100644
> index 0000000000..9b81e3adab
> --- /dev/null
> +++ b/package/nodejs/0001-add-qemu-wrapper-support.patch
> @@ -0,0 +1,76 @@
> +From fa09fa3ad6a21ae0b35fb860f76d1762e5f29972 Mon Sep 17 00:00:00 2001
> +From: Adam Duskett <aduskett@gmail.com>
> +Date: Mon, 27 Sep 2021 12:55:09 -0700
> +Subject: [PATCH] 1
This is perhaps a bit weak as a commit title and commit description :-)
> +# 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
Would have been great for MAYBE_WRAPPER to be a ./configure option :-)
But fair enough.
Overall, except the commit title/log of the patch, I don't see much
problem with this patch.
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2021-10-08 21:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-08 20:43 [Buildroot] [PATCH v3 0/2] package/nodejs: bump version to 14.17.6 Adam Duskett
2021-10-08 20:43 ` [Buildroot] [PATCH v3 1/2] package/python3: Add bzip2 option to host Adam Duskett
2021-10-08 20:43 ` [Buildroot] [PATCH v3 2/2] package/nodejs: bump version to 14.17.6 Adam Duskett
2021-10-08 21:16 ` Thomas Petazzoni [this message]
2021-10-09 0:20 ` Adam Duskett
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211008231657.43d2f9aa@windsurf \
--to=thomas.petazzoni@bootlin.com \
--cc=aduskett@gmail.com \
--cc=asafka7@gmail.com \
--cc=buildroot@buildroot.org \
--cc=daniel.price@gmail.com \
--cc=martin@barkynet.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox