为 ARM7 交叉编译 Nodejs 时 node-v8.11.1/out/Release/icupkg 上的执行格式错误

为 ARM7 交叉编译 Nodejs 时 node-v8.11.1/out/Release/icupkg 上的执行格式错误

我分叉了Nodejs-ARM-builder存储库并将 Vagrant box 更新至 Ubuntu 18.04 (这是我的存储库:https://github.com/lbrutti/Nodejs-ARM-builder)。

当尝试为 ARM Cortex 交叉编译 NodeJS 时(我想将 NodeJS 放在 Parrot AR 2.0 无人机上,但我想使用 LTS 版本而不是这里提出的旧版本:https://github.com/felixge/node-cross-compiler/downloads)我收到一个错误,我不知道如何修复:

arm-unknown-linux-gnueabihf-g++ -pthread -rdynamic  -o /home/vagrant/node- 
v8.11.1/out/Release/icupkg -Wl,--start-group /home/vagrant/node-v8.11.1/out/Release/obj.host/icupkg/deps/icu-small/source/tools/icupkg/icupkg.o /home/vagrant/node-v8.11.1/out/Release/obj.host/icupkg/tools/icu/no-op.o /home/vagrant/node-v8.11.1/out/Release/obj.host/tools/icu/libicutools.a  -Wl,--end-group
arm-unknown-linux-gnueabihf-g++ -pthread -rdynamic  -o /home/vagrant/node-v8.11.1/out/Release/genrb -Wl,--start-group /home/vagrant/node-v8.11.1/out/Release/obj.host/genrb/deps/icu-small/source/tools/genrb/read.o /home/vagrant/node-v8.11.1/out/Release/obj.host/genrb/deps/icu-small/source/tools/genrb/errmsg.o /home/vagrant/node-v8.11.1/out/Release/obj.host/genrb/deps/icu-small/source/tools/genrb/prscmnts.o /home/vagrant/node-v8.11.1/out/Release/obj.host/genrb/deps/icu-small/source/tools/genrb/parse.o /home/vagrant/node-v8.11.1/out/Release/obj.host/genrb/deps/icu-small/source/tools/genrb/genrb.o /home/vagrant/node-v8.11.1/out/Release/obj.host/genrb/deps/icu-small/source/tools/genrb/wrtjava.o /home/vagrant/node-v8.11.1/out/Release/obj.host/genrb/deps/icu-small/source/tools/genrb/ustr.o /home/vagrant/node-v8.11.1/out/Release/obj.host/genrb/deps/icu-small/source/tools/genrb/rbutil.o         /home/vagrant/node-v8.11.1/out/Release/obj.host/genrb/deps/icu-small/source/tools/genrb/wrtxml.o /home/vagrant/node-v8.11.1/out/Release/obj.host/genrb/deps/icu-small/source/tools/genrb/rle.o /home/vagrant/node-v8.11.1/out/Release/obj.host/genrb/deps/icu-small/source/tools/genrb/reslist.o /home/vagrant/node-v8.11.1/out/Release/obj.host/tools/icu/libicutools.a  -Wl,--end-group
arm-unknown-linux-gnueabihf-g++ -pthread -rdynamic  -o /home/vagrant/node-v8.11.1/out/Release/iculslocs -Wl,--start-group /home/vagrant/node-v8.11.1/out/Release/obj.host/iculslocs/tools/icu/iculslocs.o /home/vagrant/node-v8.11.1/out/Release/obj.host/iculslocs/tools/icu/no-op.o /home/vagrant/node-v8.11.1/out/Release/obj.host/tools/icu/libicutools.a  -Wl,--end-group
LD_LIBRARY_PATH=/home/vagrant/node-v8.11.1/out/Release/lib.host:/home/vagrant/node-v8.11.1/out/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../tools/icu; mkdir -p /home/vagrant/node-v8.11.1/out/Release/obj/gen/icutmp; python icutrim.py -P "/home/vagrant/node-v8.11.1/out/Release" -D ../../deps/icu-small/source/data/in/icudt60l.dat --delete-tmp -T "/home/vagrant/node-v8.11.1/out/Release/obj/gen/icutmp" -F icu_small.json -O icudt60l.dat -v -L en,root
Options: {'verbose': 1, 'filterfile': 'icu_small.json', 'toolpath': '/home/vagrant/node-v8.11.1/out/Release', 'deltmpdir': 1, 'outfile': 'icudt60l.dat', 'datfile': '../../deps/icu-small/source/data/in/icudt60l.dat', 'locales': 'en,root', 'endian': 'little', 'tmpdir': '/home/vagrant/node-v8.11.1/out/Release/obj/gen/icutmp'}
icu_small.json: icutrim.py config: Trim down ICU to just a certain locale set, needed for node.js use.
sh: 1: /home/vagrant/node-v8.11.1/out/Release/icupkg: Exec format error
FAILED: /home/vagrant/node-v8.11.1/out/Release/icupkg -tl ../../deps/icu-small/source/data/in/icudt60l.dat /home/vagrant/node-v8.11.1/out/Release/obj/gen/icutmp/icudt60l.dat
tools/icu/icudata.target.mk:13: recipe for target '/home/vagrant/node-v8.11.1/out/Release/obj/gen/icutmp/icudt60l.dat' failed
make[1]: *** [/home/vagrant/node-v8.11.1/out/Release/obj/gen/icutmp/icudt60l.dat] Error 1
rm 1a1b88980118d836843b09666155f5b83fe8fb29.intermediate
Makefile:88: recipe for target 'node' failed

我正在使用 xtools 作为工具链:http://archlinuxarm.org/builder/xtools/x-tools7h.tar.xz

谢谢

答案1

似乎通过添加可以解决问题--无国际标志来配置线路,如https://github.com/nodejs/node/issues/7173

./configure --cross-compiling --without-snapshot --without-npm --without-ssl --without-intl --dest-cpu=arm --dest-os=linux --prefix="${PREFIX_DIR}"

现在我没有收到任何错误并且编译继续进行。

好像打包步骤中出现了错误:

Invalid package configuration: Cannot package the path '/tmp/installARMv7/usr/lib', does it exist? {:level=>:error}

但似乎已创建节点可执行文件。明天我将尝试将其部署在 Parrot Drone 上,看看它是否有效。

相关内容