Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to compile VLC from this GitHub repo on my Allwinner device (ARM Cortex-A8 NEON with armhf kernel and about 380 MB of RAM) using instructions provided here.

I keep getting segfaults, so I created a swap partition like this:

 root@lianro:~/# dd if=/dev/zero of=/swap bs=1M count=1024
 root@linaro:~/# mkswap -c /swap
 root@linaro:~/# swapon /swap

It got better; instead of breaking randomly after about one minute it breaks randomly after a long time, last time it almost finished but I got a segfault on one of the last modules.

Swap doesn't seem to be used at all at any point during the compilation. I have plenty of disk space free.

What can be the problem?

share|improve this question
    
Can you post the lines leading up to the segmentation fault? Does it always segfault at the same location? Does echo 2 > /proc/cpu/alignment help? (If it does you have an alignment bug. X86 architecture allows this albeit with a big performance impact. Other architectures often require you do do it right. Tools/programs which get ported often run into these problems. (Though without the error I am just guessing). –  Hennes Jul 27 '13 at 16:56
    
When you say that swap isn't being used, how do you know? Anything in dmesg relating to oom-killer? –  Flup Jul 27 '13 at 17:12
    
I just ran top in another terminal while compiling. Physical memory is almost full but swap is empty during compilation. I finally managed to compile it all just by trying a few times in a row. The whole process took me almost 4 hours, good thing it doesn't need to recompile already compiled modules! –  elcodedocle Jul 27 '13 at 17:58
    
@Hennes the segfaults are random, the lines leading to it are all cc somemodule and the compiler displays a message saying it's a segfault and it cannot trace the problem and it must be SO related. echo 2 > /proc/cpu/alignment didn't help –  elcodedocle Jul 27 '13 at 18:03
1  
You might find it easier to set up a cross compile configuration on your main machine. Doing this using something like chroot/schroot might make it significantly simpler. I know that there are instructions on setting up Ubuntu for cross compiling onto the Raspberry Pi (another ARM platform) so it should be possible. –  KayEss Aug 1 '13 at 3:07
show 2 more comments

1 Answer

up vote 1 down vote accepted

If compilation of a particular module requires more RAM than you physically have available, swap will not help, because the program will attempt to allocate and use significantly more RAM than you have in the system and swap cannot make up for that. Linux can't swap out memory that is actively in use.

You might try manually changing the CFLAGS or the Makefile rule for compilation for the particular module that's crashing to not perform optimization (-O0) or to use a lower level of optimization (-O1 or -Os for example). This will use significantly less memory during compilation, and while it isn't ideal, it may allow the compilation to succeed. Media players tend to use expensive optimizations that require lots of RAM, both at compile-time and at runtime.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.