buildroot.busybox.net archive mirror
 help / color / mirror / Atom feed
From: Alexandru Ardelean <ardeleanalex@gmail.com>
To: buildroot@buildroot.org
Cc: Alexandru Ardelean <ardeleanalex@gmail.com>,
	fontaine.fabrice@gmail.com, aduskett@gmail.com
Subject: [Buildroot] [PATCH 04/13] nodejs: fix 'Duplicate v8 target errors when cross-compiling' error
Date: Tue,  9 Aug 2022 10:56:55 +0300	[thread overview]
Message-ID: <20220809075704.86472-5-ardeleanalex@gmail.com> (raw)
In-Reply-To: <20220809075704.86472-1-ardeleanalex@gmail.com>

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.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
---
 ...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

diff --git a/package/nodejs/0002-include-obj-name-in-shared-intermediate.patch b/package/nodejs/0002-include-obj-name-in-shared-intermediate.patch
new file mode 100644
index 0000000000..6628499362
--- /dev/null
+++ b/package/nodejs/0002-include-obj-name-in-shared-intermediate.patch
@@ -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):
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  parent reply	other threads:[~2022-08-09  7:58 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 ` Alexandru Ardelean [this message]
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
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=20220809075704.86472-5-ardeleanalex@gmail.com \
    --to=ardeleanalex@gmail.com \
    --cc=aduskett@gmail.com \
    --cc=buildroot@buildroot.org \
    --cc=fontaine.fabrice@gmail.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).