From 4e32293ce6e25dfe4f3f756032a044f4d39e70d1 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Mon, 22 Nov 1999 23:17:32 -0700 Subject: [PATCH] freebsd.h: New, FreeBSD architecture independent file. * config/freebsd.h: New, FreeBSD architecture independent file. * config/i386/freebsd-elf.h: removed FreeBSD architecturally independent pieces. * config/i386/freebsd.h: include i386/perform.h via tm.h rather than directly by i386/freebsd.h. * configure.in (*-*-freebsdelf): Include new FreeBSD architecturally independent configuration file. (*-*-freebsdelf): Include i386/perform.h via tm.h rather than directly by i386/freebsd.h. * configure: Rebuilt. *POTFILES.in: Add config/freebsd.h From-SVN: r30628 --- gcc/ChangeLog | 11 +++ gcc/config/freebsd.h | 141 ++++++++++++++++++++++++++++++++++ gcc/config/i386/freebsd-elf.h | 68 +++------------- gcc/config/i386/freebsd.h | 3 - gcc/configure | 4 +- gcc/configure.in | 4 +- gcc/po/ChangeLog | 4 + gcc/po/POTFILES.in | 1 + 8 files changed, 170 insertions(+), 66 deletions(-) create mode 100644 gcc/config/freebsd.h diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e19a9e1c1b5..1f88b82594f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,16 @@ Mon Nov 22 23:09:44 1999 David O'Brien + * config/freebsd.h: New, FreeBSD architecture independent file. + * config/i386/freebsd-elf.h: removed FreeBSD architecturally + independent pieces. + * config/i386/freebsd.h: include i386/perform.h via tm.h rather than + directly by i386/freebsd.h. + * configure.in (*-*-freebsdelf): Include new FreeBSD architecturally + independent configuration file. + (*-*-freebsdelf): Include i386/perform.h via tm.h rather than + directly by i386/freebsd.h. + * configure: Rebuilt. + * xm-i386.h: Define `__i386__' if not defined, rather than `i386' which is in the user's namespace. * libgcc2.c: Look for the ANSI-C approved `__i386__' symbol, vs. diff --git a/gcc/config/freebsd.h b/gcc/config/freebsd.h new file mode 100644 index 00000000000..461f69edf1b --- /dev/null +++ b/gcc/config/freebsd.h @@ -0,0 +1,141 @@ +/* Base configuration file for all FreeBSD targets. + Copyright (C) 1999 Free Software Foundation, Inc. + +This file is part of GNU CC. + +GNU CC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU CC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU CC; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* Common FreeBSD configuration. + All FreeBSD architectures should include this file, which will specify + their commonalities. + Adapted from gcc/config/i386/freebsd-elf.h by + David O'Brien . */ + + +/* This defines which switch letters take arguments. On FreeBSD, most of + the normal cases (defined in gcc.c) apply, and we also have -h* and + -z* options (for the linker) (coming from SVR4). + We also have -R (alias --rpath), no -z, --soname (-h), --assert etc. */ + +#define FBSD_SWITCH_TAKES_ARG(CHAR) \ + (DEFAULT_SWITCH_TAKES_ARG (CHAR) \ + || (CHAR) == 'h' \ + || (CHAR) == 'z' /* ignored by ld */ \ + || (CHAR) == 'R') + +#undef SWITCH_TAKES_ARG +#define SWITCH_TAKES_ARG(CHAR) (FBSD_SWITCH_TAKES_ARG(CHAR)) + +#define FBSD_WORD_SWITCH_TAKES_ARG(STR) \ + (DEFAULT_WORD_SWITCH_TAKES_ARG (STR) \ + || !strcmp ((STR), "rpath") || !strcmp ((STR), "rpath-link") \ + || !strcmp ((STR), "soname") || !strcmp ((STR), "defsym") \ + || !strcmp ((STR), "assert") || !strcmp ((STR), "dynamic-linker")) + +#undef WORD_SWITCH_TAKES_ARG +#define WORD_SWITCH_TAKES_ARG(STR) (FBSD_WORD_SWITCH_TAKES_ARG(STR)) + +/* Provide a CPP_SPEC appropriate for FreeBSD. We just deal with the GCC + option `-posix', and PIC issues. */ + +#undef CPP_SPEC +#define CPP_SPEC "%(cpp_cpu) \ + %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} \ + %{posix:-D_POSIX_SOURCE}" + +/* Provide a LIB_SPEC appropriate for FreeBSD. Just select the appropriate + libc, depending on whether we're doing profiling or need threads support. + (simular to the default, except no -lg, and no -p). */ + +#undef LIB_SPEC +#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}}}" + + +/* Code generation parameters. */ + +/* Make gcc agree with . */ + +#undef WCHAR_TYPE +#define WCHAR_TYPE "int" + +#undef WCHAR_UNSIGNED +#define WCHAR_UNSIGNED 0 + +/* Don't default to pcc-struct-return, because gcc is the only compiler, and + we want to retain compatibility with older gcc versions + (even though the SVR4 ABI for the i386 says that records and unions are + returned in memory). */ +#undef DEFAULT_PCC_STRUCT_RETURN +#define DEFAULT_PCC_STRUCT_RETURN 0 + +/* Ensure we the configuration knows our system correctly so we can link with + libraries compiled with the native cc. */ +#undef NO_DOLLAR_IN_LABEL + +/* Use more efficient ``thunks'' to implement C++ vtables. */ +#undef DEFAULT_VTABLE_THUNKS +#define DEFAULT_VTABLE_THUNKS 1 + +/* This is BSD, so use stabs instead of DWARF debug format. */ +#undef PREFERRED_DEBUGGING_TYPE +#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG + +/* Attach a special .ident directive to the end of the file to identify + the version of GCC which compiled this code. The format of the .ident + string is patterned after the ones produced by native SVR4 C compilers. */ +#undef IDENT_ASM_OP +#define IDENT_ASM_OP ".ident" + +/* Output #ident as a .ident. */ +#undef ASM_OUTPUT_IDENT +#define ASM_OUTPUT_IDENT(FILE, NAME) \ + fprintf ((FILE), "\t%s\t\"%s\"\n", IDENT_ASM_OP, (NAME)); + +#undef ASM_IDENTIFY_LANGUAGE +#define ASM_IDENTIFY_LANGUAGE(FILE) \ + fprintf ((FILE), "\t%s \"GCC (%s) %s\"\n", IDENT_ASM_OP, \ + lang_identify (), version_string) + +#undef ASM_FILE_END +#define ASM_FILE_END(FILE) \ +do { \ + if (!flag_no_ident) \ + fprintf ((FILE), "\t%s\t\"GCC: (GNU) %s\"\n", \ + IDENT_ASM_OP, version_string); \ + } while (0) + + +/* Miscellaneous parameters. */ + +/* Don't assume anything about the header files. */ +#undef NO_IMPLICIT_EXTERN_C +#define NO_IMPLICIT_EXTERN_C + +/* Allow #sccs in preprocessor. */ +#define SCCS_DIRECTIVE + +/* Handle #pragma weak and #pragma pack. */ +#define HANDLE_SYSV_PRAGMA + +/* Tell libgcc2.c that FreeBSD targets support atexit(3). */ +#define HAVE_ATEXIT diff --git a/gcc/config/i386/freebsd-elf.h b/gcc/config/i386/freebsd-elf.h index e97d4ca07bb..4c27dfa52e0 100644 --- a/gcc/config/i386/freebsd-elf.h +++ b/gcc/config/i386/freebsd-elf.h @@ -25,20 +25,6 @@ Boston, MA 02111-1307, USA. */ #undef TARGET_VERSION #define TARGET_VERSION fprintf (stderr, " (i386 FreeBSD/ELF)"); -/* The svr4 ABI for the i386 says that records and unions are returned - in memory. */ -/* On FreeBSD, we do not. */ -#undef DEFAULT_PCC_STRUCT_RETURN -#define DEFAULT_PCC_STRUCT_RETURN 0 - -/* This gets defined in tm.h->linux.h->svr4.h, and keeps us from using - libraries compiled with the native cc, so undef it. */ -#undef NO_DOLLAR_IN_LABEL - -/* Use more efficient ``thunks'' to implement C++ vtables. */ -#undef DEFAULT_VTABLE_THUNKS -#define DEFAULT_VTABLE_THUNKS 1 - /* Override the default comment-starter of "/". */ #undef ASM_COMMENT_START #define ASM_COMMENT_START "#" @@ -57,16 +43,12 @@ Boston, MA 02111-1307, USA. */ i386.md for an explanation of the expression this outputs. */ #undef ASM_OUTPUT_ADDR_DIFF_ELT #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \ - fprintf (FILE, "\t.long _GLOBAL_OFFSET_TABLE_+[.-%s%d]\n", LPREFIX, VALUE) + fprintf ((FILE), "\t.long _GLOBAL_OFFSET_TABLE_+[.-%s%d]\n", LPREFIX, VALUE) /* Indicate that jump tables go in the text section. This is necessary when compiling PIC code. */ #define JUMP_TABLES_IN_TEXT_SECTION (flag_pic) -/* Use stabs instead of DWARF debug format. */ -#undef PREFERRED_DEBUGGING_TYPE -#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG - /* Copy this from the svr4 specifications... */ /* Define the register numbers to be used in Dwarf debugging information. The SVR4 reference port C compiler uses the following register numbers @@ -141,44 +123,25 @@ Boston, MA 02111-1307, USA. */ #define FUNCTION_PROFILER(FILE, LABELNO) \ { \ if (flag_pic) \ - fprintf (FILE, "\tcall *.mcount@GOT(%%ebx)\n"); \ + fprintf ((FILE), "\tcall *.mcount@GOT(%%ebx)\n"); \ else \ - fprintf (FILE, "\tcall .mcount\n"); \ + fprintf ((FILE), "\tcall .mcount\n"); \ } +/* Make gcc agree with . */ + #undef SIZE_TYPE #define SIZE_TYPE "unsigned int" #undef PTRDIFF_TYPE #define PTRDIFF_TYPE "int" -#undef WCHAR_TYPE -#define WCHAR_TYPE "int" - -#undef WCHAR_UNSIGNED -#define WCHAR_UNSIGNED 0 - #undef WCHAR_TYPE_SIZE #define WCHAR_TYPE_SIZE BITS_PER_WORD #undef CPP_PREDEFINES #define CPP_PREDEFINES "-Di386 -Dunix -D__ELF__ -D__FreeBSD__ -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)" -#undef CPP_SPEC -#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}" - -/* This defines which switch letters take arguments. On FreeBSD, most of - the normal cases (defined in gcc.c) apply, and we also have -h* and - -z* options (for the linker) (comming from svr4). - We also have -R (alias --rpath), no -z, --soname (-h), --assert etc. */ - -#undef SWITCH_TAKES_ARG -#define SWITCH_TAKES_ARG(CHAR) \ - (DEFAULT_SWITCH_TAKES_ARG (CHAR) \ - || (CHAR) == 'h' \ - || (CHAR) == 'z' \ - || (CHAR) == 'R') - /* Provide a STARTFILE_SPEC appropriate for FreeBSD. Here we add the magical crtbegin.o file (see crtstuff.c) which provides part of the support for getting C++ file-scope static object constructed @@ -202,19 +165,6 @@ Boston, MA 02111-1307, USA. */ #define ENDFILE_SPEC \ "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s" -/* Provide a LIB_SPEC appropriate for FreeBSD. Just select the appropriate - libc, depending on whether we're doing profiling or need threads support. - (simular to the default, except no -lg, and no -p. */ - -#undef LIB_SPEC -#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}}}" - /* Provide a LINK_SPEC appropriate for FreeBSD. Here we provide support for the special GCC options -static and -shared, which allow us to link things in one of these three modes by applying the appropriate @@ -249,9 +199,9 @@ Boston, MA 02111-1307, USA. */ This is used to align code labels according to Intel recommendations. */ #ifdef HAVE_GAS_MAX_SKIP_P2ALIGN -#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP) \ - if ((LOG) != 0) {\ - if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \ - else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \ +#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE, LOG, MAX_SKIP) \ + if ((LOG) != 0) { \ + if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \ + else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \ } #endif diff --git a/gcc/config/i386/freebsd.h b/gcc/config/i386/freebsd.h index 40ca25e0f94..5492fd18678 100644 --- a/gcc/config/i386/freebsd.h +++ b/gcc/config/i386/freebsd.h @@ -29,9 +29,6 @@ Boston, MA 02111-1307, USA. */ #include "i386/gstabs.h" -/* Get perform_* macros to build libgcc.a. */ -#include "i386/perform.h" - /* This goes away when the math-emulator is fixed */ #undef TARGET_DEFAULT #define TARGET_DEFAULT \ diff --git a/gcc/configure b/gcc/configure index c894a5131f8..92bb397cdef 100755 --- a/gcc/configure +++ b/gcc/configure @@ -4051,7 +4051,7 @@ for machine in $build $host $target; do # use_collect2=yes ;; i[34567]86-*-freebsdelf*) - tm_file="i386/i386.h i386/att.h svr4.h i386/freebsd-elf.h i386/perform.h" + tm_file="i386/i386.h i386/att.h svr4.h freebsd.h i386/freebsd-elf.h i386/perform.h" extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o" tmake_file=t-freebsd gas=yes @@ -4065,7 +4065,7 @@ for machine in $build $host $target; do esac ;; i[34567]86-*-freebsd*) - tm_file=i386/freebsd.h + tm_file="i386/freebsd.h i386/perform.h" tmake_file=t-freebsd ;; i[34567]86-*-netbsd*) diff --git a/gcc/configure.in b/gcc/configure.in index 4ce212cac68..3599580fd77 100644 --- a/gcc/configure.in +++ b/gcc/configure.in @@ -1273,7 +1273,7 @@ changequote([,])dnl changequote(,)dnl i[34567]86-*-freebsdelf*) changequote([,])dnl - tm_file="i386/i386.h i386/att.h svr4.h i386/freebsd-elf.h i386/perform.h" + tm_file="i386/i386.h i386/att.h svr4.h freebsd.h i386/freebsd-elf.h i386/perform.h" extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o" tmake_file=t-freebsd gas=yes @@ -1289,7 +1289,7 @@ changequote([,])dnl changequote(,)dnl i[34567]86-*-freebsd*) changequote([,])dnl - tm_file=i386/freebsd.h + tm_file="i386/freebsd.h i386/perform.h" tmake_file=t-freebsd ;; changequote(,)dnl diff --git a/gcc/po/ChangeLog b/gcc/po/ChangeLog index 37471a7e419..f79ad9efb92 100644 --- a/gcc/po/ChangeLog +++ b/gcc/po/ChangeLog @@ -1,3 +1,7 @@ +Mon Nov 22 23:17:13 1999 Jeffrey A Law (law@cygnus.com) + + * POTFILES.in: Add config/freebsd.h + Sun Oct 31 17:17:18 1999 Jeffrey A Law (law@cygnus.com) * POTFILES.in: Add simplify-rtx.c diff --git a/gcc/po/POTFILES.in b/gcc/po/POTFILES.in index d136e6783d3..3e3c43cbf69 100644 --- a/gcc/po/POTFILES.in +++ b/gcc/po/POTFILES.in @@ -142,6 +142,7 @@ config/float-i64.h config/float-sh.h config/float-vax.h config/fp-bit.c +config/freebsd.h config/fx80/fx80.c config/fx80/fx80.h config/fx80/xm-fx80.h -- 2.30.2