Changeset 33414


Ignore:
Timestamp:
2012-09-15T12:21:24+02:00 (5 years ago)
Author:
nbd
Message:

build: add a config option for passing the top-level make jobserver to packages that have parallel build enabled, significantly improves parallelization and gets rid of CPU overcommit during intra-package parallel builds

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Config.in

    r33197 r33414  
    312312                  If you are unsure, select N. 
    313313 
     314        config PKG_BUILD_USE_JOBSERVER 
     315                bool 
     316                prompt "Use top-level make jobserver for packages" 
     317                depends on PKG_BUILD_PARALLEL 
     318                default y 
     319                help 
     320                  This passes the main make process jobserver fds to package builds, 
     321                  enabling full parallelization across different packages 
     322 
    314323        config PKG_BUILD_JOBS 
    315324                int 
     
    317326                range 2 512 
    318327                default 2 
    319                 depends on PKG_BUILD_PARALLEL 
     328                depends on PKG_BUILD_PARALLEL && !PKG_BUILD_USE_JOBSERVER 
    320329                help 
    321330                  The number of jobs (-jX) to pass to packages submake. 
  • trunk/include/package.mk

    r32837 r33414  
    1616PKG_INFO_DIR := $(STAGING_DIR)/pkginfo 
    1717 
     18ifneq ($(CONFIG_PKG_BUILD_USE_JOBSERVER),) 
     19  MAKE_J:=$(MAKE_JOBSERVER) 
     20else 
     21  MAKE_J:=-j$(CONFIG_PKG_BUILD_JOBS) 
     22endif 
     23 
    1824ifeq ($(strip $(PKG_BUILD_PARALLEL)),0) 
    1925PKG_JOBS?=-j1 
    2026else 
    2127PKG_JOBS?=$(if $(PKG_BUILD_PARALLEL)$(CONFIG_PKG_DEFAULT_PARALLEL),\ 
    22         $(if $(CONFIG_PKG_BUILD_PARALLEL),-j$(CONFIG_PKG_BUILD_JOBS),-j1),-j1) 
     28        $(if $(CONFIG_PKG_BUILD_PARALLEL),$(MAKE_J),-j1),-j1) 
    2329endif 
    2430 
  • trunk/include/toplevel.mk

    r32749 r33414  
    149149                fi \ 
    150150        ) 
    151         @+$(SUBMAKE) -r $@ 
     151        @+$(SUBMAKE) -r $@ MAKE_JOBSERVER="$(filter --jobserver% -j,$(MAKEFLAGS))" 
    152152 
    153153help: 
Note: See TracChangeset for help on using the changeset viewer.