cc/gcc: speed up the build a little bit
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Wed Sep 14 12:59:17 2011 +0200 (2011-09-14)
changeset 2676af542a04bf69
parent 2675 7c288c777455
child 2677 7df89370f805
cc/gcc: speed up the build a little bit

Even if the current process is highly parallel, crosstool-NG spends most
of its time in single-job steps on fast machines (with a 12-CPU system,
I approximate the parallel vs. non-parallel time to be in the order os
1 to 3; that is crostool-NG spends two-thirds of its time running
non-parallel jobs).

Some steps to build gcc can be paralleled, gaining a litle bit of time
on the whole compilation.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
scripts/build/cc/gcc.sh
     1.1 --- a/scripts/build/cc/gcc.sh	Sat Sep 17 14:30:52 2011 +0200
     1.2 +++ b/scripts/build/cc/gcc.sh	Wed Sep 14 12:59:17 2011 +0200
     1.3 @@ -327,17 +327,17 @@
     1.4          # Next we have to configure gcc, create libgcc.mk then edit it...
     1.5          # So much easier if we just edit the source tree, but hey...
     1.6          if [ ! -f "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/gcc/BASE-VER" ]; then
     1.7 -            CT_DoExecLog CFG make configure-libiberty
     1.8 +            CT_DoExecLog CFG make ${JOBSFLAGS} configure-libiberty
     1.9              CT_DoExecLog ALL make ${JOBSFLAGS} -C libiberty libiberty.a
    1.10 -            CT_DoExecLog CFG make configure-gcc configure-libcpp
    1.11 +            CT_DoExecLog CFG make ${JOBSFLAGS} configure-gcc configure-libcpp
    1.12              CT_DoExecLog ALL make ${JOBSFLAGS} all-libcpp
    1.13          else
    1.14 -            CT_DoExecLog CFG make configure-gcc configure-libcpp configure-build-libiberty
    1.15 +            CT_DoExecLog CFG make ${JOBSFLAGS} configure-gcc configure-libcpp configure-build-libiberty
    1.16              CT_DoExecLog ALL make ${JOBSFLAGS} all-libcpp all-build-libiberty
    1.17          fi
    1.18          # HACK: gcc-4.2 uses libdecnumber to build libgcc.mk, so build it here.
    1.19          if [ -d "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/libdecnumber" ]; then
    1.20 -            CT_DoExecLog CFG make configure-libdecnumber
    1.21 +            CT_DoExecLog CFG make ${JOBSFLAGS} configure-libdecnumber
    1.22              CT_DoExecLog ALL make ${JOBSFLAGS} -C libdecnumber libdecnumber.a
    1.23          fi
    1.24  
    1.25 @@ -379,7 +379,7 @@
    1.26      CT_DoExecLog ALL make ${JOBSFLAGS} "${core_targets[@]/#/all-}"
    1.27  
    1.28      CT_DoLog EXTRA "Installing ${mode} core C compiler"
    1.29 -    CT_DoExecLog ALL make "${core_targets[@]/#/install-}"
    1.30 +    CT_DoExecLog ALL make ${JOBSFLAGS} "${core_targets[@]/#/install-}"
    1.31  
    1.32      # Create a symlink ${CT_TARGET}-cc to ${CT_TARGET}-gcc to always be able
    1.33      # to call the C compiler with the same, somewhat canonical name.
    1.34 @@ -623,7 +623,7 @@
    1.35      CT_DoExecLog ALL make ${JOBSFLAGS} all
    1.36  
    1.37      CT_DoLog EXTRA "Installing final compiler"
    1.38 -    CT_DoExecLog ALL make install
    1.39 +    CT_DoExecLog ALL make ${JOBSFLAGS} install
    1.40  
    1.41      # Create a symlink ${CT_TARGET}-cc to ${CT_TARGET}-gcc to always be able
    1.42      # to call the C compiler with the same, somewhat canonical name.