user1032861
user1032861

Reputation: 527

Bad -rpath option while trying to cross-compile node.js for arm

I'm trying to cross-compile node.js for an arm processor following this instructions http://www.wigwag.com/devblog/cross-compile-node-js-for-arm/#comment-1419 and after some time I get a "bad -rpath option" on ld. Does anyone know how can I fix it?

Upvotes: 2

Views: 2932

Answers (1)

EdH
EdH

Reputation: 3293

I actually wrote that article... Just ran across this while trying to fix the same issue.

Apparently in the CodeSourcery binaries we use now (gcc-4.4.4-glibc-2.11.1-multilib-1.0 via Freescale's tools) the ld command no longer likes the rpath switches - just like your issue. In any case you can get around this by switching to g++ as suggested in this forum: https://groups.google.com/forum/?fromgroups=#!topic/nodejs/uzHnSBhEp6g

Here is a gist of a working solution:
https://gist.github.com/edhemphill/5094239

So make this change:

export LD="${PREFIX_BIN}-g++"

Further explanation:

The funky -Wl,-rpath-link,${X} syntax in there is to pass the switch -rpath-link X to the linker. This is needed so your node binary's shared libraries can find their shared libraries when ran on your ARM platform. Luckily most of the shared library mess is a non-issue since node links so much statically.

http://ftp.gnu.org/old-gnu/Manuals/ld-2.9.1/html_node/ld_3.html

Upvotes: 2

Related Questions