OSDN Git Service

2001-11-20 David O'Brien <obrien@FreeBSD.org>
authorobrien <obrien@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 20 Nov 2001 19:43:28 +0000 (19:43 +0000)
committerobrien <obrien@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 20 Nov 2001 19:43:28 +0000 (19:43 +0000)
* config.gcc: Add FreeBSD/PowerPC target.
(powerpc64-*-linux*, powerpc-*-sysv*, powerpc-*-netbsd*,
powerpc-*-chorusos*, powerpc-*-eabiaix*, powerpc-*-eabisim*,
powerpc-*-elf*, powerpc-*-eabi*, powerpc-*-rtems*,
powerpc-*-linux*libc1, powerpc-*-linux*, powerpc-wrs-vxworks*,
powerpcle-wrs-vxworks*, powerpcle-*-sysv*, powerpcle-*-elf*,
powerpcle-*-eabisim*, powerpcle-*-eabi*, powerpcle-*-solaris2*): Add
freebsd-spec.h to tm_file.
(rs6000-*-lynxos*): Add lynx.h to tm_file.
* config/freebsd.h: Tidy up.
(USING_CONFIG_FREEBSD): Define.
(FBSD_SWITCH_TAKES_ARG, FBSD_WORD_SWITCH_TAKES_ARG,
FBSD_CPP_PREDEFINES, FBSD_CPP_SPEC, FBSD_STARTFILE_SPEC,
FBSD_ENDFILE_SPEC, FBSD_LIB_SPEC): Remove (moved to freebsd-spec.h).
(TARGET_HAS_F_SETLKW): Define.
(ASM_OUTPUT_IDENT): Delete, the elfos.h definition is fine.
* config/freebsd-spec.h: New file.
* config/rs6000/freebsd.h: New file.
* config/rs6000/rs6000.h (TARGET_VERSION): Do not define.
* config/rs6000/rs6000.c: Test for USING_ELFOS_H rather than
USING_SVR4_H to know when to turn on ELF support.
* config/rs6000/sysv4.h (TARGET_VERSION, CPP_PREDEFINES): Don't undef,
define only if not already defined.
Add FreeBSD support.
* config/rs6000/aix.h (TARGET_VERSION): Define.
* config/rs6000/beos.h: Likewise.
* config/rs6000/darwin.h: Likewise.
* config/rs6000/mach.h: Likewise.
* config/rs6000/lynx.h (TARGET_VERSION): Likewise.
Don't include lynx.h directly.

Approved by:  Geoff Keating <geoffk@geoffk.org>
              Message-Id: <200111192053.MAA11977@geoffk.org>
  Stan Shebs <shebs@apple.com>  (Darwin bits)
              Message-ID: <3BF95F29.794BC924@apple.com>

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47223 138bc75d-0d04-0410-961f-82ee72b054a4

12 files changed:
gcc/ChangeLog
gcc/config.gcc
gcc/config/freebsd.h
gcc/config/rs6000/aix.h
gcc/config/rs6000/beos.h
gcc/config/rs6000/darwin.h
gcc/config/rs6000/freebsd.h [new file with mode: 0644]
gcc/config/rs6000/lynx.h
gcc/config/rs6000/mach.h
gcc/config/rs6000/rs6000.c
gcc/config/rs6000/rs6000.h
gcc/config/rs6000/sysv4.h

index 9e8e999..2744c43 100644 (file)
@@ -1,3 +1,36 @@
+2001-11-20  David O'Brien  <obrien@FreeBSD.org>
+
+       * config.gcc: Add FreeBSD/PowerPC target.
+       (powerpc64-*-linux*, powerpc-*-sysv*, powerpc-*-netbsd*,
+       powerpc-*-chorusos*, powerpc-*-eabiaix*, powerpc-*-eabisim*,
+       powerpc-*-elf*, powerpc-*-eabi*, powerpc-*-rtems*,
+       powerpc-*-linux*libc1, powerpc-*-linux*, powerpc-wrs-vxworks*,
+       powerpcle-wrs-vxworks*, powerpcle-*-sysv*, powerpcle-*-elf*,
+       powerpcle-*-eabisim*, powerpcle-*-eabi*, powerpcle-*-solaris2*): Add
+       freebsd-spec.h to tm_file.
+       (rs6000-*-lynxos*): Add lynx.h to tm_file.
+       * config/freebsd.h: Tidy up.
+       (USING_CONFIG_FREEBSD): Define.
+       (FBSD_SWITCH_TAKES_ARG, FBSD_WORD_SWITCH_TAKES_ARG,
+       FBSD_CPP_PREDEFINES, FBSD_CPP_SPEC, FBSD_STARTFILE_SPEC,
+       FBSD_ENDFILE_SPEC, FBSD_LIB_SPEC): Remove (moved to freebsd-spec.h).
+       (TARGET_HAS_F_SETLKW): Define.
+       (ASM_OUTPUT_IDENT): Delete, the elfos.h definition is fine.
+       * config/freebsd-spec.h: New file.
+       * config/rs6000/freebsd.h: New file.
+       * config/rs6000/rs6000.h (TARGET_VERSION): Do not define.
+       * config/rs6000/rs6000.c: Test for USING_ELFOS_H rather than
+       USING_SVR4_H to know when to turn on ELF support.
+       * config/rs6000/sysv4.h (TARGET_VERSION, CPP_PREDEFINES): Don't undef,
+       define only if not already defined.
+       Add FreeBSD support.
+       * config/rs6000/aix.h (TARGET_VERSION): Define.
+       * config/rs6000/beos.h: Likewise.
+       * config/rs6000/darwin.h: Likewise.
+       * config/rs6000/mach.h: Likewise.
+       * config/rs6000/lynx.h (TARGET_VERSION): Likewise.
+       Don't include lynx.h directly.
+
 2001-11-20  Graham Stott  <grahams@redhat.com>
 
        * unwind-dw2-fde.c (__deregister_frame_info_bases):
