summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormb <mb@3c298f89-4303-0410-b956-a3cf2f4a3e73>2010-10-03 12:54:07 +0000
committermb <mb@3c298f89-4303-0410-b956-a3cf2f4a3e73>2010-10-03 12:54:07 +0000
commita26814e6d64497363e371690e8a4ac44a2df1425 (patch)
tree940cf0a57c57d5fee01760097f72c7790584ef3e
parent3e0c7f1e5920860b2a69c8260ce6748c9f897252 (diff)
optionally support parallel toolchain build. This defaults to off, because certain toolchain versions are known to break on parallel build. However, it significantly speeds up the build and latest versions of the tools do compile fine.
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@23196 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r--Config.in18
-rw-r--r--include/toolchain-build.mk2
-rw-r--r--toolchain/binutils/Makefile2
-rw-r--r--toolchain/gcc/common.mk2
-rw-r--r--toolchain/uClibc/Makefile2
5 files changed, 21 insertions, 5 deletions
diff --git a/Config.in b/Config.in
index 651cbdef5..ab8fbf8e4 100644
--- 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"
diff --git a/include/toolchain-build.mk b/include/toolchain-build.mk
index 6defe63ed..a0bc4061f 100644
--- a/include/toolchain-build.mk
+++ b/include/toolchain-build.mk
@@ -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
diff --git a/toolchain/binutils/Makefile b/toolchain/binutils/Makefile
index 5682698bc..d829098e5 100644
--- a/toolchain/binutils/Makefile
+++ b/toolchain/binutils/Makefile
@@ -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
diff --git a/toolchain/gcc/common.mk b/toolchain/gcc/common.mk
index e2277207b..8c293dd33 100644
--- a/toolchain/gcc/common.mk
+++ b/toolchain/gcc/common.mk
@@ -173,7 +173,7 @@ endif
GCC_MAKE:= \
export SHELL="$(BASH)"; \
- $(MAKE) \
+ $(MAKE) $(TOOLCHAIN_JOBS) \
CFLAGS_FOR_TARGET="$(TARGET_CFLAGS)" \
CXXFLAGS_FOR_TARGET="$(TARGET_CFLAGS)"
diff --git a/toolchain/uClibc/Makefile b/toolchain/uClibc/Makefile
index 362548aae..d3d4d85cd 100644
--- a/toolchain/uClibc/Makefile
+++ b/toolchain/uClibc/Makefile
@@ -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/