# HG changeset patch # User Bryan Hundven # Date 1291917333 -3600 # Node ID c423e3d8f541fce756f40e97a75a1334f9933b2b # Parent cdafca8bdaa871b52d35e2d2b2196a338234459c binutils/binutils: build statically If the global static option is set, then build binutils statically. Signed-off-by: "Bryan Hundven" Signed-off-by: "Yann E. MORIN" diff -r cdafca8bdaa8 -r c423e3d8f541 config/toolchain.in --- a/config/toolchain.in Thu Dec 09 18:55:15 2010 +0100 +++ b/config/toolchain.in Thu Dec 09 18:55:33 2010 +0100 @@ -41,6 +41,7 @@ you can say 'Y' here, and all the host tools will be linked staticaly. The impacted tools are: + - the GNU binutils - the cross-gdb The default is 'N', to build dynamicaly-linked host binaries. diff -r cdafca8bdaa8 -r c423e3d8f541 scripts/build/binutils/binutils.sh --- a/scripts/build/binutils/binutils.sh Thu Dec 09 18:55:15 2010 +0100 +++ b/scripts/build/binutils/binutils.sh Thu Dec 09 18:55:33 2010 +0100 @@ -18,6 +18,7 @@ # Build binutils do_binutils() { local -a extra_config + local -a extra_make_flags mkdir -p "${CT_BUILD_DIR}/build-binutils" cd "${CT_BUILD_DIR}/build-binutils" @@ -40,8 +41,14 @@ ${CT_BINUTILS_EXTRA_CONFIG} \ ${BINUTILS_SYSROOT_ARG} + if [ "${CT_STATIC_TOOLCHAIN}" = "y" ]; then + extra_make_flags+=("LDFLAGS=-all-static") + CT_DoLog EXTRA "Prepare binutils for static build" + CT_DoExecLog ALL make configure-host + fi + CT_DoLog EXTRA "Building binutils" - CT_DoExecLog ALL make ${PARALLELMFLAGS} + CT_DoExecLog ALL make "${extra_make_flags[@]}" ${PARALLELMFLAGS} CT_DoLog EXTRA "Installing binutils" CT_DoExecLog ALL make install