index 96609c9..7a87a96 100644 (file)
@@ -320,7 +320,7 @@ case $machine in
        # entries of tm_file with the minor exception that components
        # of the tm_file set here will always be of the form:
        #
-       # freebsd<version_number>.h [freebsd-<conf_option>.h ...] freebsd.h
+       # freebsd<version_number>.h [freebsd-<conf_option>.h ...] freebsd-spec.h freebsd.h
        #
        # The machine-specific section should not tamper with this
        # ordering but may order all other entries of tm_file as it
@@ -2600,7 +2600,7 @@ powerpc-*-openbsd*)
        tmake_file="${tmake_file} rs6000/t-rs6000 rs6000/t-openbsd"
        ;;
 powerpc64-*-linux*)
-       tm_file="${tm_file} elfos.h svr4.h rs6000/sysv4.h rs6000/linux64.h"
+       tm_file="${tm_file} elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/linux64.h"
        out_file=rs6000/rs6000.c
        tmake_file="rs6000/t-ppcos t-slibgcc-elf-ver t-linux rs6000/t-ppccomm"
        extra_headers=ppc-asm.h
@@ -2626,21 +2626,28 @@ powerpc-*-darwin*)
        # Darwin linker does collect2 functionality
        use_collect2=no
        ;;
+powerpc*-*-freebsd*)
+       tm_file="${tm_file} elfos.h ${fbsd_tm_file} rs6000/sysv4.h rs6000/freebsd.h"
+       xm_file=rs6000/xm-sysv4.h
+       out_file=rs6000/rs6000.c
+       tmake_file="rs6000/t-ppcos t-freebsd rs6000/t-ppccomm"
+       extra_headers=ppc-asm.h
+       ;;
 powerpc-*-sysv*)
-       tm_file="${tm_file} elfos.h svr4.h rs6000/sysv4.h"
+       tm_file="${tm_file} elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h"
        xm_defines=POSIX
        extra_headers=ppc-asm.h
        tmake_file="rs6000/t-ppcos rs6000/t-ppccomm"
        ;;
 powerpc-*-netbsd*)
        xm_defines=POSIX
-       tm_file="${tm_file} elfos.h svr4.h rs6000/sysv4.h rs6000/netbsd.h"
+       tm_file="${tm_file} elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/netbsd.h"
        tmake_file="rs6000/t-ppcos rs6000/t-ppccomm"
        extra_headers=ppc-asm.h
        ;;
 powerpc-*-chorusos*)
        xm_defines=POSIX
-       tm_file="${tm_file} elfos.h svr4.h rs6000/sysv4.h chorus.h"
+       tm_file="${tm_file} elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h chorus.h"
        tmake_file="rs6000/t-ppcos rs6000/t-ppccomm"
        extra_headers=ppc-asm.h
        case x${enable_threads} in
@@ -2651,31 +2658,31 @@ powerpc-*-chorusos*)
        ;;
 powerpc-*-eabiaix*)
        xm_defines=POSIX
-       tm_file="${tm_file} elfos.h svr4.h rs6000/sysv4.h rs6000/eabi.h rs6000/eabiaix.h"
+       tm_file="${tm_file} elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/eabi.h rs6000/eabiaix.h"
        tmake_file="rs6000/t-ppcgas rs6000/t-ppccomm"
        extra_headers=ppc-asm.h
        ;;
 powerpc-*-eabisim*)
        xm_defines=POSIX
-       tm_file="${tm_file} elfos.h svr4.h rs6000/sysv4.h rs6000/eabi.h rs6000/eabisim.h"
+       tm_file="${tm_file} elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/eabi.h rs6000/eabisim.h"
        tmake_file="rs6000/t-ppcgas rs6000/t-ppccomm"
        extra_headers=ppc-asm.h
        ;;
 powerpc-*-elf*)
        xm_defines=POSIX
-       tm_file="${tm_file} elfos.h svr4.h rs6000/sysv4.h"
+       tm_file="${tm_file} elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h"
        tmake_file="rs6000/t-ppcgas rs6000/t-ppccomm"
        extra_headers=ppc-asm.h
        ;;
 powerpc-*-eabi*)
        xm_defines=POSIX
-       tm_file="${tm_file} elfos.h svr4.h rs6000/sysv4.h rs6000/eabi.h"
+       tm_file="${tm_file} elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/eabi.h"
        tmake_file="rs6000/t-ppcgas rs6000/t-ppccomm"
        extra_headers=ppc-asm.h
        ;;
 powerpc-*-rtems*)
        xm_defines=POSIX
-       tm_file="${tm_file} elfos.h svr4.h rs6000/sysv4.h rs6000/eabi.h rtems.h rs6000/rtems.h"
+       tm_file="${tm_file} elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/eabi.h rtems.h rs6000/rtems.h"
        tmake_file="rs6000/t-ppcgas t-rtems rs6000/t-ppccomm"
        extra_headers=ppc-asm.h
        if test x$enable_threads = xyes; then
