From f664d7dc24c70ef08ced78d5d3f50a8ad673ea02 Mon Sep 17 00:00:00 2001 From: James Hilliard Date: Sun, 16 Oct 2022 13:30:14 -0600 Subject: [PATCH] package/Makefile.in: set --shuffle=none for MAKE1 Make 4.4 introduces a shuffle mode which randomizes prerequisites in order to better flush out issues with parallel builds. On the other hand, we use MAKE1 to build packages that are known to be broken with parallel build. For these, passing the shuffle option would be counter-productive and lead to spurious build failures. The --shuffle=none option exists to turn off shuffling again. We can't add this option unconditionally, however, because Make < 4.4 doesn't know it. Therefore, conditionally pass --shuffle=none only if there is a shuffle option in MAKEFLAGS. Signed-off-by: James Hilliard Signed-off-by: Arnout Vandecappelle --- package/Makefile.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package/Makefile.in b/package/Makefile.in index 4953d2d418..5c11cae732 100644 --- a/package/Makefile.in +++ b/package/Makefile.in @@ -17,7 +17,9 @@ else PARALLEL_JOBS := $(BR2_JLEVEL) endif -MAKE1 := $(HOSTMAKE) -j1 +# Only build one job at a time, *and* to not randomise goals and +# prerequisites ordering in make 4.4+ +MAKE1 := $(HOSTMAKE) -j1 $(if $(findstring --shuffle,$(MAKEFLAGS)),--shuffle=none) override MAKE = $(HOSTMAKE) \ $(if $(findstring j,$(filter-out --%,$(MAKEFLAGS))),,-j$(PARALLEL_JOBS))