OSDN Git Service

8f10577312e61bfeece1b7eaa9c0e668d8836d01
[pf3gnuchains/gcc-fork.git] / gcc / config / xtensa / linux.h
1 /* Xtensa Linux configuration.
2    Derived from the configuration for GCC for Intel i386 running Linux.
3    Copyright (C) 2001, 2002 Free Software Foundation, Inc.
4
5 This file is part of GCC.
6
7 GCC is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2, or (at your option) any later
10 version.
11
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15 for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING.  If not, write to the Free
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
20 02111-1307, USA.  */
21
22 #define TARGET_OS_CPP_BUILTINS()                                \
23   do {                                                          \
24     builtin_define_std ("linux");                               \
25     builtin_define_std ("unix");                                \
26     builtin_define ("__ELF__");                                 \
27     builtin_define ("__gnu_linux__");                           \
28     builtin_assert ("system=posix");                            \
29     /* The GNU C++ standard library requires this.  */          \
30     if (c_language == clk_cplusplus)                            \
31       builtin_define ("_GNU_SOURCE");                           \
32   } while (0)
33
34 #undef TARGET_VERSION
35 #define TARGET_VERSION fputs (" (Xtensa GNU/Linux with ELF)", stderr);
36
37 #undef ASM_SPEC
38 #define ASM_SPEC "%{v} %{mno-density:--no-density} \
39                   %{mtext-section-literals:--text-section-literals} \
40                   %{mno-text-section-literals:--no-text-section-literals} \
41                   %{mtarget-align:--target-align} \
42                   %{mno-target-align:--no-target-align} \
43                   %{mlongcalls:--longcalls} \
44                   %{mno-longcalls:--no-longcalls}"
45
46 #undef ASM_FINAL_SPEC
47
48 #undef LIB_SPEC
49 #define LIB_SPEC \
50   "%{shared: -lc} \
51    %{!shared: %{pthread:-lpthread} \
52    %{profile:-lc_p} %{!profile: -lc}}"
53
54 #undef LINK_SPEC
55 #define LINK_SPEC \
56  "%{shared:-shared} \
57   %{!shared: \
58     %{!ibcs: \
59       %{!static: \
60         %{rdynamic:-export-dynamic} \
61         %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
62       %{static:-static}}}"
63
64 #undef LOCAL_LABEL_PREFIX
65 #define LOCAL_LABEL_PREFIX      "."
66
67 /* Always enable "-fpic" for Xtensa Linux.  */
68 #define XTENSA_ALWAYS_PIC 1
69
70 /* Redefine the standard ELF version of ASM_DECLARE_FUNCTION_SIZE to
71    allow adding the ".end literal_prefix" directive at the end of the
72    function.  */
73 #undef ASM_DECLARE_FUNCTION_SIZE
74 #define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL)            \
75   do                                                            \
76     {                                                           \
77       if (!flag_inhibit_size_directive)                         \
78         ASM_OUTPUT_MEASURED_SIZE (FILE, FNAME);                 \
79       XTENSA_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL);          \
80     }                                                           \
81   while (0)