@@ -2683,7 +2690,7 @@ powerpc-*-rtems*)
        fi
        ;;
 powerpc-*-linux*libc1)
-       tm_file="${tm_file} elfos.h svr4.h rs6000/sysv4.h rs6000/linux.h"
+       tm_file="${tm_file} elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/linux.h"
        out_file=rs6000/rs6000.c
        tmake_file="rs6000/t-ppcos t-slibgcc-elf-ver t-linux t-linux-gnulibc1 rs6000/t-ppccomm"
        extra_headers=ppc-asm.h
@@ -2692,7 +2699,7 @@ powerpc-*-linux*libc1)
        fi
        ;;
 powerpc-*-linux*)
-       tm_file="${tm_file} elfos.h svr4.h rs6000/sysv4.h rs6000/linux.h"
+       tm_file="${tm_file} elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/linux.h"
        out_file=rs6000/rs6000.c
        tmake_file="rs6000/t-ppcos t-slibgcc-elf-ver t-linux rs6000/t-ppccomm"
        extra_headers=ppc-asm.h
@@ -2702,44 +2709,44 @@ powerpc-*-linux*)
        ;;
 powerpc-wrs-vxworks*)
        xm_defines=POSIX
-        tm_file="${tm_file} elfos.h svr4.h rs6000/sysv4.h rs6000/vxppc.h"
+        tm_file="${tm_file} elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/vxppc.h"
         tmake_file="rs6000/t-ppcgas rs6000/t-ppccomm"
        extra_headers=ppc-asm.h
        thread_file='vxworks'
         ;;
 powerpcle-wrs-vxworks*)
        xm_defines=POSIX
-        tm_file="${tm_file} elfos.h svr4.h rs6000/sysv4.h rs6000/sysv4le.h rs6000/vxppc.h"
+        tm_file="${tm_file} elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/sysv4le.h rs6000/vxppc.h"
         tmake_file="rs6000/t-ppcgas rs6000/t-ppccomm"
        extra_headers=ppc-asm.h
        thread_file='vxworks'
         ;;
 powerpcle-*-sysv*)
-       tm_file="${tm_file} elfos.h svr4.h rs6000/sysv4.h rs6000/sysv4le.h"
+       tm_file="${tm_file} elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/sysv4le.h"
        xm_defines=POSIX
        tmake_file="rs6000/t-ppcos rs6000/t-ppccomm"
        extra_headers=ppc-asm.h
        ;;
 powerpcle-*-elf*)
        xm_defines=POSIX
-       tm_file="${tm_file} elfos.h svr4.h rs6000/sysv4.h rs6000/sysv4le.h"
+       tm_file="${tm_file} elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/sysv4le.h"
        tmake_file="rs6000/t-ppcgas rs6000/t-ppccomm"
        extra_headers=ppc-asm.h
        ;;
 powerpcle-*-eabisim*)
        xm_defines=POSIX
-       tm_file="${tm_file} elfos.h svr4.h rs6000/sysv4.h rs6000/sysv4le.h rs6000/eabi.h rs6000/eabisim.h"
+       tm_file="${tm_file} elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/sysv4le.h rs6000/eabi.h rs6000/eabisim.h"
        tmake_file="rs6000/t-ppcgas rs6000/t-ppccomm"
        extra_headers=ppc-asm.h
        ;;
 powerpcle-*-eabi*)
        xm_defines=POSIX
-       tm_file="${tm_file} elfos.h svr4.h rs6000/sysv4.h rs6000/sysv4le.h rs6000/eabi.h"
+       tm_file="${tm_file} elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/sysv4le.h rs6000/eabi.h"
        tmake_file="rs6000/t-ppcgas rs6000/t-ppccomm"
        extra_headers=ppc-asm.h
        ;;
 powerpcle-*-solaris2*)
-       tm_file="${tm_file} elfos.h svr4.h rs6000/sysv4.h rs6000/sysv4le.h rs6000/sol2.h"
+       tm_file="${tm_file} elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/sysv4le.h rs6000/sol2.h"
        xm_defines=POSIX
        tmake_file="rs6000/t-ppcos rs6000/t-ppccomm"
        extra_headers=ppc-asm.h
@@ -2798,7 +2805,7 @@ rs6000-*-mach*)
        use_collect2=yes
        ;;
 rs6000-*-lynxos*)
-       tm_file=rs6000/lynx.h
+       tm_file="lynx.h rs6000/lynx.h"
        tmake_file=rs6000/t-rs6000
        use_collect2=yes
        ;;
index 779b7e9..e618beb 100644 (file)
@@ -27,139 +27,31 @@ Boston, MA 02111-1307, USA.  */
    Loren J. Rittle <ljrittle@acm.org>.  */
 
 
-/* To help with rs6000/sysv4.h carnal knowledge problem.  */
-#define _USING_CONFIG_FREEBSD 1
+/* In case we need to know.  */
+#define USING_CONFIG_FREEBSD 1
 
 /* 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))
 
-/* This defines which multi-letter switches take arguments.  */
-
-#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))
 
