0
|
1 /* Definitions of target machine for GNU compiler,
|
|
2 for PowerPC machines running Linux.
|
|
3 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
|
|
4 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
|
|
5 Contributed by Michael Meissner (meissner@cygnus.com).
|
|
6
|
|
7 This file is part of GCC.
|
|
8
|
|
9 GCC is free software; you can redistribute it and/or modify it
|
|
10 under the terms of the GNU General Public License as published
|
|
11 by the Free Software Foundation; either version 3, or (at your
|
|
12 option) any later version.
|
|
13
|
|
14 GCC is distributed in the hope that it will be useful, but WITHOUT
|
|
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
16 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
|
|
17 License for more details.
|
|
18
|
|
19 You should have received a copy of the GNU General Public License
|
|
20 along with GCC; see the file COPYING3. If not see
|
|
21 <http://www.gnu.org/licenses/>. */
|
|
22
|
|
23 #undef MD_EXEC_PREFIX
|
|
24 #undef MD_STARTFILE_PREFIX
|
|
25
|
|
26 /* Linux doesn't support saving and restoring 64-bit regs in a 32-bit
|
|
27 process. */
|
|
28 #define OS_MISSING_POWERPC64 1
|
|
29
|
|
30 /* We use glibc _mcount for profiling. */
|
|
31 #define NO_PROFILE_COUNTERS 1
|
|
32
|
|
33 /* glibc has float and long double forms of math functions. */
|
|
34 #undef TARGET_C99_FUNCTIONS
|
|
35 #define TARGET_C99_FUNCTIONS (OPTION_GLIBC)
|
|
36
|
|
37 /* Whether we have sincos that follows the GNU extension. */
|
|
38 #undef TARGET_HAS_SINCOS
|
|
39 #define TARGET_HAS_SINCOS (OPTION_GLIBC)
|
|
40
|
|
41 #undef TARGET_OS_CPP_BUILTINS
|
|
42 #define TARGET_OS_CPP_BUILTINS() \
|
|
43 do \
|
|
44 { \
|
|
45 builtin_define_std ("PPC"); \
|
|
46 builtin_define_std ("powerpc"); \
|
|
47 builtin_assert ("cpu=powerpc"); \
|
|
48 builtin_assert ("machine=powerpc"); \
|
|
49 TARGET_OS_SYSV_CPP_BUILTINS (); \
|
|
50 } \
|
|
51 while (0)
|
|
52
|
|
53 #undef CPP_OS_DEFAULT_SPEC
|
|
54 #define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux)"
|
|
55
|
|
56 /* The GNU C++ standard library currently requires _GNU_SOURCE being
|
|
57 defined on glibc-based systems. This temporary hack accomplishes this,
|
|
58 it should go away as soon as libstdc++-v3 has a real fix. */
|
|
59 #undef CPLUSPLUS_CPP_SPEC
|
|
60 #define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
|
|
61
|
|
62 #undef LINK_SHLIB_SPEC
|
|
63 #define LINK_SHLIB_SPEC "%{shared:-shared} %{!shared: %{static:-static}}"
|
|
64
|
|
65 #undef LIB_DEFAULT_SPEC
|
|
66 #define LIB_DEFAULT_SPEC "%(lib_linux)"
|
|
67
|
|
68 #undef STARTFILE_DEFAULT_SPEC
|
|
69 #define STARTFILE_DEFAULT_SPEC "%(startfile_linux)"
|
|
70
|
|
71 #undef ENDFILE_DEFAULT_SPEC
|
|
72 #define ENDFILE_DEFAULT_SPEC "%(endfile_linux)"
|
|
73
|
|
74 #undef LINK_START_DEFAULT_SPEC
|
|
75 #define LINK_START_DEFAULT_SPEC "%(link_start_linux)"
|
|
76
|
|
77 #undef LINK_OS_DEFAULT_SPEC
|
|
78 #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)"
|
|
79
|
|
80 #define LINK_GCC_C_SEQUENCE_SPEC \
|
|
81 "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
|
|
82
|
|
83 /* Use --as-needed -lgcc_s for eh support. */
|
|
84 #ifdef HAVE_LD_AS_NEEDED
|
|
85 #define USE_LD_AS_NEEDED 1
|
|
86 #endif
|
|
87
|
|
88 #undef TARGET_VERSION
|
|
89 #define TARGET_VERSION fprintf (stderr, " (PowerPC GNU/Linux)");
|
|
90
|
|
91 /* Override rs6000.h definition. */
|
|
92 #undef ASM_APP_ON
|
|
93 #define ASM_APP_ON "#APP\n"
|
|
94
|
|
95 /* Override rs6000.h definition. */
|
|
96 #undef ASM_APP_OFF
|
|
97 #define ASM_APP_OFF "#NO_APP\n"
|
|
98
|
|
99 /* For backward compatibility, we must continue to use the AIX
|
|
100 structure return convention. */
|
|
101 #undef DRAFT_V4_STRUCT_RET
|
|
102 #define DRAFT_V4_STRUCT_RET 1
|
|
103
|
|
104 /* We are 32-bit all the time, so optimize a little. */
|
|
105 #undef TARGET_64BIT
|
|
106 #define TARGET_64BIT 0
|
|
107
|
|
108 /* We don't need to generate entries in .fixup, except when
|
|
109 -mrelocatable or -mrelocatable-lib is given. */
|
|
110 #undef RELOCATABLE_NEEDS_FIXUP
|
|
111 #define RELOCATABLE_NEEDS_FIXUP \
|
|
112 (target_flags & target_flags_explicit & MASK_RELOCATABLE)
|
|
113
|
|
114 #define TARGET_ASM_FILE_END file_end_indicate_exec_stack
|
|
115
|
|
116 #define TARGET_POSIX_IO
|
|
117
|
|
118 #define MD_UNWIND_SUPPORT "config/rs6000/linux-unwind.h"
|
|
119
|
|
120 #ifdef TARGET_LIBC_PROVIDES_SSP
|
|
121 /* ppc32 glibc provides __stack_chk_guard in -0x7008(2). */
|
|
122 #define TARGET_THREAD_SSP_OFFSET -0x7008
|
|
123 #endif
|
|
124
|
|
125 #define POWERPC_LINUX
|
|
126
|
|
127 /* ppc linux has 128-bit long double support in glibc 2.4 and later. */
|
|
128 #ifdef TARGET_DEFAULT_LONG_DOUBLE_128
|
|
129 #define RS6000_DEFAULT_LONG_DOUBLE_SIZE 128
|
|
130 #endif
|