common.mk: buildroot: force make -j1 in buildroot when not per-package

Buildroot parallel build is allowed when BR2_PER_PACKAGE_DIRECTORIES is
'y', see commit e9bff1c86e93 ("common.mk: buildroot: enable top-level
parallel build"). When disabled, Buildroot is not supposed to spawn
several make jobs simultaneously. However for some reason it seems it
can happen, see the IBART failure at [1]. The steps:
 >>> optee_client_ext 1.0 Fixing libtool files
and:
 >>> pcsc-lite 1.9.4 Fixing libtool files
...seem to be running simultaneously and touching the same path (since
per-package is disabled), which results in:
 mv: cannot stat '/home/optee/devel/qemu/out-br/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libpcsclite.la.fixed': No such file or directory
 package/pkg-generic.mk:331: recipe for target '/home/optee/devel/qemu/out-br/build/pcsc-lite-1.9.4/.stamp_staging_installed' failed

I confirmed the fact by adding a 'sleep 5' after "Fixing libtool files"
in package/pkg-generic.mk, as well as a 'ps -ef | grep sleep | grep -v
grep || :' just before the sleep. Then when building with
'make -j32 BR2_PER_PACKAGE_DIRECTORIES=n' (32 core machine) the 'sleep 5'
is displayed occasionally.

To avoid that, let's explicitly invoke make with -j1 when
BR2_PER_PACKAGE_DIRECTORIES is disabled.

Link: [1] https://optee.mooo.com:5000/logs/OP-TEE/optee_os/5487/1027234243/9147c347fb53612f62bf7de1c17e47a246d61ef2#02-qemu-build line 16398:
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
1 file changed
tree: 1e55575ff7afa9dac64326e50eff48f7b4709bad
  1. .github/
  2. br-ext/
  3. fvp/
  4. imx/
  5. kconfigs/
  6. qemu_v8/
  7. rpi3/
  8. ti/
  9. zynqmp/
  10. .gitignore
  11. am43xx.mk
  12. am57xx.mk
  13. common.mk
  14. dra7xx.mk
  15. fvp-psa-sp.mk
  16. fvp.mk
  17. get_clang.sh
  18. hikey.mk
  19. hikey960.mk
  20. imx.mk
  21. juno.mk
  22. poplar.mk
  23. qemu-check.exp
  24. qemu.mk
  25. qemu_v8.mk
  26. README.md
  27. rpi3.mk
  28. soc_term.py
  29. stm32mp1.mk
  30. synquacer.mk
  31. toolchain.mk
  32. trusted-keys.exp
  33. trusted-services.mk
  34. verdin.mk
  35. zynqmp.mk
README.md

OP-TEE build.git

This git contains makefiles etc to be able to build a full OP-TEE developer setup for the OP-TEE project.

All official OP-TEE documentation has moved to http://optee.readthedocs.io. The pages that used to be here in this git can be found under build and Device specific information at he new location for the OP-TEE documentation.

// OP-TEE core maintainers