-#if FBSD_MAJOR == 6
-#define FBSD_CPP_PREDEFINES \
-  "-D__FreeBSD__=6 -Dunix -D__ELF__ -D__KPRINTF_ATTRIBUTE__ -Asystem=unix -Asystem=bsd -Asystem=FreeBSD"
-#endif
-
-#if FBSD_MAJOR == 5
-#define FBSD_CPP_PREDEFINES \
-  "-D__FreeBSD__=5 -Dunix -D__ELF__ -D__KPRINTF_ATTRIBUTE__ -Asystem=unix -Asystem=bsd -Asystem=FreeBSD"
-#endif
-
-#if FBSD_MAJOR == 4
-#define FBSD_CPP_PREDEFINES \
-  "-D__FreeBSD__=4 -Dunix -D__ELF__ -D__KPRINTF_ATTRIBUTE__ -Asystem=unix -Asystem=bsd -Asystem=FreeBSD"
-#endif
-
-#if FBSD_MAJOR == 3
-#define FBSD_CPP_PREDEFINES \
-  "-D__FreeBSD__=3 -Dunix -D__ELF__ -D__KPRINTF_ATTRIBUTE__ -Asystem=unix -Asystem=bsd -Asystem=FreeBSD"
-#endif
-
-#ifndef FBSD_CPP_PREDEFINES
-#define FBSD_CPP_PREDEFINES \
-  "-D__FreeBSD__   -Dunix -D__ELF__ -D__KPRINTF_ATTRIBUTE__ -Asystem=unix -Asystem=bsd -Asystem=FreeBSD"
-#endif
-
 #undef  CPP_PREDEFINES
 #define CPP_PREDEFINES FBSD_CPP_PREDEFINES
 
-/* Provide a CPP_SPEC appropriate for FreeBSD.  We just deal with the GCC 
-   option `-posix', and PIC issues.  */
-
-#define FBSD_CPP_SPEC "                                                        \
-  %(cpp_cpu)                                                           \
-  %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__}              \
-  %{posix:-D_POSIX_SOURCE}"
-
 #undef  CPP_SPEC
 #define CPP_SPEC FBSD_CPP_SPEC
 
-/* 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 
-       before entering `main'. */
-   
-#define FBSD_STARTFILE_SPEC \
-  "%{!shared: \
-     %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
-                      %{!p:%{profile:gcrt1.o%s} \
-                        %{!profile:crt1.o%s}}}} \
-   crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
-
-/* Provide a ENDFILE_SPEC appropriate for FreeBSD.  Here we tack on
-   the magical crtend.o file (see crtstuff.c) which provides part of 
-       the support for getting C++ file-scope static object constructed 
-       before entering `main', followed by a normal "finalizer" file, 
-       `crtn.o'.  */
-
-#define FBSD_ENDFILE_SPEC \
-  "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
-
-/* Provide a LIB_SPEC appropriate for FreeBSD as configured and as
-   required by the user-land thread model.  Before __FreeBSD_version
-   500016, select the appropriate libc, depending on whether we're
-   doing profiling or need threads support.  At __FreeBSD_version
-   500016 and later, when threads support is requested include both
-   -lc and -lc_r instead of only -lc_r.  To make matters interesting,
-   we can't actually use __FreeBSD_version provided by <osreldate.h>
-   directly since it breaks cross-compiling.  As a final twist, make
-   it a hard error if -pthread is provided on the command line and gcc
-   was configured with --disable-threads (this will help avoid bug
-   reports from users complaining about threading when they
-   misconfigured the gcc bootstrap but are later consulting FreeBSD
-   manual pages that refer to the mythical -pthread option).  */
-
-/* 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).  */
-
-#ifdef FBSD_NO_THREADS
-#define FBSD_LIB_SPEC "                                                        \
-  %{pthread: %eThe -pthread option is only supported on FreeBSD when gcc \
-is built with the --enable-threads configure-time option.}             \
-  %{!shared:                                                           \
-    %{!pg: -lc}                                                                \
-    %{pg:  -lc_p}                                                      \
-  }"
-#else
-#if FBSD_MAJOR >= 5
-#define FBSD_LIB_SPEC "                                                        \
-  %{!shared:                                                           \
-    %{!pg: %{pthread:-lc_r} -lc}                                       \
-    %{pg:  %{pthread:-lc_r_p} -lc_p}                                   \
-  }"
-#else
-#define FBSD_LIB_SPEC "                                                        \
-  %{!shared:                                                           \
-    %{!pg:                                                             \
-      %{!pthread:-lc}                                                  \
-      %{pthread:-lc_r}}                                                        \
-    %{pg:                                                              \
-      %{!pthread:-lc_p}                                                        \
-      %{pthread:-lc_r_p}}                                              \
-  }"
-#endif
-#endif
+#undef  STARTFILE_SPEC
+#define STARTFILE_SPEC FBSD_STARTFILE_SPEC
+
+#undef  ENDFILE_SPEC
+#define ENDFILE_SPEC FBSD_ENDFILE_SPEC
 
 #undef  LIB_SPEC
 #define LIB_SPEC FBSD_LIB_SPEC
@@ -197,6 +89,11 @@ is built with the --enable-threads configure-time option.}          \
    with libraries compiled with the native cc.  */
 #undef NO_DOLLAR_IN_LABEL
 
