]>
Commit | Line | Data |
---|---|---|
052dbd9e MK |
1 | /* Operating system specific defines to be used when targeting GCC for |
2 | Interix | |
5dd8a9b1 | 3 | Copyright (C) 1994, 1995, 1999, 2002 Free Software Foundation, Inc. |
052dbd9e MK |
4 | Donn Terry, Softway Systems, Inc. (donn@softway.com) |
5 | Modified from code | |
6 | Contributed by Douglas B. Rupp (drupp@cs.washington.edu). | |
7 | ||
8 | This file is part of GNU CC. | |
9 | ||
10 | GNU CC is free software; you can redistribute it and/or modify | |
11 | it under the terms of the GNU General Public License as published by | |
12 | the Free Software Foundation; either version 2, or (at your option) | |
13 | any later version. | |
14 | ||
15 | GNU CC is distributed in the hope that it will be useful, | |
16 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | GNU General Public License for more details. | |
19 | ||
20 | You should have received a copy of the GNU General Public License | |
21 | along with GNU CC; see the file COPYING. If not, write to | |
22 | the Free Software Foundation, 59 Temple Place - Suite 330, | |
23 | Boston, MA 02111-1307, USA. */ | |
24 | ||
10b2117e | 25 | #ifndef TARGET_MEM_FUNCTIONS |
052dbd9e | 26 | #define TARGET_MEM_FUNCTIONS |
10b2117e | 27 | #endif |
052dbd9e MK |
28 | |
29 | /* POSIX/Uni-thread only for now. Look at the winnt version | |
30 | for windows/multi thread */ | |
31 | ||
32 | /* We need multiple -lc -lcpsx because they mutually refer; | |
33 | that should go away someday */ | |
34 | ||
35 | #undef LIB_SPEC | |
36 | #define LIB_SPEC "\ | |
37 | %{!shared:%{!dynamic:-lc -lcpsx -lc -lcpsx %$INTERIX_ROOT/usr/lib/psxdll.a \ | |
38 | %$INTERIX_ROOT/usr/lib/psxdll2.a \ | |
39 | }} \ | |
40 | %{!G:%{!dynamic:-lc -lcpsx -lc -lcpsx %$INTERIX_ROOT/usr/lib/psxdll.a \ | |
41 | %$INTERIX_ROOT/usr/lib/psxdll2.a \ | |
42 | }} \ | |
43 | %{dynamic:-lc %$INTERIX_ROOT/usr/lib/psxdll.a \ | |
44 | %$INTERIX_ROOT/usr/lib/psxdll2.a \ | |
45 | } \ | |
46 | %{v}" | |
47 | ||
48 | #undef LINK_SPEC | |
49 | #define LINK_SPEC "%{!shared:-stack 0x400000,0x10000} \ | |
50 | -subsystem posix \ | |
51 | %{g} \ | |
52 | %{dynamic:-Bdynamic} \ | |
53 | %{static:-Bstatic} \ | |
54 | %{shared:--shared -Bdynamic} \ | |
55 | %{G:--shared -Bdynamic} \ | |
56 | %{symbolic:--shared -Bsymbolic -Bdynamic} \ | |
57 | %{soname*:--soname %*} \ | |
58 | %{rpath*:--rpath %*} \ | |
59 | " | |
60 | ||
61 | #undef STARTFILE_SPEC | |
62 | #define STARTFILE_SPEC \ | |
63 | "%{!shared:%{pg:gcrt0%O%s}%{!pg:%{p:mcrt0%O%s}%{!p:crt0%O%s}}} %{shared:crti%O%s}" | |
64 | ||
65 | #undef WORD_SWITCH_TAKES_ARG | |
66 | #define WORD_SWITCH_TAKES_ARG(STR) \ | |
67 | ((DEFAULT_WORD_SWITCH_TAKES_ARG (STR) \ | |
68 | || !strcmp(STR, "rpath")) \ | |
69 | && strcmp (STR, "Tdata") && strcmp (STR, "Ttext") \ | |
70 | && strcmp (STR, "Tbss")) | |
71 | ||
72 | ||
73 | #if 0 | |
74 | /* don't do this until we can sort out the default path issues. MK */ | |
75 | #undef STANDARD_EXEC_PREFIX | |
76 | #define STANDARD_EXEC_PREFIX "" | |
77 | ||
78 | #undef STANDARD_STARTFILE_PREFIX | |
79 | #define STANDARD_STARTFILE_PREFIX "" | |
80 | ||
81 | #undef TOOLDIR_BASE_PREFIX | |
82 | #define TOOLDIR_BASE_PREFIX "" | |
83 | ||
84 | #endif /* 0 */ | |
85 | ||
006946e4 | 86 | #define STDC_0_IN_SYSTEM_HEADERS 1 |
052dbd9e | 87 | |
615c8231 DT |
88 | #define HANDLE_SYSV_PRAGMA |
89 | #undef HANDLE_PRAGMA_WEAK /* until the link format can handle it */ | |
90 | ||
91 | /* Names to predefine in the preprocessor for this target machine. */ | |
92 | ||
23532de9 JT |
93 | #define DBX_DEBUGGING_INFO 1 |
94 | #define SDB_DEBUGGING_INFO 1 | |
615c8231 DT |
95 | #undef PREFERRED_DEBUGGING_TYPE |
96 | #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG | |
97 | ||
98 | ||
99 | /* TARGET_DEFAULT from configure */ | |
100 | ||
101 | #undef WCHAR_TYPE | |
102 | #undef WCHAR_TYPE_SIZE | |
615c8231 DT |
103 | #define WCHAR_TYPE "short unsigned int" |
104 | #define WCHAR_TYPE_SIZE 16 | |
5dd8a9b1 ZW |
105 | |
106 | /* Our strategy for finding global constructors is a bit different, although | |
107 | not a lot. */ | |
108 | #define DO_GLOBAL_CTORS_BODY \ | |
109 | do { \ | |
110 | int i; \ | |
111 | unsigned long nptrs; \ | |
112 | func_ptr *p; \ | |
113 | asm( \ | |
114 | " .section .ctor_head, \"rw\"\n" \ | |
115 | "1:\n" \ | |
116 | " .text \n" \ | |
117 | ASM_LOAD_ADDR(1b,%0) \ | |
118 | : "=r" (p) : : "cc"); \ | |
119 | for (nptrs = 0; p[nptrs] != 0; nptrs++); \ | |
120 | for (i = nptrs-1; i >= 0; i--) \ | |
121 | p[i] (); \ | |
122 | } while (0) | |
123 | ||
124 | #define DO_GLOBAL_DTORS_BODY \ | |
125 | do { \ | |
126 | func_ptr *p; \ | |
127 | asm( \ | |
128 | " .section .dtor_head, \"rw\"\n" \ | |
129 | "1:\n" \ | |
130 | " .text \n" \ | |
131 | ASM_LOAD_ADDR(1b,%0) \ | |
132 | : "=r" (p) : : "cc"); \ | |
133 | while (*p) \ | |
134 | { \ | |
135 | p++; \ | |
136 | (*(p-1)) (); \ | |
137 | } \ | |
138 | } while (0) |