lynx.h revision 169689
176861Skris/* Definitions for Rs6000 running LynxOS. 276861Skris Copyright (C) 1995, 1996, 2000, 2002, 2003, 2004, 2005 376861Skris Free Software Foundation, Inc. 476861Skris Contributed by David Henkel-Wallace, Cygnus Support (gumby@cygnus.com) 576861Skris Rewritten by Adam Nemet, LynuxWorks Inc. 676861Skris 776861Skris This file is part of GCC. 876861Skris 996316Sobrien GCC is free software; you can redistribute it and/or modify it 1096316Sobrien under the terms of the GNU General Public License as published 11126890Strhodes by the Free Software Foundation; either version 2, or (at your 12161214Sdes option) any later version. 13161214Sdes 14161214Sdes GCC is distributed in the hope that it will be useful, but WITHOUT 15161214Sdes ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 16161214Sdes or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 17161214Sdes License for more details. 18161214Sdes 19161214Sdes You should have received a copy of the GNU General Public License 20161214Sdes along with GCC; see the file COPYING. If not, write to the 21161214Sdes Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, 22161214Sdes MA 02110-1301, USA. */ 23161214Sdes 24161214Sdes/* Override the definition in sysv4.h. */ 25161214Sdes 26161214Sdes#undef TARGET_VERSION 2776861Skris#define TARGET_VERSION fputs (" (PowerPC/LynxOS)", stderr); 28140359Sobrien 29124372Sru/* Undefine the definition to enable the LynxOS default from the 3099542Sobrien top-level lynx.h. */ 31124372Sru 3299542Sobrien#undef SUBTARGET_EXTRA_SPECS 3376861Skris 34140359Sobrien/* Get rid off the spec definitions from rs6000/sysv4.h. */ 35124372Sru 3676861Skris#undef CPP_SPEC 37140359Sobrien#define CPP_SPEC \ 38140361Sobrien"%{msoft-float: -D_SOFT_FLOAT} \ 39140361Sobrien %(cpp_cpu) \ 4087976Sobrien %(cpp_os_lynx)" 41140359Sobrien 42140361Sobrien/* LynxOS only supports big-endian on PPC so we override the 43140361Sobrien definition from sysv4.h. Since the LynxOS 4.0 compiler was set to 4487976Sobrien return every structure in memory regardless of their size we have 4594332Sobrien to emulate the same behavior here with disabling the SVR4 structure 46140359Sobrien returning. */ 47125884Sdes 4894332Sobrien#undef CC1_SPEC 49140359Sobrien#define CC1_SPEC \ 5088936Sdwmalone"%{G*} %{mno-sdata:-msdata=none} \ 5188936Sdwmalone %{maltivec:-mabi=altivec} \ 52124372Sru -maix-struct-return" 5388936Sdwmalone 54169961Sobrien#undef ASM_SPEC 55169723Skan#define ASM_SPEC \ 56169961Sobrien"%(asm_cpu) \ 5776861Skris %{.s: %{mregnames} %{mno-regnames}} \ 5876861Skris %{.S: %{mregnames} %{mno-regnames}}" 5976861Skris 6076861Skris#undef STARTFILE_SPEC 6176861Skris#undef ENDFILE_SPEC 6276861Skris#undef LIB_SPEC 6376861Skris#undef LINK_SPEC 64124372Sru#define LINK_SPEC \ 65124372Sru"%{!msdata=none:%{G*}} %{msdata=none:-G0} \ 6699542Sobrien %(link_os_lynx)" 67124372Sru 6899542Sobrien/* Override the definition from sysv4.h. */ 6976861Skris 7076861Skris#undef TARGET_OS_CPP_BUILTINS 7176861Skris#define TARGET_OS_CPP_BUILTINS() \ 7276861Skris do \ 73163971Sjb { \ 74163971Sjb builtin_define ("__BIG_ENDIAN__"); \ 75163971Sjb builtin_define ("__powerpc__"); \ 76163971Sjb builtin_assert ("cpu=powerpc"); \ 77180012Sru builtin_assert ("machine=powerpc"); \ 78180012Sru builtin_define ("__PPC__"); \ 79180012Sru } \ 80180012Sru while (0) 81180012Sru 82180012Sru/* Override the rs6000.h definition. */ 8376861Skris 8476861Skris#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