]>
Commit | Line | Data |
---|---|---|
378b66d4 ME |
1 | /* Configuration for an OpenBSD i386 target. |
2 | ||
818ab71a | 3 | Copyright (C) 2005-2016 Free Software Foundation, Inc. |
378b66d4 ME |
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 | |
2f83c7d6 | 9 | the Free Software Foundation; either version 3, or (at your option) |
378b66d4 ME |
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 | |
2f83c7d6 NC |
18 | along with GCC; see the file COPYING3. If not see |
19 | <http://www.gnu.org/licenses/>. */ | |
378b66d4 | 20 | |
378b66d4 ME |
21 | #define TARGET_OS_CPP_BUILTINS() \ |
22 | do \ | |
23 | { \ | |
f5975bd5 | 24 | OPENBSD_OS_CPP_BUILTINS(); \ |
378b66d4 ME |
25 | } \ |
26 | while (0) | |
27 | ||
613061fd MK |
28 | #undef DBX_REGISTER_NUMBER |
29 | #define DBX_REGISTER_NUMBER(n) \ | |
30 | (TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n]) | |
378b66d4 | 31 | |
613061fd | 32 | /* This must agree with <machine/_types.h>. */ |
378b66d4 | 33 | #undef SIZE_TYPE |
aa58f943 | 34 | #define SIZE_TYPE "long unsigned int" |
378b66d4 ME |
35 | |
36 | #undef PTRDIFF_TYPE | |
aa58f943 | 37 | #define PTRDIFF_TYPE "long int" |
378b66d4 ME |
38 | |
39 | #undef WCHAR_TYPE | |
40 | #define WCHAR_TYPE "int" | |
41 | ||
42 | #undef WCHAR_TYPE_SIZE | |
613061fd | 43 | #define WCHAR_TYPE_SIZE 32 |
378b66d4 | 44 | |
aa58f943 JG |
45 | #undef WINT_TYPE |
46 | #define WINT_TYPE "int" | |
47 | ||
613061fd MK |
48 | /* Don't default to pcc-struct-return, because gcc is the only compiler, and |
49 | we want to retain compatibility with older gcc versions. */ | |
50 | ||
51 | #undef DEFAULT_PCC_STRUCT_RETURN | |
52 | #define DEFAULT_PCC_STRUCT_RETURN 0 | |
53 | ||
54 | /* Override the default comment-starter of "/". */ | |
55 | #undef ASM_COMMENT_START | |
56 | #define ASM_COMMENT_START "#" | |
378b66d4 ME |
57 | |
58 | #undef ASM_APP_ON | |
59 | #define ASM_APP_ON "#APP\n" | |
60 | ||
61 | #undef ASM_APP_OFF | |
62 | #define ASM_APP_OFF "#NO_APP\n" | |
63 | ||
613061fd MK |
64 | /* A C statement to output to the stdio stream FILE an assembler |
65 | command to advance the location counter to a multiple of 1<<LOG | |
66 | bytes if it is within MAX_SKIP bytes. | |
378b66d4 | 67 | |
613061fd | 68 | This is used to align code labels according to Intel recommendations. */ |
378b66d4 ME |
69 | |
70 | #ifdef HAVE_GAS_MAX_SKIP_P2ALIGN | |
613061fd MK |
71 | #define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP) \ |
72 | do { \ | |
73 | if ((LOG) != 0) { \ | |
74 | if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \ | |
75 | else { \ | |
76 | fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \ | |
77 | /* Make sure that we have at least 8 byte alignment if > 8 byte \ | |
78 | alignment is preferred. */ \ | |
79 | if ((LOG) > 3 \ | |
80 | && (1 << (LOG)) > ((MAX_SKIP) + 1) \ | |
81 | && (MAX_SKIP) >= 7) \ | |
82 | fputs ("\t.p2align 3\n", (FILE)); \ | |
83 | } \ | |
84 | } \ | |
85 | } while (0) | |
378b66d4 ME |
86 | #endif |
87 | ||
378b66d4 | 88 | /* OpenBSD's profiler recovers all information from the stack pointer. |
613061fd | 89 | The icky part is not here, but in <machine/profile.h>. */ |
378b66d4 ME |
90 | #undef FUNCTION_PROFILER |
91 | #define FUNCTION_PROFILER(FILE, LABELNO) \ | |
92 | fputs (flag_pic ? "\tcall __mcount@PLT\n": "\tcall __mcount\n", FILE); | |
93 | ||
378b66d4 ME |
94 | #undef LINK_SPEC |
95 | #define LINK_SPEC \ | |
7aed7dfc | 96 | "%{!shared:%{!nostdlib:%{!r:%{!e*:-e __start}}}} \ |
378b66d4 ME |
97 | %{shared:-shared} %{R*} \ |
98 | %{static:-Bstatic} \ | |
99 | %{!static:-Bdynamic} \ | |
100 | %{assert*} \ | |
e59dabd2 | 101 | -dynamic-linker /usr/libexec/ld.so" |
378b66d4 | 102 | |
613061fd MK |
103 | #undef STARTFILE_SPEC |
104 | #define STARTFILE_SPEC "\ | |
105 | %{!shared: %{pg:gcrt0%O%s} %{!pg:%{p:gcrt0%O%s} %{!p:crt0%O%s}} \ | |
106 | crtbegin%O%s} %{shared:crtbeginS%O%s}" | |
107 | ||
108 | #undef ENDFILE_SPEC | |
109 | #define ENDFILE_SPEC "%{!shared:crtend%O%s} %{shared:crtendS%O%s}" | |
110 | ||
378b66d4 | 111 | #define OBSD_HAS_CORRECT_SPECS |
613061fd MK |
112 | |
113 | #define HAVE_ENABLE_EXECUTE_STACK |