[uClibc] Using jobserver in buildroot

Jeffrey Baitis baitisj at evolution.com
Thu Oct 16 17:38:36 UTC 2003


Hi all:

I noticed today that some enterprising individual decided to incorporate
ccache into the buildroot tool. Here are some simple patches that allow
you to specify a multiprocess "make -jX" build in the top level
Makefile. I enable it for binutils and gcc, since these components
appear to be written to accommodate the job server, and seem to compile
correctly.

To specify a multiprocess build, just add the following to your
Makefile:

        # For SMP machines, we can compile using the jobserver.
        JLEVEL=-j5
        
and then apply the patches at the end of this message. Enjoy!

-Jeff
        

------------------------------------------------------------------------ 
$ cvs diff -u binutils.mk 
Index: binutils.mk
===================================================================
RCS file: /var/cvs/buildroot/make/binutils.mk,v
retrieving revision 1.4
diff -u -r1.4 binutils.mk
--- binutils.mk 8 Oct 2003 02:43:49 -0000 1.4
+++ binutils.mk 16 Oct 2003 17:27:09 -0000
@@ -67,11 +67,11 @@
  touch $(BINUTILS_DIR1)/.configured
 
 $(BINUTILS_DIR1)/binutils/objdump: $(BINUTILS_DIR1)/.configured
- $(MAKE) CC_FOR_HOST=$(HOSTCC) CXX_FOR_HOST=$(HOSTCC) \
+ $(MAKE) $(JLEVEL) CC_FOR_HOST=$(HOSTCC) CXX_FOR_HOST=$(HOSTCC) \
   -C $(BINUTILS_DIR1);
 
 $(STAGING_DIR)/$(GNU_TARGET_NAME)/bin/ld: $(BINUTILS_DIR1)/binutils/objdump 
- $(MAKE) CC_FOR_HOST=$(HOSTCC) CXX_FOR_HOST=$(HOSTCC) \
+ $(MAKE) $(JLEVEL) CC_FOR_HOST=$(HOSTCC) CXX_FOR_HOST=$(HOSTCC) \
   -C $(BINUTILS_DIR1) install;
  rm -rf $(STAGING_DIR)/info $(STAGING_DIR)/man $(STAGING_DIR)/share/doc \
   $(STAGING_DIR)/share/locale
@@ -150,7 +150,7 @@
  touch $(BINUTILS_DIR2)/.configured
 
 $(BINUTILS_DIR2)/binutils/objdump: $(BINUTILS_DIR2)/.configured
- $(MAKE) -C $(BINUTILS_DIR2) \
+ $(MAKE) $(JLEVEL) -C $(BINUTILS_DIR2) \
   CC_FOR_BUILD=$(HOSTCC) \
   CXX_FOR_BUILD=$(HOSTCC) \
   AR_FOR_TARGET=$(TARGET_CROSS)ar \
@@ -164,7 +164,7 @@
  touch -c $(BINUTILS_DIR2)/binutils/objdump
 
 $(TARGET_DIR)/usr/bin/ld: $(BINUTILS_DIR2)/binutils/objdump 
- $(MAKE) -C $(BINUTILS_DIR2) \
+ $(MAKE) $(JLEVEL) -C $(BINUTILS_DIR2) \
   CC_FOR_BUILD=$(HOSTCC) \
   CXX_FOR_BUILD=$(HOSTCC) \
   AR_FOR_TARGET=$(TARGET_CROSS)ar \

------------------------------------------------------------------- 
$ cvs diff -u gcc-3.3.mk 
Index: gcc-3.3.mk
===================================================================
RCS file: /var/cvs/buildroot/make/gcc-3.3.mk,v
retrieving revision 1.7
diff -u -r1.7 gcc-3.3.mk
--- gcc-3.3.mk 15 Oct 2003 07:04:19 -0000 1.7
+++ gcc-3.3.mk 16 Oct 2003 17:31:22 -0000
@@ -128,7 +128,7 @@
  touch $(GCC_BUILD_DIR1)/.configured
 
 $(GCC_BUILD_DIR1)/.compiled: $(GCC_BUILD_DIR1)/.configured
- PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR1) \
+ PATH=$(TARGET_PATH) $(MAKE) $(JLEVEL) -C $(GCC_BUILD_DIR1) \
      AR_FOR_TARGET=$(STAGING_DIR)/bin/$(ARCH)-uclibc-ar \
      RANLIB_FOR_TARGET=$(STAGING_DIR)/bin/$(ARCH)-uclibc-ranlib
  touch $(GCC_BUILD_DIR1)/.compiled
@@ -207,7 +207,7 @@
  PATH=$(TARGET_PATH) CC=$(HOSTCC) \
      AR_FOR_TARGET=$(TARGET_CROSS)ar RANLIB_FOR_TARGET=$(TARGET_CROSS)ranlib \
      LD_FOR_TARGET=$(TARGET_CROSS)ld NM_FOR_TARGET=$(TARGET_CROSS)nm \
-     CC_FOR_TARGET=$(TARGET_CROSS)gcc $(MAKE) -C $(GCC_BUILD_DIR2)
+     CC_FOR_TARGET=$(TARGET_CROSS)gcc $(MAKE) $(JLEVEL) -C $(GCC_BUILD_DIR2)
  touch $(GCC_BUILD_DIR2)/.compiled
 
 $(GCC_BUILD_DIR2)/.installed: $(GCC_BUILD_DIR2)/.compiled
@@ -379,7 +379,7 @@
 #endif
 
 $(GCC_BUILD_DIR3)/.compiled: $(GCC_BUILD_DIR3)/.configured
- $(MAKE) $(TARGET_GCC_ARGS) -C $(GCC_BUILD_DIR3)
+ $(MAKE) $(JLEVEL) $(TARGET_GCC_ARGS) -C $(GCC_BUILD_DIR3)
  touch $(GCC_BUILD_DIR3)/.compiled
 
 $(TARGET_DIR)/usr/bin/gcc: $(GCC_BUILD_DIR3)/.compiled

-----------------------------------------------------------------------




-- 
Jeffrey Baitis <baitisj at evolution.com>



More information about the uClibc mailing list