You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/home/iojs/build/workspace/node-cross-compile/nodes/cross-compiler-pi1p/out/Release/mksnapshot: 1: /home/iojs/build/workspace/node-cross-compile/nodes/cross-compiler-pi1p/out/Release/mksnapshot: Syntax error: word unexpected (expecting ")")
I changed the node-cross-compile to pass --without-snapshot to configure, so that we can continue running CI while we figure the best long-term approach.
A few questions:
Is it absolutely impossible to produce a snapshot on the build platform, if it's different from the target platform? Or is it just a limitation in the compiler?
Are ARM release builds coming out of the cross-compile job?
Is it absolutely impossible to produce a snapshot on the build platform, if it's different from the target platform?
Only if you have an emulator. What the snapshot does is compile and execute JS to native machine code, then save the generated machine code to an image.
Building remotely on node-msft-cross-compiler-1 (cross-compiler-pi1p) in workspace /home/iojs/build/workspace/node-cross-compile/nodes/cross-compiler-pi1p
I think @indutny might be right. The job seem to be doing a configure instead of configure --dest-cpu=arm. On my x64 box, this is the config.gypi I get:
I believe I have this working now and will be able to re-enable snapshots when nodejs/node#4117 lands. V8 can handle cross compiling of snapshots if the {CC,CXX}_host variables are defined, by compiling the mksnapshot executable with the host compiler.
@joaocgreis When setting CC_host the host build picks up the CFLAGS environment variable, which I've used to configure the target, so the build fails for me.
How should CFLAGS be set for the target when wanting to cross compile with snapshot?
GYP uses the variables {CC,CXX}_host and {CC,CXX}_target to override {CC,CXX} when cross compiling. I'm not sure if it also handles CFLAGS, but it would need a similar duplication to be complete. On our side, it would be great to have configure supporting every combination, but most people committing to configure are not cross compiling so it would break easily. Work like that would require someone to keep a more constant attention over it, that's why I chose to do the least disruptive modification to configure and support only {CC,CXX}_host. Contributions are welcome!
@fornwall Perhaps the best way is not using the CFLAGS variable at all, and adding its contents to the proper {CC,CXX} variable in the script. Something like:
Hi all, I have same problems during crossing compile node.js.
When I edit android-configure file and add this text : --without-snapshot , It's successful to cross compile.
Here is my android-configure file :
Should a new issue be created for Android cross-compile does not work with v8 snapshots, since this issue is closed (and the Android issue doesn't seem ARM-specific)?
Activity
bnoordhuis commentedon Nov 24, 2015
Only if you have an emulator. What the snapshot does is compile and execute JS to native machine code, then save the generated machine code to an image.
indutny commentedon Nov 24, 2015
qemu?
indutny commentedon Nov 24, 2015
Also a question how does V8 handle this? I'm sure that Google cross-compiles it for arm. cc @ofrobots
targos commentedon Nov 24, 2015
There is some documentation about this here: https://github.com/v8/v8/wiki/Cross-compiling%20for%20ARM
indutny commentedon Nov 24, 2015
@targos I'm afraid that this page is very likely to be outdated. V8 does not use
sconsfor a very long time now.indutny commentedon Nov 24, 2015
@orangemocha is there any way to check that
want_separate_host_toolsetwas1during our builds?indutny commentedon Nov 24, 2015
It looks like it was
0. This is very likely a cause of the problem.indutny commentedon Nov 24, 2015
Wait, are we cross-compiling there? Or is it an actual raspberry pi?
ofrobots commentedon Nov 24, 2015
Looking output:
Building remotely on node-msft-cross-compiler-1 (cross-compiler-pi1p) in workspace /home/iojs/build/workspace/node-cross-compile/nodes/cross-compiler-pi1p
The job ran on https://ci.nodejs.org/computer/node-msft-cross-compiler-1/ which is described as "Ubuntu 14.04 LTS with Raspberry Pi cross compiler installed", so I would say this is a cross-compilation.
indutny commentedon Nov 24, 2015
This is a config.gypi:
For some reason
host_archisarmthere...ofrobots commentedon Nov 24, 2015
Indeed. Odd.
orangemocha commentedon Nov 24, 2015
Definitely cross-compiling. Better get the nitty gritty details from @joaocgreis, who set this up and also did some experiments with qemu.
ofrobots commentedon Nov 24, 2015
I think @indutny might be right. The job seem to be doing a
configureinstead ofconfigure --dest-cpu=arm. On my x64 box, this is the config.gypi I get:joaocgreis commentedon Dec 7, 2015
I believe I have this working now and will be able to re-enable snapshots when nodejs/node#4117 lands. V8 can handle cross compiling of snapshots if the
{CC,CXX}_hostvariables are defined, by compiling themksnapshotexecutable with the host compiler.joaocgreis commentedon Dec 9, 2015
nodejs/node#4117 has landed and CI is building snapshots for arm now: https://ci.nodejs.org/job/node-test-commit-arm-fanned/768/ . I will close this for now, please reopen if there are issues.
kikijhu commentedon Jan 14, 2016
It's still failed when building v5.4.1 on ubuntu 14.04 for android
make[1]: ** [/home/kiki/node.js/node-v5.4.1/out/Release/obj.target/v8_snapshot/geni/snapshot.cc] Error 2
make[1]: Leaving directory `/home/kiki/node.js/node-v5.4.1/out'
make: ** [node] Error 2
kikijhu commentedon Jan 14, 2016
I have to modified android-configure to pass --without-snapshot to configure.
joaocgreis commentedon Jan 14, 2016
@kikijhu Instead of adding
--without-snapshot, can you try to addI don't have the Android NDK here for a quick test, so let us know if this works. Thanks!
fornwall commentedon Jan 15, 2016
@joaocgreis When setting
CC_hostthe host build picks up theCFLAGSenvironment variable, which I've used to configure the target, so the build fails for me.How should
CFLAGSbe set for the target when wanting to cross compile with snapshot?joaocgreis commentedon Jan 15, 2016
GYP uses the variables
{CC,CXX}_hostand{CC,CXX}_targetto override{CC,CXX}when cross compiling. I'm not sure if it also handlesCFLAGS, but it would need a similar duplication to be complete. On our side, it would be great to haveconfiguresupporting every combination, but most people committing toconfigureare not cross compiling so it would break easily. Work like that would require someone to keep a more constant attention over it, that's why I chose to do the least disruptive modification toconfigureand support only{CC,CXX}_host. Contributions are welcome!@fornwall Perhaps the best way is not using the
CFLAGSvariable at all, and adding its contents to the proper{CC,CXX}variable in the script. Something like:kikijhu commentedon Jan 18, 2016
I add these lines to ./android-configure
Build failed again.
peter279k commentedon Jan 22, 2016
Hi all, I have same problems during crossing compile node.js.
When I edit android-configure file and add this text : --without-snapshot , It's successful to cross compile.
Here is my android-configure file :
Following texts are a part of crossing compile nodejs's message.
fornwall commentedon Jan 22, 2016
Should a new issue be created for
Android cross-compile does not work with v8 snapshots, since this issue is closed (and the Android issue doesn't seem ARM-specific)?joaocgreis commentedon Jan 25, 2016
Discussion moved to nodejs/node#4860
michael-ts commentedon Mar 1, 2017
I am seeing this issue cross-compiling for Linux on ARM (but NOT Android). I'm using the following commands:
Per the above suggestion, I also tried adding:
I'm not sure I understand what the fix for this is supposed to be. Is there something I am doing wrong, or is this a bug?
fornwall commentedon Mar 1, 2017
@michael-ts I think this is the issue to track: nodejs/node#9707
michael-ts commentedon Mar 1, 2017
@fornwall Ah, i see they are using
--without-intl. Using that I seem to get a successful build.fornwall commentedon Mar 1, 2017
@michael-ts Are you building node 6.x or 7.x?
michael-ts commentedon Mar 1, 2017
@fornwall 6.9.1