[Yocto] fatal error: Killed signal terminated program cc1plus

Some machine has an error when building yocto with error as below:

fatal error: Killed signal terminated program cc1plus

One of the more reasons is the resource (number of CPU core threads used to build) to build machines are not enough.

My solution: configure the number thread for yocto build at file  conf/local.conf  in the build folder by adding two lines:

PARALLEL_MAKE = "-j x"
BB_NUMBER_THREADS = "y"

with x, y are number CPU thread.

PARALLEL_MAKE defines how many threads should be used when using make -j command during do_compile.

BB_NUMBER_THREADS defines number of threads for bitbake.

refer to:
https://stackoverflow.com/questions/66488550/how-to-add-more-threads-when-building

Note: x, y should are less than number CPU of current build machine.
Command to check CPU cores:

$ nproc 
8

==> x, y can choose is : 1-> 6
in this case you can config:

PARALLEL_MAKE = "-j 4"
BB_NUMBER_THREADS = "4"

I hope this thing can help you 🙂

P/S:  x=y=1 is good to avoid this problem but it will be slowly built 🙂

PARALLEL_MAKE = "-j 1"
BB_NUMBER_THREADS = "1"

2 Comments

Leave a Reply to Anonymous Cancel reply

Your email address will not be published. Required fields are marked *