6835f715236115d48f7a57a0c86bdee3a0809666
[gcc.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 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, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
21
22 /* This sets the post-install default ABI to n32. This must NOT be
23 kept in sync with the default ABI in gcc/config.gcc; it's actually
24 meant to override that. However, for correct behavior at build
25 time, we also need t-linux64 to get the build-time specs in line
26 with the setting in config.gcc. */
27 #define DRIVER_DEFAULT_ABI_SELF_SPEC "%{!mabi=*:-mabi=n32}"
28 #undef SUBTARGET_EXTRA_SPECS
29 #define SUBTARGET_EXTRA_SPECS \
30 { "driver_default_abi_self_spec", DRIVER_DEFAULT_ABI_SELF_SPEC },
31 #define DRIVER_SELF_SPECS \
32 "%{!EB:%{!EL:%(endian_spec)}}", \
33 "%(driver_default_abi_self_spec)", \
34 "%{!mips*:%{!march=*:%{mabi=32:-mips1}%{mabi=n32|mabi=64:-mips3}}}"
35
36 #undef SUBTARGET_ASM_SPEC
37 #define SUBTARGET_ASM_SPEC "\
38 %{!fno-PIC:%{!fno-pic:-KPIC}} \
39 %{fno-PIC:-non_shared} %{fno-pic:-non_shared} \
40 %{mabi=64:-64} %{mabi=n32:-n32}"
41
42 #undef LIB_SPEC
43 #define LIB_SPEC "\
44 %{shared: -lc} \
45 %{!static: \
46 %{mabi=n32:-rpath-link %R/lib32:%R/usr/lib32} \
47 %{mabi=64:-rpath-link %R/lib64:%R/usr/lib64} \
48 %{mabi=32:-rpath-link %R/lib:%R/usr/lib}} \
49 %{!shared: %{pthread:-lpthread} \
50 %{profile:-lc_p} %{!profile: -lc}}"
51
52 #undef LINK_SPEC
53 #define LINK_SPEC "\
54 %{G*} %{EB} %{EL} %{mips1} %{mips2} %{mips3} %{mips4} \
55 %{bestGnum} %{shared} %{non_shared} \
56 %{call_shared} %{no_archive} %{exact_version} \
57 %(endian_spec) \
58 %{!shared: \
59 %{!ibcs: \
60 %{!static: \
61 %{rdynamic:-export-dynamic} \
62 %{!dynamic-linker: \
63 %{mabi=n32: -dynamic-linker /lib32/ld.so.1} \
64 %{mabi=64: -dynamic-linker /lib64/ld.so.1} \
65 %{mabi=32: -dynamic-linker /lib/ld.so.1}}} \
66 %{static:-static}}} \
67 %{mabi=n32:-melf32%{EB:b}%{EL:l}tsmipn32} \
68 %{mabi=64:-melf64%{EB:b}%{EL:l}tsmip} \
69 %{mabi=32:-melf32%{EB:b}%{EL:l}tsmip}"
70
71 #undef LOCAL_LABEL_PREFIX
72 #define LOCAL_LABEL_PREFIX (TARGET_OLDABI ? "$" : ".")
73
74 /* The size in bytes of a DWARF field indicating an offset or length
75 relative to a debug info section, specified to be 4 bytes in the DWARF-2
76 specification. The SGI/MIPS ABI defines it to be the same as PTR_SIZE. */
77 #define DWARF_OFFSET_SIZE PTR_SIZE
78
79 /* GNU/Linux doesn't use the same floating-point format that IRIX uses
80 for long double. There's no need to override this here, since
81 ieee_quad_format is the default, but let's put this here to make
82 sure nobody thinks we just forgot to set it to something else. */
83 #define MIPS_TFMODE_FORMAT mips_quad_format