openembedded/meta-openembedded

NodeJs 16.14.2 yocto build issue

Opened this issue · 6 comments

I'm using the yocto Langdale version for building yocto rootfs for the machine "zc702-zynq7". Initially, I'm able to add the other required recipes for example pps-tools, gpsd, gcc, etc.

After installing all the above recipes I wanted to install nodejs then I added the following line in the core-image-minimal.bb file.

IMAGE_INSTALL+= " pps-tools gpsd gcc nodejs "

but while compilation I got the following issue,

collect2: fatal error: ld terminated with signal 9

Can you please help me to understand the cause of the above issue? how can we solve this issue?

Your builder probably run out of memory and OOMK killed the ld, check dmesg. nodejs uses a lot of ram to build.

How to solve this issue? Is there any configuration that will help me here?

Hi

to compile nodejs using yocto, on ubuntu we use to increase the swap eg:

sudo swapon -s
sudo swapoff -v /swapfile
sudo swapon -s
sudo rm -rf /swapfile
sudo fallocate -l 32G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile

it works for our build

Please note that he still didn't reply to confirm that he has seen OOMK in dmesg, it's just most likely in my experience.

And building in swap is very slow, get more ram unless you're building nodejs just once in lifetime as a hobby (lowering PARALLEL_MAKE/BB_NUMBER_THREADS to fit nodejs.do_compile in ram would probably be a bit faster than adding more and more swap)

Just for reference, when building nodejs (on Kirkstone), I need to lower PARALLEL_MAKE and BB_NUMBER_THREADS to 4 in order to avoid failure in ld due to limited ram.

My build machine is a i5-12xxx with 12 threads and 24G of ram. Increasing to 5 leads to failure.

kraj commented

try using gold linker of lld that might help.