为 armv7 编译 node.js v0.10.31 时出错 [英] Error Compiling node.js v0.10.31 for armv7

查看:24
本文介绍了为 armv7 编译 node.js v0.10.31 时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试在 Ubuntu 14.04 上编译 Node.js v0.10.31(和 v0.10.30)以在 Raspberry pi(运行 ARM)上使用时.我正在使用以下编译器标志:

When trying to compile Node.js v0.10.31 (and v0.10.30) on Ubuntu 14.04 for use on Raspberry pi (running ARM). I'm using the following compiler flags:

export AR=arm-linux-gnueabihf-ar
export CC=arm-linux-gnueabihf-gcc
export CXX=arm-linux-gnueabihf-g++
export LINK=arm-linux-gnueabihf-g++

但是我收到以下错误:

make -C out BUILDTYPE=Release V=1
make[1]: Entering directory `/home/ubuntu/node/out'
  arm-linux-gnueabihf-g++ -pthread -rdynamic -Wl,--whole-archive /home/ubuntu/node/out/Release/libopenssl.a -Wl,--no-whole-archive -Wl,--whole-archive /home/ubuntu/node/out/Release/obj.target/deps/v8/tools/gyp/libv8_base.a -Wl,--no-whole-archive -pthread  -o /home/ubuntu/node/out/Release/node -Wl,--start-group /home/ubuntu/node/out/Release/obj.target/node/src/fs_event_wrap.o /home/ubuntu/node/out/Release/obj.target/node/src/cares_wrap.o /home/ubuntu/node/out/Release/obj.target/node/src/handle_wrap.o /home/ubuntu/node/out/Release/obj.target/node/src/node.o /home/ubuntu/node/out/Release/obj.target/node/src/node_buffer.o /home/ubuntu/node/out/Release/obj.target/node/src/node_constants.o /home/ubuntu/node/out/Release/obj.target/node/src/node_extensions.o /home/ubuntu/node/out/Release/obj.target/node/src/node_file.o /home/ubuntu/node/out/Release/obj.target/node/src/node_http_parser.o /home/ubuntu/node/out/Release/obj.target/node/src/node_javascript.o /home/ubuntu/node/out/Release/obj.target/node/src/node_main.o /home/ubuntu/node/out/Release/obj.target/node/src/node_os.o /home/ubuntu/node/out/Release/obj.target/node/src/node_script.o /home/ubuntu/node/out/Release/obj.target/node/src/node_stat_watcher.o /home/ubuntu/node/out/Release/obj.target/node/src/node_string.o /home/ubuntu/node/out/Release/obj.target/node/src/node_zlib.o /home/ubuntu/node/out/Release/obj.target/node/src/pipe_wrap.o /home/ubuntu/node/out/Release/obj.target/node/src/signal_wrap.o /home/ubuntu/node/out/Release/obj.target/node/src/string_bytes.o /home/ubuntu/node/out/Release/obj.target/node/src/stream_wrap.o /home/ubuntu/node/out/Release/obj.target/node/src/slab_allocator.o /home/ubuntu/node/out/Release/obj.target/node/src/tcp_wrap.o /home/ubuntu/node/out/Release/obj.target/node/src/timer_wrap.o /home/ubuntu/node/out/Release/obj.target/node/src/tty_wrap.o /home/ubuntu/node/out/Release/obj.target/node/src/process_wrap.o /home/ubuntu/node/out/Release/obj.target/node/src/v8_typed_array.o /home/ubuntu/node/out/Release/obj.target/node/src/udp_wrap.o /home/ubuntu/node/out/Release/obj.target/node/src/node_crypto.o /home/ubuntu/node/out/Release/obj.target/deps/openssl/libopenssl.a /home/ubuntu/node/out/Release/obj.target/deps/zlib/libchrome_zlib.a /home/ubuntu/node/out/Release/obj.target/deps/http_parser/libhttp_parser.a /home/ubuntu/node/out/Release/obj.target/deps/cares/libcares.a /home/ubuntu/node/out/Release/obj.target/deps/uv/libuv.a /home/ubuntu/node/out/Release/obj.target/deps/v8/tools/gyp/libv8_base.a /home/ubuntu/node/out/Release/obj.target/deps/v8/tools/gyp/libv8_nosnapshot.a -Wl,--end-group -lm -ldl -lrt
/home/ubuntu/node/out/Release/libopenssl.a(armcap.o): In function `OPENSSL_cpuid_setup':
armcap.c:(.text.startup+0x0): multiple definition of `OPENSSL_cpuid_setup'
/home/ubuntu/node/out/Release/libopenssl.a(cryptlib.o):cryptlib.c:(.text+0x360): first defined here
/home/ubuntu/node/out/Release/libopenssl.a(armcap.o): In function `OPENSSL_rdtsc':
armcap.c:(.text+0x36): undefined reference to `_armv7_tick'
/home/ubuntu/node/out/Release/libopenssl.a(armcap.o): In function `OPENSSL_cpuid_setup':
armcap.c:(.text.startup+0xe0): undefined reference to `_armv7_tick'
armcap.c:(.text.startup+0x10c): undefined reference to `_armv7_neon_probe'
collect2: error: ld returned 1 exit status
make[1]: *** [/home/ubuntu/node/out/Release/node] Error 1
make[1]: Leaving directory `/home/ubuntu/node/out'
make: *** [node] Error 2

任何想法如何解决这个错误?谢谢!

Any ideas how to solve this error? Thank you!

推荐答案

我最近在 Raspberry Pi 上安装了 Node(不要使用 apt-get,即使在 Raspbian 上.如果你可以转移到 Raspbian,据我所知 Ubuntu不喜欢ARM).试试这个:

I recently installed Node on a Raspberry Pi (do not use apt-get, even on Raspbian. If you can move to Raspbian, as far as I know Ubuntu doesn't like ARM). Try this:

$ cd /home/pi/node/ #or any directory you want
$ wget http://node-arm.herokuapp.com/node_latest_armhf.deb
$ sudo dpkg -i node_latest_armhf.deb

如果您尝试打开 REPL ($ node) 并且这会给您一个错误,这可能是因为它找不到可执行文件.在这种情况下,以下命令对我有用:

If you try to open the REPL ($ node) and this gives you an error, it's probably because it can't find the executable find. In that case this following command made it work for me:

$ hash -r

这篇关于为 armv7 编译 node.js v0.10.31 时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