buildroot.busybox.net archive mirror
 help / color / mirror / Atom feed
From: Alexandru Ardelean <ardeleanalex@gmail.com>
To: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: fontaine.fabrice@gmail.com, aduskett@gmail.com, buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH 00/13] package/nodejs: rework cross-building
Date: Sun, 25 Sep 2022 19:15:56 +0300	[thread overview]
Message-ID: <CA+U=DspSC9f3P-m3DnBRnKb9-F4UtY7BynBTgytPsORZ3TY0cA@mail.gmail.com> (raw)
In-Reply-To: <CA+U=DsrMnh-60tcZKk7r41h5kyuGR5Cni7S5D6pTA0UpR4oE7Q@mail.gmail.com>

On Sun, Sep 25, 2022 at 6:17 PM Alexandru Ardelean
<ardeleanalex@gmail.com> wrote:
>
> On Sun, Sep 25, 2022 at 11:27 AM Thomas Petazzoni
> <thomas.petazzoni@bootlin.com> wrote:
> >
> > Hello Alexandru,
> >
> > On Tue,  9 Aug 2022 10:56:51 +0300
> > Alexandru Ardelean <ardeleanalex@gmail.com> wrote:
> >
> > > 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
> >
> > 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?
>
> 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.

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>
>’ 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


>
> Thanks
> Alexandru
>
> >
> > Best regards,
> >
> > 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

  reply	other threads:[~2022-09-25 16:16 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-09  7:56 [Buildroot] [PATCH 00/13] package/nodejs: rework cross-building Alexandru Ardelean
2022-08-09  7:56 ` [Buildroot] [PATCH 01/13] package/libuv: add host-build Alexandru Ardelean
2022-08-09  7:56 ` [Buildroot] [PATCH 02/13] package/nghttp2: " Alexandru Ardelean
2022-08-09  7:56 ` [Buildroot] [PATCH 03/13] nodejs: remove v8-qemu-wrapper stuff Alexandru Ardelean
2022-08-09 11:49   ` Thomas Petazzoni via buildroot
2022-08-09 12:52     ` Alexandru Ardelean
2022-08-09  7:56 ` [Buildroot] [PATCH 04/13] nodejs: fix 'Duplicate v8 target errors when cross-compiling' error Alexandru Ardelean
2022-08-09  7:56 ` [Buildroot] [PATCH 05/13] package/nodejs: add host-{c-ares, libuv, nghttp2} to deps Alexandru Ardelean
2022-08-09  7:56 ` [Buildroot] [PATCH 06/13] package/nodejs: provide {CC, CXX, CFLAGS, CXXFLAGS, LDFLAGS}_host env vars to target-build Alexandru Ardelean
2022-08-09  7:56 ` [Buildroot] [PATCH 07/13] package/nodejs: don't install nodejs host-tools Alexandru Ardelean
2022-08-09  7:56 ` [Buildroot] [PATCH 08/13] package/nodejs: rename LDFLAGS.host -> LDFLAGS opt Alexandru Ardelean
2022-08-09  7:57 ` [Buildroot] [PATCH 09/13] package/nodejs: impose dep on ia32 libs/compiler if target arch not 64 bits Alexandru Ardelean
2022-08-09  7:57 ` [Buildroot] [PATCH 10/13] package/nodejs: add host-zlib depedency to target package Alexandru Ardelean
2022-08-09  7:57 ` [Buildroot] [PATCH 11/13] package/nodejs: fix ARM build with VFP3 instruction Alexandru Ardelean
2022-08-09  7:57 ` [Buildroot] [PATCH 12/13] package/nodejs: add a hack to cross-compile 32-bit targets on x64 hosts Alexandru Ardelean
2022-08-09  7:57 ` [Buildroot] [PATCH 13/13] package/nodejs: build host-nodejs only if we're installing modules with NPM Alexandru Ardelean
2022-08-09 11:42 ` [Buildroot] [PATCH 00/13] package/nodejs: rework cross-building Thomas Petazzoni via buildroot
2022-08-09 12:48   ` Alexandru Ardelean
2022-08-10 21:23 ` Thomas Petazzoni via buildroot
2022-08-11  7:48   ` Alexandru Ardelean
2022-09-25  8:27 ` Thomas Petazzoni
2022-09-25 15:17   ` Alexandru Ardelean
2022-09-25 16:15     ` Alexandru Ardelean [this message]
2022-09-25 18:41       ` Thomas Petazzoni
2022-09-26 13:11         ` Alexandru Ardelean

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='CA+U=DspSC9f3P-m3DnBRnKb9-F4UtY7BynBTgytPsORZ3TY0cA@mail.gmail.com' \
    --to=ardeleanalex@gmail.com \
    --cc=aduskett@gmail.com \
    --cc=buildroot@buildroot.org \
    --cc=fontaine.fabrice@gmail.com \
    --cc=thomas.petazzoni@bootlin.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;
as well as URLs for NNTP newsgroup(s).