+/* Used by libgcc2.c.  We support file locking with fcntl / F_SETLKW.
+   This enables the test coverage code to use file locking when exiting a
+   program, which avoids race conditions if the program has forked.  */
+#define TARGET_HAS_F_SETLKW
+
 /* The prefix to add to user-visible assembler symbols.
    For System V Release 4 & ELF the convention is *not* to prepend a leading
    underscore onto user-level symbol names. Some CPU files such as
@@ -214,12 +111,6 @@ is built with the --enable-threads configure-time option.}         \
 #undef  IDENT_ASM_OP
 #define IDENT_ASM_OP "\t.ident\t"
 
-/* Output #ident as a .ident.  */
-
-#undef  ASM_OUTPUT_IDENT
-#define ASM_OUTPUT_IDENT(FILE, NAME)                                   \
-  fprintf ((FILE), "%s\"%s\"\n", IDENT_ASM_OP, (NAME));
-
 /************************[  Debugger stuff  ]*********************************/
 
 /* All ELF targets can support DWARF-2.  */
index ae3b9c6..2738a37 100644 (file)
@@ -189,3 +189,6 @@ Boston, MA 02111-1307, USA.  */
 #define SETUP_FRAME_ADDRESSES() rs6000_aix_emit_builtin_unwind_init ()
 
 #define PROFILE_HOOK(LABEL)   output_profile_hook (LABEL)
+
+/* Print subsidiary information on the compiler version in use.  */
+#define TARGET_VERSION ;
index 60bb75c..cb2fb5b 100644 (file)
@@ -20,6 +20,8 @@ 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.  */
 
+#undef  TARGET_VERSION
+#define TARGET_VERSION fprintf (stderr, " (BeOS/PowerPC)");
 
 /* Enable AIX XL compiler calling convention breakage compatibility.  */
 #define MASK_XL_CALL           0x40000000
index dfc6280..3d4f376 100644 (file)
@@ -19,6 +19,9 @@ 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.  */
 
+#undef  TARGET_VERSION
+#define TARGET_VERSION fprintf (stderr, " (Darwin/PowerPC)");
+
 /* The "Darwin ABI" is mostly like AIX, but with some key differences.  */
 
 #define DEFAULT_ABI ABI_DARWIN
diff --git a/gcc/config/rs6000/freebsd.h b/gcc/config/rs6000/freebsd.h
new file mode 100644 (file)
index 0000000..1f2850a
--- /dev/null
@@ -0,0 +1,66 @@
+/* Definitions for PowerPC running FreeBSD using the ELF format
+   Copyright (C) 2001 Free Software Foundation, Inc.
+   Contributed by David E. O'Brien <obrien@FreeBSD.org> and BSDi.
+
+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, 675 Mass Ave, Cambridge, MA 02139, USA.  */
+
+/* Override the defaults, which exist to force the proper definition. */
+
+#undef CPP_OS_DEFAULT_SPEC
+#define CPP_OS_DEFAULT_SPEC "%(cpp_os_freebsd)"
+
+#undef STARTFILE_DEFAULT_SPEC
+#define STARTFILE_DEFAULT_SPEC "%(startfile_freebsd)"
+
+#undef ENDFILE_DEFAULT_SPEC
+#define ENDFILE_DEFAULT_SPEC "%(endfile_freebsd)"
+
+#undef LIB_DEFAULT_SPEC
+#define LIB_DEFAULT_SPEC "%(lib_freebsd)"
+
+#undef LINK_START_DEFAULT_SPEC
+#define LINK_START_DEFAULT_SPEC "%(link_start_freebsd)"
+
+#undef LINK_OS_DEFAULT_SPEC
+#define        LINK_OS_DEFAULT_SPEC "%(link_os_freebsd)"
+
+
+/************************[  Target stuff  ]***********************************/
+
+/* Define the actual types of some ANSI-mandated types.  
+   Needs to agree with <machine/ansi.h>.  GCC defaults come from c-decl.c,
+   c-common.c, and config/<arch>/<arch>.h.  */
+
+/* rs6000.h gets this wrong for FreeBSD.  We use the GCC defaults instead.  */
+#undef WCHAR_TYPE
+
+#undef  WCHAR_UNSIGNED
+#define WCHAR_UNSIGNED 0
+
+#undef  WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE 32
+
+#undef  TARGET_VERSION
+#define TARGET_VERSION fprintf (stderr, " (FreeBSD/PowerPC ELF)");
+
+/* Override rs6000.h definition.  */
+#undef  ASM_APP_ON
+#define ASM_APP_ON "#APP\n"
+
+/* Override rs6000.h definition.  */
+#undef  ASM_APP_OFF
+#define ASM_APP_OFF "#NO_APP\n"
index 9c84366..5a859ca 100644 (file)
@@ -19,8 +19,6 @@ 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.  */
 
-#include <lynx.h>
-
 /* Definitions we want to override with those from rs6000.h: */
 #undef LIB_SPEC
 #undef PTRDIFF_TYPE
@@ -47,6 +45,9 @@ Boston, MA 02111-1307, USA.  */
 
 #include <rs6000/rs6000.h>
 
+/* Print subsidiary information on the compiler version in use.  */
+#define TARGET_VERSION fprintf (stderr, " (LynxOS-RS/6000)");
+
 /* LynxOS has signed chars, regardless of what most R/S 6000 systems do */
 #undef DEFAULT_SIGNED_CHAR
 #define DEFAULT_SIGNED_CHAR 1
index 453fe77..d4395d5 100644 (file)
@@ -22,6 +22,9 @@ Boston, MA 02111-1307, USA.  */
 
 #define TARGET_AIX 0
 
+/* Print subsidiary information on the compiler version in use.  */
+#define TARGET_VERSION fprintf (stderr, " (Mach-RS/6000)");
+
 /* We don't define AIX under MACH; instead we define `unix'.  */
 #undef CPP_PREDEFINES
 #define CPP_PREDEFINES "-Drios -D_IBMR2 -Dunix -Asystem=unix -Asystem=mach -Acpu=rs6000 -Amachine=rs6000"
