[Buildroot] make creates a memory overflow

Peter Korsgaard peter at korsgaard.com
Tue Oct 13 06:20:17 UTC 2020


>>>>> "Michael" == Michael Fischer <mf at go-sys.de> writes:

 > Hello all,
 > I use VirtualBox with SuSE linux to compile Buildroot.

 > For my other projects I use the default make settings -j

 > /etc/environment
 > export MAKEOPTS='-j'
 > export MAKEFLAGS='-j'

That is not a safe setting. -j without a number tells make to use as
many processes as it wants to use, which for a big thing like Buildroot
can be a LOT. A more sensible setting is nr-of-CPUs (+1), which matches
the default logic we have for BR2_JLEVEL.

 > When I use this, than buildroot crashes the Virtualbox with a memory overflow. > 8GB

 > I found this in the /package/Makefile

 > MAKE1 := $(HOSTMAKE) -j1
 > override MAKE = $(HOSTMAKE) \
 >         $(if $(findstring j,$(filter-out --%,$(MAKEFLAGS))),,-j$(PARALLEL_JOBS))


 > I'm not sure but I think this should be 

 >         $(if $(findstring j,$(filter-out -j%,$(MAKEFLAGS))),,-j$(PARALLEL_JOBS))


No, the intention is for the logic to not get confused about variables
passed on the make command line, as they are added to MAKEFLAGS after
a -- seperator, E.G.:

make -k foo=j
MAKEFLAGS='k -- foo=j'

-- 
Bye, Peter Korsgaard


More information about the buildroot mailing list