Index: scripts/scripts/cross-scripts/cross-gcc-final.sh
===================================================================
--- scripts/scripts/cross-scripts/cross-gcc-final.sh	(revision 3a26e5ef633376751ba362e14dd86c499221103c)
+++ scripts/scripts/cross-scripts/cross-gcc-final.sh	(revision e05079470ef20d3491142b0c28c0368abc111b4c)
@@ -13,4 +13,15 @@
 
 LOG="gcc-cross-final.log"
+
+# we cannot assume what the default env for the the host system is,
+# so we just set libdirname to "lib"
+libdirname="lib"
+
+#set_libdirname
+#setup_multiarch
+#
+#if [ ! "${libdirname}" = "lib" ]; then
+#   extra_conf="--libdir=${HST_TOOLS}/${libdirname}"
+#fi
 
 if [ "Y" = "${MULTIARCH}" ]; then
@@ -39,5 +50,5 @@
 else
    # If we are not multi-arch, disable multilib
-   extra_conf="--enable-multilib=no"
+   extra_conf="${extra_conf} --enable-multilib=no"
 
    # HACK: this sets abi to n32 with mips... this should be handled
@@ -79,13 +90,18 @@
 cd ${SRC}/${PKGDIR}
 case ${target_gcc_ver} in
-   3.4.3 ) apply_patch gcc-3.4.3-linkonce-1
-           apply_patch gcc-3.4.0-arm-bigendian
-           apply_patch gcc-3.4.0-arm-nolibfloat
-           apply_patch gcc-3.4.0-arm-lib1asm
-           apply_patch gcc-3.4.3-clean_exec_and_lib_search_paths_when_cross-1
+   3.4.3 )
+      apply_patch gcc-3.4.3-linkonce-1
+      apply_patch gcc-3.4.0-arm-bigendian
+      apply_patch gcc-3.4.0-arm-nolibfloat
+      apply_patch gcc-3.4.0-arm-lib1asm
+      apply_patch gcc-3.4.3-clean_exec_and_lib_search_paths_when_cross-1
    ;;
-   4.0.0 ) apply_patch gcc-4.0.0-fix_tree_optimisation_PR21173
-           apply_patch gcc-4.0.0-reload_check_uninitialized_pseudos_PR20973
-           apply_patch gcc-4.0.0-clean_exec_and_lib_search_paths_when_cross-1
+   4.0.0 )
+      apply_patch gcc-4.0.0-fix_tree_optimisation_PR21173
+      apply_patch gcc-4.0.0-reload_check_uninitialized_pseudos_PR20973
+      apply_patch gcc-4.0.0-clean_exec_and_lib_search_paths_when_cross-1
+   ;;
+   4.0.* | 4.1.* )
+      apply_patch gcc-4.0.0-clean_exec_and_lib_search_paths_when_cross-1
    ;;
 esac
Index: scripts/scripts/cross-scripts/cross-gcc-shared.sh
===================================================================
--- scripts/scripts/cross-scripts/cross-gcc-shared.sh	(revision 3a26e5ef633376751ba362e14dd86c499221103c)
+++ scripts/scripts/cross-scripts/cross-gcc-shared.sh	(revision e05079470ef20d3491142b0c28c0368abc111b4c)
@@ -81,13 +81,18 @@
 cd ${SRC}/${PKGDIR}
 case ${target_gcc_ver} in
-   3.4.3 ) apply_patch gcc-3.4.3-linkonce-1
-           apply_patch gcc-3.4.0-arm-bigendian
-           apply_patch gcc-3.4.0-arm-nolibfloat
-           apply_patch gcc-3.4.0-arm-lib1asm
-           apply_patch gcc-3.4.3-clean_exec_and_lib_search_paths_when_cross-1
+   3.4.3 )
+      apply_patch gcc-3.4.3-linkonce-1
+      apply_patch gcc-3.4.0-arm-bigendian
+      apply_patch gcc-3.4.0-arm-nolibfloat
+      apply_patch gcc-3.4.0-arm-lib1asm
+      apply_patch gcc-3.4.3-clean_exec_and_lib_search_paths_when_cross-1
    ;;
-   4.0.0 ) apply_patch gcc-4.0.0-fix_tree_optimisation_PR21173
-           apply_patch gcc-4.0.0-reload_check_uninitialized_pseudos_PR20973
-           apply_patch gcc-4.0.0-clean_exec_and_lib_search_paths_when_cross-1
+   4.0.0 )
+      apply_patch gcc-4.0.0-fix_tree_optimisation_PR21173
+      apply_patch gcc-4.0.0-reload_check_uninitialized_pseudos_PR20973
+      apply_patch gcc-4.0.0-clean_exec_and_lib_search_paths_when_cross-1
+   ;;
+   4.0.* | 4.1.* )
+      apply_patch gcc-4.0.0-clean_exec_and_lib_search_paths_when_cross-1
    ;;
 esac
Index: scripts/scripts/cross-scripts/cross-gcc-static.sh
===================================================================
--- scripts/scripts/cross-scripts/cross-gcc-static.sh	(revision 3a26e5ef633376751ba362e14dd86c499221103c)
+++ scripts/scripts/cross-scripts/cross-gcc-static.sh	(revision e05079470ef20d3491142b0c28c0368abc111b4c)
@@ -78,13 +78,18 @@
 cd ${SRC}/${PKGDIR}
 case ${target_gcc_ver} in