index d9b3e09..b2bb934 100644 (file)
@@ -80,7 +80,7 @@ int rs6000_compare_fp_p;
    get the address of the GOT section */
 int rs6000_pic_labelno;
 
-#ifdef USING_SVR4_H
+#ifdef USING_ELFOS_H
 /* Which abi to adhere to */
 const char *rs6000_abi_name = RS6000_ABI_NAME;
 
@@ -540,7 +540,7 @@ rs6000_file_start (file, default_cpu)
            }
        }
 
-#ifdef USING_SVR4_H
+#ifdef USING_ELFOS_H
       switch (rs6000_sdata)
        {
        case SDATA_NONE: fprintf (file, "%s -msdata=none", start); start = ""; break;
@@ -8849,7 +8849,7 @@ rs6000_longcall_ref (call_ref)
    Do not define this macro if you put all constants in the read-only
    data section.  */
 
-#ifdef USING_SVR4_H
+#ifdef USING_ELFOS_H
 
 void
 rs6000_select_rtx_section (mode, x)
@@ -9055,7 +9055,7 @@ rs6000_encode_section_info (decl)
     }
 }
 
-#endif /* USING_SVR4_H */
+#endif /* USING_ELFOS_H */
 
 \f
 /* Return a REG that occurs in ADDR with coefficient 1.
index 94aa09e..b2401d9 100644 (file)
@@ -41,9 +41,6 @@ Boston, MA 02111-1307, USA.  */
 #define TARGET_AIX 0
 #endif
 
-/* Print subsidiary information on the compiler version in use.  */
-#define TARGET_VERSION ;
-
 /* Default string to use for cpu if not specified.  */
 #ifndef TARGET_CPU_DEFAULT
 #define TARGET_CPU_DEFAULT ((char *)0)
index 99e4c27..c4f7e92 100644 (file)
@@ -194,6 +194,8 @@ do {                                                                        \
     }                                                                  \
   else if (!strcmp (rs6000_abi_name, "aixdesc"))                       \
     rs6000_current_abi = ABI_AIX;                                      \
+  else if (!strcmp (rs6000_abi_name, "freebsd"))                       \
+    rs6000_current_abi = ABI_V4;                                       \
   else if (!strcmp (rs6000_abi_name, "linux"))                         \
     rs6000_current_abi = ABI_V4;                                       \
   else if (!strcmp (rs6000_abi_name, "netbsd"))                                \
@@ -917,12 +919,14 @@ do {                                              \
 
 /* This is the end of what might become sysv4dbx.h.  */
 
-/* Override rs6000.h definition.  */
-#undef TARGET_VERSION
+#ifndef        TARGET_VERSION
 #define        TARGET_VERSION fprintf (stderr, " (PowerPC System V.4)");
+#endif
 \f
+#ifndef        CPP_PREDEFINES
 #define        CPP_PREDEFINES \
   "-DPPC -Dunix -D__svr4__ -Asystem=unix -Asystem=svr4 -Acpu=powerpc -Amachine=powerpc"
+#endif
 
 /* Pass various options to the assembler.  */
 /* Override svr4.h definition.  */
@@ -935,9 +939,11 @@ do {                                               \
 %{mlittle} %{mlittle-endian} %{mbig} %{mbig-endian} \
 %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
     %{mcall-solaris: -mlittle -msolaris} \
+    %{mcall-freebsd: -mbig} \
     %{mcall-i960-old: -mlittle} \
     %{mcall-linux: -mbig} \
-    %{mcall-netbsd: -mbig} }}}}"
+    %{mcall-netbsd: -mbig} \
+}}}}"
 
 #define        CC1_ENDIAN_BIG_SPEC ""
 
@@ -956,13 +962,14 @@ do {                                              \
 %{mbig: %(cc1_endian_big)} %{!mbig: %{mbig-endian: %(cc1_endian_big)}} \
 %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
     %{mcall-aixdesc: -mbig %(cc1_endian_big) } \
+    %{mcall-freebsd: -mbig %(cc1_endian_big) } \
     %{mcall-solaris: -mlittle %(cc1_endian_little) } \
     %{mcall-i960-old: -mlittle %(cc1_endian_little) } \
     %{mcall-linux: -mbig %(cc1_endian_big) } \
     %{mcall-netbsd: -mbig %(cc1_endian_big) } \
-    %{!mcall-aixdesc: %{!mcall-solaris: %{!mcall-i960-old: %{!mcall-linux: %{!mcall-netbsd: \
+    %{!mcall-aixdesc: %{!mcall-freebsd: %{!mcall-solaris: %{!mcall-i960-old: %{!mcall-linux: %{!mcall-netbsd: \
            %(cc1_endian_default) \
-    }}}}} \
+    }}}}}} \
 }}}} \
 %{mcall-solaris: -mregnames } \
 %{mno-sdata: -msdata=none } \
