[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    [PATCH 1/1] Makefile: prevent race making libbb
From:       Juro Bystricky <juro.bystricky () intel ! com>
Date:       2016-09-12 21:37:41
Message-ID: 1473716261-38017-2-git-send-email-juro.bystricky () intel ! com
[Download RAW message or body]

This patch fixes the following error due to a race condition with parallel make:

libbb/appletlib.c:164:13: error: 'NUM_APPLETS' undeclared (first use in this function)
  while (i < NUM_APPLETS) {
             ^~~~~~~~~~~

The race condition is fairly rare, nevertheless it occures from time to time.
The patch assures libbb is built last, at which point all include files that are
generated are present.

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
---
 Makefile | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 5cfc763..69f3831 100644
--- a/Makefile
+++ b/Makefile
@@ -738,9 +738,18 @@ $(sort $(busybox-all)): $(busybox-dirs) ;
 # Error messages still appears in the original language
 
 PHONY += $(busybox-dirs)
-$(busybox-dirs): prepare scripts
+
+libbb-dir = $(filter libbb,$(busybox-dirs))
+busybox-dirs1 = $(filter-out libbb,$(busybox-dirs))
+
+$(busybox-dirs1): prepare scripts
 	$(Q)$(MAKE) $(build)=$@
 
+ifneq ($(libbb-dir),)
+$(libbb-dir): | $(busybox-dirs1)
+	$(Q)$(MAKE) $(build)=$@
+endif
+
 # Build the kernel release string
 # The KERNELRELEASE is stored in a file named .kernelrelease
 # to be used when executing for example make install or make modules_install
-- 
2.7.4

_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic