just like this, but for mips: http://gcc.gnu.org/ml/gcc-patches/2002-12/msg00526.html --- gcc/config/mips/linux.h +++ gcc/config/mips/linux.h @@ -175,7 +175,7 @@ #undef LIB_SPEC #define LIB_SPEC "\ %{shared: -lc} \ -%{!shared: %{pthread:-lpthread} \ - %{profile:-lc_p} %{!profile: -lc}}" +%{pthread:-lpthread} \ +%{!shared: %{profile:-lc_p} %{!profile: -lc}}" #define MD_UNWIND_SUPPORT "config/mips/linux-unwind.h" --- gcc/config/mips/linux64.h +++ gcc/config/mips/linux64.h @@ -33,8 +33,8 @@ #undef LIB_SPEC #define LIB_SPEC "\ %{shared: -lc} \ -%{!shared: %{pthread:-lpthread} \ - %{profile:-lc_p} %{!profile: -lc}}" +%{pthread:-lpthread} \ +%{!shared: %{profile:-lc_p} %{!profile: -lc}}" #define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1" #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld.so.1"