# HG changeset patch # User "Yann E. MORIN" # Date 1293641915 -3600 # Node ID 4ea8e6d381f09ff5f92fcef6ff1d85e72f912e91 # Parent 49fa28e62b076e8c7c1d7b8aab61395965101ea2 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" diff -r 49fa28e62b07 -r 4ea8e6d381f0 scripts/build/cc/gcc.sh --- a/scripts/build/cc/gcc.sh Wed Dec 29 18:19:40 2010 +0100 +++ b/scripts/build/cc/gcc.sh Wed Dec 29 17:58:35 2010 +0100 @@ -481,6 +481,16 @@ "") extra_config+=("--without-long-double-128");; esac + # If LTO is selected and binutils has gold, then enable + # building the lto plugin with the --enable-gold option, + # but only if gold has support for plugins. + if [ "${CT_BINUTILS_GOLD_INSTALLED}" = "y" \ + -a "${CT_BINUTILS_GOLD_PLUGINS}" = "y" \ + -a "${CT_CC_GCC_USE_LTO}" = "y" \ + ]; then + extra_config+=( --enable-gold ) + fi + CT_DoLog DEBUG "Extra config passed: '${extra_config[*]}'" # --enable-symvers=gnu really only needed for sh4 to work around a