@@ -970,6 +977,7 @@ do {                                                \
 %{!meabi: %{!mno-eabi: \
     %{mrelocatable: -meabi } \
     %{mcall-solaris: -mno-eabi } \
+    %{mcall-freebsd: -mno-eabi } \
     %{mcall-i960-old: -meabi } \
     %{mcall-linux: -mno-eabi } \
     %{mcall-netbsd: -mno-eabi }}} \
@@ -1000,10 +1008,11 @@ do {                                            \
 %{myellowknife: %(link_start_yellowknife) } \
 %{mmvme: %(link_start_mvme) } \
 %{msim: %(link_start_sim) } \
+%{mcall-freebsd: %(link_start_freebsd) } \
 %{mcall-linux: %(link_start_linux) } \
 %{mcall-netbsd: %(link_start_netbsd) } \
 %{mcall-solaris: %(link_start_solaris) } \
-%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-netbsd: %{!mcall-solaris: %(link_start_default) }}}}}}}"
+%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-freebsd: %{!mcall-linux: %{!mcall-netbsd: %{!mcall-solaris: %(link_start_default) }}}}}}}}"
 
 #define LINK_START_DEFAULT_SPEC ""
 
@@ -1056,10 +1065,11 @@ do {                                            \
 %{myellowknife: %(link_os_yellowknife) } \
 %{mmvme: %(link_os_mvme) } \
 %{msim: %(link_os_sim) } \
+%{mcall-freebsd: %(link_os_freebsd) } \
 %{mcall-linux: %(link_os_linux) } \
 %{mcall-netbsd: %(link_os_netbsd) } \
 %{mcall-solaris: %(link_os_solaris) } \
-%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-netbsd: %{!mcall-solaris: %(link_os_default) }}}}}}}"
+%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-freebsd: %{!mcall-linux: %{!mcall-netbsd: %{!mcall-solaris: %(link_os_default) }}}}}}}}"
 
 #define LINK_OS_DEFAULT_SPEC ""
 
@@ -1105,11 +1115,12 @@ do {                                            \
 %{mbig-endian: %(cpp_endian_big) } \
 %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
     %{mcall-solaris: %(cpp_endian_solaris) } \
+    %{mcall-freebsd: %(cpp_endian_big) } \
     %{mcall-linux: %(cpp_endian_big) } \
     %{mcall-netbsd: %(cpp_endian_big) } \
     %{mcall-i960-old: %(cpp_endian_little) } \
     %{mcall-aixdesc:  %(cpp_endian_big) } \
-    %{!mcall-solaris: %{!mcall-linux: %{!mcall-netbsd: %{!mcall-aixdesc: %(cpp_endian_default) }}}}}}}}"
+    %{!mcall-solaris: %{!mcall-linux: %{!mcall-freebsd: %{!mcall-netbsd: %{!mcall-aixdesc: %(cpp_endian_default) }}}}}}}}}"
 
 #define        CPP_ENDIAN_DEFAULT_SPEC "%(cpp_endian_big)"
 
@@ -1120,10 +1131,11 @@ do {                                            \
 %{myellowknife: %(cpp_os_yellowknife) } \
 %{mmvme: %(cpp_os_mvme) } \
 %{msim: %(cpp_os_sim) } \
+%{mcall-freebsd: %(cpp_os_freebsd) } \
 %{mcall-linux: %(cpp_os_linux) } \
 %{mcall-netbsd: %(cpp_os_netbsd) } \
 %{mcall-solaris: %(cpp_os_solaris) } \
-%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-netbsd: %{!mcall-solaris: %(cpp_os_default) }}}}}}}"
+%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-freebsd: %{!mcall-linux: %{!mcall-netbsd: %{!mcall-solaris: %(cpp_os_default) }}}}}}}}"
 
 #define        CPP_OS_DEFAULT_SPEC ""
 
@@ -1134,10 +1146,11 @@ do {                                            \
 %{myellowknife: %(startfile_yellowknife) } \
 %{mmvme: %(startfile_mvme) } \
 %{msim: %(startfile_sim) } \
+%{mcall-freebsd: %(startfile_freebsd) } \
 %{mcall-linux: %(startfile_linux) } \
 %{mcall-netbsd: %(startfile_netbsd) } \
 %{mcall-solaris: %(startfile_solaris) } \
-%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-netbsd: %{!mcall-solaris: %(startfile_default) }}}}}}}"
+%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-freebsd: %{!mcall-linux: %{!mcall-netbsd: %{!mcall-solaris: %(startfile_default) }}}}}}}}"
 
 #define        STARTFILE_DEFAULT_SPEC ""
 
@@ -1148,10 +1161,11 @@ do {                                            \
 %{myellowknife: %(lib_yellowknife) } \
 %{mmvme: %(lib_mvme) } \
 %{msim: %(lib_sim) } \
+%{mcall-freebsd: %(lib_freebsd) } \
 %{mcall-linux: %(lib_linux) } \
 %{mcall-netbsd: %(lib_netbsd) } \
 %{mcall-solaris: %(lib_solaris) } \
-%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-netbsd: %{!mcall-solaris: %(lib_default) }}}}}}}"
+%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-freebsd: %%{!mcall-linux: %{!mcall-netbsd: %{!mcall-solaris: %(lib_default) }}}}}}}}"
 
 #define LIB_DEFAULT_SPEC ""
 
@@ -1162,11 +1176,12 @@ do {                                            \
 %{myellowknife: %(endfile_yellowknife)} \
 %{mmvme: %(endfile_mvme)} \
 %{msim: %(endfile_sim)} \
+%{mcall-freebsd: %(endfile_freebsd) } \
 %{mcall-linux: %(endfile_linux) } \
 %{mcall-netbsd: %(endfile_netbsd) } \
 %{mcall-solaris: %(endfile_solaris)} \
 %{mvxworks: %(endfile_vxworks) } \
-%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-netbsd: %{!mcall-solaris: %{!mvxworks: %(endfile_default) }}}}}}}}"
+%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-freebsd: %{!mcall-linux: %{!mcall-netbsd: %{!mcall-solaris: %{!mvxworks: %(endfile_default) }}}}}}}}}"
 
 #define        ENDFILE_DEFAULT_SPEC ""
 
