OSDN Git Service

2007-01-19 Richard Guenther <rguenther@suse.de>
[pf3gnuchains/gcc-fork.git] / gcc / config / rs6000 / linux.h
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 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 2, 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 COPYING.  If not, write to the
21    Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
22    MA 02110-1301, USA.  */
23
24 #undef MD_EXEC_PREFIX
25 #undef MD_STARTFILE_PREFIX
26
27 /* Linux doesn't support saving and restoring 64-bit regs in a 32-bit
28    process.  */
29 #define OS_MISSING_POWERPC64 1
30
31 /* We use glibc _mcount for profiling.  */
32 #define NO_PROFILE_COUNTERS 1
33
34 /* glibc has float and long double forms of math functions.  */
35 #undef  TARGET_C99_FUNCTIONS
36 #define TARGET_C99_FUNCTIONS (OPTION_GLIBC)
37
38 /* Whether we have sincos that follows the GNU extension.  */
39 #undef  TARGET_HAS_SINCOS
40 #define TARGET_HAS_SINCOS (OPTION_GLIBC)
41
42 #undef  TARGET_OS_CPP_BUILTINS
43 #define TARGET_OS_CPP_BUILTINS()                \
44   do                                            \
45     {                                           \
46       builtin_define_std ("PPC");               \
47       builtin_define_std ("powerpc");           \
48       builtin_assert ("cpu=powerpc");           \
49       builtin_assert ("machine=powerpc");       \
50       TARGET_OS_SYSV_CPP_BUILTINS ();           \
51     }                                           \
52   while (0)
53
54 #undef  CPP_OS_DEFAULT_SPEC
55 #define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux)"
56
57 /* The GNU C++ standard library currently requires _GNU_SOURCE being
58    defined on glibc-based systems. This temporary hack accomplishes this,
59    it should go away as soon as libstdc++-v3 has a real fix.  */
60 #undef  CPLUSPLUS_CPP_SPEC
61 #define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
62
63 #undef  LINK_SHLIB_SPEC
64 #define LINK_SHLIB_SPEC "%{shared:-shared} %{!shared: %{static:-static}}"
65
66 #undef  LIB_DEFAULT_SPEC
67 #define LIB_DEFAULT_SPEC "%(lib_linux)"
68
69 #undef  STARTFILE_DEFAULT_SPEC
70 #define STARTFILE_DEFAULT_SPEC "%(startfile_linux)"
71
72 #undef  ENDFILE_DEFAULT_SPEC
73 #define ENDFILE_DEFAULT_SPEC "%(endfile_linux)"
74
75 #undef  LINK_START_DEFAULT_SPEC
76 #define LINK_START_DEFAULT_SPEC "%(link_start_linux)"
77
78 #undef  LINK_OS_DEFAULT_SPEC
79 #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)"
80
81 #define LINK_GCC_C_SEQUENCE_SPEC \
82   "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
83
84 /* Use --as-needed -lgcc_s for eh support.  */
85 #ifdef HAVE_LD_AS_NEEDED
86 #define USE_LD_AS_NEEDED 1
87 #endif
88
89 #undef  TARGET_VERSION
90 #define TARGET_VERSION fprintf (stderr, " (PowerPC GNU/Linux)");
91
92 /* Override rs6000.h definition.  */
93 #undef  ASM_APP_ON
94 #define ASM_APP_ON "#APP\n"
95
96 /* Override rs6000.h definition.  */
97 #undef  ASM_APP_OFF
98 #define ASM_APP_OFF "#NO_APP\n"
99
100 /* For backward compatibility, we must continue to use the AIX
101    structure return convention.  */
102 #undef  DRAFT_V4_STRUCT_RET
103 #define DRAFT_V4_STRUCT_RET 1
104
105 /* We are 32-bit all the time, so optimize a little.  */
106 #undef TARGET_64BIT
107 #define TARGET_64BIT 0
108  
109 /* We don't need to generate entries in .fixup, except when
110    -mrelocatable or -mrelocatable-lib is given.  */
111 #undef RELOCATABLE_NEEDS_FIXUP
112 #define RELOCATABLE_NEEDS_FIXUP \
113   (target_flags & target_flags_explicit & MASK_RELOCATABLE)
114
115 #define TARGET_ASM_FILE_END file_end_indicate_exec_stack
116
117 #define TARGET_POSIX_IO
118
119 #define MD_UNWIND_SUPPORT "config/rs6000/linux-unwind.h"
120
121 #ifdef TARGET_LIBC_PROVIDES_SSP
122 /* ppc32 glibc provides __stack_chk_guard in -0x7008(2).  */
123 #define TARGET_THREAD_SSP_OFFSET        -0x7008
124 #endif
125
126 #define POWERPC_LINUX
127
128 /* ppc linux has 128-bit long double support in glibc 2.4 and later.  */
129 #ifdef TARGET_DEFAULT_LONG_DOUBLE_128
130 #define RS6000_DEFAULT_LONG_DOUBLE_SIZE 128
131 #endif