2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / config / mips / linux64.h
blobbac5d635c003c0a56f3adaf07ea041acd30cedd5
1 /* Definitions for MIPS running Linux-based GNU systems with ELF format
2 using n32/64 abi.
3 Copyright 2002, 2003 Free Software Foundation, Inc.
5 This file is part of GCC.
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.
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.
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. */
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 "%{mabi-fake-default:%{!mabi=*:-mabi=32}}", \
34 "%(driver_default_abi_self_spec)", \
35 "%{!mips*:%{!march=*:%{mabi=32:-mips1}%{mabi=n32|mabi=64:-mips3}}}"
37 #undef SUBTARGET_TARGET_SWITCHES
38 #define SUBTARGET_TARGET_SWITCHES \
39 { "abi-fake-default", 0, N_("Same as -mabi=32, just trickier") },
41 #undef SUBTARGET_ASM_SPEC
42 #define SUBTARGET_ASM_SPEC "\
43 %{!fno-PIC:%{!fno-pic:-KPIC}} \
44 %{fno-PIC:-non_shared} %{fno-pic:-non_shared} \
45 %{mabi=64:-64} %{mabi=n32:-n32}"
47 #undef LIB_SPEC
48 #define LIB_SPEC "\
49 %{shared: -lc} \
50 %{!static: \
51 %{mabi=n32:-rpath-link %R/lib32:%R/usr/lib32} \
52 %{mabi=64:-rpath-link %R/lib64:%R/usr/lib64} \
53 %{mabi=32:-rpath-link %R/lib:%R/usr/lib}} \
54 %{!shared: %{pthread:-lpthread} \
55 %{profile:-lc_p} %{!profile: -lc}}"
57 #undef LINK_SPEC
58 #define LINK_SPEC "\
59 %{G*} %{EB} %{EL} %{mips1} %{mips2} %{mips3} %{mips4} \
60 %{bestGnum} %{shared} %{non_shared} \
61 %{call_shared} %{no_archive} %{exact_version} \
62 %(endian_spec) \
63 %{!shared: \
64 %{!ibcs: \
65 %{!static: \
66 %{rdynamic:-export-dynamic} \
67 %{!dynamic-linker: \
68 %{mabi=n32: -dynamic-linker /lib32/ld.so.1} \
69 %{mabi=64: -dynamic-linker /lib64/ld.so.1} \
70 %{mabi=32: -dynamic-linker /lib/ld.so.1}}} \
71 %{static:-static}}} \
72 %{mabi=n32:-melf32%{EB:b}%{EL:l}tsmipn32} \
73 %{mabi=64:-melf64%{EB:b}%{EL:l}tsmip} \
74 %{mabi=32:-melf32%{EB:b}%{EL:l}tsmip}"
76 #undef LOCAL_LABEL_PREFIX
77 #define LOCAL_LABEL_PREFIX ((mips_abi == ABI_32 || mips_abi == ABI_O64) \
78 ? "$" : ".")
80 /* The size in bytes of a DWARF field indicating an offset or length
81 relative to a debug info section, specified to be 4 bytes in the DWARF-2
82 specification. The SGI/MIPS ABI defines it to be the same as PTR_SIZE. */
83 #define DWARF_OFFSET_SIZE PTR_SIZE
85 #undef ASM_PREFERRED_EH_DATA_FORMAT
86 #if 0 /* We can't use relative addressing modes on NEWABI :-( */
87 #define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) \
88 (flag_pic \
89 ? ((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_sdata4 \
90 : DW_EH_PE_absptr)
91 #endif
93 /* GNU/Linux doesn't use the same floating-point format that IRIX uses
94 for long double. There's no need to override this here, since
95 ieee_quad_format is the default, but let's put this here to make
96 sure nobody thinks we just forgot to set it to something else. */
97 #define MIPS_TFMODE_FORMAT mips_quad_format