@@ -1222,6 +1237,20 @@ do {                                             \
 
 #define CPP_OS_SIM_SPEC ""
 
+/* FreeBSD support.  */
+
+#define CPP_OS_FREEBSD_SPEC    "\
+  -D__PPC__ -D__ppc__ -D__PowerPC__ -D__powerpc__ \
+  -Acpu=powerpc -Amachine=powerpc"
+
+#define        STARTFILE_FREEBSD_SPEC  FBSD_STARTFILE_SPEC
+#define ENDFILE_FREEBSD_SPEC   FBSD_ENDFILE_SPEC
+#define LIB_FREEBSD_SPEC       FBSD_LIB_SPEC
+#define LINK_START_FREEBSD_SPEC        ""
+
+#define LINK_OS_FREEBSD_SPEC "\
+  %{symbolic:-Bsymbolic}"
+
 /* GNU/Linux support.  */
 #ifdef USE_GNULIBC_1
 #define LIB_LINUX_SPEC "%{mnewlib: --start-group -llinux -lc --end-group } \
@@ -1379,6 +1408,7 @@ ncrtn.o%s"
   { "lib_yellowknife",         LIB_YELLOWKNIFE_SPEC },                 \
   { "lib_mvme",                        LIB_MVME_SPEC },                        \
   { "lib_sim",                 LIB_SIM_SPEC },                         \
+  { "lib_freebsd",             LIB_FREEBSD_SPEC },                     \
   { "lib_linux",               LIB_LINUX_SPEC },                       \
   { "lib_netbsd",              LIB_NETBSD_SPEC },                      \
   { "lib_solaris",             LIB_SOLARIS_SPEC },                     \
@@ -1388,6 +1418,7 @@ ncrtn.o%s"
   { "startfile_yellowknife",   STARTFILE_YELLOWKNIFE_SPEC },           \
   { "startfile_mvme",          STARTFILE_MVME_SPEC },                  \
   { "startfile_sim",           STARTFILE_SIM_SPEC },                   \
+  { "startfile_freebsd",       STARTFILE_FREEBSD_SPEC },               \
   { "startfile_linux",         STARTFILE_LINUX_SPEC },                 \
   { "startfile_netbsd",                STARTFILE_NETBSD_SPEC },                \
   { "startfile_solaris",       STARTFILE_SOLARIS_SPEC },               \
@@ -1397,6 +1428,7 @@ ncrtn.o%s"
   { "endfile_yellowknife",     ENDFILE_YELLOWKNIFE_SPEC },             \
   { "endfile_mvme",            ENDFILE_MVME_SPEC },                    \
   { "endfile_sim",             ENDFILE_SIM_SPEC },                     \
+  { "endfile_freebsd",         ENDFILE_FREEBSD_SPEC },                 \
   { "endfile_linux",           ENDFILE_LINUX_SPEC },                   \
   { "endfile_netbsd",          ENDFILE_NETBSD_SPEC },                  \
   { "endfile_solaris",         ENDFILE_SOLARIS_SPEC },                 \
@@ -1410,6 +1442,7 @@ ncrtn.o%s"
   { "link_start_yellowknife",  LINK_START_YELLOWKNIFE_SPEC },          \
   { "link_start_mvme",         LINK_START_MVME_SPEC },                 \
   { "link_start_sim",          LINK_START_SIM_SPEC },                  \
+  { "link_start_freebsd",      LINK_START_FREEBSD_SPEC },              \
   { "link_start_linux",                LINK_START_LINUX_SPEC },                \
   { "link_start_netbsd",       LINK_START_NETBSD_SPEC },               \
   { "link_start_solaris",      LINK_START_SOLARIS_SPEC },              \
@@ -1420,6 +1453,7 @@ ncrtn.o%s"
   { "link_os_yellowknife",     LINK_OS_YELLOWKNIFE_SPEC },             \
   { "link_os_mvme",            LINK_OS_MVME_SPEC },                    \
   { "link_os_sim",             LINK_OS_SIM_SPEC },                     \
+  { "link_os_freebsd",         LINK_OS_FREEBSD_SPEC },                 \
   { "link_os_linux",           LINK_OS_LINUX_SPEC },                   \
   { "link_os_netbsd",          LINK_OS_NETBSD_SPEC },                  \
   { "link_os_solaris",         LINK_OS_SOLARIS_SPEC },                 \
@@ -1437,6 +1471,7 @@ ncrtn.o%s"
   { "cpp_os_yellowknife",      CPP_OS_YELLOWKNIFE_SPEC },              \
   { "cpp_os_mvme",             CPP_OS_MVME_SPEC },                     \
   { "cpp_os_sim",              CPP_OS_SIM_SPEC },                      \
+  { "cpp_os_freebsd",          CPP_OS_FREEBSD_SPEC },                  \
   { "cpp_os_linux",            CPP_OS_LINUX_SPEC },                    \
   { "cpp_os_netbsd",           CPP_OS_NETBSD_SPEC },                   \
   { "cpp_os_solaris",          CPP_OS_SOLARIS_SPEC },                  \