OSDN Git Service

gcc/
[pf3gnuchains/gcc-fork.git] / gcc / config / mips / linux64.h
1 /* Definitions for MIPS running Linux-based GNU systems with ELF format
2    using n32/64 abi.
3    Copyright 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
4
5 This file is part of GCC.
6
7 GCC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
11
12 GCC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING.  If not, write to
19 the Free Software Foundation, 51 Franklin Street, Fifth Floor,
20 Boston, MA 02110-1301, USA.  */
21
22 /* Force the default endianness and ABI flags onto the command line
23    in order to make the other specs easier to write.  */
24 #undef DRIVER_SELF_SPECS
25 #define DRIVER_SELF_SPECS \
26 NO_SHARED_SPECS \
27 " %{!EB:%{!EL:%(endian_spec)}}" \
28 " %{!mabi=*: -mabi=n32}"
29
30 #undef SUBTARGET_ASM_SPEC
31 #define SUBTARGET_ASM_SPEC "\
32 %{!fno-PIC:%{!fno-pic:-KPIC}} \
33 %{fno-PIC:-non_shared} %{fno-pic:-non_shared}"
34
35 #undef LIB_SPEC
36 #define LIB_SPEC "\
37 %{shared: -lc} \
38 %{!shared: %{pthread:-lpthread} \
39   %{profile:-lc_p} %{!profile: -lc}}"
40
41 #define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1"
42 #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld.so.1"
43 #define GLIBC_DYNAMIC_LINKERN32 "/lib32/ld.so.1"
44 #define UCLIBC_DYNAMIC_LINKERN32 "/lib32/ld-uClibc.so.0"
45 #define LINUX_DYNAMIC_LINKERN32 \
46   CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERN32, UCLIBC_DYNAMIC_LINKERN32)
47
48 #undef LINK_SPEC
49 #define LINK_SPEC "\
50 %{G*} %{EB} %{EL} %{mips1} %{mips2} %{mips3} %{mips4} \
51 %{bestGnum} %{shared} %{non_shared} \
52 %{call_shared} %{no_archive} %{exact_version} \
53  %(endian_spec) \
54   %{!shared: \
55     %{!ibcs: \
56       %{!static: \
57         %{rdynamic:-export-dynamic} \
58         %{!dynamic-linker: \
59           %{mabi=n32: -dynamic-linker " LINUX_DYNAMIC_LINKERN32 "} \
60           %{mabi=64: -dynamic-linker " LINUX_DYNAMIC_LINKER64 "} \
61           %{mabi=32: -dynamic-linker " LINUX_DYNAMIC_LINKER32 "}}} \
62       %{static:-static}}} \
63 %{mabi=n32:-melf32%{EB:b}%{EL:l}tsmipn32} \
64 %{mabi=64:-melf64%{EB:b}%{EL:l}tsmip} \
65 %{mabi=32:-melf32%{EB:b}%{EL:l}tsmip}"
66
67 #undef LOCAL_LABEL_PREFIX
68 #define LOCAL_LABEL_PREFIX (TARGET_OLDABI ? "$" : ".")
69
70 /* GNU/Linux doesn't use the same floating-point format that IRIX uses
71    for long double.  There's no need to override this here, since
72    ieee_quad_format is the default, but let's put this here to make
73    sure nobody thinks we just forgot to set it to something else.  */
74 #define MIPS_TFMODE_FORMAT mips_quad_format