OSDN Git Service

* libjava.compile/weirddecl.xfail: Removed xfail-*.
[pf3gnuchains/gcc-fork.git] / gcc / config / sparc / linux-aout.h
1 /* Definitions for SPARC running Linux-based GNU systems with a.out.
2    Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
3    Contributed by Eddie C. Dost (ecd@skynet.be)
4
5 This file is part of GNU CC.
6
7 GNU CC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
11
12 GNU CC 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
18 along with GNU CC; see the file COPYING.  If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA.  */
21
22 #include <aoutos.h>
23 #include <sparc/sparc.h>
24
25 /* Don't assume anything about the header files. */
26 #define NO_IMPLICIT_EXTERN_C
27
28 /* GNU/Linux uses ctype from glibc.a. I am not sure how complete it is.
29    For now, we play safe. It may change later. */
30
31 #if 0
32 #undef MULTIBYTE_CHARS
33 #define MULTIBYTE_CHARS 1
34 #endif
35
36 /* We need that too. */
37 #define HANDLE_SYSV_PRAGMA
38
39 #undef MD_EXEC_PREFIX
40 #undef MD_STARTFILE_PREFIX
41
42 /* Output at beginning of assembler file.  */
43 /* The .file command should always begin the output.  */
44 #undef ASM_FILE_START
45 #define ASM_FILE_START(FILE)                                            \
46   do {                                                                  \
47         output_file_directive (FILE, main_input_filename);              \
48         fprintf (FILE, "\t.version\t\"01.01\"\n");                      \
49   } while (0)
50
51 #undef STARTFILE_SPEC
52 #define STARTFILE_SPEC  "%{pg:gcrt0.o%s} %{!pg:%{p:gcrt0.o%s} %{!p:crt0.o%s}} %{static:-static}"
53
54 #undef TARGET_VERSION
55 #define TARGET_VERSION fprintf (stderr, " (sparc GNU/Linux with a.out)");
56
57 #undef SIZE_TYPE
58 #define SIZE_TYPE "unsigned int"
59
60 #undef PTRDIFF_TYPE
61 #define PTRDIFF_TYPE "int"
62
63 #undef WCHAR_TYPE
64 #define WCHAR_TYPE "int"
65
66 #undef WCHAR_TYPE_SIZE
67 #define WCHAR_TYPE_SIZE 32
68
69 #undef MAX_WCHAR_TYPE_SIZE
70
71 #undef CPP_PREDEFINES
72 #define CPP_PREDEFINES "-Dunix -Dsparc -Dlinux -Asystem=unix -Asystem=posix"
73
74 #undef CPP_SUBTARGET_SPEC
75 #define CPP_SUBTARGET_SPEC \
76 "%{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
77
78 /* Don't default to pcc-struct-return, because gcc is the only compiler,
79    and we want to retain compatibility with older gcc versions.  */
80 #define DEFAULT_PCC_STRUCT_RETURN 0
81
82 #undef LIB_SPEC
83
84 #if 1
85 /* We no longer link with libc_p.a or libg.a by default. If you
86    want to profile or debug the GNU/Linux C library, please add
87    -lc_p or -ggdb to LDFLAGS at the link time, respectively.  */
88 #define LIB_SPEC \
89 "%{mieee-fp:-lieee} %{p:-lgmon} %{pg:-lgmon} %{!ggdb:-lc} %{ggdb:-lg}"
90 #else    
91 #define LIB_SPEC \
92 "%{mieee-fp:-lieee} %{p:-lgmon -lc_p} %{pg:-lgmon -lc_p} \
93  %{!p:%{!pg:%{!g*:-lc} %{g*:-lg -static}}}" 
94 #endif
95
96 #undef LINK_SPEC
97 #define LINK_SPEC       "-m sparclinux"
98
99 /* The sun bundled assembler doesn't accept -Yd, (and neither does gas).
100    It's safe to pass -s always, even if -g is not used. */
101 #undef ASM_SPEC
102 #define ASM_SPEC \
103   "%{V} %{v:%{!V:-V}} %{n} %{T} %{Ym,*} %{Wa,*:%*} -s %{fpic:-K PIC} %{fPIC:-K PIC}"
104 \f
105 /* Override MACHINE_STATE_{SAVE,RESTORE} because we have special
106    traps available which can get and set the condition codes
107    reliably.  */
108 #undef MACHINE_STATE_SAVE
109 #define MACHINE_STATE_SAVE(ID)                          \
110   unsigned long int ms_flags, ms_saveret;               \
111   asm volatile("ta      0x20\n\t"                       \
112                "mov     %%g1, %0\n\t"                   \
113                "mov     %%g2, %1\n\t"                   \
114                : "=r" (ms_flags), "=r" (ms_saveret));
115
116 #undef MACHINE_STATE_RESTORE
117 #define MACHINE_STATE_RESTORE(ID)                       \
118   asm volatile("mov     %0, %%g1\n\t"                   \
119                "mov     %1, %%g2\n\t"                   \
120                "ta      0x21\n\t"                       \
121                : /* no outputs */                       \
122                : "r" (ms_flags), "r" (ms_saveret));