Merge "build-host-gcc.sh: enable libgomp where possible (ARM > 4.4.3)"
diff --git a/build/tools/build-host-gcc.sh b/build/tools/build-host-gcc.sh
index 49d4a71..d6d8250 100755
--- a/build/tools/build-host-gcc.sh
+++ b/build/tools/build-host-gcc.sh
@@ -1413,7 +1413,6 @@
 
     ARGS=$ARGS" --with-gnu-as --with-gnu-ld"
     ARGS=$ARGS" --enable-threads --disable-libssp --disable-libmudflap"
-    ARGS=$ARGS" --disable-libgomp"  # TODO: Add option to enable this
     ARGS=$ARGS" --disable-libstdc__-v3 --disable-sjlj-exceptions"
     ARGS=$ARGS" --disable-tls"
     ARGS=$ARGS" --disable-libquadmath --disable-libitm --disable-bootstrap"
@@ -1423,6 +1422,19 @@
     ARGS=$ARGS" --disable-werror"
     ARGS=$ARGS" --enable-target-optspace"
 
+    case "$GCC_VERSION" in
+     4.4.3)
+       ARGS=$ARGS" --disable-libgomp"
+       ;;
+     *)
+       case $TARGET_ARCH in
+	     arm) ARGS=$ARGS" --enable-libgomp";;
+	     x86) ARGS=$ARGS" --disable-libgomp";;
+	     mips|mipsel) ARGS=$ARGS" --disable-libgomp";;
+	 esac
+	 ;;
+    esac
+
     # Place constructors/destructors in .init_array/.fini_array, not in
     # .ctors/.dtors on Android. Note that upstream Linux GLibc is now doing
     # the same.