cc/gcc: build lto-plugin if binutils' gold is built
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Wed Dec 29 17:58:35 2010 +0100 (2010-12-29)
changeset 22484ea8e6d381f0
parent 2247 49fa28e62b07
child 2249 e12331b7e070
cc/gcc: build lto-plugin if binutils' gold is built

To properly enable LTO with gold, gcc has to install a plugin that gold
uses to handle the LTO information.

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	Wed Dec 29 18:19:40 2010 +0100
     1.2 +++ b/scripts/build/cc/gcc.sh	Wed Dec 29 17:58:35 2010 +0100
     1.3 @@ -481,6 +481,16 @@
     1.4          "") extra_config+=("--without-long-double-128");;
     1.5      esac
     1.6  
     1.7 +    # If LTO is selected and binutils has gold, then enable
     1.8 +    # building the lto plugin with the --enable-gold option,
     1.9 +    # but only if gold has support for plugins.
    1.10 +    if [    "${CT_BINUTILS_GOLD_INSTALLED}" = "y"   \
    1.11 +         -a "${CT_BINUTILS_GOLD_PLUGINS}" = "y"     \
    1.12 +         -a "${CT_CC_GCC_USE_LTO}" = "y"            \
    1.13 +       ]; then
    1.14 +        extra_config+=( --enable-gold )
    1.15 +    fi
    1.16 +
    1.17      CT_DoLog DEBUG "Extra config passed: '${extra_config[*]}'"
    1.18  
    1.19      # --enable-symvers=gnu really only needed for sh4 to work around a