binutils/binutils: build statically
authorBryan Hundven <bryanhundven@gmail.com>
Thu Dec 09 18:55:33 2010 +0100 (2010-12-09)
changeset 2210c423e3d8f541
parent 2209 cdafca8bdaa8
child 2211 2f67667ee385
binutils/binutils: build statically

If the global static option is set, then build binutils statically.

Signed-off-by: "Bryan Hundven" <bryanhundven@gmail.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
config/toolchain.in
scripts/build/binutils/binutils.sh
     1.1 --- a/config/toolchain.in	Thu Dec 09 18:55:15 2010 +0100
     1.2 +++ b/config/toolchain.in	Thu Dec 09 18:55:33 2010 +0100
     1.3 @@ -41,6 +41,7 @@
     1.4        you can say 'Y' here, and all the host tools will be linked staticaly.
     1.5        
     1.6        The impacted tools are:
     1.7 +        - the GNU binutils
     1.8          - the cross-gdb
     1.9        
    1.10        The default is 'N', to build dynamicaly-linked host binaries.
     2.1 --- a/scripts/build/binutils/binutils.sh	Thu Dec 09 18:55:15 2010 +0100
     2.2 +++ b/scripts/build/binutils/binutils.sh	Thu Dec 09 18:55:33 2010 +0100
     2.3 @@ -18,6 +18,7 @@
     2.4  # Build binutils
     2.5  do_binutils() {
     2.6      local -a extra_config
     2.7 +    local -a extra_make_flags
     2.8  
     2.9      mkdir -p "${CT_BUILD_DIR}/build-binutils"
    2.10      cd "${CT_BUILD_DIR}/build-binutils"
    2.11 @@ -40,8 +41,14 @@
    2.12          ${CT_BINUTILS_EXTRA_CONFIG}                             \
    2.13          ${BINUTILS_SYSROOT_ARG}
    2.14  
    2.15 +    if [ "${CT_STATIC_TOOLCHAIN}" = "y" ]; then
    2.16 +        extra_make_flags+=("LDFLAGS=-all-static")
    2.17 +        CT_DoLog EXTRA "Prepare binutils for static build"
    2.18 +        CT_DoExecLog ALL make configure-host
    2.19 +    fi
    2.20 +
    2.21      CT_DoLog EXTRA "Building binutils"
    2.22 -    CT_DoExecLog ALL make ${PARALLELMFLAGS}
    2.23 +    CT_DoExecLog ALL make "${extra_make_flags[@]}" ${PARALLELMFLAGS}
    2.24  
    2.25      CT_DoLog EXTRA "Installing binutils"
    2.26      CT_DoExecLog ALL make install