-   3.4.3 ) apply_patch gcc-3.4.3-linkonce-1
-           apply_patch gcc-3.4.0-arm-bigendian
-           apply_patch gcc-3.4.0-arm-nolibfloat
-           apply_patch gcc-3.4.0-arm-lib1asm
-           apply_patch gcc-3.4.3-clean_exec_and_lib_search_paths_when_cross-1
+   3.4.3 )
+      apply_patch gcc-3.4.3-linkonce-1
+      apply_patch gcc-3.4.0-arm-bigendian
+      apply_patch gcc-3.4.0-arm-nolibfloat
+      apply_patch gcc-3.4.0-arm-lib1asm
+      apply_patch gcc-3.4.3-clean_exec_and_lib_search_paths_when_cross-1
    ;;
-   4.0.0 ) apply_patch gcc-4.0.0-fix_tree_optimisation_PR21173
-           apply_patch gcc-4.0.0-reload_check_uninitialized_pseudos_PR20973
-           apply_patch gcc-4.0.0-clean_exec_and_lib_search_paths_when_cross-1
+   4.0.0 )
+      apply_patch gcc-4.0.0-fix_tree_optimisation_PR21173
+      apply_patch gcc-4.0.0-reload_check_uninitialized_pseudos_PR20973
+      apply_patch gcc-4.0.0-clean_exec_and_lib_search_paths_when_cross-1
+   ;;
+   4.0.* | 4.1.* )
+      apply_patch gcc-4.0.0-clean_exec_and_lib_search_paths_when_cross-1
    ;;
 esac
Index: scripts/scripts/native-scripts/native-gcc.sh
===================================================================
--- scripts/scripts/native-scripts/native-gcc.sh	(revision 3a26e5ef633376751ba362e14dd86c499221103c)
+++ scripts/scripts/native-scripts/native-gcc.sh	(revision e05079470ef20d3491142b0c28c0368abc111b4c)
@@ -83,10 +83,10 @@
       apply_patch gcc-3.4.0-arm-lib1asm
    ;;
-   4.0.1 | 4.1.* )
-      apply_patch gcc-4.0.0-remove_standard_startfile_prefix_from_startfile_prefixes-1
-   ;;
    4.0.0 )
       apply_patch gcc-4.0.0-fix_tree_optimisation_PR21173
       apply_patch gcc-4.0.0-reload_check_uninitialized_pseudos_PR20973
+      apply_patch gcc-4.0.0-remove_standard_startfile_prefix_from_startfile_prefixes-1
+   ;;
+   4.0.* | 4.1.* )
       apply_patch gcc-4.0.0-remove_standard_startfile_prefix_from_startfile_prefixes-1
    ;;
Index: scripts/scripts/target-scripts/target-gcc.sh
===================================================================
--- scripts/scripts/target-scripts/target-gcc.sh	(revision 3a26e5ef633376751ba362e14dd86c499221103c)
+++ scripts/scripts/target-scripts/target-gcc.sh	(revision e05079470ef20d3491142b0c28c0368abc111b4c)
@@ -91,16 +91,19 @@
 cd ${SRC}/${PKGDIR}
 case ${target_gcc_ver} in
-   3.4.3 ) apply_patch gcc-3.4.3-linkonce-1
-           apply_patch gcc-3.4.0-arm-bigendian
-           apply_patch gcc-3.4.0-arm-nolibfloat
-           apply_patch gcc-3.4.0-arm-lib1asm
-           apply_patch gcc-3.4.3-clean_exec_and_lib_search_paths_when_cross-1
-   ;;
-   4.0.0 ) apply_patch gcc-4.0.0-fix_tree_optimisation_PR21173
-           apply_patch gcc-4.0.0-reload_check_uninitialized_pseudos_PR20973
-           apply_patch gcc-4.0.0-clean_exec_and_lib_search_paths_when_cross-1
-   ;;
-   4.0.* ) apply_patch gcc-4.0.0-clean_exec_and_lib_search_paths_when_cross-1 ;;
-   4.1.* ) apply_patch gcc-4.0.0-clean_exec_and_lib_search_paths_when_cross-1 ;;
+   3.4.3 )
+      apply_patch gcc-3.4.3-linkonce-1
+      apply_patch gcc-3.4.0-arm-bigendian
+      apply_patch gcc-3.4.0-arm-nolibfloat
+      apply_patch gcc-3.4.0-arm-lib1asm
+      apply_patch gcc-3.4.3-clean_exec_and_lib_search_paths_when_cross-1
+   ;;
+   4.0.0 )
+      apply_patch gcc-4.0.0-fix_tree_optimisation_PR21173
+      apply_patch gcc-4.0.0-reload_check_uninitialized_pseudos_PR20973
+      apply_patch gcc-4.0.0-clean_exec_and_lib_search_paths_when_cross-1
+   ;;
+   4.0.* | 4.1.* )
+      apply_patch gcc-4.0.0-clean_exec_and_lib_search_paths_when_cross-1
+   ;;
 esac
 
