node icon indicating copy to clipboard operation
node copied to clipboard

Duplicate v8 target errors when cross-compiling

Open minrk opened this issue 3 years ago • 4 comments

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.

minrk avatar Feb 19 '21 11:02 minrk

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

vilkov avatar Jun 24 '22 21:06 vilkov

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

scr06 avatar Jul 06 '22 13:07 scr06

Hi @scr06 ,

Did you by any chance solved this issue?

spockfish avatar Aug 01 '22 18:08 spockfish

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

scr06 avatar Aug 02 '22 17:08 scr06