freebsd.h revision 103261
1/* Definitions for Sun Sparc64 running FreeBSD using the ELF format 2 Copyright (C) 2001, 2002 Free Software Foundation, Inc. 3 Contributed by David E. O'Brien <obrien@FreeBSD.org> and BSDi. 4 5This file is part of GNU CC. 6 7GNU CC is free software; you can redistribute it and/or modify 8it under the terms of the GNU General Public License as published by 9the Free Software Foundation; either version 2, or (at your option) 10any later version. 11 12GNU CC is distributed in the hope that it will be useful, 13but WITHOUT ANY WARRANTY; without even the implied warranty of 14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15GNU General Public License for more details. 16 17You should have received a copy of the GNU General Public License 18along with GNU CC; see the file COPYING. If not, write to 19the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ 20 21/* $FreeBSD: head/contrib/gcc/config/sparc/freebsd.h 103261 2002-09-12 17:19:09Z obrien $ */ 22 23/* FreeBSD needs's the platform name (sparc64) defined. 24 Emacs needs to know if the arch is 64 or 32-bits. */ 25 26#undef CPP_CPU64_DEFAULT_SPEC 27#define CPP_CPU64_DEFAULT_SPEC "-D__sparc64__ -D__sparc_v9__ -D__arch64__" 28 29#undef CPP_PREDEFINES 30#define CPP_PREDEFINES FBSD_CPP_PREDEFINES 31 32#define LINK_SPEC "%(link_arch) \ 33 %{!mno-relax:%{!r:-relax}} \ 34 %{p:%e`-p' not supported; use `-pg' and gprof(1)} \ 35 %{Wl,*:%*} \ 36 %{assert*} %{R*} %{rpath*} %{defsym*} \ 37 %{shared:-Bshareable %{h*} %{soname*}} \ 38 %{symbolic:-Bsymbolic} \ 39 %{!shared: \ 40 %{!static: \ 41 %{rdynamic:-export-dynamic} \ 42 %{!dynamic-linker:-dynamic-linker /usr/libexec/ld-elf.so.1}} \ 43 %{static:-Bstatic}}" 44 45 46/************************[ Target stuff ]***********************************/ 47 48/* Define the actual types of some ANSI-mandated types. 49 Needs to agree with <machine/ansi.h>. GCC defaults come from c-decl.c, 50 c-common.c, and config/<arch>/<arch>.h. */ 51 52/* Earlier headers may get this wrong for FreeBSD. 53 We use the GCC defaults instead. */ 54#undef WCHAR_TYPE 55 56#undef WCHAR_UNSIGNED 57#define WCHAR_UNSIGNED 0 58 59#undef WCHAR_TYPE_SIZE 60#define WCHAR_TYPE_SIZE 32 61 62/* Define for support of TFmode long double and REAL_ARITHMETIC. 63 Sparc ABI says that long double is 4 words. */ 64#undef LONG_DOUBLE_TYPE_SIZE 65#define LONG_DOUBLE_TYPE_SIZE (TARGET_LONG_DOUBLE_128 ? 128 : 64) 66 67/* Constant which presents upper bound of the above value. */ 68#undef MAX_LONG_DOUBLE_TYPE_SIZE 69#define MAX_LONG_DOUBLE_TYPE_SIZE 128 70 71/* Define this to set long double type size to use in libgcc2.c, which can 72 not depend on target_flags. */ 73#if defined(__arch64__) || defined(__LONG_DOUBLE_128__) 74#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 128 75#else 76#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 64 77#endif 78 79/* Definitions for 64-bit SPARC running systems with ELF. */ 80 81#undef SUBTARGET_SWITCHES 82#define SUBTARGET_SWITCHES \ 83 {"long-double-64", -MASK_LONG_DOUBLE_128, N_("Use 64 bit long doubles") }, \ 84 {"long-double-128", MASK_LONG_DOUBLE_128, N_("Use 128 bit long doubles") }, 85 86#undef TARGET_VERSION 87#define TARGET_VERSION fprintf (stderr, " (FreeBSD/sparc64 ELF)"); 88 89#define TARGET_ELF 1 90 91/* XXX */ 92/* A 64 bit v9 compiler with stack-bias, 93 in a Medium/mid code model environment. */ 94 95#undef TARGET_DEFAULT 96#define TARGET_DEFAULT \ 97 (MASK_V9 + MASK_64BIT + MASK_PTR64 /* + MASK_FASTER_STRUCTS */ \ 98 + MASK_STACK_BIAS + MASK_APP_REGS + MASK_FPU \ 99 + MASK_LONG_DOUBLE_128 /* + MASK_HARD_QUAD */) 100 101/* The default code model. */ 102#undef SPARC_DEFAULT_CMODEL 103#define SPARC_DEFAULT_CMODEL CM_MEDLOW 104 105 106/************************[ Assembler stuff ]********************************/ 107 108#undef LOCAL_LABEL_PREFIX 109#define LOCAL_LABEL_PREFIX "." 110 111/* XXX2 */ 112/* This is how to output a definition of an internal numbered label where 113 PREFIX is the class of label and NUM is the number within the class. */ 114 115#undef ASM_OUTPUT_INTERNAL_LABEL 116#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \ 117 fprintf (FILE, ".L%s%d:\n", PREFIX, NUM) 118 119/* XXX2 */ 120/* This is how to output a reference to an internal numbered label where 121 PREFIX is the class of label and NUM is the number within the class. */ 122 123#undef ASM_OUTPUT_INTERNAL_LABELREF 124#define ASM_OUTPUT_INTERNAL_LABELREF(FILE,PREFIX,NUM) \ 125 fprintf (FILE, ".L%s%d", PREFIX, NUM) 126 127/* XXX2 */ 128/* This is how to store into the string LABEL 129 the symbol_ref name of an internal numbered label where 130 PREFIX is the class of label and NUM is the number within the class. 131 This is suitable for output with `assemble_name'. */ 132 133#undef ASM_GENERATE_INTERNAL_LABEL 134#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \ 135 sprintf (LABEL, "*.L%s%d", PREFIX, NUM) 136 137 138/************************[ Debugger stuff ]*********************************/ 139 140/* This is the char to use for continuation (in case we need to turn 141 continuation back on). */ 142 143#undef DBX_CONTIN_CHAR 144#define DBX_CONTIN_CHAR '?' 145 146/* DWARF bits. */ 147 148/* Follow Irix 6 and not the Dwarf2 draft in using 64-bit offsets. 149 Obviously the Dwarf2 folks havn't tried to actually build systems 150 with their spec. On a 64-bit system, only 64-bit relocs become 151 RELATIVE relocations. */ 152 153/* #define DWARF_OFFSET_SIZE PTR_SIZE */ 154 155#undef ENDFILE_SPEC 156#define ENDFILE_SPEC \ 157 "%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s}" \ 158 FBSD_ENDFILE_SPEC 159 160/* We use GNU ld so undefine this so that attribute((init_priority)) works. */ 161#undef CTORS_SECTION_ASM_OP 162#undef DTORS_SECTION_ASM_OP 163