lynx.h revision 169690
1193323Sed/* Definitions for Rs6000 running LynxOS.
2193323Sed   Copyright (C) 1995, 1996, 2000, 2002, 2003, 2004, 2005
3193323Sed   Free Software Foundation, Inc.
4193323Sed   Contributed by David Henkel-Wallace, Cygnus Support (gumby@cygnus.com)
5193323Sed   Rewritten by Adam Nemet, LynuxWorks Inc.
6193323Sed
7193323Sed   This file is part of GCC.
8193323Sed
9193323Sed   GCC is free software; you can redistribute it and/or modify it
10193323Sed   under the terms of the GNU General Public License as published
11193323Sed   by the Free Software Foundation; either version 2, or (at your
12193323Sed   option) any later version.
13193323Sed
14202375Srdivacky   GCC is distributed in the hope that it will be useful, but WITHOUT
15202375Srdivacky   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16193323Sed   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
17193323Sed   License for more details.
18193323Sed
19202375Srdivacky   You should have received a copy of the GNU General Public License
20202375Srdivacky   along with GCC; see the file COPYING.  If not, write to the
21202375Srdivacky   Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
22202375Srdivacky   MA 02110-1301, USA.  */
23202375Srdivacky
24202375Srdivacky/* Override the definition in sysv4.h.  */
25202375Srdivacky
26202375Srdivacky#undef TARGET_VERSION
27202375Srdivacky#define TARGET_VERSION fputs (" (PowerPC/LynxOS)", stderr);
28202375Srdivacky
29202375Srdivacky/* Undefine the definition to enable the LynxOS default from the
30202375Srdivacky   top-level lynx.h.  */
31202375Srdivacky
32193323Sed#undef SUBTARGET_EXTRA_SPECS
33193323Sed
34193323Sed/* Get rid off the spec definitions from rs6000/sysv4.h.  */
35193323Sed
36202375Srdivacky#undef CPP_SPEC
37202375Srdivacky#define CPP_SPEC \
38202375Srdivacky"%{msoft-float: -D_SOFT_FLOAT} \
39202375Srdivacky %(cpp_cpu) \
40193323Sed %(cpp_os_lynx)"
41202375Srdivacky
42193323Sed/* LynxOS only supports big-endian on PPC so we override the
43202375Srdivacky   definition from sysv4.h.  Since the LynxOS 4.0 compiler was set to
44202375Srdivacky   return every structure in memory regardless of their size we have
45193323Sed   to emulate the same behavior here with disabling the SVR4 structure
46202878Srdivacky   returning.  */
47193323Sed
48193323Sed#undef CC1_SPEC
49193323Sed#define CC1_SPEC \
50193323Sed"%{G*} %{mno-sdata:-msdata=none} \
51202375Srdivacky %{maltivec:-mabi=altivec} \
52202375Srdivacky -maix-struct-return"
53202375Srdivacky
54226633Sdim#undef ASM_SPEC
55226633Sdim#define ASM_SPEC \
56226633Sdim"%(asm_cpu) \
57226633Sdim %{.s: %{mregnames} %{mno-regnames}} \
58193323Sed %{.S: %{mregnames} %{mno-regnames}}"
59193323Sed
60#undef STARTFILE_SPEC
61#undef ENDFILE_SPEC
62#undef LIB_SPEC
63#undef LINK_SPEC
64#define LINK_SPEC \
65"%{!msdata=none:%{G*}} %{msdata=none:-G0} \
66 %(link_os_lynx)"
67
68/* Override the definition from sysv4.h.  */
69
70#undef TARGET_OS_CPP_BUILTINS
71#define TARGET_OS_CPP_BUILTINS()		\
72  do						\
73    {						\
74      builtin_define ("__BIG_ENDIAN__");	\
75      builtin_define ("__powerpc__");		\
76      builtin_assert ("cpu=powerpc");		\
77      builtin_assert ("machine=powerpc");	\
78      builtin_define ("__PPC__");		\
79    }						\
80  while (0)
81
82/* Override the rs6000.h definition.  */
83
84#undef ASM_APP_ON
85#define ASM_APP_ON "#APP\n"
86
87/* Override the rs6000.h definition.  */
88
89#undef ASM_APP_OFF
90#define ASM_APP_OFF "#NO_APP\n"
91
92/* LynxOS does not do anything with .fixup plus let's not create
93   writable section for linkonce.r and linkonce.t.  */
94
95#undef RELOCATABLE_NEEDS_FIXUP
96
97/* Override these from rs6000.h with the generic definition.  */
98
99#undef SIZE_TYPE
100#undef ASM_OUTPUT_ALIGN
101#undef PREFERRED_DEBUGGING_TYPE
102
103/* The file rs6000.c defines TARGET_HAVE_TLS unconditionally to the
104   value of HAVE_AS_TLS.  HAVE_AS_TLS is true as gas support for TLS
105   is detected by configure.  Override the definition to false.  */
106
107#undef HAVE_AS_TLS
108#define HAVE_AS_TLS 0
109
110#ifdef CRT_BEGIN
111/* This function is part of crtbegin*.o which is at the beginning of
112   the link and is called from .fini which is usually toward the end
113   of the executable.  Make it longcall so that we don't limit the
114   text size of the executables to 32M.  */
115
116static void __do_global_dtors_aux (void) __attribute__ ((longcall));
117#endif	/* CRT_BEGIN */
118
119#ifdef CRT_END
120/* Similarly here.  This function resides in crtend*.o which is toward
121   to end of the link and is called from .init which is at the
122   beginning.  */
123
124static void __do_global_ctors_aux (void) __attribute__ ((longcall));
125#endif	/* CRT_END */
126