Cross-build x64 host -> arm target fails in V8 host arch guard (v8config.h)
Personne n'a encore pris cette issue.
- Langage dominant
- JavaScript
- Étoiles
- 122k
- Forks
- 37.4k
- Merge moyen
- 4 j 3 h
- PR mergées (30 j)
- 272
Description
Summary
Cross-building Node.js for --dest-cpu=arm (32-bit ARM / armhf) from an x64 Linux host fails in V8 host object compilation due to a host/target architecture guard in deps/v8/include/v8config.h.
Environment
- Host: Ubuntu 24.04 x86_64
- Target: Raspberry Pi 3, 32-bit Raspbian Buster (armhf)
- Cross toolchain:
arm-linux-gnueabihf-*
Repro
From x64 host:
./configure \
--dest-os=linux \
--dest-cpu=arm \
--cross-compiling \
--with-arm-float-abi=hard \
--with-arm-fpu=neon \
--without-node-snapshot
make -j1
Failure
Host V8 compilation fails with:
#error Target architecture arm is only supported on arm and ia32 host
Coming from deps/v8/include/v8config.h:
#if (V8_TARGET_ARCH_ARM && !(V8_HOST_ARCH_IA32 || V8_HOST_ARCH_ARM))
#error Target architecture arm is only supported on arm and ia32 host
#endif
In generated host makefiles (for example out/tools/v8_gypfiles/v8_libplatform.host.mk), host objects are compiled with -DV8_TARGET_ARCH_ARM, which triggers this guard on x64 hosts.
Notes
--without-node-snapshotdoes not avoid this, as host V8 objects are still built with ARM target macros.- A local workaround changing the guard to include x64 host allows compilation to proceed:
-#if (V8_TARGET_ARCH_ARM && !(V8_HOST_ARCH_IA32 || V8_HOST_ARCH_ARM))
+#if (V8_TARGET_ARCH_ARM && !(V8_HOST_ARCH_IA32 || V8_HOST_ARCH_ARM || V8_HOST_ARCH_X64))
Request
What is the intended/supported path for x64-host -> arm-target cross-builds in current Node/V8?
If this should be supported, could build generation be adjusted so host-side V8 tools/objects do not fail this guard (or guard logic updated in a supported way)?
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Reproduire le build x64-to-arm avec les commandes configure et make indiquées dans l’issue. Commencer par deps/v8/include/v8config.h et le fichier généré out/tools/v8_gypfiles/v8_libplatform.host.mk, puis déterminer pourquoi les objets de l’hôte reçoivent la macro de cible ARM. Le travail est terminé lorsque le chemin de cross-build pris en charge ainsi que le guard requis ou le comportement de génération du build sont documentés et vérifiés.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- cpp, javascript, linux
- Domaine
- build-system, compilers, operating-systems
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 45/100