freebsd.h revision 52113
145135Sobrien/* Base configuration file for all FreeBSD targets. 245135Sobrien Copyright (C) 1999 Free Software Foundation, Inc. 345135Sobrien 445135SobrienThis file is part of GNU CC. 545135Sobrien 645135SobrienGNU CC is free software; you can redistribute it and/or modify 745135Sobrienit under the terms of the GNU General Public License as published by 845135Sobrienthe Free Software Foundation; either version 2, or (at your option) 945135Sobrienany later version. 1045135Sobrien 1145135SobrienGNU CC is distributed in the hope that it will be useful, 1245135Sobrienbut WITHOUT ANY WARRANTY; without even the implied warranty of 1345135SobrienMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1445135SobrienGNU General Public License for more details. 1545135Sobrien 1645135SobrienYou should have received a copy of the GNU General Public License 1745135Sobrienalong with GNU CC; see the file COPYING. If not, write to 1845135Sobrienthe Free Software Foundation, 59 Temple Place - Suite 330, 1945135SobrienBoston, MA 02111-1307, USA. */ 2045135Sobrien 2145135Sobrien/* Common FreeBSD configuration. 2245135Sobrien All FreeBSD architectures should include this file, which will specify 2345135Sobrien their commonalities. 2445135Sobrien Adapted from /usr/src/contrib/gcc/config/i386/freebsd.h & 2545135Sobrien egcs/gcc/config/i386/freebsd-elf.h version by David O'Brien */ 2645135Sobrien 2752113Sobrien/* $FreeBSD: head/contrib/gcc/config/freebsd.h 52113 1999-10-10 22:43:12Z obrien $ */ 2845135Sobrien 2952113Sobrien 3048474Sobrien/* Don't assume anything about the header files. */ 3145277Sobrien#undef NO_IMPLICIT_EXTERN_C 3245135Sobrien#define NO_IMPLICIT_EXTERN_C 3345135Sobrien 3446122Sobrien/* This defines which switch letters take arguments. On FreeBSD, most of 3545135Sobrien the normal cases (defined in gcc.c) apply, and we also have -h* and 3646122Sobrien -z* options (for the linker) (comming from svr4). 3748474Sobrien We also have -R (alias --rpath), no -z, --soname (-h), --assert etc. */ 3845135Sobrien 3945940Sobrien#define FBSD_SWITCH_TAKES_ARG(CHAR) \ 4046122Sobrien (DEFAULT_SWITCH_TAKES_ARG (CHAR) \ 4145135Sobrien || (CHAR) == 'h' \ 4245135Sobrien || (CHAR) == 'z' /* ignored by ld */ \ 4345135Sobrien || (CHAR) == 'R') 4445135Sobrien 4549854Sobrien#undef SWITCH_TAKES_ARG 4649854Sobrien#define SWITCH_TAKES_ARG(CHAR) (FBSD_SWITCH_TAKES_ARG(CHAR)) 4749854Sobrien 4845940Sobrien#define FBSD_WORD_SWITCH_TAKES_ARG(STR) \ 4945135Sobrien (DEFAULT_WORD_SWITCH_TAKES_ARG (STR) \ 5050080Sobrien || !strcmp ((STR), "rpath") || !strcmp ((STR), "rpath-link") \ 5150080Sobrien || !strcmp ((STR), "soname") || !strcmp ((STR), "defsym") \ 5250080Sobrien || !strcmp ((STR), "assert") || !strcmp ((STR), "dynamic-linker")) 5345135Sobrien 5449854Sobrien#undef WORD_SWITCH_TAKES_ARG 5549854Sobrien#define WORD_SWITCH_TAKES_ARG(STR) (FBSD_WORD_SWITCH_TAKES_ARG(STR)) 5649854Sobrien 5745317Sobrien/* Place spaces around this string. We depend on string splicing to produce 5845317Sobrien the final CPP_PREDEFINES value. */ 5945474Sbde#define CPP_FBSD_PREDEFINES " -Dunix -D__FreeBSD__=4 -D__FreeBSD_cc_version=400002 -Asystem(unix) -Asystem(FreeBSD) " 6045135Sobrien 6145458Sobrien/* Provide a LIB_SPEC appropriate for FreeBSD. Just select the appropriate 6245458Sobrien libc, depending on whether we're doing profiling. 6348474Sobrien (like the default, except no -lg, and no -p). */ 6445458Sobrien#undef LIB_SPEC 6545458Sobrien#define LIB_SPEC "%{!shared:%{!pg:%{!pthread:%{!kthread:-lc}%{kthread:-lpthread -lc}}%{pthread:-lc_r}}%{pg:%{!pthread:%{!kthread:-lc_p}%{kthread:-lpthread_p -lc_p}}%{pthread:-lc_r_p}}}" 6645135Sobrien 6745458Sobrien 6845135Sobrien/* Code generation parameters. */ 6945135Sobrien 7045135Sobrien/* Don't default to pcc-struct-return, because gcc is the only compiler, and 7148475Sobrien we want to retain compatibility with older gcc versions 7245135Sobrien (even though the svr4 ABI for the i386 says that records and unions are 7348474Sobrien returned in memory). */ 7445277Sobrien#undef DEFAULT_PCC_STRUCT_RETURN 7545135Sobrien#define DEFAULT_PCC_STRUCT_RETURN 0 7645135Sobrien 7745135Sobrien/* Ensure we the configuration knows our system correctly so we can link with 7848474Sobrien libraries compiled with the native cc. */ 7945135Sobrien#undef NO_DOLLAR_IN_LABEL 8045135Sobrien 8146211Sobrien/* Use more efficient ``thunks'' to implement C++ vtables. XXX note that 8246211Sobrien this setting is claimed to have a few bugs by the EGCS maintainers. They 8348474Sobrien believe the bugs will be worked out in EGCS 1.2. */ 8445277Sobrien#undef DEFAULT_VTABLE_THUNKS 8546211Sobrien#define DEFAULT_VTABLE_THUNKS 1 8645135Sobrien 8750048Sobrien/* This is BSD, so we want the DBX format. */ 8850048Sobrien#define DBX_DEBUGGING_INFO 8945277Sobrien 9050048Sobrien/* Use stabs instead of DWARF debug format. */ 9150048Sobrien#undef PREFERRED_DEBUGGING_TYPE 9250048Sobrien#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG 9350048Sobrien 9450048Sobrien 9545135Sobrien/* Miscellaneous parameters. */ 9645135Sobrien 9745135Sobrien/* Tell libgcc2.c that FreeBSD targets support atexit(3). */ 9845135Sobrien#define HAVE_ATEXIT 9948475Sobrien 10048475Sobrien/* Our malloc can allocte pagesized blocks efficiently. The default size 10148475Sobrien of 4072 bytes is not optimal on the i386 nor the Alpha. */ 10248475Sobrien#define OBSTACK_CHUNK_SIZE (getpagesize()) 103