just like this, but for mips: http://gcc.gnu.org/ml/gcc-patches/2002-12/msg00526.html --- gcc/config/mips/linux.h | 4 ++-- gcc/config/mips/linux64.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) Index: gcc-4.2.3/gcc/config/mips/linux.h =================================================================== --- gcc-4.2.3.orig/gcc/config/mips/linux.h +++ gcc-4.2.3/gcc/config/mips/linux.h @@ -174,7 +174,7 @@ along with GCC; see the file COPYING3. #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" Index: gcc-4.2.3/gcc/config/mips/linux64.h =================================================================== --- gcc-4.2.3.orig/gcc/config/mips/linux64.h +++ gcc-4.2.3/gcc/config/mips/linux64.h @@ -32,8 +32,8 @@ along with GCC; see the file COPYING3. #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"