lynx.h revision 259065
1231200Smm/* Definitions for Rs6000 running LynxOS.
2231200Smm   Copyright (C) 1995, 1996, 2000, 2002, 2003, 2004, 2005
3231200Smm   Free Software Foundation, Inc.
4231200Smm   Contributed by David Henkel-Wallace, Cygnus Support (gumby@cygnus.com)
5231200Smm   Rewritten by Adam Nemet, LynuxWorks Inc.
6231200Smm
7231200Smm   This file is part of GCC.
8231200Smm
9231200Smm   GCC is free software; you can redistribute it and/or modify it
10231200Smm   under the terms of the GNU General Public License as published
11231200Smm   by the Free Software Foundation; either version 2, or (at your
12231200Smm   option) any later version.
13231200Smm
14231200Smm   GCC is distributed in the hope that it will be useful, but WITHOUT
15231200Smm   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16231200Smm   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
17231200Smm   License for more details.
18231200Smm
19231200Smm   You should have received a copy of the GNU General Public License
20231200Smm   along with GCC; see the file COPYING.  If not, write to the
21231200Smm   Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
22231200Smm   MA 02110-1301, USA.  */
23231200Smm
24231200Smm/* Override the definition in sysv4.h.  */
25231200Smm
26231200Smm#undef TARGET_VERSION
27231200Smm#define TARGET_VERSION fputs (" (PowerPC/LynxOS)", stderr);
28231200Smm
29231200Smm/* Undefine the definition to enable the LynxOS default from the
30231200Smm   top-level lynx.h.  */
31231200Smm
32231200Smm#undef SUBTARGET_EXTRA_SPECS
33231200Smm
34231200Smm/* Get rid off the spec definitions from rs6000/sysv4.h.  */
35231200Smm
36231200Smm#undef CPP_SPEC
37231200Smm#define CPP_SPEC \
38231200Smm"%{msoft-float: -D_SOFT_FLOAT} \
39231200Smm %(cpp_cpu) \
40231200Smm %(cpp_os_lynx)"
41232153Smm
42231200Smm/* LynxOS only supports big-endian on PPC so we override the
43231200Smm   definition from sysv4.h.  Since the LynxOS 4.0 compiler was set to
44231200Smm   return every structure in memory regardless of their size we have
45231200Smm   to emulate the same behavior here with disabling the SVR4 structure
46231200Smm   returning.  */
47231200Smm
48231200Smm#undef CC1_SPEC
49231200Smm#define CC1_SPEC \
50231200Smm"%{G*} %{mno-sdata:-msdata=none} \
51232153Smm %{maltivec:-mabi=altivec} \
52232153Smm -maix-struct-return"
53231200Smm
54232153Smm#undef ASM_SPEC
55231200Smm#define ASM_SPEC \
56232153Smm"%(asm_cpu) \
57232153Smm %{.s: %{mregnames} %{mno-regnames}} \
58232153Smm %{.S: %{mregnames} %{mno-regnames}}"
59232153Smm
60232153Smm#undef STARTFILE_SPEC
61232153Smm#undef ENDFILE_SPEC
62232153Smm#undef LIB_SPEC
63232153Smm#undef LINK_SPEC
64232153Smm#define LINK_SPEC \
65232153Smm"%{!msdata=none:%{G*}} %{msdata=none:-G0} \
66232153Smm %(link_os_lynx)"
67232153Smm
68232153Smm/* Override the definition from sysv4.h.  */
69231200Smm
70231200Smm#undef TARGET_OS_CPP_BUILTINS
71231200Smm#define TARGET_OS_CPP_BUILTINS()		\
72231200Smm  do						\
73231200Smm    {						\
74231200Smm      builtin_define ("__BIG_ENDIAN__");	\
75231200Smm      builtin_define ("__powerpc__");		\
76231200Smm      builtin_assert ("cpu=powerpc");		\
77231200Smm      builtin_assert ("machine=powerpc");	\
78231200Smm      builtin_define ("__PPC__");		\
79231200Smm    }						\
80231200Smm  while (0)
81231200Smm
82231200Smm/* Override the rs6000.h definition.  */
83231200Smm
84231200Smm#undef ASM_APP_ON
85231200Smm#define ASM_APP_ON "#APP\n"
86231200Smm
87231200Smm/* Override the rs6000.h definition.  */
88231200Smm
89231200Smm#undef ASM_APP_OFF
90231200Smm#define ASM_APP_OFF "#NO_APP\n"
91231200Smm
92231200Smm/* LynxOS does not do anything with .fixup plus let's not create
93231200Smm   writable section for linkonce.r and linkonce.t.  */
94231200Smm
95231200Smm#undef RELOCATABLE_NEEDS_FIXUP
96231200Smm
97231200Smm/* Override these from rs6000.h with the generic definition.  */
98231200Smm
99231200Smm#undef SIZE_TYPE
100231200Smm#undef ASM_OUTPUT_ALIGN
101231200Smm#undef PREFERRED_DEBUGGING_TYPE
102231200Smm
103231200Smm/* The file rs6000.c defines TARGET_HAVE_TLS unconditionally to the
104231200Smm   value of HAVE_AS_TLS.  HAVE_AS_TLS is true as gas support for TLS
105231200Smm   is detected by configure.  Override the definition to false.  */
106231200Smm
107231200Smm#undef HAVE_AS_TLS
108231200Smm#define HAVE_AS_TLS 0
109231200Smm
110231200Smm#ifdef CRT_BEGIN
111231200Smm/* This function is part of crtbegin*.o which is at the beginning of
112231200Smm   the link and is called from .fini which is usually toward the end
113231200Smm   of the executable.  Make it longcall so that we don't limit the
114231200Smm   text size of the executables to 32M.  */
115231200Smm
116231200Smmstatic void __do_global_dtors_aux (void) __attribute__ ((longcall));
117231200Smm#endif	/* CRT_BEGIN */
118231200Smm
119231200Smm#ifdef CRT_END
120232153Smm/* Similarly here.  This function resides in crtend*.o which is toward
121232153Smm   to end of the link and is called from .init which is at the
122232153Smm   beginning.  */
123232153Smm
124232153Smmstatic void __do_global_ctors_aux (void) __attribute__ ((longcall));
125232153Smm#endif	/* CRT_END */
126232153Smm