Phantomjs build error
AllInOne.o inspector/InspectorAllInOne.cpp
{standard input}: Assembler messages:
{standard input}:195655: Warning: end of file not at end of a line; newline inserted
{standard input}:196277: Error: bad register name %r' {standard input}: Error: open CFI at the end of file; missing .cfi_endproc directive g++: internal compiler error: Killed (program cc1plus) Please submit a full bug report, with preprocessed source if appropriate. See <file:///usr/share/doc/gcc-4.7/README.Bugs> for instructions. make[2]: *** [.obj/inspector/InspectorAllInOne.o] Error 4 make[2]: Leaving directory/root/phantomjs/src/qt/qtwebkit/Source/WebCore'
make[1]: *** [sub-Target-pri-make_first-ordered] Error 2
make[1]: Leaving directory `/root/phantomjs/src/qt/qtwebkit/Source/WebCore'
make: *** [sub-Source-WebCore-WebCore-pro-make_first-ordered] Error 2
GCC version? Distro?
I read that this problem can be caused from the RAM becouse i have only 1GB Ram. GCC and Distro: gcc version 4.7.2 (Debian 4.7.2-5)
I experienced a very similar build error on a CentOS 6.5 VM with 2GB. After reading above, I tried doubling the RAM allocation for the VM. It fixed the problem and I was able to complete the build.
is there a way to resolve this without using additional RAM? I am trying to compile this on a raspberry pi and it has a fixed amount of RAM. I can increase the SWAP space.
does anyone have good ideas about this, just like swap or something else...
Any time you see the error message g++: internal compiler error: Killed, or any sort of syntax error coming from the assembler rather than the C++ compiler, that means the computer does not have enough memory to compile PhantomJS. (Linux and I think also OSX default to "memory overcommitment", which means memory-allocation primitives always succeed, but if a process tries to actually use more memory than is available, it will be abruptly killed. "Internal compiler error: Killed" means exactly that, and syntax errors from the assembler mean that the compiler proper got killed in the middle of writing out a line of assembly language. Overcommit is inelegant, but for complicated technical+historical reasons it works better than any alternative. Buy me a drink sometime if you want the entire rant.)
We don't have precise numbers for exactly how much memory you need to compile PhantomJS. Our best estimate is four gigabytes per CPU core, when build.py is run in the default mode. You can cut this to 4GB total by using --jobs 1. If you don't have 4GB of physical RAM, swap space should be good enough; I have never actually tried that myself. If you're in that boat, I'd suggest providing at least 8GB of swap (just to be sure) and using --jobs 1. And be prepared to wait several hours for the build to finish. Sorry.
This is not actually a bug in PhantomJS, so I am going to close this report.
Oh, one more thing:
@psychoph Even with how much trouble setting up a cross-toolchain is, I think you'll have a much better time if you cross-compile from a beefier computer.
@zackw Thanks a lot. It saves my day!