* config/ia64/ia64.md: Define new attribute "empty".
[official-gcc.git] / gcc / config / alpha / linux.h
blobe2a16dff3dba064626467c74fc87a8f79bb8da8b
1 /* Definitions of target machine for GNU compiler,
2 for Alpha Linux-based GNU systems.
3 Copyright (C) 1996, 1997, 1998, 2002, 2003, 2004
4 Free Software Foundation, Inc.
5 Contributed by Richard Henderson.
7 This file is part of GCC.
9 GCC is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2, or (at your option)
12 any later version.
14 GCC is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with GCC; see the file COPYING. If not, write to
21 the Free Software Foundation, 59 Temple Place - Suite 330,
22 Boston, MA 02111-1307, USA. */
24 #undef TARGET_DEFAULT
25 #define TARGET_DEFAULT (MASK_FP | MASK_FPREGS | MASK_GAS)
27 #define TARGET_OS_CPP_BUILTINS() \
28 do { \
29 builtin_define ("__gnu_linux__"); \
30 builtin_define ("_LONGLONG"); \
31 builtin_define_std ("linux"); \
32 builtin_define_std ("unix"); \
33 builtin_assert ("system=linux"); \
34 builtin_assert ("system=unix"); \
35 builtin_assert ("system=posix"); \
36 /* The GNU C++ standard library requires this. */ \
37 if (c_dialect_cxx ()) \
38 builtin_define ("_GNU_SOURCE"); \
39 } while (0)
41 #undef LIB_SPEC
42 #define LIB_SPEC \
43 "%{pthread:-lpthread} \
44 %{shared:-lc} \
45 %{!shared: %{profile:-lc_p}%{!profile:-lc}}"
47 /* Show that we need a GP when profiling. */
48 #undef TARGET_PROFILING_NEEDS_GP
49 #define TARGET_PROFILING_NEEDS_GP 1
51 /* Don't care about faults in the prologue. */
52 #undef TARGET_CAN_FAULT_IN_PROLOGUE
53 #define TARGET_CAN_FAULT_IN_PROLOGUE 1
55 /* OS fixes up EV5 data fault on prefetch. */
56 #undef TARGET_FIXUP_EV5_PREFETCH
57 #define TARGET_FIXUP_EV5_PREFETCH 1
59 #undef WCHAR_TYPE
60 #define WCHAR_TYPE "int"
62 /* Define this so that all GNU/Linux targets handle the same pragmas. */
63 #define HANDLE_PRAGMA_PACK_PUSH_POP
65 /* Determine whether the the entire c99 runtime is present in the
66 runtime library. */
67 #define TARGET_C99_FUNCTIONS 1
69 #define TARGET_HAS_F_SETLKW
71 #define LINK_GCC_C_SEQUENCE_SPEC \
72 "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
74 /* Use --as-needed -lgcc_s for eh support. */
75 #ifdef HAVE_LD_AS_NEEDED
76 #define USE_LD_AS_NEEDED 1
77 #endif
79 /* Do code reading to identify a signal frame, and set the frame
80 state data appropriately. See unwind-dw2.c for the structs. */
82 #ifdef IN_LIBGCC2
83 #include <signal.h>
84 #include <sys/ucontext.h>
85 #endif
87 #define MD_FALLBACK_FRAME_STATE_FOR(CONTEXT, FS, SUCCESS) \
88 do { \
89 unsigned int *pc_ = (CONTEXT)->ra; \
90 struct sigcontext *sc_; \
91 long new_cfa_, i_; \
93 if (pc_[0] != 0x47fe0410 /* mov $30,$16 */ \
94 || pc_[2] != 0x00000083 /* callsys */) \
95 break; \
96 if ((CONTEXT)->cfa == 0) \
97 break; \
98 if (pc_[1] == 0x201f0067) /* lda $0,NR_sigreturn */ \
99 sc_ = (CONTEXT)->cfa; \
100 else if (pc_[1] == 0x201f015f) /* lda $0,NR_rt_sigreturn */ \
102 struct rt_sigframe { \
103 struct siginfo info; \
104 struct ucontext uc; \
105 } *rt_ = (CONTEXT)->cfa; \
106 sc_ = &rt_->uc.uc_mcontext; \
108 else \
109 break; \
110 new_cfa_ = sc_->sc_regs[30]; \
111 (FS)->cfa_how = CFA_REG_OFFSET; \
112 (FS)->cfa_reg = 30; \
113 (FS)->cfa_offset = new_cfa_ - (long) (CONTEXT)->cfa; \
114 for (i_ = 0; i_ < 30; ++i_) \
116 (FS)->regs.reg[i_].how = REG_SAVED_OFFSET; \
117 (FS)->regs.reg[i_].loc.offset \
118 = (long)&sc_->sc_regs[i_] - new_cfa_; \
120 for (i_ = 0; i_ < 31; ++i_) \
122 (FS)->regs.reg[i_+32].how = REG_SAVED_OFFSET; \
123 (FS)->regs.reg[i_+32].loc.offset \
124 = (long)&sc_->sc_fpregs[i_] - new_cfa_; \
126 (FS)->regs.reg[64].how = REG_SAVED_OFFSET; \
127 (FS)->regs.reg[64].loc.offset = (long)&sc_->sc_pc - new_cfa_; \
128 (FS)->retaddr_column = 64; \
129 goto SUCCESS; \
130 } while (0)