/* Definitions for MIPS running Linux-based GNU systems with ELF format.
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
This file is part of GCC.
builtin_define ("_MIPS_SZINT=32"); \
} while (0)
-#undef SUBTARGET_CPP_SPEC
-#define SUBTARGET_CPP_SPEC "%{pthread:-D_REENTRANT}"
+#undef SUBTARGET_CPP_SPEC
+#define SUBTARGET_CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
+
+/* A standard GNU/Linux mapping. On most targets, it is included in
+ CC1_SPEC itself by config/linux.h, but mips.h overrides CC1_SPEC
+ and provides this hook instead. */
+#undef SUBTARGET_CC1_SPEC
+#define SUBTARGET_CC1_SPEC "%{profile:-p}"
/* From iris5.h */
/* -G is incompatible with -KPIC which is the default, so only allow objects
#undef MIPS_DEFAULT_GVALUE
#define MIPS_DEFAULT_GVALUE 0
+#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
+
/* Borrowed from sparc/linux.h */
#undef LINK_SPEC
#define LINK_SPEC \
%{!ibcs: \
%{!static: \
%{rdynamic:-export-dynamic} \
- %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
+ %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER "}} \
%{static:-static}}}"
#undef SUBTARGET_ASM_SPEC
%{profile:-lc_p} %{!profile: -lc}}"
#define MD_UNWIND_SUPPORT "config/mips/linux-unwind.h"
+
+#ifdef HAVE_AS_NO_SHARED
+/* Default to -mno-shared for non-PIC. */
+#define NO_SHARED_SPECS \
+ "%{mshared|mno-shared|fpic|fPIC|fpie|fPIE:;:-mno-shared}"
+#define DRIVER_SELF_SPECS NO_SHARED_SPECS
+#else
+#define NO_SHARED_SPECS
+#endif