Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate v8 target errors when cross-compiling #37441

Open
minrk opened this issue Feb 19, 2021 · 4 comments
Open

Duplicate v8 target errors when cross-compiling #37441

minrk opened this issue Feb 19, 2021 · 4 comments
Labels
build Issues and PRs related to build files or the CI. gyp Issues and PRs related to the GYP tool and .gyp build files macos Issues and PRs related to the macOS platform / OSX.

Comments

@minrk
Copy link

minrk commented Feb 19, 2021

We are working on packaging node for arm64 macs over at conda-forge

Attempting to cross-compile on mac, x86_64 -> arm64 with

./configure
    --ninja \
    --prefix=${PREFIX} \
    --without-node-snapshot \
    --shared \
    --shared-libuv \
    --shared-openssl \
    --shared-zlib \
    --with-intl=system-icu \
    --cross-compiling --dest-os=mac --dest-cpu=arm64

fails with this error:

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

I was able to narrow it down to the fact that v8/torque is built for both host and target, while SHARED_INTERMEDIATE_DIR is not unique per toolset.

Adding $|OBJ to SHARED_INTERMEDIATE_DIR via this patch so it is per-toolchain instead of per-product seems to work, but I don't know if that's actually the right fix. It seems plausible that these should only be generated once, and the bug really is is that they are being generated twice. I couldn't figure out how to solve that, though.

@richardlau richardlau added the macos Issues and PRs related to the macOS platform / OSX. label Feb 19, 2021
@targos targos added build Issues and PRs related to build files or the CI. gyp Issues and PRs related to the GYP tool and .gyp build files labels Feb 19, 2021
@vilkov
Copy link

vilkov commented Jun 24, 2022

It still the case for 18.4.0... Any chance to fix the upstream?

@scr06
Copy link

scr06 commented Jul 6, 2022

Same issue when cross-compiling nodejs 16.15.0 using Buildroot (x86_64 VM -> arm64 target).
I tried to apply the 2 aforementioned patches (SHARED_INTERMEDIATE_DIR and LDFLAGS) without success...
Really don't know how to solve that...

@spockfish
Copy link

Hi @scr06 ,

Did you by any chance solved this issue?

@scr06
Copy link

scr06 commented Aug 2, 2022

Unfortunatly no... I managed to get pre-built librairies for arm target. But node modules are not available...

arnout pushed a commit to buildroot/buildroot that referenced this issue Sep 25, 2022
… error

Reported also via:
  nodejs/node#37441

Patched in:
  minrk/node@5e533cb

The error is:
```
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

```

Fixes:

  http://autobuild.buildroot.net/results/7fe9132236ee8e3a86dd97fe96ffee42990c2d19/

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
[Thomas:
 - regenerate patch as a git formatted patch, add a link to the
   original location, add my own SoB to it
 - improve commit log]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
arnout pushed a commit to buildroot/buildroot that referenced this issue Oct 11, 2022
… error

Reported also via:
  nodejs/node#37441

Patched in:
  minrk/node@5e533cb

The error is:
```
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

```

Fixes:

  http://autobuild.buildroot.net/results/7fe9132236ee8e3a86dd97fe96ffee42990c2d19/

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
[Thomas:
 - regenerate patch as a git formatted patch, add a link to the
   original location, add my own SoB to it
 - improve commit log]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
(cherry picked from commit 5708c5b)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
moto-timo pushed a commit to moto-timo/gyp-next that referenced this issue Feb 18, 2023
avoids duplicate ninja rules for v8 used in host and target

From: minrk/node@5e533cb
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

Reported in nodejs/node#46690
and nodejs/node#37441

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
moto-timo pushed a commit to moto-timo/gyp-next that referenced this issue Feb 20, 2023
avoids duplicate ninja rules for v8 used in host and target

From: minrk/node@5e533cb
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

Reported in nodejs/node#46690
and nodejs/node#37441

Minor refactoring as recommended by Christian Clauss.

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
moto-timo pushed a commit to moto-timo/gyp-next that referenced this issue Feb 20, 2023
avoids duplicate ninja rules for v8 used in host and target

From: minrk/node@5e533cb
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

Reported in nodejs/node#46690
and nodejs/node#37441

Minor refactoring as recommended by Christian Clauss.

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
moto-timo pushed a commit to moto-timo/gyp-next that referenced this issue Feb 20, 2023
avoids duplicate ninja rules for v8 used in host and target

From: minrk/node@5e533cb
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

Reported in nodejs/node#46690
and nodejs/node#37441

Minor refactoring as recommended by Christian Clauss.

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues and PRs related to build files or the CI. gyp Issues and PRs related to the GYP tool and .gyp build files macos Issues and PRs related to the macOS platform / OSX.
Projects
None yet
Development

No branches or pull requests

6 participants