OSDN Git Service

* config/i386/emmintrin.h: Fix comment typos.
[pf3gnuchains/gcc-fork.git] / gcc / config / ia64 / linux.h
1 /* Definitions for ia64-linux target.  */
2
3 /* This macro is a C statement to print on `stderr' a string describing the
4    particular machine description choice.  */
5
6 #define TARGET_VERSION fprintf (stderr, " (IA-64) Linux");
7
8 /* This is for -profile to use -lc_p instead of -lc.  */
9 #undef CC1_SPEC
10 #define CC1_SPEC "%{profile:-p} %{G*}"
11
12 /* Target OS builtins.  */
13 #define TARGET_OS_CPP_BUILTINS()                \
14 do {                                            \
15         builtin_assert("system=linux");         \
16         builtin_define_std("linux");            \
17         builtin_define_std("unix");             \
18         builtin_define("__gnu_linux__");        \
19         builtin_define("_LONGLONG");            \
20 } while (0)
21
22 /* Need to override linux.h STARTFILE_SPEC, since it has crtbeginT.o in.  */
23 #undef STARTFILE_SPEC
24 #ifdef HAVE_LD_PIE
25 #define STARTFILE_SPEC \
26   "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}}\
27    crti.o%s %{shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
28 #else
29 #define STARTFILE_SPEC \
30   "%{!shared: %{pg|p|profile:gcrt1.o%s;:crt1.o%s}}\
31    crti.o%s %{shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
32 #endif
33
34 /* Similar to standard Linux, but adding -ffast-math support.  */
35 #undef  ENDFILE_SPEC
36 #define ENDFILE_SPEC \
37   "%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
38    %{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
39
40 /* Define this for shared library support because it isn't in the main
41    linux.h file.  */
42
43 #undef LINK_SPEC
44 #define LINK_SPEC "\
45   %{shared:-shared} \
46   %{!shared: \
47     %{!static: \
48       %{rdynamic:-export-dynamic} \
49       %{!dynamic-linker:-dynamic-linker /lib/ld-linux-ia64.so.2}} \
50       %{static:-static}}"
51
52
53 #define JMP_BUF_SIZE  76
54
55 /* Override linux.h LINK_EH_SPEC definition.
56    Signalize that because we have fde-glibc, we don't need all C shared libs
57    linked against -lgcc_s.  */
58 #undef LINK_EH_SPEC
59 #define LINK_EH_SPEC ""
60
61 /* Do code reading to identify a signal frame, and set the frame
62    state data appropriately.  See unwind-dw2.c for the structs.  */
63
64 #ifdef IN_LIBGCC2
65 #include <signal.h>
66 #include <sys/ucontext.h>
67
68 #define IA64_GATE_AREA_START 0xa000000000000100LL
69 #define IA64_GATE_AREA_END   0xa000000000020000LL
70
71 #define MD_FALLBACK_FRAME_STATE_FOR(CONTEXT, FS, SUCCESS)               \
72   if ((CONTEXT)->rp >= IA64_GATE_AREA_START                             \
73       && (CONTEXT)->rp < IA64_GATE_AREA_END)                            \
74     {                                                                   \
75       struct sigframe {                                                 \
76         char scratch[16];                                               \
77         unsigned long sig_number;                                       \
78         struct siginfo *info;                                           \
79         struct sigcontext *sc;                                          \
80       } *frame_ = (struct sigframe *)(CONTEXT)->psp;                    \
81       struct sigcontext *sc_ = frame_->sc;                              \
82                                                                         \
83       /* Restore scratch registers in case the unwinder needs to        \
84          refer to a value stored in one of them.  */                    \
85       {                                                                 \
86         int i_;                                                         \
87                                                                         \
88         for (i_ = 2; i_ < 4; i_++)                                      \
89           (CONTEXT)->ireg[i_ - 2].loc = &sc_->sc_gr[i_];                \
90         for (i_ = 8; i_ < 12; i_++)                                     \
91           (CONTEXT)->ireg[i_ - 2].loc = &sc_->sc_gr[i_];                \
92         for (i_ = 14; i_ < 32; i_++)                                    \
93           (CONTEXT)->ireg[i_ - 2].loc = &sc_->sc_gr[i_];                \
94       }                                                                 \
95                                                                         \
96       (CONTEXT)->pfs_loc = &(sc_->sc_ar_pfs);                           \
97       (CONTEXT)->lc_loc = &(sc_->sc_ar_lc);                             \
98       (CONTEXT)->unat_loc = &(sc_->sc_ar_unat);                         \
99       (CONTEXT)->br_loc[0] = &(sc_->sc_br[0]);                          \
100       (CONTEXT)->bsp = sc_->sc_ar_bsp;                                  \
101       (CONTEXT)->pr = sc_->sc_pr;                                       \
102       (CONTEXT)->psp = sc_->sc_gr[12];                                  \
103       (CONTEXT)->gp = sc_->sc_gr[1];                                    \
104       /* Signal frame doesn't have an associated reg. stack frame       \
105          other than what we adjust for below.     */                    \
106       (FS) -> no_reg_stack_frame = 1;                                   \
107                                                                         \
108       /* Don't touch the branch registers o.t. b0.  The kernel doesn't  \
109          pass the preserved branch registers in the sigcontext but      \
110          leaves them intact, so there's no need to do anything          \
111          with them here.  */                                            \
112                                                                         \
113       {                                                                 \
114         unsigned long sof = sc_->sc_cfm & 0x7f;                         \
115         (CONTEXT)->bsp = (unsigned long)                                \
116           ia64_rse_skip_regs ((unsigned long *)(sc_->sc_ar_bsp), -sof); \
117       }                                                                 \
118                                                                         \
119       (FS)->curr.reg[UNW_REG_RP].where = UNW_WHERE_SPREL;               \
120       (FS)->curr.reg[UNW_REG_RP].val                                    \
121         = (unsigned long)&(sc_->sc_ip) - (CONTEXT)->psp;                \
122       (FS)->curr.reg[UNW_REG_RP].when = -1;                             \
123                                                                         \
124       goto SUCCESS;                                                     \
125     }
126 #endif /* IN_LIBGCC2 */