optionally support parallel toolchain build. This defaults to off, because certain...
authorMichael Büsch <mb@bu3sch.de>
Sun, 3 Oct 2010 12:54:07 +0000 (12:54 +0000)
committerMichael Büsch <mb@bu3sch.de>
Sun, 3 Oct 2010 12:54:07 +0000 (12:54 +0000)
SVN-Revision: 23196

Config.in
include/toolchain-build.mk
toolchain/binutils/Makefile
toolchain/gcc/common.mk
toolchain/uClibc/Makefile

index 651cbdef5ae5b9c0be572933a8dc932c70d453c5..ab8fbf8e4d51ea103fb8a63e43e359cd81a4e2bf 100644 (file)
--- a/Config.in
+++ b/Config.in
@@ -268,7 +268,7 @@ menu "Global build settings"
 
        config PKG_DEFAULT_PARALLEL
                bool
-               prompt "Always parallelize the default package build rule (Dangerous)"
+               prompt "Parallelize the default package build rule (May break build)"
                depends on PKG_BUILD_PARALLEL
                default n
                help
@@ -278,7 +278,21 @@ menu "Global build settings"
                  packages with multiple jobs that are probably not tested in
                  a parallel build environment.
 
-                 Say N. Only say Y for testing.
+                 Only say Y, if you don't mind fixing broken packages.
+                 Before reporting build bugs, set this to N and re-run the build.
+
+       config TOOLCHAIN_PARALLEL
+               bool
+               prompt "Parallelize the toolchain build (May break build)"
+               depends on PKG_BUILD_PARALLEL
+               default n
+               help
+                 Build the toolchain with parallel make jobs.
+                 This speeds up the toolchain build on SMP machines, but may
+                 break the build for certain toolchain versions.
+
+                 If you say Y, toolchain build might break.
+                 Before reporting build bugs, set this to N and re-run the build.
 
        comment "Stripping options"
 
index 6defe63edf06e79d2b483682cd9ed0fe478fbaab..a0bc4061fcfcfc6c488e30ac985ccf4c709f9d5d 100644 (file)
@@ -11,6 +11,8 @@ REAL_STAGING_DIR_HOST:=$(STAGING_DIR_HOST)
 STAGING_DIR_HOST:=$(TOOLCHAIN_DIR)
 BUILD_DIR_HOST:=$(BUILD_DIR_TOOLCHAIN)
 
+TOOLCHAIN_JOBS?=$(if $(CONFIG_TOOLCHAIN_PARALLEL),-j$(CONFIG_PKG_BUILD_JOBS))
+
 include $(INCLUDE_DIR)/host-build.mk
 
 HOST_STAMP_PREPARED=$(HOST_BUILD_DIR)/.prepared
index 5682698bcf04a0237bdb48935aa7bf6ac0aa0265..d829098e54f616b892c74e285963483865378ad8 100644 (file)
@@ -79,7 +79,7 @@ define Host/Configure
 endef
 
 define Host/Compile
-       $(MAKE) -C $(HOST_BUILD_DIR) all
+       $(MAKE) $(TOOLCHAIN_JOBS) -C $(HOST_BUILD_DIR) all
 endef
 
 define Host/Install
index e2277207b8b4fe7f15c2eb609ff76e3c26f96f47..8c293dd33212005430572e7761fd61eb47049581 100644 (file)
@@ -173,7 +173,7 @@ endif
 
 GCC_MAKE:= \
        export SHELL="$(BASH)"; \
-       $(MAKE) \
+       $(MAKE) $(TOOLCHAIN_JOBS) \
                CFLAGS_FOR_TARGET="$(TARGET_CFLAGS)" \
                CXXFLAGS_FOR_TARGET="$(TARGET_CFLAGS)"
 
index 362548aae5a2e8597936fd4e801c3a3fe919cb15..d3d4d85cdd39df2bd6ffee9f4268fe21e14e49a2 100644 (file)
@@ -109,7 +109,7 @@ UCLIBC_MAKE = PATH='$(TARGET_PATH)' $(MAKE) -C $(HOST_BUILD_DIR) \
 
 define Host/Compile
        $(SED) 's,^CROSS=.*,CROSS=$(TARGET_CROSS),g' $(HOST_BUILD_DIR)/Rules.mak
-       $(UCLIBC_MAKE) PREFIX= all
+       $(UCLIBC_MAKE) $(TOOLCHAIN_JOBS) PREFIX= all
        $(UCLIBC_MAKE) PREFIX="$(TOOLCHAIN_DIR)/" install_runtime install_dev
        $(CP) $(HOST_BUILD_DIR)/libc/libc_so.a $(TOOLCHAIN_DIR)/lib/
        $(CP) $(HOST_BUILD_DIR)/libpthread/*/libpthread_so.a $(TOOLCHAIN_DIR)/lib/