Merge "build-host-gcc.sh: --disable-plugins --disable-plugin globally"
diff --git a/build/tools/build-host-gcc.sh b/build/tools/build-host-gcc.sh
index d6d8250..c91fa71 100755
--- a/build/tools/build-host-gcc.sh
+++ b/build/tools/build-host-gcc.sh
@@ -1334,7 +1334,7 @@
# like build-host-libbfd.sh in the future.
ARGS=$ARGS" --enable-install-libbfd"
- # Enable plugins support for binutils-2.21+
+ # Enable plugins support for > binutils-2.19
# This is common feature for binutils and gcc
case "$BINUTILS_VERSION" in
2.19)
@@ -1405,10 +1405,20 @@
ARGS=$HOST_PREREQS_ARGS
+ # Plugins are not supported well before 4.7. On 4.7 it's required to have
+ # -flto working. Flag --enable-plugins (note 's') is actually for binutils,
+ # this is compiler requirement to have binutils configured this way. Flag
+ # --disable-plugin is for gcc -
+ # In fact, enable-plugins is broken all Canadian Cross GCC.
+ # see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50229
case "$GCC_VERSION" in
- 4.4.3|4.6)
- ARGS=$ARGS" --disable-plugin"
- ;;
+ 4.4.3|4.6|4.7)
+ ARGS=$ARGS" --disable-plugins --disable-plugin"
+ ;;
+ # Doesn't even work on 4.8
+ *)
+ ARGS=$ARGS" --enable-plugins --enable-plugin"
+ ;;
esac
ARGS=$ARGS" --with-gnu-as --with-gnu-ld"