aboutsummaryrefslogtreecommitdiffstats
path: root/lang
diff options
context:
space:
mode:
Diffstat (limited to 'lang')
-rw-r--r--lang/egcs/Makefile15
-rw-r--r--lang/egcs/files/alpha-freebsd-elf.h61
-rw-r--r--lang/egcs/files/alpha-freebsd.h443
-rw-r--r--lang/egcs/files/freebsd.h120
-rw-r--r--lang/egcs/files/patch-ad77
-rw-r--r--lang/egcs/files/patch-af48
-rw-r--r--lang/egcs/files/patch-ak10
-rw-r--r--lang/egcs/files/patch-al8
-rw-r--r--lang/gcc-devel/Makefile15
-rw-r--r--lang/gcc-devel/files/alpha-freebsd.h443
-rw-r--r--lang/gcc-devel/files/patch-ad77
-rw-r--r--lang/gcc-devel/files/patch-af48
-rw-r--r--lang/gcc-devel/files/patch-ak10
-rw-r--r--lang/gcc-devel/files/patch-al8
-rw-r--r--lang/gcc-ooo/Makefile15
-rw-r--r--lang/gcc-ooo/files/alpha-freebsd.h443
-rw-r--r--lang/gcc-ooo/files/patch-ad77
-rw-r--r--lang/gcc-ooo/files/patch-af48
-rw-r--r--lang/gcc-ooo/files/patch-ak10
-rw-r--r--lang/gcc-ooo/files/patch-al8
-rw-r--r--lang/gcc/Makefile15
-rw-r--r--lang/gcc/files/alpha-freebsd.h443
-rw-r--r--lang/gcc/files/patch-ad77
-rw-r--r--lang/gcc/files/patch-af48
-rw-r--r--lang/gcc/files/patch-ak10
-rw-r--r--lang/gcc/files/patch-al8
-rw-r--r--lang/gcc295/Makefile15
-rw-r--r--lang/gcc295/files/alpha-freebsd.h443
-rw-r--r--lang/gcc295/files/freebsd.h120
-rw-r--r--lang/gcc295/files/patch-ad77
-rw-r--r--lang/gcc295/files/patch-af48
-rw-r--r--lang/gcc295/files/patch-ak10
-rw-r--r--lang/gcc295/files/patch-al8
-rw-r--r--lang/gcc30/Makefile15
-rw-r--r--lang/gcc30/files/alpha-freebsd.h443
-rw-r--r--lang/gcc30/files/patch-ad77
-rw-r--r--lang/gcc30/files/patch-af48
-rw-r--r--lang/gcc30/files/patch-ak10
-rw-r--r--lang/gcc30/files/patch-al8
-rw-r--r--lang/gcc31/Makefile15
-rw-r--r--lang/gcc31/files/alpha-freebsd.h443
-rw-r--r--lang/gcc31/files/patch-ad77
-rw-r--r--lang/gcc31/files/patch-af48
-rw-r--r--lang/gcc31/files/patch-ak10
-rw-r--r--lang/gcc31/files/patch-al8
-rw-r--r--lang/gcc32/Makefile15
-rw-r--r--lang/gcc32/files/alpha-freebsd.h443
-rw-r--r--lang/gcc32/files/patch-ad77
-rw-r--r--lang/gcc32/files/patch-af48
-rw-r--r--lang/gcc32/files/patch-ak10
-rw-r--r--lang/gcc32/files/patch-al8
-rw-r--r--lang/gcc33/Makefile15
-rw-r--r--lang/gcc33/files/alpha-freebsd.h443
-rw-r--r--lang/gcc33/files/patch-ad77
-rw-r--r--lang/gcc33/files/patch-af48
-rw-r--r--lang/gcc33/files/patch-ak10
-rw-r--r--lang/gcc33/files/patch-al8
-rw-r--r--lang/gcc34/Makefile15
-rw-r--r--lang/gcc34/files/alpha-freebsd.h443
-rw-r--r--lang/gcc34/files/patch-ad77
-rw-r--r--lang/gcc34/files/patch-af48
-rw-r--r--lang/gcc34/files/patch-ak10
-rw-r--r--lang/gcc34/files/patch-al8
-rw-r--r--lang/gcc35/Makefile15
-rw-r--r--lang/gcc35/files/alpha-freebsd.h443
-rw-r--r--lang/gcc35/files/patch-ad77
-rw-r--r--lang/gcc35/files/patch-af48
-rw-r--r--lang/gcc35/files/patch-ak10
-rw-r--r--lang/gcc35/files/patch-al8
-rw-r--r--lang/gcc40/Makefile15
-rw-r--r--lang/gcc40/files/alpha-freebsd.h443
-rw-r--r--lang/gcc40/files/patch-ad77
-rw-r--r--lang/gcc40/files/patch-af48
-rw-r--r--lang/gcc40/files/patch-ak10
-rw-r--r--lang/gcc40/files/patch-al8
-rw-r--r--lang/gcc41/Makefile15
-rw-r--r--lang/gcc41/files/alpha-freebsd.h443
-rw-r--r--lang/gcc41/files/patch-ad77
-rw-r--r--lang/gcc41/files/patch-af48
-rw-r--r--lang/gcc41/files/patch-ak10
-rw-r--r--lang/gcc41/files/patch-al8
-rw-r--r--lang/gcc42/Makefile15
-rw-r--r--lang/gcc42/files/alpha-freebsd.h443
-rw-r--r--lang/gcc42/files/patch-ad77
-rw-r--r--lang/gcc42/files/patch-af48
-rw-r--r--lang/gcc42/files/patch-ak10
-rw-r--r--lang/gcc42/files/patch-al8
-rw-r--r--lang/gcc43/Makefile15
-rw-r--r--lang/gcc43/files/alpha-freebsd.h443
-rw-r--r--lang/gcc43/files/patch-ad77
-rw-r--r--lang/gcc43/files/patch-af48
-rw-r--r--lang/gcc43/files/patch-ak10
-rw-r--r--lang/gcc43/files/patch-al8
-rw-r--r--lang/gcc44/Makefile15
-rw-r--r--lang/gcc44/files/alpha-freebsd.h443
-rw-r--r--lang/gcc44/files/patch-ad77
-rw-r--r--lang/gcc44/files/patch-af48
-rw-r--r--lang/gcc44/files/patch-ak10
-rw-r--r--lang/gcc44/files/patch-al8
-rw-r--r--lang/gcc45/Makefile15
-rw-r--r--lang/gcc45/files/alpha-freebsd.h443
-rw-r--r--lang/gcc45/files/patch-ad77
-rw-r--r--lang/gcc45/files/patch-af48
-rw-r--r--lang/gcc45/files/patch-ak10
-rw-r--r--lang/gcc45/files/patch-al8
-rw-r--r--lang/gcc46/Makefile15
-rw-r--r--lang/gcc46/files/alpha-freebsd.h443
-rw-r--r--lang/gcc46/files/patch-ad77
-rw-r--r--lang/gcc46/files/patch-af48
-rw-r--r--lang/gcc46/files/patch-ak10
-rw-r--r--lang/gcc46/files/patch-al8
-rw-r--r--lang/gcc47/Makefile15
-rw-r--r--lang/gcc47/files/alpha-freebsd.h443
-rw-r--r--lang/gcc47/files/patch-ad77
-rw-r--r--lang/gcc47/files/patch-af48
-rw-r--r--lang/gcc47/files/patch-ak10
-rw-r--r--lang/gcc47/files/patch-al8
-rw-r--r--lang/gcc48/Makefile15
-rw-r--r--lang/gcc48/files/alpha-freebsd.h443
-rw-r--r--lang/gcc48/files/patch-ad77
-rw-r--r--lang/gcc48/files/patch-af48
-rw-r--r--lang/gcc48/files/patch-ak10
-rw-r--r--lang/gcc48/files/patch-al8
123 files changed, 11681 insertions, 640 deletions
diff --git a/lang/egcs/Makefile b/lang/egcs/Makefile
index f9347a47d87e..cd5b039f398a 100644
--- a/lang/egcs/Makefile
+++ b/lang/egcs/Makefile
@@ -4,7 +4,7 @@
# Date created: 9 Jan 1998
# Whom: John Polstra <jdp@polstra.com>
#
-# $Id: Makefile,v 1.48 1999/03/08 07:28:27 asami Exp $
+# $Id: Makefile,v 1.50 1999/03/17 00:40:25 obrien Exp $
#
DISTNAME= egcs-1.1.2
@@ -55,21 +55,20 @@ ALL_TARGET= bootstrap
MAN1= cccp.1 g++.1 g77.1 gcc.1
pre-patch:
+ @${MV} ${WRKSRC}/gcc/config/i386/t-freebsd ${WRKSRC}/gcc/config/
@${MV} ${WRKSRC}/gcc/config/i386/freebsd.h ${WRKSRC}/gcc/config/i386/freebsd-aout.h
@${MV} ${WRKSRC}/gcc/config/i386/freebsd-elf.h ${WRKSRC}/gcc/config/i386/freebsd.h
+ @${CP} ${FILESDIR}/alpha-freebsd-elf.h ${WRKSRC}/gcc/config/alpha/freebsd-elf.h
+ @${CP} ${FILESDIR}/alpha-freebsd.h ${WRKSRC}/gcc/config/alpha/freebsd.h
pre-configure:
@# Keep from running `autoconf' and `autoheader' since we modified
@# configure.in by patching it.
@touch ${WRKSRC}/gcc/configure
@touch ${WRKSRC}/gcc/cstamp-h.in
- @(cd ${WRKSRC}/gcc/config/${ARCH}/ ; \
- MAJ=`sysctl -n kern.osreldate | ${SED} -e '/.....$$/s///'` ; \
- ${MV} freebsd-aout.h freebsd-aout.h.in ; \
- ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" freebsd-aout.h.in \
- >freebsd-aout.h ; \
- ${MV} freebsd.h freebsd.h.in ; \
- ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" freebsd.h.in >freebsd.h )
+ @(MAJ=`sysctl -n kern.osreldate | ${SED} -e '/.....$$/s///'` ; \
+ ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" ${FILESDIR}/freebsd.h \
+ >${WRKSRC}/gcc/config/freebsd.h )
.if ${PORTOBJFORMAT} == "elf" && ${MACHINE_ARCH} == "i386"
@${SED} -e 's/^@comment ELF-only://' ${PKGDIR}/PLIST >${PLIST}
.endif
diff --git a/lang/egcs/files/alpha-freebsd-elf.h b/lang/egcs/files/alpha-freebsd-elf.h
new file mode 100644
index 000000000000..5edb57f05dd0
--- /dev/null
+++ b/lang/egcs/files/alpha-freebsd-elf.h
@@ -0,0 +1,61 @@
+/* Definitions of target machine for GNU compiler
+ for Alpha FreeBSD systems using ELF.
+ Copyright (C) 1998 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#undef TARGET_VERSION
+#define TARGET_VERSION fprintf (stderr, " (FreeBSD/alpha ELF)");
+
+#undef SUB_CPP_PREDEFINES
+#define SUB_CPP_PREDEFINES "-D__ELF__"
+
+#undef SUBTARGET_EXTRA_SPECS
+#define SUBTARGET_EXTRA_SPECS \
+{ "elf_dynamic_linker", ELF_DYNAMIC_LINKER },
+
+#define ELF_DYNAMIC_LINKER "/usr/libexec/ld-elf.so.1"
+
+#undef LINK_SPEC
+#define LINK_SPEC "-m elf64alpha %{G*} %{relax:-relax} \
+ %{O*:-O3} %{!O*:-O1} \
+ %{assert*} \
+ %{shared:-shared} \
+ %{!shared: \
+ -dc -dp \
+ %{!nostdlib:%{!r*:%{!e*:-e _start}}} \
+ %{!static: \
+ %{rdynamic:-export-dynamic} \
+ %{!dynamic-linker:-dynamic-linker %(elf_dynamic_linker)}} \
+ %{static:-static}}"
+
+#undef STARTFILE_SPEC
+#define STARTFILE_SPEC \
+ "%{!shared: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}} \
+ %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
+
+/* Provide a ENDFILE_SPEC appropriate for ELF. Here we tack on the
+ magical crtend.o file which provides part of the support for
+ getting C++ file-scope static object constructed before entering
+ `main', followed by a normal ELF "finalizer" file, `crtn.o'. */
+
+#undef ENDFILE_SPEC
+#define ENDFILE_SPEC \
+ "%{!shared:crtend.o%s} %{shared:crtendS.o%s}"
+
+/* We support #pragma. */
+#define HANDLE_SYSV_PRAGMA
diff --git a/lang/egcs/files/alpha-freebsd.h b/lang/egcs/files/alpha-freebsd.h
new file mode 100644
index 000000000000..60a1f07b94ba
--- /dev/null
+++ b/lang/egcs/files/alpha-freebsd.h
@@ -0,0 +1,443 @@
+/* Definitions of target machine for GNU compiler,
+ for Alpha FreeBSD systems.
+ Copyright (C) 1998 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* This is used on Alpha platforms that use the ELF format.
+ This was taken from the NetBSD configuration, and modified
+ for FreeBSD/alpha by Hidetoshi Shimokawa <simokawa@FreeBSD.ORG> */
+
+
+/* Get generic FreeBSD definitions. */
+#include <freebsd.h>
+
+
+#undef OBJECT_FORMAT_COFF
+#undef EXTENDED_COFF
+#define OBJECT_FORMAT_ELF
+
+/* This is BSD, so it wants DBX format. */
+
+#define DBX_DEBUGGING_INFO
+
+/* This is the char to use for continuation (in case we need to turn
+ continuation back on). */
+
+#define DBX_CONTIN_CHAR '?'
+
+#undef ASM_FINAL_SPEC
+
+/* Names to predefine in the preprocessor for this target machine.
+ XXX FreeBSD, by convention, shouldn't do __alpha, but lots of applications
+ expect it because that's what OSF/1 does. */
+
+#undef TARGET_DEFAULT
+#define TARGET_DEFAULT (MASK_FP | MASK_FPREGS | MASK_GAS)
+
+#undef CPP_PREDEFINES
+#define CPP_PREDEFINES "\
+-D__alpha__ -D__alpha -Acpu(alpha) -Amachine(alpha) " \
+FBSD_CPP_PREDEFINES \
+SUB_CPP_PREDEFINES
+
+/* Make gcc agree with <machine/ansi.h> */
+
+#undef WCHAR_TYPE
+#define WCHAR_TYPE "int"
+
+#undef WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE 32
+
+/* Output assembler code to FILE to increment profiler label # LABELNO
+ for profiling a function entry. Under FreeBSD/Alpha, the assembler does
+ nothing special with -pg. */
+
+#undef FUNCTION_PROFILER
+#define FUNCTION_PROFILER(FILE, LABELNO) \
+ fputs ("\tjsr $28,_mcount\n", (FILE))
+
+/* Show that we need a GP when profiling. */
+#define TARGET_PROFILING_NEEDS_GP
+
+#undef HAS_INIT_SECTION
+
+/* Provide an ASM_SPEC appropriate for a FreeBSD/alpha target. This differs
+ from the generic FreeBSD ASM_SPEC in that no special handling of PIC is
+ necessary on the Alpha. */
+
+#undef ASM_SPEC
+#define ASM_SPEC " %| %{mcpu=*:-m%*}"
+
+/* Output at beginning of assembler file. */
+
+#undef ASM_FILE_START
+#define ASM_FILE_START(FILE) \
+{ \
+ alpha_write_verstamp (FILE); \
+ output_file_directive (FILE, main_input_filename); \
+ fprintf (FILE, "\t.version\t\"01.01\"\n"); \
+ fprintf (FILE, "\t.set noat\n"); \
+}
+
+#define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE) \
+ alpha_output_lineno (STREAM, LINE)
+extern void alpha_output_lineno ();
+
+extern void output_file_directive ();
+
+/* 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. */
+
+#define IDENT_ASM_OP ".ident"
+
+#ifdef IDENTIFY_WITH_IDENT
+#define ASM_IDENTIFY_GCC(FILE) /* nothing */
+#define ASM_IDENTIFY_LANGUAGE(FILE) \
+ fprintf(FILE, "\t%s \"GCC (%s) %s\"\n", IDENT_ASM_OP, \
+ lang_identify(), version_string)
+#else
+#define ASM_FILE_END(FILE) \
+do { \
+ fprintf ((FILE), "\t%s\t\"GCC: (GNU) %s\"\n", \
+ IDENT_ASM_OP, version_string); \
+ } while (0)
+#endif
+
+/* Allow #sccs in preprocessor. */
+
+#define SCCS_DIRECTIVE
+
+/* Output #ident as a .ident. */
+
+#define ASM_OUTPUT_IDENT(FILE, NAME) \
+ fprintf (FILE, "\t%s\t\"%s\"\n", IDENT_ASM_OP, NAME);
+
+/* This is how to allocate empty space in some section. The .zero
+ pseudo-op is used for this on most svr4 assemblers. */
+
+#define SKIP_ASM_OP ".zero"
+
+#undef ASM_OUTPUT_SKIP
+#define ASM_OUTPUT_SKIP(FILE,SIZE) \
+ fprintf (FILE, "\t%s\t%u\n", SKIP_ASM_OP, (SIZE))
+
+/* Output the label which precedes a jumptable. Note that for all svr4
+ systems where we actually generate jumptables (which is to say every
+ svr4 target except i386, where we use casesi instead) we put the jump-
+ tables into the .rodata section and since other stuff could have been
+ put into the .rodata section prior to any given jumptable, we have to
+ make sure that the location counter for the .rodata section gets pro-
+ perly re-aligned prior to the actual beginning of the jump table. */
+
+#define ALIGN_ASM_OP ".align"
+
+#ifndef ASM_OUTPUT_BEFORE_CASE_LABEL
+#define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE,PREFIX,NUM,TABLE) \
+ ASM_OUTPUT_ALIGN ((FILE), 2);
+#endif
+
+#undef ASM_OUTPUT_CASE_LABEL
+#define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,JUMPTABLE) \
+ do { \
+ ASM_OUTPUT_BEFORE_CASE_LABEL (FILE, PREFIX, NUM, JUMPTABLE) \
+ ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); \
+ } while (0)
+
+/* The standard SVR4 assembler seems to require that certain builtin
+ library routines (e.g. .udiv) be explicitly declared as .globl
+ in each assembly file where they are referenced. */
+
+#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
+ ASM_GLOBALIZE_LABEL (FILE, XSTR (FUN, 0))
+
+/* This says how to output assembler code to declare an
+ uninitialized external linkage data object. Under SVR4,
+ the linker seems to want the alignment of data objects
+ to depend on their types. We do exactly that here. */
+
+#define COMMON_ASM_OP ".comm"
+
+#undef ASM_OUTPUT_ALIGNED_COMMON
+#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
+do { \
+ fprintf ((FILE), "\t%s\t", COMMON_ASM_OP); \
+ assemble_name ((FILE), (NAME)); \
+ fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \
+} while (0)
+
+/* This says how to output assembler code to declare an
+ uninitialized internal linkage data object. Under SVR4,
+ the linker seems to want the alignment of data objects
+ to depend on their types. We do exactly that here. */
+
+#define LOCAL_ASM_OP ".local"
+
+#undef ASM_OUTPUT_ALIGNED_LOCAL
+#define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
+do { \
+ fprintf ((FILE), "\t%s\t", LOCAL_ASM_OP); \
+ assemble_name ((FILE), (NAME)); \
+ fprintf ((FILE), "\n"); \
+ ASM_OUTPUT_ALIGNED_COMMON (FILE, NAME, SIZE, ALIGN); \
+} while (0)
+
+/* This is the pseudo-op used to generate a 64-bit word of data with a
+ specific value in some section. */
+
+#define INT_ASM_OP ".quad"
+
+/* This is the pseudo-op used to generate a contiguous sequence of byte
+ values from a double-quoted string WITHOUT HAVING A TERMINATING NUL
+ AUTOMATICALLY APPENDED. This is the same for most svr4 assemblers. */
+
+#undef ASCII_DATA_ASM_OP
+#define ASCII_DATA_ASM_OP ".ascii"
+
+/* Support const sections and the ctors and dtors sections for g++.
+ Note that there appears to be two different ways to support const
+ sections at the moment. You can either #define the symbol
+ READONLY_DATA_SECTION (giving it some code which switches to the
+ readonly data section) or else you can #define the symbols
+ EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, SELECT_SECTION, and
+ SELECT_RTX_SECTION. We do both here just to be on the safe side. */
+
+#define USE_CONST_SECTION 1
+
+#define CONST_SECTION_ASM_OP ".section\t.rodata"
+
+/* Define the pseudo-ops used to switch to the .ctors and .dtors sections.
+
+ Note that we want to give these sections the SHF_WRITE attribute
+ because these sections will actually contain data (i.e. tables of
+ addresses of functions in the current root executable or shared library
+ file) and, in the case of a shared library, the relocatable addresses
+ will have to be properly resolved/relocated (and then written into) by
+ the dynamic linker when it actually attaches the given shared library
+ to the executing process. (Note that on SVR4, you may wish to use the
+ `-z text' option to the ELF linker, when building a shared library, as
+ an additional check that you are doing everything right. But if you do
+ use the `-z text' option when building a shared library, you will get
+ errors unless the .ctors and .dtors sections are marked as writable
+ via the SHF_WRITE attribute.) */
+
+#define CTORS_SECTION_ASM_OP ".section\t.ctors,\"aw\""
+#define DTORS_SECTION_ASM_OP ".section\t.dtors,\"aw\""
+
+/* On svr4, we *do* have support for the .init and .fini sections, and we
+ can put stuff in there to be executed before and after `main'. We let
+ crtstuff.c and other files know this by defining the following symbols.
+ The definitions say how to change sections to the .init and .fini
+ sections. This is the same for all known svr4 assemblers. */
+
+#define INIT_SECTION_ASM_OP ".section\t.init"
+#define FINI_SECTION_ASM_OP ".section\t.fini"
+
+/* A default list of other sections which we might be "in" at any given
+ time. For targets that use additional sections (e.g. .tdesc) you
+ should override this definition in the target-specific file which
+ includes this file. */
+
+#undef EXTRA_SECTIONS
+#define EXTRA_SECTIONS in_const, in_ctors, in_dtors
+
+/* A default list of extra section function definitions. For targets
+ that use additional sections (e.g. .tdesc) you should override this
+ definition in the target-specific file which includes this file. */
+
+#undef EXTRA_SECTION_FUNCTIONS
+#define EXTRA_SECTION_FUNCTIONS \
+ CONST_SECTION_FUNCTION \
+ CTORS_SECTION_FUNCTION \
+ DTORS_SECTION_FUNCTION
+
+#undef READONLY_DATA_SECTION
+#define READONLY_DATA_SECTION() const_section ()
+
+extern void text_section ();
+
+#define CONST_SECTION_FUNCTION \
+void \
+const_section () \
+{ \
+ if (!USE_CONST_SECTION) \
+ text_section(); \
+ else if (in_section != in_const) \
+ { \
+ fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP); \
+ in_section = in_const; \
+ } \
+}
+
+#define CTORS_SECTION_FUNCTION \
+void \
+ctors_section () \
+{ \
+ if (in_section != in_ctors) \
+ { \
+ fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP); \
+ in_section = in_ctors; \
+ } \
+}
+
+#define DTORS_SECTION_FUNCTION \
+void \
+dtors_section () \
+{ \
+ if (in_section != in_dtors) \
+ { \
+ fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP); \
+ in_section = in_dtors; \
+ } \
+}
+
+/* Switch into a generic section.
+ This is currently only used to support section attributes.
+
+ We make the section read-only and executable for a function decl,
+ read-only for a const data decl, and writable for a non-const data decl. */
+#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC) \
+ fprintf (FILE, ".section\t%s,\"%s\",@progbits\n", NAME, \
+ (DECL) && TREE_CODE (DECL) == FUNCTION_DECL ? "ax" : \
+ (DECL) && DECL_READONLY_SECTION (DECL, RELOC) ? "a" : "aw")
+
+
+/* A C statement (sans semicolon) to output an element in the table of
+ global constructors. */
+#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
+ do { \
+ ctors_section (); \
+ fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
+ assemble_name (FILE, NAME); \
+ fprintf (FILE, "\n"); \
+ } while (0)
+
+/* A C statement (sans semicolon) to output an element in the table of
+ global destructors. */
+#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
+ do { \
+ dtors_section (); \
+ fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
+ assemble_name (FILE, NAME); \
+ fprintf (FILE, "\n"); \
+ } while (0)
+
+/* A C statement or statements to switch to the appropriate
+ section for output of DECL. DECL is either a `VAR_DECL' node
+ or a constant of some sort. RELOC indicates whether forming
+ the initial value of DECL requires link-time relocations. */
+
+#define SELECT_SECTION(DECL,RELOC) \
+{ \
+ if (TREE_CODE (DECL) == STRING_CST) \
+ { \
+ if (! flag_writable_strings) \
+ const_section (); \
+ else \
+ data_section (); \
+ } \
+ else if (TREE_CODE (DECL) == VAR_DECL) \
+ { \
+ if ((flag_pic && RELOC) \
+ || !TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL) \
+ || !DECL_INITIAL (DECL) \
+ || (DECL_INITIAL (DECL) != error_mark_node \
+ && !TREE_CONSTANT (DECL_INITIAL (DECL)))) \
+ data_section (); \
+ else \
+ const_section (); \
+ } \
+ else \
+ const_section (); \
+}
+
+/* A C statement or statements to switch to the appropriate
+ section for output of RTX in mode MODE. RTX is some kind
+ of constant in RTL. The argument MODE is redundant except
+ in the case of a `const_int' rtx. Currently, these always
+ go into the const section. */
+
+#undef SELECT_RTX_SECTION
+#define SELECT_RTX_SECTION(MODE,RTX) const_section()
+
+/* Define the strings used for the special svr4 .type and .size directives.
+ These strings generally do not vary from one system running svr4 to
+ another, but if a given system (e.g. m88k running svr) needs to use
+ different pseudo-op names for these, they may be overridden in the
+ file which includes this one. */
+
+#define TYPE_ASM_OP ".type"
+#define SIZE_ASM_OP ".size"
+
+/* This is how we tell the assembler that two symbols have the same value. */
+
+#define ASM_OUTPUT_DEF(FILE,NAME1,NAME2) \
+ do { assemble_name(FILE, NAME1); \
+ fputs(" = ", FILE); \
+ assemble_name(FILE, NAME2); \
+ fputc('\n', FILE); } while (0)
+
+/* A table of bytes codes used by the ASM_OUTPUT_ASCII and
+ ASM_OUTPUT_LIMITED_STRING macros. Each byte in the table
+ corresponds to a particular byte value [0..255]. For any
+ given byte value, if the value in the corresponding table
+ position is zero, the given character can be output directly.
+ If the table value is 1, the byte must be output as a \ooo
+ octal escape. If the tables value is anything else, then the
+ byte value should be output as a \ followed by the value
+ in the table. Note that we can use standard UN*X escape
+ sequences for many control characters, but we don't use
+ \a to represent BEL because some svr4 assemblers (e.g. on
+ the i386) don't know about that. Also, we don't use \v
+ since some versions of gas, such as 2.2 did not accept it. */
+
+#define ESCAPES \
+"\1\1\1\1\1\1\1\1btn\1fr\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\0\0\"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\\\0\0\0\
+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1"
+
+/* Some svr4 assemblers have a limit on the number of characters which
+ can appear in the operand of a .string directive. If your assembler
+ has such a limitation, you should define STRING_LIMIT to reflect that
+ limit. Note that at least some svr4 assemblers have a limit on the
+ actual number of bytes in the double-quoted string, and that they
+ count each character in an escape sequence as one byte. Thus, an
+ escape sequence like \377 would count as four bytes.
+
+ If your target assembler doesn't support the .string directive, you
+ should define this to zero.
+*/
+
+#define STRING_LIMIT ((unsigned) 256)
+
+#define STRING_ASM_OP ".string"
+
+/*
+ * We always use gas here, so we don't worry about ECOFF assembler problems.
+ */
+#undef TARGET_GAS
+#define TARGET_GAS (1)
+
+#undef PREFERRED_DEBUGGING_TYPE
+#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
diff --git a/lang/egcs/files/freebsd.h b/lang/egcs/files/freebsd.h
new file mode 100644
index 000000000000..0ec7426b5f30
--- /dev/null
+++ b/lang/egcs/files/freebsd.h
@@ -0,0 +1,120 @@
+/* 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 /usr/src/contrib/gcc/config/i386/freebsd.h &
+ egcs/gcc/config/i386/freebsd-elf.h version by David O'Brien */
+
+
+/* Don't assume anything about the header files. */
+#define NO_IMPLICIT_EXTERN_C
+
+/* This defines which switch letters take arguments. On svr4, most of
+ the normal cases (defined in gcc.c) apply, and we also have -h* and
+ -z* options (for the linker). We have a slightly different mix. We
+ have -R (alias --rpath), no -z, --soname (-h), --assert etc. */
+
+#undef SWITCH_TAKES_ARG
+#define SWITCH_TAKES_ARG(CHAR) \
+ ( (CHAR) == 'D' \
+ || (CHAR) == 'U' \
+ || (CHAR) == 'o' \
+ || (CHAR) == 'e' \
+ || (CHAR) == 'T' \
+ || (CHAR) == 'u' \
+ || (CHAR) == 'I' \
+ || (CHAR) == 'm' \
+ || (CHAR) == 'x' \
+ || (CHAR) == 'L' \
+ || (CHAR) == 'A' \
+ || (CHAR) == 'V' \
+ || (CHAR) == 'B' \
+ || (CHAR) == 'b' \
+ || (CHAR) == 'h' \
+ || (CHAR) == 'z' /* ignored by ld */ \
+ || (CHAR) == 'R')
+
+#undef WORD_SWITCH_TAKES_ARG
+#define 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"))
+
+
+#define CPP_FBSD_PREDEFINES " -Dunix -D__FreeBSD__ -Asystem(unix) -Asystem(FreeBSD) "
+
+
+/* Code generation parameters. */
+
+/* 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) */
+#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
+
+
+/* Miscellaneous parameters. */
+
+/* Tell libgcc2.c that FreeBSD targets support atexit(3). */
+#define HAVE_ATEXIT
+
+
+/* FREEBSD_NATIVE is defined when gcc is integrated into the FreeBSD
+ source tree so it can be configured appropriately without using
+ the GNU configure/build mechanism. */
+
+#ifdef FREEBSD_NATIVE
+
+/* Look for the include files in the system-defined places. */
+
+#define GPLUSPLUS_INCLUDE_DIR "/usr/include/g++"
+#define GCC_INCLUDE_DIR "/usr/include"
+
+/* Now that GCC knows what the include path applies to, put the G++ one first.
+ C++ can now have include files that override the default C ones. */
+#define INCLUDE_DEFAULTS \
+ { \
+ { GPLUSPLUS_INCLUDE_DIR, "C++", 1, 1 }, \
+ { GCC_INCLUDE_DIR, "GCC", 0, 0 }, \
+ { 0, 0, 0, 0 } \
+ }
+
+/* Under FreeBSD, the normal location of the compiler back ends is the
+ /usr/libexec directory. */
+
+#define STANDARD_EXEC_PREFIX "/usr/libexec/"
+#define TOOLDIR_BASE_PREFIX "/usr/libexec/"
+
+/* Under FreeBSD, the normal location of the various *crt*.o files is the
+ /usr/lib directory. */
+
+#define STANDARD_STARTFILE_PREFIX "/usr/lib/"
+
+/* FreeBSD is 4.4BSD derived */
+#define bsd4_4
+
+#endif /* FREEBSD_NATIVE */
diff --git a/lang/egcs/files/patch-ad b/lang/egcs/files/patch-ad
index f8fb5803acf0..bea070deb344 100644
--- a/lang/egcs/files/patch-ad
+++ b/lang/egcs/files/patch-ad
@@ -1,6 +1,41 @@
--- gcc/config/i386/freebsd-aout.h.orig Mon Mar 1 14:47:33 1999
-+++ gcc/config/i386/freebsd-aout.h Sat Mar 13 19:24:50 1999
-@@ -103,19 +103,18 @@
++++ gcc/config/i386/freebsd-aout.h Sat Mar 20 00:27:02 1999
+@@ -20,6 +20,10 @@
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
++
++/* Get generic FreeBSD definitions. */
++#include <freebsd.h>
++
+ /* This goes away when the math-emulator is fixed */
+ #define TARGET_CPU_DEFAULT 0400 /* TARGET_NO_FANCY_MATH_387 */
+
+@@ -35,7 +39,7 @@
+ #include "i386/perform.h"
+
+ #undef CPP_PREDEFINES
+-#define CPP_PREDEFINES "-Dunix -Di386 -D__FreeBSD__ -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)"
++#define CPP_PREDEFINES "-Di386 -Acpu(i386) -Amachine(i386)" CPP_FBSD_PREDEFINES
+
+ /* Like the default, except no -lg. */
+ #define LIB_SPEC "%{!shared:%{!pg:-lc}%{pg:-lc_p}}"
+@@ -85,14 +89,6 @@
+ necessary when compiling PIC code. */
+
+ #define JUMP_TABLES_IN_TEXT_SECTION 1
+-
+-/* Don't default to pcc-struct-return, because gcc is the only compiler, and
+- we want to retain compatibility with older gcc versions. */
+-#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
+
+ /* i386 freebsd still uses old binutils that don't insert nops by default
+ when the .align directive demands to insert extra space in the text
+@@ -103,19 +99,18 @@
/* Profiling routines, partially copied from i386/osfrose.h. */
@@ -23,7 +58,7 @@
fprintf (FILE, "\tcall mcount\n"); \
} \
}
-@@ -133,6 +132,7 @@
+@@ -133,6 +128,7 @@
#define TYPE_ASM_OP ".type"
#define SIZE_ASM_OP ".size"
@@ -31,7 +66,7 @@
/* The following macro defines the format used to output the second
operand of the .type assembler directive. Different svr4 assemblers
-@@ -142,6 +142,12 @@
+@@ -142,6 +138,12 @@
#define TYPE_OPERAND_FMT "@%s"
@@ -44,12 +79,34 @@
/* Write the extra assembler code needed to declare a function's result.
Most svr4 assemblers don't require any special declaration of the
result value, but there are exceptions. */
-@@ -243,6 +249,8 @@
- #define STARTFILE_SPEC \
+@@ -244,29 +246,4 @@
"%{shared:c++rt0.o%s} \
%{!shared:%{pg:gcrt0.o%s}%{!pg:%{static:scrt0.o%s}%{!static:crt0.o%s}}}"
-+
-+#define MD_STARTFILE_PREFIX "/usr/lib/aout/"
- /* This is defined when gcc is compiled in the BSD-directory-tree, and must
- * make up for the gap to all the stuff done in the GNU-makefiles.
+-/* This is defined when gcc is compiled in the BSD-directory-tree, and must
+- * make up for the gap to all the stuff done in the GNU-makefiles.
+- */
+-
+-#ifdef FREEBSD_NATIVE
+-
+-#define INCLUDE_DEFAULTS { \
+- { "/usr/include", 0, 0, 0 }, \
+- { "/usr/include/g++", "G++", 1, 1 }, \
+- { 0, 0, 0, 0} \
+- }
+-
+-#undef MD_EXEC_PREFIX
+-#define MD_EXEC_PREFIX "/usr/libexec/"
+-
+-#undef STANDARD_STARTFILE_PREFIX
+-#define STANDARD_STARTFILE_PREFIX "/usr/lib"
+-
+-#if 0 /* This is very wrong!!! */
+-#define DEFAULT_TARGET_MACHINE "i386-unknown-freebsd_1.0"
+-#define GPLUSPLUS_INCLUDE_DIR "/usr/local/lib/gcc-lib/i386-unknown-freebsd_1.0/2.5.8/include"
+-#define TOOL_INCLUDE_DIR "/usr/local/i386-unknown-freebsd_1.0/include"
+-#define GCC_INCLUDE_DIR "/usr/local/lib/gcc-lib/i386-unknown-freebsd_1.0/2.5.8/include"
+-#endif
+-
+-#endif /* FREEBSD_NATIVE */
++#define MD_STARTFILE_PREFIX "/usr/lib/aout/"
diff --git a/lang/egcs/files/patch-af b/lang/egcs/files/patch-af
index c50ce06c8375..c1f1ba0e855f 100644
--- a/lang/egcs/files/patch-af
+++ b/lang/egcs/files/patch-af
@@ -1,6 +1,30 @@
--- gcc/config/i386/freebsd.h.orig Mon Mar 1 14:47:32 1999
-+++ gcc/config/i386/freebsd.h Sat Mar 13 19:25:53 1999
-@@ -113,22 +113,19 @@
++++ gcc/config/i386/freebsd.h Sun Mar 21 16:58:39 1999
+@@ -21,19 +21,13 @@
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
++
++/* Get generic FreeBSD definitions. */
++#include <freebsd.h>
++
+ #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
+-
+ /* This is how to output an element of a case-vector that is relative.
+ This is only used for PIC code. See comments by the `casesi' insn in
+ i386.md for an explanation of the expression this outputs. */
+@@ -113,22 +107,19 @@
: ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \
: (-1))
@@ -27,8 +51,18 @@
} \
}
-@@ -151,20 +148,8 @@
- #define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
+@@ -145,26 +136,16 @@
+ #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)"
++#define CPP_PREDEFINES "-Di386 -D__ELF__ -Acpu(i386) -Amachine(i386)" CPP_FBSD_PREDEFINES
+
+ #undef CPP_SPEC
+-#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
++#define CPP_SPEC \
++ "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE} %{m486:-D__i486__}"
++ /* %{pthread:-D_REENTRANT} */
#undef LIB_SPEC
-#if 1
@@ -36,16 +70,16 @@
- * want to profile or debug the C library, please add
- * -lc_p or -ggdb to LDFLAGS at the link time, respectively.
- */
- #define LIB_SPEC \
+-#define LIB_SPEC \
- "%{!shared: %{mieee-fp:-lieee} %{p:-lgmon} %{pg:-lgmon} \
- %{!ggdb:-lc} %{ggdb:-lg}}"
-#else
--#define LIB_SPEC \
+ #define LIB_SPEC \
- "%{!shared: \
- %{mieee-fp:-lieee} %{p:-lgmon -lc_p} %{pg:-lgmon -lc_p} \
- %{!p:%{!pg:%{!g*:-lc} %{g*:-lg}}}}"
-#endif
-+ "%{!shared: %{p:-lc_p} %{pg:-lc_p} %{!p:%{!pg:-lc}}}"
++ "%{!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
diff --git a/lang/egcs/files/patch-ak b/lang/egcs/files/patch-ak
index 19a2994f3f05..2e54beea1a61 100644
--- a/lang/egcs/files/patch-ak
+++ b/lang/egcs/files/patch-ak
@@ -1,5 +1,5 @@
---- gcc/configure.orig Mon Mar 8 10:06:10 1999
-+++ gcc/configure Sat Mar 13 19:08:06 1999
+--- gcc/configure.orig Sun Mar 14 02:59:02 1999
++++ gcc/configure Sat Mar 20 00:40:05 1999
@@ -2395,6 +2395,15 @@
thread_file='posix'
fi
@@ -27,18 +27,20 @@
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
- extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
+- tmake_file=i386/t-freebsd
- gas=yes
- gnu_ld=yes
- stabs=yes
++ tmake_file=t-freebsd
;;
i[34567]86-*-freebsd*)
- tm_file=i386/freebsd.h
+ tm_file="i386/i386.h i386/att.h linux.h i386/freebsd.h i386/perform.h"
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
+- tmake_file=i386/t-freebsd
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
++ tmake_file=t-freebsd
+ gas=yes
+ gnu_ld=yes
+ stabs=yes
diff --git a/lang/egcs/files/patch-al b/lang/egcs/files/patch-al
index 51e1b8cdee1c..c8a195127ed0 100644
--- a/lang/egcs/files/patch-al
+++ b/lang/egcs/files/patch-al
@@ -1,5 +1,5 @@
--- gcc/configure.in.orig Sun Mar 7 16:22:22 1999
-+++ gcc/configure.in Sat Mar 13 19:23:23 1999
++++ gcc/configure.in Sat Mar 20 00:40:58 1999
@@ -416,6 +416,15 @@
thread_file='posix'
fi
@@ -27,18 +27,20 @@
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
- extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
+- tmake_file=i386/t-freebsd
- gas=yes
- gnu_ld=yes
- stabs=yes
++ tmake_file=t-freebsd
;;
i[[34567]]86-*-freebsd*)
- tm_file=i386/freebsd.h
+ tm_file="i386/i386.h i386/att.h linux.h i386/freebsd.h i386/perform.h"
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
+- tmake_file=i386/t-freebsd
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
++ tmake_file=t-freebsd
+ gas=yes
+ gnu_ld=yes
+ stabs=yes
diff --git a/lang/gcc-devel/Makefile b/lang/gcc-devel/Makefile
index f9347a47d87e..cd5b039f398a 100644
--- a/lang/gcc-devel/Makefile
+++ b/lang/gcc-devel/Makefile
@@ -4,7 +4,7 @@
# Date created: 9 Jan 1998
# Whom: John Polstra <jdp@polstra.com>
#
-# $Id: Makefile,v 1.48 1999/03/08 07:28:27 asami Exp $
+# $Id: Makefile,v 1.50 1999/03/17 00:40:25 obrien Exp $
#
DISTNAME= egcs-1.1.2
@@ -55,21 +55,20 @@ ALL_TARGET= bootstrap
MAN1= cccp.1 g++.1 g77.1 gcc.1
pre-patch:
+ @${MV} ${WRKSRC}/gcc/config/i386/t-freebsd ${WRKSRC}/gcc/config/
@${MV} ${WRKSRC}/gcc/config/i386/freebsd.h ${WRKSRC}/gcc/config/i386/freebsd-aout.h
@${MV} ${WRKSRC}/gcc/config/i386/freebsd-elf.h ${WRKSRC}/gcc/config/i386/freebsd.h
+ @${CP} ${FILESDIR}/alpha-freebsd-elf.h ${WRKSRC}/gcc/config/alpha/freebsd-elf.h
+ @${CP} ${FILESDIR}/alpha-freebsd.h ${WRKSRC}/gcc/config/alpha/freebsd.h
pre-configure:
@# Keep from running `autoconf' and `autoheader' since we modified
@# configure.in by patching it.
@touch ${WRKSRC}/gcc/configure
@touch ${WRKSRC}/gcc/cstamp-h.in
- @(cd ${WRKSRC}/gcc/config/${ARCH}/ ; \
- MAJ=`sysctl -n kern.osreldate | ${SED} -e '/.....$$/s///'` ; \
- ${MV} freebsd-aout.h freebsd-aout.h.in ; \
- ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" freebsd-aout.h.in \
- >freebsd-aout.h ; \
- ${MV} freebsd.h freebsd.h.in ; \
- ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" freebsd.h.in >freebsd.h )
+ @(MAJ=`sysctl -n kern.osreldate | ${SED} -e '/.....$$/s///'` ; \
+ ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" ${FILESDIR}/freebsd.h \
+ >${WRKSRC}/gcc/config/freebsd.h )
.if ${PORTOBJFORMAT} == "elf" && ${MACHINE_ARCH} == "i386"
@${SED} -e 's/^@comment ELF-only://' ${PKGDIR}/PLIST >${PLIST}
.endif
diff --git a/lang/gcc-devel/files/alpha-freebsd.h b/lang/gcc-devel/files/alpha-freebsd.h
new file mode 100644
index 000000000000..60a1f07b94ba
--- /dev/null
+++ b/lang/gcc-devel/files/alpha-freebsd.h
@@ -0,0 +1,443 @@
+/* Definitions of target machine for GNU compiler,
+ for Alpha FreeBSD systems.
+ Copyright (C) 1998 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* This is used on Alpha platforms that use the ELF format.
+ This was taken from the NetBSD configuration, and modified
+ for FreeBSD/alpha by Hidetoshi Shimokawa <simokawa@FreeBSD.ORG> */
+
+
+/* Get generic FreeBSD definitions. */
+#include <freebsd.h>
+
+
+#undef OBJECT_FORMAT_COFF
+#undef EXTENDED_COFF
+#define OBJECT_FORMAT_ELF
+
+/* This is BSD, so it wants DBX format. */
+
+#define DBX_DEBUGGING_INFO
+
+/* This is the char to use for continuation (in case we need to turn
+ continuation back on). */
+
+#define DBX_CONTIN_CHAR '?'
+
+#undef ASM_FINAL_SPEC
+
+/* Names to predefine in the preprocessor for this target machine.
+ XXX FreeBSD, by convention, shouldn't do __alpha, but lots of applications
+ expect it because that's what OSF/1 does. */
+
+#undef TARGET_DEFAULT
+#define TARGET_DEFAULT (MASK_FP | MASK_FPREGS | MASK_GAS)
+
+#undef CPP_PREDEFINES
+#define CPP_PREDEFINES "\
+-D__alpha__ -D__alpha -Acpu(alpha) -Amachine(alpha) " \
+FBSD_CPP_PREDEFINES \
+SUB_CPP_PREDEFINES
+
+/* Make gcc agree with <machine/ansi.h> */
+
+#undef WCHAR_TYPE
+#define WCHAR_TYPE "int"
+
+#undef WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE 32
+
+/* Output assembler code to FILE to increment profiler label # LABELNO
+ for profiling a function entry. Under FreeBSD/Alpha, the assembler does
+ nothing special with -pg. */
+
+#undef FUNCTION_PROFILER
+#define FUNCTION_PROFILER(FILE, LABELNO) \
+ fputs ("\tjsr $28,_mcount\n", (FILE))
+
+/* Show that we need a GP when profiling. */
+#define TARGET_PROFILING_NEEDS_GP
+
+#undef HAS_INIT_SECTION
+
+/* Provide an ASM_SPEC appropriate for a FreeBSD/alpha target. This differs
+ from the generic FreeBSD ASM_SPEC in that no special handling of PIC is
+ necessary on the Alpha. */
+
+#undef ASM_SPEC
+#define ASM_SPEC " %| %{mcpu=*:-m%*}"
+
+/* Output at beginning of assembler file. */
+
+#undef ASM_FILE_START
+#define ASM_FILE_START(FILE) \
+{ \
+ alpha_write_verstamp (FILE); \
+ output_file_directive (FILE, main_input_filename); \
+ fprintf (FILE, "\t.version\t\"01.01\"\n"); \
+ fprintf (FILE, "\t.set noat\n"); \
+}
+
+#define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE) \
+ alpha_output_lineno (STREAM, LINE)
+extern void alpha_output_lineno ();
+
+extern void output_file_directive ();
+
+/* 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. */
+
+#define IDENT_ASM_OP ".ident"
+
+#ifdef IDENTIFY_WITH_IDENT
+#define ASM_IDENTIFY_GCC(FILE) /* nothing */
+#define ASM_IDENTIFY_LANGUAGE(FILE) \
+ fprintf(FILE, "\t%s \"GCC (%s) %s\"\n", IDENT_ASM_OP, \
+ lang_identify(), version_string)
+#else
+#define ASM_FILE_END(FILE) \
+do { \
+ fprintf ((FILE), "\t%s\t\"GCC: (GNU) %s\"\n", \
+ IDENT_ASM_OP, version_string); \
+ } while (0)
+#endif
+
+/* Allow #sccs in preprocessor. */
+
+#define SCCS_DIRECTIVE
+
+/* Output #ident as a .ident. */
+
+#define ASM_OUTPUT_IDENT(FILE, NAME) \
+ fprintf (FILE, "\t%s\t\"%s\"\n", IDENT_ASM_OP, NAME);
+
+/* This is how to allocate empty space in some section. The .zero
+ pseudo-op is used for this on most svr4 assemblers. */
+
+#define SKIP_ASM_OP ".zero"
+
+#undef ASM_OUTPUT_SKIP
+#define ASM_OUTPUT_SKIP(FILE,SIZE) \
+ fprintf (FILE, "\t%s\t%u\n", SKIP_ASM_OP, (SIZE))
+
+/* Output the label which precedes a jumptable. Note that for all svr4
+ systems where we actually generate jumptables (which is to say every
+ svr4 target except i386, where we use casesi instead) we put the jump-
+ tables into the .rodata section and since other stuff could have been
+ put into the .rodata section prior to any given jumptable, we have to
+ make sure that the location counter for the .rodata section gets pro-
+ perly re-aligned prior to the actual beginning of the jump table. */
+
+#define ALIGN_ASM_OP ".align"
+
+#ifndef ASM_OUTPUT_BEFORE_CASE_LABEL
+#define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE,PREFIX,NUM,TABLE) \
+ ASM_OUTPUT_ALIGN ((FILE), 2);
+#endif
+
+#undef ASM_OUTPUT_CASE_LABEL
+#define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,JUMPTABLE) \
+ do { \
+ ASM_OUTPUT_BEFORE_CASE_LABEL (FILE, PREFIX, NUM, JUMPTABLE) \
+ ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); \
+ } while (0)
+
+/* The standard SVR4 assembler seems to require that certain builtin
+ library routines (e.g. .udiv) be explicitly declared as .globl
+ in each assembly file where they are referenced. */
+
+#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
+ ASM_GLOBALIZE_LABEL (FILE, XSTR (FUN, 0))
+
+/* This says how to output assembler code to declare an
+ uninitialized external linkage data object. Under SVR4,
+ the linker seems to want the alignment of data objects
+ to depend on their types. We do exactly that here. */
+
+#define COMMON_ASM_OP ".comm"
+
+#undef ASM_OUTPUT_ALIGNED_COMMON
+#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
+do { \
+ fprintf ((FILE), "\t%s\t", COMMON_ASM_OP); \
+ assemble_name ((FILE), (NAME)); \
+ fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \
+} while (0)
+
+/* This says how to output assembler code to declare an
+ uninitialized internal linkage data object. Under SVR4,
+ the linker seems to want the alignment of data objects
+ to depend on their types. We do exactly that here. */
+
+#define LOCAL_ASM_OP ".local"
+
+#undef ASM_OUTPUT_ALIGNED_LOCAL
+#define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
+do { \
+ fprintf ((FILE), "\t%s\t", LOCAL_ASM_OP); \
+ assemble_name ((FILE), (NAME)); \
+ fprintf ((FILE), "\n"); \
+ ASM_OUTPUT_ALIGNED_COMMON (FILE, NAME, SIZE, ALIGN); \
+} while (0)
+
+/* This is the pseudo-op used to generate a 64-bit word of data with a
+ specific value in some section. */
+
+#define INT_ASM_OP ".quad"
+
+/* This is the pseudo-op used to generate a contiguous sequence of byte
+ values from a double-quoted string WITHOUT HAVING A TERMINATING NUL
+ AUTOMATICALLY APPENDED. This is the same for most svr4 assemblers. */
+
+#undef ASCII_DATA_ASM_OP
+#define ASCII_DATA_ASM_OP ".ascii"
+
+/* Support const sections and the ctors and dtors sections for g++.
+ Note that there appears to be two different ways to support const
+ sections at the moment. You can either #define the symbol
+ READONLY_DATA_SECTION (giving it some code which switches to the
+ readonly data section) or else you can #define the symbols
+ EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, SELECT_SECTION, and
+ SELECT_RTX_SECTION. We do both here just to be on the safe side. */
+
+#define USE_CONST_SECTION 1
+
+#define CONST_SECTION_ASM_OP ".section\t.rodata"
+
+/* Define the pseudo-ops used to switch to the .ctors and .dtors sections.
+
+ Note that we want to give these sections the SHF_WRITE attribute
+ because these sections will actually contain data (i.e. tables of
+ addresses of functions in the current root executable or shared library
+ file) and, in the case of a shared library, the relocatable addresses
+ will have to be properly resolved/relocated (and then written into) by
+ the dynamic linker when it actually attaches the given shared library
+ to the executing process. (Note that on SVR4, you may wish to use the
+ `-z text' option to the ELF linker, when building a shared library, as
+ an additional check that you are doing everything right. But if you do
+ use the `-z text' option when building a shared library, you will get
+ errors unless the .ctors and .dtors sections are marked as writable
+ via the SHF_WRITE attribute.) */
+
+#define CTORS_SECTION_ASM_OP ".section\t.ctors,\"aw\""
+#define DTORS_SECTION_ASM_OP ".section\t.dtors,\"aw\""
+
+/* On svr4, we *do* have support for the .init and .fini sections, and we
+ can put stuff in there to be executed before and after `main'. We let
+ crtstuff.c and other files know this by defining the following symbols.
+ The definitions say how to change sections to the .init and .fini
+ sections. This is the same for all known svr4 assemblers. */
+
+#define INIT_SECTION_ASM_OP ".section\t.init"
+#define FINI_SECTION_ASM_OP ".section\t.fini"
+
+/* A default list of other sections which we might be "in" at any given
+ time. For targets that use additional sections (e.g. .tdesc) you
+ should override this definition in the target-specific file which
+ includes this file. */
+
+#undef EXTRA_SECTIONS
+#define EXTRA_SECTIONS in_const, in_ctors, in_dtors
+
+/* A default list of extra section function definitions. For targets
+ that use additional sections (e.g. .tdesc) you should override this
+ definition in the target-specific file which includes this file. */
+
+#undef EXTRA_SECTION_FUNCTIONS
+#define EXTRA_SECTION_FUNCTIONS \
+ CONST_SECTION_FUNCTION \
+ CTORS_SECTION_FUNCTION \
+ DTORS_SECTION_FUNCTION
+
+#undef READONLY_DATA_SECTION
+#define READONLY_DATA_SECTION() const_section ()
+
+extern void text_section ();
+
+#define CONST_SECTION_FUNCTION \
+void \
+const_section () \
+{ \
+ if (!USE_CONST_SECTION) \
+ text_section(); \
+ else if (in_section != in_const) \
+ { \
+ fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP); \
+ in_section = in_const; \
+ } \
+}
+
+#define CTORS_SECTION_FUNCTION \
+void \
+ctors_section () \
+{ \
+ if (in_section != in_ctors) \
+ { \
+ fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP); \
+ in_section = in_ctors; \
+ } \
+}
+
+#define DTORS_SECTION_FUNCTION \
+void \
+dtors_section () \
+{ \
+ if (in_section != in_dtors) \
+ { \
+ fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP); \
+ in_section = in_dtors; \
+ } \
+}
+
+/* Switch into a generic section.
+ This is currently only used to support section attributes.
+
+ We make the section read-only and executable for a function decl,
+ read-only for a const data decl, and writable for a non-const data decl. */
+#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC) \
+ fprintf (FILE, ".section\t%s,\"%s\",@progbits\n", NAME, \
+ (DECL) && TREE_CODE (DECL) == FUNCTION_DECL ? "ax" : \
+ (DECL) && DECL_READONLY_SECTION (DECL, RELOC) ? "a" : "aw")
+
+
+/* A C statement (sans semicolon) to output an element in the table of
+ global constructors. */
+#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
+ do { \
+ ctors_section (); \
+ fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
+ assemble_name (FILE, NAME); \
+ fprintf (FILE, "\n"); \
+ } while (0)
+
+/* A C statement (sans semicolon) to output an element in the table of
+ global destructors. */
+#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
+ do { \
+ dtors_section (); \
+ fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
+ assemble_name (FILE, NAME); \
+ fprintf (FILE, "\n"); \
+ } while (0)
+
+/* A C statement or statements to switch to the appropriate
+ section for output of DECL. DECL is either a `VAR_DECL' node
+ or a constant of some sort. RELOC indicates whether forming
+ the initial value of DECL requires link-time relocations. */
+
+#define SELECT_SECTION(DECL,RELOC) \
+{ \
+ if (TREE_CODE (DECL) == STRING_CST) \
+ { \
+ if (! flag_writable_strings) \
+ const_section (); \
+ else \
+ data_section (); \
+ } \
+ else if (TREE_CODE (DECL) == VAR_DECL) \
+ { \
+ if ((flag_pic && RELOC) \
+ || !TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL) \
+ || !DECL_INITIAL (DECL) \
+ || (DECL_INITIAL (DECL) != error_mark_node \
+ && !TREE_CONSTANT (DECL_INITIAL (DECL)))) \
+ data_section (); \
+ else \
+ const_section (); \
+ } \
+ else \
+ const_section (); \
+}
+
+/* A C statement or statements to switch to the appropriate
+ section for output of RTX in mode MODE. RTX is some kind
+ of constant in RTL. The argument MODE is redundant except
+ in the case of a `const_int' rtx. Currently, these always
+ go into the const section. */
+
+#undef SELECT_RTX_SECTION
+#define SELECT_RTX_SECTION(MODE,RTX) const_section()
+
+/* Define the strings used for the special svr4 .type and .size directives.
+ These strings generally do not vary from one system running svr4 to
+ another, but if a given system (e.g. m88k running svr) needs to use
+ different pseudo-op names for these, they may be overridden in the
+ file which includes this one. */
+
+#define TYPE_ASM_OP ".type"
+#define SIZE_ASM_OP ".size"
+
+/* This is how we tell the assembler that two symbols have the same value. */
+
+#define ASM_OUTPUT_DEF(FILE,NAME1,NAME2) \
+ do { assemble_name(FILE, NAME1); \
+ fputs(" = ", FILE); \
+ assemble_name(FILE, NAME2); \
+ fputc('\n', FILE); } while (0)
+
+/* A table of bytes codes used by the ASM_OUTPUT_ASCII and
+ ASM_OUTPUT_LIMITED_STRING macros. Each byte in the table
+ corresponds to a particular byte value [0..255]. For any
+ given byte value, if the value in the corresponding table
+ position is zero, the given character can be output directly.
+ If the table value is 1, the byte must be output as a \ooo
+ octal escape. If the tables value is anything else, then the
+ byte value should be output as a \ followed by the value
+ in the table. Note that we can use standard UN*X escape
+ sequences for many control characters, but we don't use
+ \a to represent BEL because some svr4 assemblers (e.g. on
+ the i386) don't know about that. Also, we don't use \v
+ since some versions of gas, such as 2.2 did not accept it. */
+
+#define ESCAPES \
+"\1\1\1\1\1\1\1\1btn\1fr\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\0\0\"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\\\0\0\0\
+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1"
+
+/* Some svr4 assemblers have a limit on the number of characters which
+ can appear in the operand of a .string directive. If your assembler
+ has such a limitation, you should define STRING_LIMIT to reflect that
+ limit. Note that at least some svr4 assemblers have a limit on the
+ actual number of bytes in the double-quoted string, and that they
+ count each character in an escape sequence as one byte. Thus, an
+ escape sequence like \377 would count as four bytes.
+
+ If your target assembler doesn't support the .string directive, you
+ should define this to zero.
+*/
+
+#define STRING_LIMIT ((unsigned) 256)
+
+#define STRING_ASM_OP ".string"
+
+/*
+ * We always use gas here, so we don't worry about ECOFF assembler problems.
+ */
+#undef TARGET_GAS
+#define TARGET_GAS (1)
+
+#undef PREFERRED_DEBUGGING_TYPE
+#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
diff --git a/lang/gcc-devel/files/patch-ad b/lang/gcc-devel/files/patch-ad
index f8fb5803acf0..bea070deb344 100644
--- a/lang/gcc-devel/files/patch-ad
+++ b/lang/gcc-devel/files/patch-ad
@@ -1,6 +1,41 @@
--- gcc/config/i386/freebsd-aout.h.orig Mon Mar 1 14:47:33 1999
-+++ gcc/config/i386/freebsd-aout.h Sat Mar 13 19:24:50 1999
-@@ -103,19 +103,18 @@
++++ gcc/config/i386/freebsd-aout.h Sat Mar 20 00:27:02 1999
+@@ -20,6 +20,10 @@
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
++
++/* Get generic FreeBSD definitions. */
++#include <freebsd.h>
++
+ /* This goes away when the math-emulator is fixed */
+ #define TARGET_CPU_DEFAULT 0400 /* TARGET_NO_FANCY_MATH_387 */
+
+@@ -35,7 +39,7 @@
+ #include "i386/perform.h"
+
+ #undef CPP_PREDEFINES
+-#define CPP_PREDEFINES "-Dunix -Di386 -D__FreeBSD__ -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)"
++#define CPP_PREDEFINES "-Di386 -Acpu(i386) -Amachine(i386)" CPP_FBSD_PREDEFINES
+
+ /* Like the default, except no -lg. */
+ #define LIB_SPEC "%{!shared:%{!pg:-lc}%{pg:-lc_p}}"
+@@ -85,14 +89,6 @@
+ necessary when compiling PIC code. */
+
+ #define JUMP_TABLES_IN_TEXT_SECTION 1
+-
+-/* Don't default to pcc-struct-return, because gcc is the only compiler, and
+- we want to retain compatibility with older gcc versions. */
+-#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
+
+ /* i386 freebsd still uses old binutils that don't insert nops by default
+ when the .align directive demands to insert extra space in the text
+@@ -103,19 +99,18 @@
/* Profiling routines, partially copied from i386/osfrose.h. */
@@ -23,7 +58,7 @@
fprintf (FILE, "\tcall mcount\n"); \
} \
}
-@@ -133,6 +132,7 @@
+@@ -133,6 +128,7 @@
#define TYPE_ASM_OP ".type"
#define SIZE_ASM_OP ".size"
@@ -31,7 +66,7 @@
/* The following macro defines the format used to output the second
operand of the .type assembler directive. Different svr4 assemblers
-@@ -142,6 +142,12 @@
+@@ -142,6 +138,12 @@
#define TYPE_OPERAND_FMT "@%s"
@@ -44,12 +79,34 @@
/* Write the extra assembler code needed to declare a function's result.
Most svr4 assemblers don't require any special declaration of the
result value, but there are exceptions. */
-@@ -243,6 +249,8 @@
- #define STARTFILE_SPEC \
+@@ -244,29 +246,4 @@
"%{shared:c++rt0.o%s} \
%{!shared:%{pg:gcrt0.o%s}%{!pg:%{static:scrt0.o%s}%{!static:crt0.o%s}}}"
-+
-+#define MD_STARTFILE_PREFIX "/usr/lib/aout/"
- /* This is defined when gcc is compiled in the BSD-directory-tree, and must
- * make up for the gap to all the stuff done in the GNU-makefiles.
+-/* This is defined when gcc is compiled in the BSD-directory-tree, and must
+- * make up for the gap to all the stuff done in the GNU-makefiles.
+- */
+-
+-#ifdef FREEBSD_NATIVE
+-
+-#define INCLUDE_DEFAULTS { \
+- { "/usr/include", 0, 0, 0 }, \
+- { "/usr/include/g++", "G++", 1, 1 }, \
+- { 0, 0, 0, 0} \
+- }
+-
+-#undef MD_EXEC_PREFIX
+-#define MD_EXEC_PREFIX "/usr/libexec/"
+-
+-#undef STANDARD_STARTFILE_PREFIX
+-#define STANDARD_STARTFILE_PREFIX "/usr/lib"
+-
+-#if 0 /* This is very wrong!!! */
+-#define DEFAULT_TARGET_MACHINE "i386-unknown-freebsd_1.0"
+-#define GPLUSPLUS_INCLUDE_DIR "/usr/local/lib/gcc-lib/i386-unknown-freebsd_1.0/2.5.8/include"
+-#define TOOL_INCLUDE_DIR "/usr/local/i386-unknown-freebsd_1.0/include"
+-#define GCC_INCLUDE_DIR "/usr/local/lib/gcc-lib/i386-unknown-freebsd_1.0/2.5.8/include"
+-#endif
+-
+-#endif /* FREEBSD_NATIVE */
++#define MD_STARTFILE_PREFIX "/usr/lib/aout/"
diff --git a/lang/gcc-devel/files/patch-af b/lang/gcc-devel/files/patch-af
index c50ce06c8375..c1f1ba0e855f 100644
--- a/lang/gcc-devel/files/patch-af
+++ b/lang/gcc-devel/files/patch-af
@@ -1,6 +1,30 @@
--- gcc/config/i386/freebsd.h.orig Mon Mar 1 14:47:32 1999
-+++ gcc/config/i386/freebsd.h Sat Mar 13 19:25:53 1999
-@@ -113,22 +113,19 @@
++++ gcc/config/i386/freebsd.h Sun Mar 21 16:58:39 1999
+@@ -21,19 +21,13 @@
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
++
++/* Get generic FreeBSD definitions. */
++#include <freebsd.h>
++
+ #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
+-
+ /* This is how to output an element of a case-vector that is relative.
+ This is only used for PIC code. See comments by the `casesi' insn in
+ i386.md for an explanation of the expression this outputs. */
+@@ -113,22 +107,19 @@
: ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \
: (-1))
@@ -27,8 +51,18 @@
} \
}
-@@ -151,20 +148,8 @@
- #define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
+@@ -145,26 +136,16 @@
+ #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)"
++#define CPP_PREDEFINES "-Di386 -D__ELF__ -Acpu(i386) -Amachine(i386)" CPP_FBSD_PREDEFINES
+
+ #undef CPP_SPEC
+-#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
++#define CPP_SPEC \
++ "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE} %{m486:-D__i486__}"
++ /* %{pthread:-D_REENTRANT} */
#undef LIB_SPEC
-#if 1
@@ -36,16 +70,16 @@
- * want to profile or debug the C library, please add
- * -lc_p or -ggdb to LDFLAGS at the link time, respectively.
- */
- #define LIB_SPEC \
+-#define LIB_SPEC \
- "%{!shared: %{mieee-fp:-lieee} %{p:-lgmon} %{pg:-lgmon} \
- %{!ggdb:-lc} %{ggdb:-lg}}"
-#else
--#define LIB_SPEC \
+ #define LIB_SPEC \
- "%{!shared: \
- %{mieee-fp:-lieee} %{p:-lgmon -lc_p} %{pg:-lgmon -lc_p} \
- %{!p:%{!pg:%{!g*:-lc} %{g*:-lg}}}}"
-#endif
-+ "%{!shared: %{p:-lc_p} %{pg:-lc_p} %{!p:%{!pg:-lc}}}"
++ "%{!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
diff --git a/lang/gcc-devel/files/patch-ak b/lang/gcc-devel/files/patch-ak
index 19a2994f3f05..2e54beea1a61 100644
--- a/lang/gcc-devel/files/patch-ak
+++ b/lang/gcc-devel/files/patch-ak
@@ -1,5 +1,5 @@
---- gcc/configure.orig Mon Mar 8 10:06:10 1999
-+++ gcc/configure Sat Mar 13 19:08:06 1999
+--- gcc/configure.orig Sun Mar 14 02:59:02 1999
++++ gcc/configure Sat Mar 20 00:40:05 1999
@@ -2395,6 +2395,15 @@
thread_file='posix'
fi
@@ -27,18 +27,20 @@
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
- extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
+- tmake_file=i386/t-freebsd
- gas=yes
- gnu_ld=yes
- stabs=yes
++ tmake_file=t-freebsd
;;
i[34567]86-*-freebsd*)
- tm_file=i386/freebsd.h
+ tm_file="i386/i386.h i386/att.h linux.h i386/freebsd.h i386/perform.h"
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
+- tmake_file=i386/t-freebsd
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
++ tmake_file=t-freebsd
+ gas=yes
+ gnu_ld=yes
+ stabs=yes
diff --git a/lang/gcc-devel/files/patch-al b/lang/gcc-devel/files/patch-al
index 51e1b8cdee1c..c8a195127ed0 100644
--- a/lang/gcc-devel/files/patch-al
+++ b/lang/gcc-devel/files/patch-al
@@ -1,5 +1,5 @@
--- gcc/configure.in.orig Sun Mar 7 16:22:22 1999
-+++ gcc/configure.in Sat Mar 13 19:23:23 1999
++++ gcc/configure.in Sat Mar 20 00:40:58 1999
@@ -416,6 +416,15 @@
thread_file='posix'
fi
@@ -27,18 +27,20 @@
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
- extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
+- tmake_file=i386/t-freebsd
- gas=yes
- gnu_ld=yes
- stabs=yes
++ tmake_file=t-freebsd
;;
i[[34567]]86-*-freebsd*)
- tm_file=i386/freebsd.h
+ tm_file="i386/i386.h i386/att.h linux.h i386/freebsd.h i386/perform.h"
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
+- tmake_file=i386/t-freebsd
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
++ tmake_file=t-freebsd
+ gas=yes
+ gnu_ld=yes
+ stabs=yes
diff --git a/lang/gcc-ooo/Makefile b/lang/gcc-ooo/Makefile
index f9347a47d87e..cd5b039f398a 100644
--- a/lang/gcc-ooo/Makefile
+++ b/lang/gcc-ooo/Makefile
@@ -4,7 +4,7 @@
# Date created: 9 Jan 1998
# Whom: John Polstra <jdp@polstra.com>
#
-# $Id: Makefile,v 1.48 1999/03/08 07:28:27 asami Exp $
+# $Id: Makefile,v 1.50 1999/03/17 00:40:25 obrien Exp $
#
DISTNAME= egcs-1.1.2
@@ -55,21 +55,20 @@ ALL_TARGET= bootstrap
MAN1= cccp.1 g++.1 g77.1 gcc.1
pre-patch:
+ @${MV} ${WRKSRC}/gcc/config/i386/t-freebsd ${WRKSRC}/gcc/config/
@${MV} ${WRKSRC}/gcc/config/i386/freebsd.h ${WRKSRC}/gcc/config/i386/freebsd-aout.h
@${MV} ${WRKSRC}/gcc/config/i386/freebsd-elf.h ${WRKSRC}/gcc/config/i386/freebsd.h
+ @${CP} ${FILESDIR}/alpha-freebsd-elf.h ${WRKSRC}/gcc/config/alpha/freebsd-elf.h
+ @${CP} ${FILESDIR}/alpha-freebsd.h ${WRKSRC}/gcc/config/alpha/freebsd.h
pre-configure:
@# Keep from running `autoconf' and `autoheader' since we modified
@# configure.in by patching it.
@touch ${WRKSRC}/gcc/configure
@touch ${WRKSRC}/gcc/cstamp-h.in
- @(cd ${WRKSRC}/gcc/config/${ARCH}/ ; \
- MAJ=`sysctl -n kern.osreldate | ${SED} -e '/.....$$/s///'` ; \
- ${MV} freebsd-aout.h freebsd-aout.h.in ; \
- ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" freebsd-aout.h.in \
- >freebsd-aout.h ; \
- ${MV} freebsd.h freebsd.h.in ; \
- ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" freebsd.h.in >freebsd.h )
+ @(MAJ=`sysctl -n kern.osreldate | ${SED} -e '/.....$$/s///'` ; \
+ ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" ${FILESDIR}/freebsd.h \
+ >${WRKSRC}/gcc/config/freebsd.h )
.if ${PORTOBJFORMAT} == "elf" && ${MACHINE_ARCH} == "i386"
@${SED} -e 's/^@comment ELF-only://' ${PKGDIR}/PLIST >${PLIST}
.endif
diff --git a/lang/gcc-ooo/files/alpha-freebsd.h b/lang/gcc-ooo/files/alpha-freebsd.h
new file mode 100644
index 000000000000..60a1f07b94ba
--- /dev/null
+++ b/lang/gcc-ooo/files/alpha-freebsd.h
@@ -0,0 +1,443 @@
+/* Definitions of target machine for GNU compiler,
+ for Alpha FreeBSD systems.
+ Copyright (C) 1998 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* This is used on Alpha platforms that use the ELF format.
+ This was taken from the NetBSD configuration, and modified
+ for FreeBSD/alpha by Hidetoshi Shimokawa <simokawa@FreeBSD.ORG> */
+
+
+/* Get generic FreeBSD definitions. */
+#include <freebsd.h>
+
+
+#undef OBJECT_FORMAT_COFF
+#undef EXTENDED_COFF
+#define OBJECT_FORMAT_ELF
+
+/* This is BSD, so it wants DBX format. */
+
+#define DBX_DEBUGGING_INFO
+
+/* This is the char to use for continuation (in case we need to turn
+ continuation back on). */
+
+#define DBX_CONTIN_CHAR '?'
+
+#undef ASM_FINAL_SPEC
+
+/* Names to predefine in the preprocessor for this target machine.
+ XXX FreeBSD, by convention, shouldn't do __alpha, but lots of applications
+ expect it because that's what OSF/1 does. */
+
+#undef TARGET_DEFAULT
+#define TARGET_DEFAULT (MASK_FP | MASK_FPREGS | MASK_GAS)
+
+#undef CPP_PREDEFINES
+#define CPP_PREDEFINES "\
+-D__alpha__ -D__alpha -Acpu(alpha) -Amachine(alpha) " \
+FBSD_CPP_PREDEFINES \
+SUB_CPP_PREDEFINES
+
+/* Make gcc agree with <machine/ansi.h> */
+
+#undef WCHAR_TYPE
+#define WCHAR_TYPE "int"
+
+#undef WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE 32
+
+/* Output assembler code to FILE to increment profiler label # LABELNO
+ for profiling a function entry. Under FreeBSD/Alpha, the assembler does
+ nothing special with -pg. */
+
+#undef FUNCTION_PROFILER
+#define FUNCTION_PROFILER(FILE, LABELNO) \
+ fputs ("\tjsr $28,_mcount\n", (FILE))
+
+/* Show that we need a GP when profiling. */
+#define TARGET_PROFILING_NEEDS_GP
+
+#undef HAS_INIT_SECTION
+
+/* Provide an ASM_SPEC appropriate for a FreeBSD/alpha target. This differs
+ from the generic FreeBSD ASM_SPEC in that no special handling of PIC is
+ necessary on the Alpha. */
+
+#undef ASM_SPEC
+#define ASM_SPEC " %| %{mcpu=*:-m%*}"
+
+/* Output at beginning of assembler file. */
+
+#undef ASM_FILE_START
+#define ASM_FILE_START(FILE) \
+{ \
+ alpha_write_verstamp (FILE); \
+ output_file_directive (FILE, main_input_filename); \
+ fprintf (FILE, "\t.version\t\"01.01\"\n"); \
+ fprintf (FILE, "\t.set noat\n"); \
+}
+
+#define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE) \
+ alpha_output_lineno (STREAM, LINE)
+extern void alpha_output_lineno ();
+
+extern void output_file_directive ();
+
+/* 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. */
+
+#define IDENT_ASM_OP ".ident"
+
+#ifdef IDENTIFY_WITH_IDENT
+#define ASM_IDENTIFY_GCC(FILE) /* nothing */
+#define ASM_IDENTIFY_LANGUAGE(FILE) \
+ fprintf(FILE, "\t%s \"GCC (%s) %s\"\n", IDENT_ASM_OP, \
+ lang_identify(), version_string)
+#else
+#define ASM_FILE_END(FILE) \
+do { \
+ fprintf ((FILE), "\t%s\t\"GCC: (GNU) %s\"\n", \
+ IDENT_ASM_OP, version_string); \
+ } while (0)
+#endif
+
+/* Allow #sccs in preprocessor. */
+
+#define SCCS_DIRECTIVE
+
+/* Output #ident as a .ident. */
+
+#define ASM_OUTPUT_IDENT(FILE, NAME) \
+ fprintf (FILE, "\t%s\t\"%s\"\n", IDENT_ASM_OP, NAME);
+
+/* This is how to allocate empty space in some section. The .zero
+ pseudo-op is used for this on most svr4 assemblers. */
+
+#define SKIP_ASM_OP ".zero"
+
+#undef ASM_OUTPUT_SKIP
+#define ASM_OUTPUT_SKIP(FILE,SIZE) \
+ fprintf (FILE, "\t%s\t%u\n", SKIP_ASM_OP, (SIZE))
+
+/* Output the label which precedes a jumptable. Note that for all svr4
+ systems where we actually generate jumptables (which is to say every
+ svr4 target except i386, where we use casesi instead) we put the jump-
+ tables into the .rodata section and since other stuff could have been
+ put into the .rodata section prior to any given jumptable, we have to
+ make sure that the location counter for the .rodata section gets pro-
+ perly re-aligned prior to the actual beginning of the jump table. */
+
+#define ALIGN_ASM_OP ".align"
+
+#ifndef ASM_OUTPUT_BEFORE_CASE_LABEL
+#define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE,PREFIX,NUM,TABLE) \
+ ASM_OUTPUT_ALIGN ((FILE), 2);
+#endif
+
+#undef ASM_OUTPUT_CASE_LABEL
+#define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,JUMPTABLE) \
+ do { \
+ ASM_OUTPUT_BEFORE_CASE_LABEL (FILE, PREFIX, NUM, JUMPTABLE) \
+ ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); \
+ } while (0)
+
+/* The standard SVR4 assembler seems to require that certain builtin
+ library routines (e.g. .udiv) be explicitly declared as .globl
+ in each assembly file where they are referenced. */
+
+#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
+ ASM_GLOBALIZE_LABEL (FILE, XSTR (FUN, 0))
+
+/* This says how to output assembler code to declare an
+ uninitialized external linkage data object. Under SVR4,
+ the linker seems to want the alignment of data objects
+ to depend on their types. We do exactly that here. */
+
+#define COMMON_ASM_OP ".comm"
+
+#undef ASM_OUTPUT_ALIGNED_COMMON
+#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
+do { \
+ fprintf ((FILE), "\t%s\t", COMMON_ASM_OP); \
+ assemble_name ((FILE), (NAME)); \
+ fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \
+} while (0)
+
+/* This says how to output assembler code to declare an
+ uninitialized internal linkage data object. Under SVR4,
+ the linker seems to want the alignment of data objects
+ to depend on their types. We do exactly that here. */
+
+#define LOCAL_ASM_OP ".local"
+
+#undef ASM_OUTPUT_ALIGNED_LOCAL
+#define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
+do { \
+ fprintf ((FILE), "\t%s\t", LOCAL_ASM_OP); \
+ assemble_name ((FILE), (NAME)); \
+ fprintf ((FILE), "\n"); \
+ ASM_OUTPUT_ALIGNED_COMMON (FILE, NAME, SIZE, ALIGN); \
+} while (0)
+
+/* This is the pseudo-op used to generate a 64-bit word of data with a
+ specific value in some section. */
+
+#define INT_ASM_OP ".quad"
+
+/* This is the pseudo-op used to generate a contiguous sequence of byte
+ values from a double-quoted string WITHOUT HAVING A TERMINATING NUL
+ AUTOMATICALLY APPENDED. This is the same for most svr4 assemblers. */
+
+#undef ASCII_DATA_ASM_OP
+#define ASCII_DATA_ASM_OP ".ascii"
+
+/* Support const sections and the ctors and dtors sections for g++.
+ Note that there appears to be two different ways to support const
+ sections at the moment. You can either #define the symbol
+ READONLY_DATA_SECTION (giving it some code which switches to the
+ readonly data section) or else you can #define the symbols
+ EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, SELECT_SECTION, and
+ SELECT_RTX_SECTION. We do both here just to be on the safe side. */
+
+#define USE_CONST_SECTION 1
+
+#define CONST_SECTION_ASM_OP ".section\t.rodata"
+
+/* Define the pseudo-ops used to switch to the .ctors and .dtors sections.
+
+ Note that we want to give these sections the SHF_WRITE attribute
+ because these sections will actually contain data (i.e. tables of
+ addresses of functions in the current root executable or shared library
+ file) and, in the case of a shared library, the relocatable addresses
+ will have to be properly resolved/relocated (and then written into) by
+ the dynamic linker when it actually attaches the given shared library
+ to the executing process. (Note that on SVR4, you may wish to use the
+ `-z text' option to the ELF linker, when building a shared library, as
+ an additional check that you are doing everything right. But if you do
+ use the `-z text' option when building a shared library, you will get
+ errors unless the .ctors and .dtors sections are marked as writable
+ via the SHF_WRITE attribute.) */
+
+#define CTORS_SECTION_ASM_OP ".section\t.ctors,\"aw\""
+#define DTORS_SECTION_ASM_OP ".section\t.dtors,\"aw\""
+
+/* On svr4, we *do* have support for the .init and .fini sections, and we
+ can put stuff in there to be executed before and after `main'. We let
+ crtstuff.c and other files know this by defining the following symbols.
+ The definitions say how to change sections to the .init and .fini
+ sections. This is the same for all known svr4 assemblers. */
+
+#define INIT_SECTION_ASM_OP ".section\t.init"
+#define FINI_SECTION_ASM_OP ".section\t.fini"
+
+/* A default list of other sections which we might be "in" at any given
+ time. For targets that use additional sections (e.g. .tdesc) you
+ should override this definition in the target-specific file which
+ includes this file. */
+
+#undef EXTRA_SECTIONS
+#define EXTRA_SECTIONS in_const, in_ctors, in_dtors
+
+/* A default list of extra section function definitions. For targets
+ that use additional sections (e.g. .tdesc) you should override this
+ definition in the target-specific file which includes this file. */
+
+#undef EXTRA_SECTION_FUNCTIONS
+#define EXTRA_SECTION_FUNCTIONS \
+ CONST_SECTION_FUNCTION \
+ CTORS_SECTION_FUNCTION \
+ DTORS_SECTION_FUNCTION
+
+#undef READONLY_DATA_SECTION
+#define READONLY_DATA_SECTION() const_section ()
+
+extern void text_section ();
+
+#define CONST_SECTION_FUNCTION \
+void \
+const_section () \
+{ \
+ if (!USE_CONST_SECTION) \
+ text_section(); \
+ else if (in_section != in_const) \
+ { \
+ fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP); \
+ in_section = in_const; \
+ } \
+}
+
+#define CTORS_SECTION_FUNCTION \
+void \
+ctors_section () \
+{ \
+ if (in_section != in_ctors) \
+ { \
+ fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP); \
+ in_section = in_ctors; \
+ } \
+}
+
+#define DTORS_SECTION_FUNCTION \
+void \
+dtors_section () \
+{ \
+ if (in_section != in_dtors) \
+ { \
+ fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP); \
+ in_section = in_dtors; \
+ } \
+}
+
+/* Switch into a generic section.
+ This is currently only used to support section attributes.
+
+ We make the section read-only and executable for a function decl,
+ read-only for a const data decl, and writable for a non-const data decl. */
+#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC) \
+ fprintf (FILE, ".section\t%s,\"%s\",@progbits\n", NAME, \
+ (DECL) && TREE_CODE (DECL) == FUNCTION_DECL ? "ax" : \
+ (DECL) && DECL_READONLY_SECTION (DECL, RELOC) ? "a" : "aw")
+
+
+/* A C statement (sans semicolon) to output an element in the table of
+ global constructors. */
+#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
+ do { \
+ ctors_section (); \
+ fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
+ assemble_name (FILE, NAME); \
+ fprintf (FILE, "\n"); \
+ } while (0)
+
+/* A C statement (sans semicolon) to output an element in the table of
+ global destructors. */
+#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
+ do { \
+ dtors_section (); \
+ fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
+ assemble_name (FILE, NAME); \
+ fprintf (FILE, "\n"); \
+ } while (0)
+
+/* A C statement or statements to switch to the appropriate
+ section for output of DECL. DECL is either a `VAR_DECL' node
+ or a constant of some sort. RELOC indicates whether forming
+ the initial value of DECL requires link-time relocations. */
+
+#define SELECT_SECTION(DECL,RELOC) \
+{ \
+ if (TREE_CODE (DECL) == STRING_CST) \
+ { \
+ if (! flag_writable_strings) \
+ const_section (); \
+ else \
+ data_section (); \
+ } \
+ else if (TREE_CODE (DECL) == VAR_DECL) \
+ { \
+ if ((flag_pic && RELOC) \
+ || !TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL) \
+ || !DECL_INITIAL (DECL) \
+ || (DECL_INITIAL (DECL) != error_mark_node \
+ && !TREE_CONSTANT (DECL_INITIAL (DECL)))) \
+ data_section (); \
+ else \
+ const_section (); \
+ } \
+ else \
+ const_section (); \
+}
+
+/* A C statement or statements to switch to the appropriate
+ section for output of RTX in mode MODE. RTX is some kind
+ of constant in RTL. The argument MODE is redundant except
+ in the case of a `const_int' rtx. Currently, these always
+ go into the const section. */
+
+#undef SELECT_RTX_SECTION
+#define SELECT_RTX_SECTION(MODE,RTX) const_section()
+
+/* Define the strings used for the special svr4 .type and .size directives.
+ These strings generally do not vary from one system running svr4 to
+ another, but if a given system (e.g. m88k running svr) needs to use
+ different pseudo-op names for these, they may be overridden in the
+ file which includes this one. */
+
+#define TYPE_ASM_OP ".type"
+#define SIZE_ASM_OP ".size"
+
+/* This is how we tell the assembler that two symbols have the same value. */
+
+#define ASM_OUTPUT_DEF(FILE,NAME1,NAME2) \
+ do { assemble_name(FILE, NAME1); \
+ fputs(" = ", FILE); \
+ assemble_name(FILE, NAME2); \
+ fputc('\n', FILE); } while (0)
+
+/* A table of bytes codes used by the ASM_OUTPUT_ASCII and
+ ASM_OUTPUT_LIMITED_STRING macros. Each byte in the table
+ corresponds to a particular byte value [0..255]. For any
+ given byte value, if the value in the corresponding table
+ position is zero, the given character can be output directly.
+ If the table value is 1, the byte must be output as a \ooo
+ octal escape. If the tables value is anything else, then the
+ byte value should be output as a \ followed by the value
+ in the table. Note that we can use standard UN*X escape
+ sequences for many control characters, but we don't use
+ \a to represent BEL because some svr4 assemblers (e.g. on
+ the i386) don't know about that. Also, we don't use \v
+ since some versions of gas, such as 2.2 did not accept it. */
+
+#define ESCAPES \
+"\1\1\1\1\1\1\1\1btn\1fr\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\0\0\"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\\\0\0\0\
+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1"
+
+/* Some svr4 assemblers have a limit on the number of characters which
+ can appear in the operand of a .string directive. If your assembler
+ has such a limitation, you should define STRING_LIMIT to reflect that
+ limit. Note that at least some svr4 assemblers have a limit on the
+ actual number of bytes in the double-quoted string, and that they
+ count each character in an escape sequence as one byte. Thus, an
+ escape sequence like \377 would count as four bytes.
+
+ If your target assembler doesn't support the .string directive, you
+ should define this to zero.
+*/
+
+#define STRING_LIMIT ((unsigned) 256)
+
+#define STRING_ASM_OP ".string"
+
+/*
+ * We always use gas here, so we don't worry about ECOFF assembler problems.
+ */
+#undef TARGET_GAS
+#define TARGET_GAS (1)
+
+#undef PREFERRED_DEBUGGING_TYPE
+#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
diff --git a/lang/gcc-ooo/files/patch-ad b/lang/gcc-ooo/files/patch-ad
index f8fb5803acf0..bea070deb344 100644
--- a/lang/gcc-ooo/files/patch-ad
+++ b/lang/gcc-ooo/files/patch-ad
@@ -1,6 +1,41 @@
--- gcc/config/i386/freebsd-aout.h.orig Mon Mar 1 14:47:33 1999
-+++ gcc/config/i386/freebsd-aout.h Sat Mar 13 19:24:50 1999
-@@ -103,19 +103,18 @@
++++ gcc/config/i386/freebsd-aout.h Sat Mar 20 00:27:02 1999
+@@ -20,6 +20,10 @@
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
++
++/* Get generic FreeBSD definitions. */
++#include <freebsd.h>
++
+ /* This goes away when the math-emulator is fixed */
+ #define TARGET_CPU_DEFAULT 0400 /* TARGET_NO_FANCY_MATH_387 */
+
+@@ -35,7 +39,7 @@
+ #include "i386/perform.h"
+
+ #undef CPP_PREDEFINES
+-#define CPP_PREDEFINES "-Dunix -Di386 -D__FreeBSD__ -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)"
++#define CPP_PREDEFINES "-Di386 -Acpu(i386) -Amachine(i386)" CPP_FBSD_PREDEFINES
+
+ /* Like the default, except no -lg. */
+ #define LIB_SPEC "%{!shared:%{!pg:-lc}%{pg:-lc_p}}"
+@@ -85,14 +89,6 @@
+ necessary when compiling PIC code. */
+
+ #define JUMP_TABLES_IN_TEXT_SECTION 1
+-
+-/* Don't default to pcc-struct-return, because gcc is the only compiler, and
+- we want to retain compatibility with older gcc versions. */
+-#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
+
+ /* i386 freebsd still uses old binutils that don't insert nops by default
+ when the .align directive demands to insert extra space in the text
+@@ -103,19 +99,18 @@
/* Profiling routines, partially copied from i386/osfrose.h. */
@@ -23,7 +58,7 @@
fprintf (FILE, "\tcall mcount\n"); \
} \
}
-@@ -133,6 +132,7 @@
+@@ -133,6 +128,7 @@
#define TYPE_ASM_OP ".type"
#define SIZE_ASM_OP ".size"
@@ -31,7 +66,7 @@
/* The following macro defines the format used to output the second
operand of the .type assembler directive. Different svr4 assemblers
-@@ -142,6 +142,12 @@
+@@ -142,6 +138,12 @@
#define TYPE_OPERAND_FMT "@%s"
@@ -44,12 +79,34 @@
/* Write the extra assembler code needed to declare a function's result.
Most svr4 assemblers don't require any special declaration of the
result value, but there are exceptions. */
-@@ -243,6 +249,8 @@
- #define STARTFILE_SPEC \
+@@ -244,29 +246,4 @@
"%{shared:c++rt0.o%s} \
%{!shared:%{pg:gcrt0.o%s}%{!pg:%{static:scrt0.o%s}%{!static:crt0.o%s}}}"
-+
-+#define MD_STARTFILE_PREFIX "/usr/lib/aout/"
- /* This is defined when gcc is compiled in the BSD-directory-tree, and must
- * make up for the gap to all the stuff done in the GNU-makefiles.
+-/* This is defined when gcc is compiled in the BSD-directory-tree, and must
+- * make up for the gap to all the stuff done in the GNU-makefiles.
+- */
+-
+-#ifdef FREEBSD_NATIVE
+-
+-#define INCLUDE_DEFAULTS { \
+- { "/usr/include", 0, 0, 0 }, \
+- { "/usr/include/g++", "G++", 1, 1 }, \
+- { 0, 0, 0, 0} \
+- }
+-
+-#undef MD_EXEC_PREFIX
+-#define MD_EXEC_PREFIX "/usr/libexec/"
+-
+-#undef STANDARD_STARTFILE_PREFIX
+-#define STANDARD_STARTFILE_PREFIX "/usr/lib"
+-
+-#if 0 /* This is very wrong!!! */
+-#define DEFAULT_TARGET_MACHINE "i386-unknown-freebsd_1.0"
+-#define GPLUSPLUS_INCLUDE_DIR "/usr/local/lib/gcc-lib/i386-unknown-freebsd_1.0/2.5.8/include"
+-#define TOOL_INCLUDE_DIR "/usr/local/i386-unknown-freebsd_1.0/include"
+-#define GCC_INCLUDE_DIR "/usr/local/lib/gcc-lib/i386-unknown-freebsd_1.0/2.5.8/include"
+-#endif
+-
+-#endif /* FREEBSD_NATIVE */
++#define MD_STARTFILE_PREFIX "/usr/lib/aout/"
diff --git a/lang/gcc-ooo/files/patch-af b/lang/gcc-ooo/files/patch-af
index c50ce06c8375..c1f1ba0e855f 100644
--- a/lang/gcc-ooo/files/patch-af
+++ b/lang/gcc-ooo/files/patch-af
@@ -1,6 +1,30 @@
--- gcc/config/i386/freebsd.h.orig Mon Mar 1 14:47:32 1999
-+++ gcc/config/i386/freebsd.h Sat Mar 13 19:25:53 1999
-@@ -113,22 +113,19 @@
++++ gcc/config/i386/freebsd.h Sun Mar 21 16:58:39 1999
+@@ -21,19 +21,13 @@
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
++
++/* Get generic FreeBSD definitions. */
++#include <freebsd.h>
++
+ #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
+-
+ /* This is how to output an element of a case-vector that is relative.
+ This is only used for PIC code. See comments by the `casesi' insn in
+ i386.md for an explanation of the expression this outputs. */
+@@ -113,22 +107,19 @@
: ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \
: (-1))
@@ -27,8 +51,18 @@
} \
}
-@@ -151,20 +148,8 @@
- #define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
+@@ -145,26 +136,16 @@
+ #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)"
++#define CPP_PREDEFINES "-Di386 -D__ELF__ -Acpu(i386) -Amachine(i386)" CPP_FBSD_PREDEFINES
+
+ #undef CPP_SPEC
+-#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
++#define CPP_SPEC \
++ "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE} %{m486:-D__i486__}"
++ /* %{pthread:-D_REENTRANT} */
#undef LIB_SPEC
-#if 1
@@ -36,16 +70,16 @@
- * want to profile or debug the C library, please add
- * -lc_p or -ggdb to LDFLAGS at the link time, respectively.
- */
- #define LIB_SPEC \
+-#define LIB_SPEC \
- "%{!shared: %{mieee-fp:-lieee} %{p:-lgmon} %{pg:-lgmon} \
- %{!ggdb:-lc} %{ggdb:-lg}}"
-#else
--#define LIB_SPEC \
+ #define LIB_SPEC \
- "%{!shared: \
- %{mieee-fp:-lieee} %{p:-lgmon -lc_p} %{pg:-lgmon -lc_p} \
- %{!p:%{!pg:%{!g*:-lc} %{g*:-lg}}}}"
-#endif
-+ "%{!shared: %{p:-lc_p} %{pg:-lc_p} %{!p:%{!pg:-lc}}}"
++ "%{!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
diff --git a/lang/gcc-ooo/files/patch-ak b/lang/gcc-ooo/files/patch-ak
index 19a2994f3f05..2e54beea1a61 100644
--- a/lang/gcc-ooo/files/patch-ak
+++ b/lang/gcc-ooo/files/patch-ak
@@ -1,5 +1,5 @@
---- gcc/configure.orig Mon Mar 8 10:06:10 1999
-+++ gcc/configure Sat Mar 13 19:08:06 1999
+--- gcc/configure.orig Sun Mar 14 02:59:02 1999
++++ gcc/configure Sat Mar 20 00:40:05 1999
@@ -2395,6 +2395,15 @@
thread_file='posix'
fi
@@ -27,18 +27,20 @@
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
- extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
+- tmake_file=i386/t-freebsd
- gas=yes
- gnu_ld=yes
- stabs=yes
++ tmake_file=t-freebsd
;;
i[34567]86-*-freebsd*)
- tm_file=i386/freebsd.h
+ tm_file="i386/i386.h i386/att.h linux.h i386/freebsd.h i386/perform.h"
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
+- tmake_file=i386/t-freebsd
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
++ tmake_file=t-freebsd
+ gas=yes
+ gnu_ld=yes
+ stabs=yes
diff --git a/lang/gcc-ooo/files/patch-al b/lang/gcc-ooo/files/patch-al
index 51e1b8cdee1c..c8a195127ed0 100644
--- a/lang/gcc-ooo/files/patch-al
+++ b/lang/gcc-ooo/files/patch-al
@@ -1,5 +1,5 @@
--- gcc/configure.in.orig Sun Mar 7 16:22:22 1999
-+++ gcc/configure.in Sat Mar 13 19:23:23 1999
++++ gcc/configure.in Sat Mar 20 00:40:58 1999
@@ -416,6 +416,15 @@
thread_file='posix'
fi
@@ -27,18 +27,20 @@
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
- extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
+- tmake_file=i386/t-freebsd
- gas=yes
- gnu_ld=yes
- stabs=yes
++ tmake_file=t-freebsd
;;
i[[34567]]86-*-freebsd*)
- tm_file=i386/freebsd.h
+ tm_file="i386/i386.h i386/att.h linux.h i386/freebsd.h i386/perform.h"
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
+- tmake_file=i386/t-freebsd
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
++ tmake_file=t-freebsd
+ gas=yes
+ gnu_ld=yes
+ stabs=yes
diff --git a/lang/gcc/Makefile b/lang/gcc/Makefile
index f9347a47d87e..cd5b039f398a 100644
--- a/lang/gcc/Makefile
+++ b/lang/gcc/Makefile
@@ -4,7 +4,7 @@
# Date created: 9 Jan 1998
# Whom: John Polstra <jdp@polstra.com>
#
-# $Id: Makefile,v 1.48 1999/03/08 07:28:27 asami Exp $
+# $Id: Makefile,v 1.50 1999/03/17 00:40:25 obrien Exp $
#
DISTNAME= egcs-1.1.2
@@ -55,21 +55,20 @@ ALL_TARGET= bootstrap
MAN1= cccp.1 g++.1 g77.1 gcc.1
pre-patch:
+ @${MV} ${WRKSRC}/gcc/config/i386/t-freebsd ${WRKSRC}/gcc/config/
@${MV} ${WRKSRC}/gcc/config/i386/freebsd.h ${WRKSRC}/gcc/config/i386/freebsd-aout.h
@${MV} ${WRKSRC}/gcc/config/i386/freebsd-elf.h ${WRKSRC}/gcc/config/i386/freebsd.h
+ @${CP} ${FILESDIR}/alpha-freebsd-elf.h ${WRKSRC}/gcc/config/alpha/freebsd-elf.h
+ @${CP} ${FILESDIR}/alpha-freebsd.h ${WRKSRC}/gcc/config/alpha/freebsd.h
pre-configure:
@# Keep from running `autoconf' and `autoheader' since we modified
@# configure.in by patching it.
@touch ${WRKSRC}/gcc/configure
@touch ${WRKSRC}/gcc/cstamp-h.in
- @(cd ${WRKSRC}/gcc/config/${ARCH}/ ; \
- MAJ=`sysctl -n kern.osreldate | ${SED} -e '/.....$$/s///'` ; \
- ${MV} freebsd-aout.h freebsd-aout.h.in ; \
- ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" freebsd-aout.h.in \
- >freebsd-aout.h ; \
- ${MV} freebsd.h freebsd.h.in ; \
- ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" freebsd.h.in >freebsd.h )
+ @(MAJ=`sysctl -n kern.osreldate | ${SED} -e '/.....$$/s///'` ; \
+ ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" ${FILESDIR}/freebsd.h \
+ >${WRKSRC}/gcc/config/freebsd.h )
.if ${PORTOBJFORMAT} == "elf" && ${MACHINE_ARCH} == "i386"
@${SED} -e 's/^@comment ELF-only://' ${PKGDIR}/PLIST >${PLIST}
.endif
diff --git a/lang/gcc/files/alpha-freebsd.h b/lang/gcc/files/alpha-freebsd.h
new file mode 100644
index 000000000000..60a1f07b94ba
--- /dev/null
+++ b/lang/gcc/files/alpha-freebsd.h
@@ -0,0 +1,443 @@
+/* Definitions of target machine for GNU compiler,
+ for Alpha FreeBSD systems.
+ Copyright (C) 1998 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* This is used on Alpha platforms that use the ELF format.
+ This was taken from the NetBSD configuration, and modified
+ for FreeBSD/alpha by Hidetoshi Shimokawa <simokawa@FreeBSD.ORG> */
+
+
+/* Get generic FreeBSD definitions. */
+#include <freebsd.h>
+
+
+#undef OBJECT_FORMAT_COFF
+#undef EXTENDED_COFF
+#define OBJECT_FORMAT_ELF
+
+/* This is BSD, so it wants DBX format. */
+
+#define DBX_DEBUGGING_INFO
+
+/* This is the char to use for continuation (in case we need to turn
+ continuation back on). */
+
+#define DBX_CONTIN_CHAR '?'
+
+#undef ASM_FINAL_SPEC
+
+/* Names to predefine in the preprocessor for this target machine.
+ XXX FreeBSD, by convention, shouldn't do __alpha, but lots of applications
+ expect it because that's what OSF/1 does. */
+
+#undef TARGET_DEFAULT
+#define TARGET_DEFAULT (MASK_FP | MASK_FPREGS | MASK_GAS)
+
+#undef CPP_PREDEFINES
+#define CPP_PREDEFINES "\
+-D__alpha__ -D__alpha -Acpu(alpha) -Amachine(alpha) " \
+FBSD_CPP_PREDEFINES \
+SUB_CPP_PREDEFINES
+
+/* Make gcc agree with <machine/ansi.h> */
+
+#undef WCHAR_TYPE
+#define WCHAR_TYPE "int"
+
+#undef WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE 32
+
+/* Output assembler code to FILE to increment profiler label # LABELNO
+ for profiling a function entry. Under FreeBSD/Alpha, the assembler does
+ nothing special with -pg. */
+
+#undef FUNCTION_PROFILER
+#define FUNCTION_PROFILER(FILE, LABELNO) \
+ fputs ("\tjsr $28,_mcount\n", (FILE))
+
+/* Show that we need a GP when profiling. */
+#define TARGET_PROFILING_NEEDS_GP
+
+#undef HAS_INIT_SECTION
+
+/* Provide an ASM_SPEC appropriate for a FreeBSD/alpha target. This differs
+ from the generic FreeBSD ASM_SPEC in that no special handling of PIC is
+ necessary on the Alpha. */
+
+#undef ASM_SPEC
+#define ASM_SPEC " %| %{mcpu=*:-m%*}"
+
+/* Output at beginning of assembler file. */
+
+#undef ASM_FILE_START
+#define ASM_FILE_START(FILE) \
+{ \
+ alpha_write_verstamp (FILE); \
+ output_file_directive (FILE, main_input_filename); \
+ fprintf (FILE, "\t.version\t\"01.01\"\n"); \
+ fprintf (FILE, "\t.set noat\n"); \
+}
+
+#define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE) \
+ alpha_output_lineno (STREAM, LINE)
+extern void alpha_output_lineno ();
+
+extern void output_file_directive ();
+
+/* 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. */
+
+#define IDENT_ASM_OP ".ident"
+
+#ifdef IDENTIFY_WITH_IDENT
+#define ASM_IDENTIFY_GCC(FILE) /* nothing */
+#define ASM_IDENTIFY_LANGUAGE(FILE) \
+ fprintf(FILE, "\t%s \"GCC (%s) %s\"\n", IDENT_ASM_OP, \
+ lang_identify(), version_string)
+#else
+#define ASM_FILE_END(FILE) \
+do { \
+ fprintf ((FILE), "\t%s\t\"GCC: (GNU) %s\"\n", \
+ IDENT_ASM_OP, version_string); \
+ } while (0)
+#endif
+
+/* Allow #sccs in preprocessor. */
+
+#define SCCS_DIRECTIVE
+
+/* Output #ident as a .ident. */
+
+#define ASM_OUTPUT_IDENT(FILE, NAME) \
+ fprintf (FILE, "\t%s\t\"%s\"\n", IDENT_ASM_OP, NAME);
+
+/* This is how to allocate empty space in some section. The .zero
+ pseudo-op is used for this on most svr4 assemblers. */
+
+#define SKIP_ASM_OP ".zero"
+
+#undef ASM_OUTPUT_SKIP
+#define ASM_OUTPUT_SKIP(FILE,SIZE) \
+ fprintf (FILE, "\t%s\t%u\n", SKIP_ASM_OP, (SIZE))
+
+/* Output the label which precedes a jumptable. Note that for all svr4
+ systems where we actually generate jumptables (which is to say every
+ svr4 target except i386, where we use casesi instead) we put the jump-
+ tables into the .rodata section and since other stuff could have been
+ put into the .rodata section prior to any given jumptable, we have to
+ make sure that the location counter for the .rodata section gets pro-
+ perly re-aligned prior to the actual beginning of the jump table. */
+
+#define ALIGN_ASM_OP ".align"
+
+#ifndef ASM_OUTPUT_BEFORE_CASE_LABEL
+#define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE,PREFIX,NUM,TABLE) \
+ ASM_OUTPUT_ALIGN ((FILE), 2);
+#endif
+
+#undef ASM_OUTPUT_CASE_LABEL
+#define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,JUMPTABLE) \
+ do { \
+ ASM_OUTPUT_BEFORE_CASE_LABEL (FILE, PREFIX, NUM, JUMPTABLE) \
+ ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); \
+ } while (0)
+
+/* The standard SVR4 assembler seems to require that certain builtin
+ library routines (e.g. .udiv) be explicitly declared as .globl
+ in each assembly file where they are referenced. */
+
+#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
+ ASM_GLOBALIZE_LABEL (FILE, XSTR (FUN, 0))
+
+/* This says how to output assembler code to declare an
+ uninitialized external linkage data object. Under SVR4,
+ the linker seems to want the alignment of data objects
+ to depend on their types. We do exactly that here. */
+
+#define COMMON_ASM_OP ".comm"
+
+#undef ASM_OUTPUT_ALIGNED_COMMON
+#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
+do { \
+ fprintf ((FILE), "\t%s\t", COMMON_ASM_OP); \
+ assemble_name ((FILE), (NAME)); \
+ fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \
+} while (0)
+
+/* This says how to output assembler code to declare an
+ uninitialized internal linkage data object. Under SVR4,
+ the linker seems to want the alignment of data objects
+ to depend on their types. We do exactly that here. */
+
+#define LOCAL_ASM_OP ".local"
+
+#undef ASM_OUTPUT_ALIGNED_LOCAL
+#define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
+do { \
+ fprintf ((FILE), "\t%s\t", LOCAL_ASM_OP); \
+ assemble_name ((FILE), (NAME)); \
+ fprintf ((FILE), "\n"); \
+ ASM_OUTPUT_ALIGNED_COMMON (FILE, NAME, SIZE, ALIGN); \
+} while (0)
+
+/* This is the pseudo-op used to generate a 64-bit word of data with a
+ specific value in some section. */
+
+#define INT_ASM_OP ".quad"
+
+/* This is the pseudo-op used to generate a contiguous sequence of byte
+ values from a double-quoted string WITHOUT HAVING A TERMINATING NUL
+ AUTOMATICALLY APPENDED. This is the same for most svr4 assemblers. */
+
+#undef ASCII_DATA_ASM_OP
+#define ASCII_DATA_ASM_OP ".ascii"
+
+/* Support const sections and the ctors and dtors sections for g++.
+ Note that there appears to be two different ways to support const
+ sections at the moment. You can either #define the symbol
+ READONLY_DATA_SECTION (giving it some code which switches to the
+ readonly data section) or else you can #define the symbols
+ EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, SELECT_SECTION, and
+ SELECT_RTX_SECTION. We do both here just to be on the safe side. */
+
+#define USE_CONST_SECTION 1
+
+#define CONST_SECTION_ASM_OP ".section\t.rodata"
+
+/* Define the pseudo-ops used to switch to the .ctors and .dtors sections.
+
+ Note that we want to give these sections the SHF_WRITE attribute
+ because these sections will actually contain data (i.e. tables of
+ addresses of functions in the current root executable or shared library
+ file) and, in the case of a shared library, the relocatable addresses
+ will have to be properly resolved/relocated (and then written into) by
+ the dynamic linker when it actually attaches the given shared library
+ to the executing process. (Note that on SVR4, you may wish to use the
+ `-z text' option to the ELF linker, when building a shared library, as
+ an additional check that you are doing everything right. But if you do
+ use the `-z text' option when building a shared library, you will get
+ errors unless the .ctors and .dtors sections are marked as writable
+ via the SHF_WRITE attribute.) */
+
+#define CTORS_SECTION_ASM_OP ".section\t.ctors,\"aw\""
+#define DTORS_SECTION_ASM_OP ".section\t.dtors,\"aw\""
+
+/* On svr4, we *do* have support for the .init and .fini sections, and we
+ can put stuff in there to be executed before and after `main'. We let
+ crtstuff.c and other files know this by defining the following symbols.
+ The definitions say how to change sections to the .init and .fini
+ sections. This is the same for all known svr4 assemblers. */
+
+#define INIT_SECTION_ASM_OP ".section\t.init"
+#define FINI_SECTION_ASM_OP ".section\t.fini"
+
+/* A default list of other sections which we might be "in" at any given
+ time. For targets that use additional sections (e.g. .tdesc) you
+ should override this definition in the target-specific file which
+ includes this file. */
+
+#undef EXTRA_SECTIONS
+#define EXTRA_SECTIONS in_const, in_ctors, in_dtors
+
+/* A default list of extra section function definitions. For targets
+ that use additional sections (e.g. .tdesc) you should override this
+ definition in the target-specific file which includes this file. */
+
+#undef EXTRA_SECTION_FUNCTIONS
+#define EXTRA_SECTION_FUNCTIONS \
+ CONST_SECTION_FUNCTION \
+ CTORS_SECTION_FUNCTION \
+ DTORS_SECTION_FUNCTION
+
+#undef READONLY_DATA_SECTION
+#define READONLY_DATA_SECTION() const_section ()
+
+extern void text_section ();
+
+#define CONST_SECTION_FUNCTION \
+void \
+const_section () \
+{ \
+ if (!USE_CONST_SECTION) \
+ text_section(); \
+ else if (in_section != in_const) \
+ { \
+ fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP); \
+ in_section = in_const; \
+ } \
+}
+
+#define CTORS_SECTION_FUNCTION \
+void \
+ctors_section () \
+{ \
+ if (in_section != in_ctors) \
+ { \
+ fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP); \
+ in_section = in_ctors; \
+ } \
+}
+
+#define DTORS_SECTION_FUNCTION \
+void \
+dtors_section () \
+{ \
+ if (in_section != in_dtors) \
+ { \
+ fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP); \
+ in_section = in_dtors; \
+ } \
+}
+
+/* Switch into a generic section.
+ This is currently only used to support section attributes.
+
+ We make the section read-only and executable for a function decl,
+ read-only for a const data decl, and writable for a non-const data decl. */
+#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC) \
+ fprintf (FILE, ".section\t%s,\"%s\",@progbits\n", NAME, \
+ (DECL) && TREE_CODE (DECL) == FUNCTION_DECL ? "ax" : \
+ (DECL) && DECL_READONLY_SECTION (DECL, RELOC) ? "a" : "aw")
+
+
+/* A C statement (sans semicolon) to output an element in the table of
+ global constructors. */
+#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
+ do { \
+ ctors_section (); \
+ fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
+ assemble_name (FILE, NAME); \
+ fprintf (FILE, "\n"); \
+ } while (0)
+
+/* A C statement (sans semicolon) to output an element in the table of
+ global destructors. */
+#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
+ do { \
+ dtors_section (); \
+ fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
+ assemble_name (FILE, NAME); \
+ fprintf (FILE, "\n"); \
+ } while (0)
+
+/* A C statement or statements to switch to the appropriate
+ section for output of DECL. DECL is either a `VAR_DECL' node
+ or a constant of some sort. RELOC indicates whether forming
+ the initial value of DECL requires link-time relocations. */
+
+#define SELECT_SECTION(DECL,RELOC) \
+{ \
+ if (TREE_CODE (DECL) == STRING_CST) \
+ { \
+ if (! flag_writable_strings) \
+ const_section (); \
+ else \
+ data_section (); \
+ } \
+ else if (TREE_CODE (DECL) == VAR_DECL) \
+ { \
+ if ((flag_pic && RELOC) \
+ || !TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL) \
+ || !DECL_INITIAL (DECL) \
+ || (DECL_INITIAL (DECL) != error_mark_node \
+ && !TREE_CONSTANT (DECL_INITIAL (DECL)))) \
+ data_section (); \
+ else \
+ const_section (); \
+ } \
+ else \
+ const_section (); \
+}
+
+/* A C statement or statements to switch to the appropriate
+ section for output of RTX in mode MODE. RTX is some kind
+ of constant in RTL. The argument MODE is redundant except
+ in the case of a `const_int' rtx. Currently, these always
+ go into the const section. */
+
+#undef SELECT_RTX_SECTION
+#define SELECT_RTX_SECTION(MODE,RTX) const_section()
+
+/* Define the strings used for the special svr4 .type and .size directives.
+ These strings generally do not vary from one system running svr4 to
+ another, but if a given system (e.g. m88k running svr) needs to use
+ different pseudo-op names for these, they may be overridden in the
+ file which includes this one. */
+
+#define TYPE_ASM_OP ".type"
+#define SIZE_ASM_OP ".size"
+
+/* This is how we tell the assembler that two symbols have the same value. */
+
+#define ASM_OUTPUT_DEF(FILE,NAME1,NAME2) \
+ do { assemble_name(FILE, NAME1); \
+ fputs(" = ", FILE); \
+ assemble_name(FILE, NAME2); \
+ fputc('\n', FILE); } while (0)
+
+/* A table of bytes codes used by the ASM_OUTPUT_ASCII and
+ ASM_OUTPUT_LIMITED_STRING macros. Each byte in the table
+ corresponds to a particular byte value [0..255]. For any
+ given byte value, if the value in the corresponding table
+ position is zero, the given character can be output directly.
+ If the table value is 1, the byte must be output as a \ooo
+ octal escape. If the tables value is anything else, then the
+ byte value should be output as a \ followed by the value
+ in the table. Note that we can use standard UN*X escape
+ sequences for many control characters, but we don't use
+ \a to represent BEL because some svr4 assemblers (e.g. on
+ the i386) don't know about that. Also, we don't use \v
+ since some versions of gas, such as 2.2 did not accept it. */
+
+#define ESCAPES \
+"\1\1\1\1\1\1\1\1btn\1fr\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\0\0\"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\\\0\0\0\
+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1"
+
+/* Some svr4 assemblers have a limit on the number of characters which
+ can appear in the operand of a .string directive. If your assembler
+ has such a limitation, you should define STRING_LIMIT to reflect that
+ limit. Note that at least some svr4 assemblers have a limit on the
+ actual number of bytes in the double-quoted string, and that they
+ count each character in an escape sequence as one byte. Thus, an
+ escape sequence like \377 would count as four bytes.
+
+ If your target assembler doesn't support the .string directive, you
+ should define this to zero.
+*/
+
+#define STRING_LIMIT ((unsigned) 256)
+
+#define STRING_ASM_OP ".string"
+
+/*
+ * We always use gas here, so we don't worry about ECOFF assembler problems.
+ */
+#undef TARGET_GAS
+#define TARGET_GAS (1)
+
+#undef PREFERRED_DEBUGGING_TYPE
+#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
diff --git a/lang/gcc/files/patch-ad b/lang/gcc/files/patch-ad
index f8fb5803acf0..bea070deb344 100644
--- a/lang/gcc/files/patch-ad
+++ b/lang/gcc/files/patch-ad
@@ -1,6 +1,41 @@
--- gcc/config/i386/freebsd-aout.h.orig Mon Mar 1 14:47:33 1999
-+++ gcc/config/i386/freebsd-aout.h Sat Mar 13 19:24:50 1999
-@@ -103,19 +103,18 @@
++++ gcc/config/i386/freebsd-aout.h Sat Mar 20 00:27:02 1999
+@@ -20,6 +20,10 @@
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
++
++/* Get generic FreeBSD definitions. */
++#include <freebsd.h>
++
+ /* This goes away when the math-emulator is fixed */
+ #define TARGET_CPU_DEFAULT 0400 /* TARGET_NO_FANCY_MATH_387 */
+
+@@ -35,7 +39,7 @@
+ #include "i386/perform.h"
+
+ #undef CPP_PREDEFINES
+-#define CPP_PREDEFINES "-Dunix -Di386 -D__FreeBSD__ -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)"
++#define CPP_PREDEFINES "-Di386 -Acpu(i386) -Amachine(i386)" CPP_FBSD_PREDEFINES
+
+ /* Like the default, except no -lg. */
+ #define LIB_SPEC "%{!shared:%{!pg:-lc}%{pg:-lc_p}}"
+@@ -85,14 +89,6 @@
+ necessary when compiling PIC code. */
+
+ #define JUMP_TABLES_IN_TEXT_SECTION 1
+-
+-/* Don't default to pcc-struct-return, because gcc is the only compiler, and
+- we want to retain compatibility with older gcc versions. */
+-#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
+
+ /* i386 freebsd still uses old binutils that don't insert nops by default
+ when the .align directive demands to insert extra space in the text
+@@ -103,19 +99,18 @@
/* Profiling routines, partially copied from i386/osfrose.h. */
@@ -23,7 +58,7 @@
fprintf (FILE, "\tcall mcount\n"); \
} \
}
-@@ -133,6 +132,7 @@
+@@ -133,6 +128,7 @@
#define TYPE_ASM_OP ".type"
#define SIZE_ASM_OP ".size"
@@ -31,7 +66,7 @@
/* The following macro defines the format used to output the second
operand of the .type assembler directive. Different svr4 assemblers
-@@ -142,6 +142,12 @@
+@@ -142,6 +138,12 @@
#define TYPE_OPERAND_FMT "@%s"
@@ -44,12 +79,34 @@
/* Write the extra assembler code needed to declare a function's result.
Most svr4 assemblers don't require any special declaration of the
result value, but there are exceptions. */
-@@ -243,6 +249,8 @@
- #define STARTFILE_SPEC \
+@@ -244,29 +246,4 @@
"%{shared:c++rt0.o%s} \
%{!shared:%{pg:gcrt0.o%s}%{!pg:%{static:scrt0.o%s}%{!static:crt0.o%s}}}"
-+
-+#define MD_STARTFILE_PREFIX "/usr/lib/aout/"
- /* This is defined when gcc is compiled in the BSD-directory-tree, and must
- * make up for the gap to all the stuff done in the GNU-makefiles.
+-/* This is defined when gcc is compiled in the BSD-directory-tree, and must
+- * make up for the gap to all the stuff done in the GNU-makefiles.
+- */
+-
+-#ifdef FREEBSD_NATIVE
+-
+-#define INCLUDE_DEFAULTS { \
+- { "/usr/include", 0, 0, 0 }, \
+- { "/usr/include/g++", "G++", 1, 1 }, \
+- { 0, 0, 0, 0} \
+- }
+-
+-#undef MD_EXEC_PREFIX
+-#define MD_EXEC_PREFIX "/usr/libexec/"
+-
+-#undef STANDARD_STARTFILE_PREFIX
+-#define STANDARD_STARTFILE_PREFIX "/usr/lib"
+-
+-#if 0 /* This is very wrong!!! */
+-#define DEFAULT_TARGET_MACHINE "i386-unknown-freebsd_1.0"
+-#define GPLUSPLUS_INCLUDE_DIR "/usr/local/lib/gcc-lib/i386-unknown-freebsd_1.0/2.5.8/include"
+-#define TOOL_INCLUDE_DIR "/usr/local/i386-unknown-freebsd_1.0/include"
+-#define GCC_INCLUDE_DIR "/usr/local/lib/gcc-lib/i386-unknown-freebsd_1.0/2.5.8/include"
+-#endif
+-
+-#endif /* FREEBSD_NATIVE */
++#define MD_STARTFILE_PREFIX "/usr/lib/aout/"
diff --git a/lang/gcc/files/patch-af b/lang/gcc/files/patch-af
index c50ce06c8375..c1f1ba0e855f 100644
--- a/lang/gcc/files/patch-af
+++ b/lang/gcc/files/patch-af
@@ -1,6 +1,30 @@
--- gcc/config/i386/freebsd.h.orig Mon Mar 1 14:47:32 1999
-+++ gcc/config/i386/freebsd.h Sat Mar 13 19:25:53 1999
-@@ -113,22 +113,19 @@
++++ gcc/config/i386/freebsd.h Sun Mar 21 16:58:39 1999
+@@ -21,19 +21,13 @@
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
++
++/* Get generic FreeBSD definitions. */
++#include <freebsd.h>
++
+ #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
+-
+ /* This is how to output an element of a case-vector that is relative.
+ This is only used for PIC code. See comments by the `casesi' insn in
+ i386.md for an explanation of the expression this outputs. */
+@@ -113,22 +107,19 @@
: ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \
: (-1))
@@ -27,8 +51,18 @@
} \
}
-@@ -151,20 +148,8 @@
- #define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
+@@ -145,26 +136,16 @@
+ #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)"
++#define CPP_PREDEFINES "-Di386 -D__ELF__ -Acpu(i386) -Amachine(i386)" CPP_FBSD_PREDEFINES
+
+ #undef CPP_SPEC
+-#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
++#define CPP_SPEC \
++ "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE} %{m486:-D__i486__}"
++ /* %{pthread:-D_REENTRANT} */
#undef LIB_SPEC
-#if 1
@@ -36,16 +70,16 @@
- * want to profile or debug the C library, please add
- * -lc_p or -ggdb to LDFLAGS at the link time, respectively.
- */
- #define LIB_SPEC \
+-#define LIB_SPEC \
- "%{!shared: %{mieee-fp:-lieee} %{p:-lgmon} %{pg:-lgmon} \
- %{!ggdb:-lc} %{ggdb:-lg}}"
-#else
--#define LIB_SPEC \
+ #define LIB_SPEC \
- "%{!shared: \
- %{mieee-fp:-lieee} %{p:-lgmon -lc_p} %{pg:-lgmon -lc_p} \
- %{!p:%{!pg:%{!g*:-lc} %{g*:-lg}}}}"
-#endif
-+ "%{!shared: %{p:-lc_p} %{pg:-lc_p} %{!p:%{!pg:-lc}}}"
++ "%{!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
diff --git a/lang/gcc/files/patch-ak b/lang/gcc/files/patch-ak
index 19a2994f3f05..2e54beea1a61 100644
--- a/lang/gcc/files/patch-ak
+++ b/lang/gcc/files/patch-ak
@@ -1,5 +1,5 @@
---- gcc/configure.orig Mon Mar 8 10:06:10 1999
-+++ gcc/configure Sat Mar 13 19:08:06 1999
+--- gcc/configure.orig Sun Mar 14 02:59:02 1999
++++ gcc/configure Sat Mar 20 00:40:05 1999
@@ -2395,6 +2395,15 @@
thread_file='posix'
fi
@@ -27,18 +27,20 @@
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
- extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
+- tmake_file=i386/t-freebsd
- gas=yes
- gnu_ld=yes
- stabs=yes
++ tmake_file=t-freebsd
;;
i[34567]86-*-freebsd*)
- tm_file=i386/freebsd.h
+ tm_file="i386/i386.h i386/att.h linux.h i386/freebsd.h i386/perform.h"
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
+- tmake_file=i386/t-freebsd
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
++ tmake_file=t-freebsd
+ gas=yes
+ gnu_ld=yes
+ stabs=yes
diff --git a/lang/gcc/files/patch-al b/lang/gcc/files/patch-al
index 51e1b8cdee1c..c8a195127ed0 100644
--- a/lang/gcc/files/patch-al
+++ b/lang/gcc/files/patch-al
@@ -1,5 +1,5 @@
--- gcc/configure.in.orig Sun Mar 7 16:22:22 1999
-+++ gcc/configure.in Sat Mar 13 19:23:23 1999
++++ gcc/configure.in Sat Mar 20 00:40:58 1999
@@ -416,6 +416,15 @@
thread_file='posix'
fi
@@ -27,18 +27,20 @@
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
- extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
+- tmake_file=i386/t-freebsd
- gas=yes
- gnu_ld=yes
- stabs=yes
++ tmake_file=t-freebsd
;;
i[[34567]]86-*-freebsd*)
- tm_file=i386/freebsd.h
+ tm_file="i386/i386.h i386/att.h linux.h i386/freebsd.h i386/perform.h"
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
+- tmake_file=i386/t-freebsd
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
++ tmake_file=t-freebsd
+ gas=yes
+ gnu_ld=yes
+ stabs=yes
diff --git a/lang/gcc295/Makefile b/lang/gcc295/Makefile
index f9347a47d87e..cd5b039f398a 100644
--- a/lang/gcc295/Makefile
+++ b/lang/gcc295/Makefile
@@ -4,7 +4,7 @@
# Date created: 9 Jan 1998
# Whom: John Polstra <jdp@polstra.com>
#
-# $Id: Makefile,v 1.48 1999/03/08 07:28:27 asami Exp $
+# $Id: Makefile,v 1.50 1999/03/17 00:40:25 obrien Exp $
#
DISTNAME= egcs-1.1.2
@@ -55,21 +55,20 @@ ALL_TARGET= bootstrap
MAN1= cccp.1 g++.1 g77.1 gcc.1
pre-patch:
+ @${MV} ${WRKSRC}/gcc/config/i386/t-freebsd ${WRKSRC}/gcc/config/
@${MV} ${WRKSRC}/gcc/config/i386/freebsd.h ${WRKSRC}/gcc/config/i386/freebsd-aout.h
@${MV} ${WRKSRC}/gcc/config/i386/freebsd-elf.h ${WRKSRC}/gcc/config/i386/freebsd.h
+ @${CP} ${FILESDIR}/alpha-freebsd-elf.h ${WRKSRC}/gcc/config/alpha/freebsd-elf.h
+ @${CP} ${FILESDIR}/alpha-freebsd.h ${WRKSRC}/gcc/config/alpha/freebsd.h
pre-configure:
@# Keep from running `autoconf' and `autoheader' since we modified
@# configure.in by patching it.
@touch ${WRKSRC}/gcc/configure
@touch ${WRKSRC}/gcc/cstamp-h.in
- @(cd ${WRKSRC}/gcc/config/${ARCH}/ ; \
- MAJ=`sysctl -n kern.osreldate | ${SED} -e '/.....$$/s///'` ; \
- ${MV} freebsd-aout.h freebsd-aout.h.in ; \
- ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" freebsd-aout.h.in \
- >freebsd-aout.h ; \
- ${MV} freebsd.h freebsd.h.in ; \
- ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" freebsd.h.in >freebsd.h )
+ @(MAJ=`sysctl -n kern.osreldate | ${SED} -e '/.....$$/s///'` ; \
+ ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" ${FILESDIR}/freebsd.h \
+ >${WRKSRC}/gcc/config/freebsd.h )
.if ${PORTOBJFORMAT} == "elf" && ${MACHINE_ARCH} == "i386"
@${SED} -e 's/^@comment ELF-only://' ${PKGDIR}/PLIST >${PLIST}
.endif
diff --git a/lang/gcc295/files/alpha-freebsd.h b/lang/gcc295/files/alpha-freebsd.h
new file mode 100644
index 000000000000..60a1f07b94ba
--- /dev/null
+++ b/lang/gcc295/files/alpha-freebsd.h
@@ -0,0 +1,443 @@
+/* Definitions of target machine for GNU compiler,
+ for Alpha FreeBSD systems.
+ Copyright (C) 1998 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* This is used on Alpha platforms that use the ELF format.
+ This was taken from the NetBSD configuration, and modified
+ for FreeBSD/alpha by Hidetoshi Shimokawa <simokawa@FreeBSD.ORG> */
+
+
+/* Get generic FreeBSD definitions. */
+#include <freebsd.h>
+
+
+#undef OBJECT_FORMAT_COFF
+#undef EXTENDED_COFF
+#define OBJECT_FORMAT_ELF
+
+/* This is BSD, so it wants DBX format. */
+
+#define DBX_DEBUGGING_INFO
+
+/* This is the char to use for continuation (in case we need to turn
+ continuation back on). */
+
+#define DBX_CONTIN_CHAR '?'
+
+#undef ASM_FINAL_SPEC
+
+/* Names to predefine in the preprocessor for this target machine.
+ XXX FreeBSD, by convention, shouldn't do __alpha, but lots of applications
+ expect it because that's what OSF/1 does. */
+
+#undef TARGET_DEFAULT
+#define TARGET_DEFAULT (MASK_FP | MASK_FPREGS | MASK_GAS)
+
+#undef CPP_PREDEFINES
+#define CPP_PREDEFINES "\
+-D__alpha__ -D__alpha -Acpu(alpha) -Amachine(alpha) " \
+FBSD_CPP_PREDEFINES \
+SUB_CPP_PREDEFINES
+
+/* Make gcc agree with <machine/ansi.h> */
+
+#undef WCHAR_TYPE
+#define WCHAR_TYPE "int"
+
+#undef WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE 32
+
+/* Output assembler code to FILE to increment profiler label # LABELNO
+ for profiling a function entry. Under FreeBSD/Alpha, the assembler does
+ nothing special with -pg. */
+
+#undef FUNCTION_PROFILER
+#define FUNCTION_PROFILER(FILE, LABELNO) \
+ fputs ("\tjsr $28,_mcount\n", (FILE))
+
+/* Show that we need a GP when profiling. */
+#define TARGET_PROFILING_NEEDS_GP
+
+#undef HAS_INIT_SECTION
+
+/* Provide an ASM_SPEC appropriate for a FreeBSD/alpha target. This differs
+ from the generic FreeBSD ASM_SPEC in that no special handling of PIC is
+ necessary on the Alpha. */
+
+#undef ASM_SPEC
+#define ASM_SPEC " %| %{mcpu=*:-m%*}"
+
+/* Output at beginning of assembler file. */
+
+#undef ASM_FILE_START
+#define ASM_FILE_START(FILE) \
+{ \
+ alpha_write_verstamp (FILE); \
+ output_file_directive (FILE, main_input_filename); \
+ fprintf (FILE, "\t.version\t\"01.01\"\n"); \
+ fprintf (FILE, "\t.set noat\n"); \
+}
+
+#define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE) \
+ alpha_output_lineno (STREAM, LINE)
+extern void alpha_output_lineno ();
+
+extern void output_file_directive ();
+
+/* 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. */
+
+#define IDENT_ASM_OP ".ident"
+
+#ifdef IDENTIFY_WITH_IDENT
+#define ASM_IDENTIFY_GCC(FILE) /* nothing */
+#define ASM_IDENTIFY_LANGUAGE(FILE) \
+ fprintf(FILE, "\t%s \"GCC (%s) %s\"\n", IDENT_ASM_OP, \
+ lang_identify(), version_string)
+#else
+#define ASM_FILE_END(FILE) \
+do { \
+ fprintf ((FILE), "\t%s\t\"GCC: (GNU) %s\"\n", \
+ IDENT_ASM_OP, version_string); \
+ } while (0)
+#endif
+
+/* Allow #sccs in preprocessor. */
+
+#define SCCS_DIRECTIVE
+
+/* Output #ident as a .ident. */
+
+#define ASM_OUTPUT_IDENT(FILE, NAME) \
+ fprintf (FILE, "\t%s\t\"%s\"\n", IDENT_ASM_OP, NAME);
+
+/* This is how to allocate empty space in some section. The .zero
+ pseudo-op is used for this on most svr4 assemblers. */
+
+#define SKIP_ASM_OP ".zero"
+
+#undef ASM_OUTPUT_SKIP
+#define ASM_OUTPUT_SKIP(FILE,SIZE) \
+ fprintf (FILE, "\t%s\t%u\n", SKIP_ASM_OP, (SIZE))
+
+/* Output the label which precedes a jumptable. Note that for all svr4
+ systems where we actually generate jumptables (which is to say every
+ svr4 target except i386, where we use casesi instead) we put the jump-
+ tables into the .rodata section and since other stuff could have been
+ put into the .rodata section prior to any given jumptable, we have to
+ make sure that the location counter for the .rodata section gets pro-
+ perly re-aligned prior to the actual beginning of the jump table. */
+
+#define ALIGN_ASM_OP ".align"
+
+#ifndef ASM_OUTPUT_BEFORE_CASE_LABEL
+#define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE,PREFIX,NUM,TABLE) \
+ ASM_OUTPUT_ALIGN ((FILE), 2);
+#endif
+
+#undef ASM_OUTPUT_CASE_LABEL
+#define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,JUMPTABLE) \
+ do { \
+ ASM_OUTPUT_BEFORE_CASE_LABEL (FILE, PREFIX, NUM, JUMPTABLE) \
+ ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); \
+ } while (0)
+
+/* The standard SVR4 assembler seems to require that certain builtin
+ library routines (e.g. .udiv) be explicitly declared as .globl
+ in each assembly file where they are referenced. */
+
+#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
+ ASM_GLOBALIZE_LABEL (FILE, XSTR (FUN, 0))
+
+/* This says how to output assembler code to declare an
+ uninitialized external linkage data object. Under SVR4,
+ the linker seems to want the alignment of data objects
+ to depend on their types. We do exactly that here. */
+
+#define COMMON_ASM_OP ".comm"
+
+#undef ASM_OUTPUT_ALIGNED_COMMON
+#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
+do { \
+ fprintf ((FILE), "\t%s\t", COMMON_ASM_OP); \
+ assemble_name ((FILE), (NAME)); \
+ fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \
+} while (0)
+
+/* This says how to output assembler code to declare an
+ uninitialized internal linkage data object. Under SVR4,
+ the linker seems to want the alignment of data objects
+ to depend on their types. We do exactly that here. */
+
+#define LOCAL_ASM_OP ".local"
+
+#undef ASM_OUTPUT_ALIGNED_LOCAL
+#define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
+do { \
+ fprintf ((FILE), "\t%s\t", LOCAL_ASM_OP); \
+ assemble_name ((FILE), (NAME)); \
+ fprintf ((FILE), "\n"); \
+ ASM_OUTPUT_ALIGNED_COMMON (FILE, NAME, SIZE, ALIGN); \
+} while (0)
+
+/* This is the pseudo-op used to generate a 64-bit word of data with a
+ specific value in some section. */
+
+#define INT_ASM_OP ".quad"
+
+/* This is the pseudo-op used to generate a contiguous sequence of byte
+ values from a double-quoted string WITHOUT HAVING A TERMINATING NUL
+ AUTOMATICALLY APPENDED. This is the same for most svr4 assemblers. */
+
+#undef ASCII_DATA_ASM_OP
+#define ASCII_DATA_ASM_OP ".ascii"
+
+/* Support const sections and the ctors and dtors sections for g++.
+ Note that there appears to be two different ways to support const
+ sections at the moment. You can either #define the symbol
+ READONLY_DATA_SECTION (giving it some code which switches to the
+ readonly data section) or else you can #define the symbols
+ EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, SELECT_SECTION, and
+ SELECT_RTX_SECTION. We do both here just to be on the safe side. */
+
+#define USE_CONST_SECTION 1
+
+#define CONST_SECTION_ASM_OP ".section\t.rodata"
+
+/* Define the pseudo-ops used to switch to the .ctors and .dtors sections.
+
+ Note that we want to give these sections the SHF_WRITE attribute
+ because these sections will actually contain data (i.e. tables of
+ addresses of functions in the current root executable or shared library
+ file) and, in the case of a shared library, the relocatable addresses
+ will have to be properly resolved/relocated (and then written into) by
+ the dynamic linker when it actually attaches the given shared library
+ to the executing process. (Note that on SVR4, you may wish to use the
+ `-z text' option to the ELF linker, when building a shared library, as
+ an additional check that you are doing everything right. But if you do
+ use the `-z text' option when building a shared library, you will get
+ errors unless the .ctors and .dtors sections are marked as writable
+ via the SHF_WRITE attribute.) */
+
+#define CTORS_SECTION_ASM_OP ".section\t.ctors,\"aw\""
+#define DTORS_SECTION_ASM_OP ".section\t.dtors,\"aw\""
+
+/* On svr4, we *do* have support for the .init and .fini sections, and we
+ can put stuff in there to be executed before and after `main'. We let
+ crtstuff.c and other files know this by defining the following symbols.
+ The definitions say how to change sections to the .init and .fini
+ sections. This is the same for all known svr4 assemblers. */
+
+#define INIT_SECTION_ASM_OP ".section\t.init"
+#define FINI_SECTION_ASM_OP ".section\t.fini"
+
+/* A default list of other sections which we might be "in" at any given
+ time. For targets that use additional sections (e.g. .tdesc) you
+ should override this definition in the target-specific file which
+ includes this file. */
+
+#undef EXTRA_SECTIONS
+#define EXTRA_SECTIONS in_const, in_ctors, in_dtors
+
+/* A default list of extra section function definitions. For targets
+ that use additional sections (e.g. .tdesc) you should override this
+ definition in the target-specific file which includes this file. */
+
+#undef EXTRA_SECTION_FUNCTIONS
+#define EXTRA_SECTION_FUNCTIONS \
+ CONST_SECTION_FUNCTION \
+ CTORS_SECTION_FUNCTION \
+ DTORS_SECTION_FUNCTION
+
+#undef READONLY_DATA_SECTION
+#define READONLY_DATA_SECTION() const_section ()
+
+extern void text_section ();
+
+#define CONST_SECTION_FUNCTION \
+void \
+const_section () \
+{ \
+ if (!USE_CONST_SECTION) \
+ text_section(); \
+ else if (in_section != in_const) \
+ { \
+ fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP); \
+ in_section = in_const; \
+ } \
+}
+
+#define CTORS_SECTION_FUNCTION \
+void \
+ctors_section () \
+{ \
+ if (in_section != in_ctors) \
+ { \
+ fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP); \
+ in_section = in_ctors; \
+ } \
+}
+
+#define DTORS_SECTION_FUNCTION \
+void \
+dtors_section () \
+{ \
+ if (in_section != in_dtors) \
+ { \
+ fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP); \
+ in_section = in_dtors; \
+ } \
+}
+
+/* Switch into a generic section.
+ This is currently only used to support section attributes.
+
+ We make the section read-only and executable for a function decl,
+ read-only for a const data decl, and writable for a non-const data decl. */
+#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC) \
+ fprintf (FILE, ".section\t%s,\"%s\",@progbits\n", NAME, \
+ (DECL) && TREE_CODE (DECL) == FUNCTION_DECL ? "ax" : \
+ (DECL) && DECL_READONLY_SECTION (DECL, RELOC) ? "a" : "aw")
+
+
+/* A C statement (sans semicolon) to output an element in the table of
+ global constructors. */
+#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
+ do { \
+ ctors_section (); \
+ fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
+ assemble_name (FILE, NAME); \
+ fprintf (FILE, "\n"); \
+ } while (0)
+
+/* A C statement (sans semicolon) to output an element in the table of
+ global destructors. */
+#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
+ do { \
+ dtors_section (); \
+ fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
+ assemble_name (FILE, NAME); \
+ fprintf (FILE, "\n"); \
+ } while (0)
+
+/* A C statement or statements to switch to the appropriate
+ section for output of DECL. DECL is either a `VAR_DECL' node
+ or a constant of some sort. RELOC indicates whether forming
+ the initial value of DECL requires link-time relocations. */
+
+#define SELECT_SECTION(DECL,RELOC) \
+{ \
+ if (TREE_CODE (DECL) == STRING_CST) \
+ { \
+ if (! flag_writable_strings) \
+ const_section (); \
+ else \
+ data_section (); \
+ } \
+ else if (TREE_CODE (DECL) == VAR_DECL) \
+ { \
+ if ((flag_pic && RELOC) \
+ || !TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL) \
+ || !DECL_INITIAL (DECL) \
+ || (DECL_INITIAL (DECL) != error_mark_node \
+ && !TREE_CONSTANT (DECL_INITIAL (DECL)))) \
+ data_section (); \
+ else \
+ const_section (); \
+ } \
+ else \
+ const_section (); \
+}
+
+/* A C statement or statements to switch to the appropriate
+ section for output of RTX in mode MODE. RTX is some kind
+ of constant in RTL. The argument MODE is redundant except
+ in the case of a `const_int' rtx. Currently, these always
+ go into the const section. */
+
+#undef SELECT_RTX_SECTION
+#define SELECT_RTX_SECTION(MODE,RTX) const_section()
+
+/* Define the strings used for the special svr4 .type and .size directives.
+ These strings generally do not vary from one system running svr4 to
+ another, but if a given system (e.g. m88k running svr) needs to use
+ different pseudo-op names for these, they may be overridden in the
+ file which includes this one. */
+
+#define TYPE_ASM_OP ".type"
+#define SIZE_ASM_OP ".size"
+
+/* This is how we tell the assembler that two symbols have the same value. */
+
+#define ASM_OUTPUT_DEF(FILE,NAME1,NAME2) \
+ do { assemble_name(FILE, NAME1); \
+ fputs(" = ", FILE); \
+ assemble_name(FILE, NAME2); \
+ fputc('\n', FILE); } while (0)
+
+/* A table of bytes codes used by the ASM_OUTPUT_ASCII and
+ ASM_OUTPUT_LIMITED_STRING macros. Each byte in the table
+ corresponds to a particular byte value [0..255]. For any
+ given byte value, if the value in the corresponding table
+ position is zero, the given character can be output directly.
+ If the table value is 1, the byte must be output as a \ooo
+ octal escape. If the tables value is anything else, then the
+ byte value should be output as a \ followed by the value
+ in the table. Note that we can use standard UN*X escape
+ sequences for many control characters, but we don't use
+ \a to represent BEL because some svr4 assemblers (e.g. on
+ the i386) don't know about that. Also, we don't use \v
+ since some versions of gas, such as 2.2 did not accept it. */
+
+#define ESCAPES \
+"\1\1\1\1\1\1\1\1btn\1fr\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\0\0\"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\\\0\0\0\
+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1"
+
+/* Some svr4 assemblers have a limit on the number of characters which
+ can appear in the operand of a .string directive. If your assembler
+ has such a limitation, you should define STRING_LIMIT to reflect that
+ limit. Note that at least some svr4 assemblers have a limit on the
+ actual number of bytes in the double-quoted string, and that they
+ count each character in an escape sequence as one byte. Thus, an
+ escape sequence like \377 would count as four bytes.
+
+ If your target assembler doesn't support the .string directive, you
+ should define this to zero.
+*/
+
+#define STRING_LIMIT ((unsigned) 256)
+
+#define STRING_ASM_OP ".string"
+
+/*
+ * We always use gas here, so we don't worry about ECOFF assembler problems.
+ */
+#undef TARGET_GAS
+#define TARGET_GAS (1)
+
+#undef PREFERRED_DEBUGGING_TYPE
+#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
diff --git a/lang/gcc295/files/freebsd.h b/lang/gcc295/files/freebsd.h
new file mode 100644
index 000000000000..0ec7426b5f30
--- /dev/null
+++ b/lang/gcc295/files/freebsd.h
@@ -0,0 +1,120 @@
+/* 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 /usr/src/contrib/gcc/config/i386/freebsd.h &
+ egcs/gcc/config/i386/freebsd-elf.h version by David O'Brien */
+
+
+/* Don't assume anything about the header files. */
+#define NO_IMPLICIT_EXTERN_C
+
+/* This defines which switch letters take arguments. On svr4, most of
+ the normal cases (defined in gcc.c) apply, and we also have -h* and
+ -z* options (for the linker). We have a slightly different mix. We
+ have -R (alias --rpath), no -z, --soname (-h), --assert etc. */
+
+#undef SWITCH_TAKES_ARG
+#define SWITCH_TAKES_ARG(CHAR) \
+ ( (CHAR) == 'D' \
+ || (CHAR) == 'U' \
+ || (CHAR) == 'o' \
+ || (CHAR) == 'e' \
+ || (CHAR) == 'T' \
+ || (CHAR) == 'u' \
+ || (CHAR) == 'I' \
+ || (CHAR) == 'm' \
+ || (CHAR) == 'x' \
+ || (CHAR) == 'L' \
+ || (CHAR) == 'A' \
+ || (CHAR) == 'V' \
+ || (CHAR) == 'B' \
+ || (CHAR) == 'b' \
+ || (CHAR) == 'h' \
+ || (CHAR) == 'z' /* ignored by ld */ \
+ || (CHAR) == 'R')
+
+#undef WORD_SWITCH_TAKES_ARG
+#define 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"))
+
+
+#define CPP_FBSD_PREDEFINES " -Dunix -D__FreeBSD__ -Asystem(unix) -Asystem(FreeBSD) "
+
+
+/* Code generation parameters. */
+
+/* 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) */
+#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
+
+
+/* Miscellaneous parameters. */
+
+/* Tell libgcc2.c that FreeBSD targets support atexit(3). */
+#define HAVE_ATEXIT
+
+
+/* FREEBSD_NATIVE is defined when gcc is integrated into the FreeBSD
+ source tree so it can be configured appropriately without using
+ the GNU configure/build mechanism. */
+
+#ifdef FREEBSD_NATIVE
+
+/* Look for the include files in the system-defined places. */
+
+#define GPLUSPLUS_INCLUDE_DIR "/usr/include/g++"
+#define GCC_INCLUDE_DIR "/usr/include"
+
+/* Now that GCC knows what the include path applies to, put the G++ one first.
+ C++ can now have include files that override the default C ones. */
+#define INCLUDE_DEFAULTS \
+ { \
+ { GPLUSPLUS_INCLUDE_DIR, "C++", 1, 1 }, \
+ { GCC_INCLUDE_DIR, "GCC", 0, 0 }, \
+ { 0, 0, 0, 0 } \
+ }
+
+/* Under FreeBSD, the normal location of the compiler back ends is the
+ /usr/libexec directory. */
+
+#define STANDARD_EXEC_PREFIX "/usr/libexec/"
+#define TOOLDIR_BASE_PREFIX "/usr/libexec/"
+
+/* Under FreeBSD, the normal location of the various *crt*.o files is the
+ /usr/lib directory. */
+
+#define STANDARD_STARTFILE_PREFIX "/usr/lib/"
+
+/* FreeBSD is 4.4BSD derived */
+#define bsd4_4
+
+#endif /* FREEBSD_NATIVE */
diff --git a/lang/gcc295/files/patch-ad b/lang/gcc295/files/patch-ad
index f8fb5803acf0..bea070deb344 100644
--- a/lang/gcc295/files/patch-ad
+++ b/lang/gcc295/files/patch-ad
@@ -1,6 +1,41 @@
--- gcc/config/i386/freebsd-aout.h.orig Mon Mar 1 14:47:33 1999
-+++ gcc/config/i386/freebsd-aout.h Sat Mar 13 19:24:50 1999
-@@ -103,19 +103,18 @@
++++ gcc/config/i386/freebsd-aout.h Sat Mar 20 00:27:02 1999
+@@ -20,6 +20,10 @@
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
++
++/* Get generic FreeBSD definitions. */
++#include <freebsd.h>
++
+ /* This goes away when the math-emulator is fixed */
+ #define TARGET_CPU_DEFAULT 0400 /* TARGET_NO_FANCY_MATH_387 */
+
+@@ -35,7 +39,7 @@
+ #include "i386/perform.h"
+
+ #undef CPP_PREDEFINES
+-#define CPP_PREDEFINES "-Dunix -Di386 -D__FreeBSD__ -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)"
++#define CPP_PREDEFINES "-Di386 -Acpu(i386) -Amachine(i386)" CPP_FBSD_PREDEFINES
+
+ /* Like the default, except no -lg. */
+ #define LIB_SPEC "%{!shared:%{!pg:-lc}%{pg:-lc_p}}"
+@@ -85,14 +89,6 @@
+ necessary when compiling PIC code. */
+
+ #define JUMP_TABLES_IN_TEXT_SECTION 1
+-
+-/* Don't default to pcc-struct-return, because gcc is the only compiler, and
+- we want to retain compatibility with older gcc versions. */
+-#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
+
+ /* i386 freebsd still uses old binutils that don't insert nops by default
+ when the .align directive demands to insert extra space in the text
+@@ -103,19 +99,18 @@
/* Profiling routines, partially copied from i386/osfrose.h. */
@@ -23,7 +58,7 @@
fprintf (FILE, "\tcall mcount\n"); \
} \
}
-@@ -133,6 +132,7 @@
+@@ -133,6 +128,7 @@
#define TYPE_ASM_OP ".type"
#define SIZE_ASM_OP ".size"
@@ -31,7 +66,7 @@
/* The following macro defines the format used to output the second
operand of the .type assembler directive. Different svr4 assemblers
-@@ -142,6 +142,12 @@
+@@ -142,6 +138,12 @@
#define TYPE_OPERAND_FMT "@%s"
@@ -44,12 +79,34 @@
/* Write the extra assembler code needed to declare a function's result.
Most svr4 assemblers don't require any special declaration of the
result value, but there are exceptions. */
-@@ -243,6 +249,8 @@
- #define STARTFILE_SPEC \
+@@ -244,29 +246,4 @@
"%{shared:c++rt0.o%s} \
%{!shared:%{pg:gcrt0.o%s}%{!pg:%{static:scrt0.o%s}%{!static:crt0.o%s}}}"
-+
-+#define MD_STARTFILE_PREFIX "/usr/lib/aout/"
- /* This is defined when gcc is compiled in the BSD-directory-tree, and must
- * make up for the gap to all the stuff done in the GNU-makefiles.
+-/* This is defined when gcc is compiled in the BSD-directory-tree, and must
+- * make up for the gap to all the stuff done in the GNU-makefiles.
+- */
+-
+-#ifdef FREEBSD_NATIVE
+-
+-#define INCLUDE_DEFAULTS { \
+- { "/usr/include", 0, 0, 0 }, \
+- { "/usr/include/g++", "G++", 1, 1 }, \
+- { 0, 0, 0, 0} \
+- }
+-
+-#undef MD_EXEC_PREFIX
+-#define MD_EXEC_PREFIX "/usr/libexec/"
+-
+-#undef STANDARD_STARTFILE_PREFIX
+-#define STANDARD_STARTFILE_PREFIX "/usr/lib"
+-
+-#if 0 /* This is very wrong!!! */
+-#define DEFAULT_TARGET_MACHINE "i386-unknown-freebsd_1.0"
+-#define GPLUSPLUS_INCLUDE_DIR "/usr/local/lib/gcc-lib/i386-unknown-freebsd_1.0/2.5.8/include"
+-#define TOOL_INCLUDE_DIR "/usr/local/i386-unknown-freebsd_1.0/include"
+-#define GCC_INCLUDE_DIR "/usr/local/lib/gcc-lib/i386-unknown-freebsd_1.0/2.5.8/include"
+-#endif
+-
+-#endif /* FREEBSD_NATIVE */
++#define MD_STARTFILE_PREFIX "/usr/lib/aout/"
diff --git a/lang/gcc295/files/patch-af b/lang/gcc295/files/patch-af
index c50ce06c8375..c1f1ba0e855f 100644
--- a/lang/gcc295/files/patch-af
+++ b/lang/gcc295/files/patch-af
@@ -1,6 +1,30 @@
--- gcc/config/i386/freebsd.h.orig Mon Mar 1 14:47:32 1999
-+++ gcc/config/i386/freebsd.h Sat Mar 13 19:25:53 1999
-@@ -113,22 +113,19 @@
++++ gcc/config/i386/freebsd.h Sun Mar 21 16:58:39 1999
+@@ -21,19 +21,13 @@
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
++
++/* Get generic FreeBSD definitions. */
++#include <freebsd.h>
++
+ #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
+-
+ /* This is how to output an element of a case-vector that is relative.
+ This is only used for PIC code. See comments by the `casesi' insn in
+ i386.md for an explanation of the expression this outputs. */
+@@ -113,22 +107,19 @@
: ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \
: (-1))
@@ -27,8 +51,18 @@
} \
}
-@@ -151,20 +148,8 @@
- #define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
+@@ -145,26 +136,16 @@
+ #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)"
++#define CPP_PREDEFINES "-Di386 -D__ELF__ -Acpu(i386) -Amachine(i386)" CPP_FBSD_PREDEFINES
+
+ #undef CPP_SPEC
+-#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
++#define CPP_SPEC \
++ "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE} %{m486:-D__i486__}"
++ /* %{pthread:-D_REENTRANT} */
#undef LIB_SPEC
-#if 1
@@ -36,16 +70,16 @@
- * want to profile or debug the C library, please add
- * -lc_p or -ggdb to LDFLAGS at the link time, respectively.
- */
- #define LIB_SPEC \
+-#define LIB_SPEC \
- "%{!shared: %{mieee-fp:-lieee} %{p:-lgmon} %{pg:-lgmon} \
- %{!ggdb:-lc} %{ggdb:-lg}}"
-#else
--#define LIB_SPEC \
+ #define LIB_SPEC \
- "%{!shared: \
- %{mieee-fp:-lieee} %{p:-lgmon -lc_p} %{pg:-lgmon -lc_p} \
- %{!p:%{!pg:%{!g*:-lc} %{g*:-lg}}}}"
-#endif
-+ "%{!shared: %{p:-lc_p} %{pg:-lc_p} %{!p:%{!pg:-lc}}}"
++ "%{!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
diff --git a/lang/gcc295/files/patch-ak b/lang/gcc295/files/patch-ak
index 19a2994f3f05..2e54beea1a61 100644
--- a/lang/gcc295/files/patch-ak
+++ b/lang/gcc295/files/patch-ak
@@ -1,5 +1,5 @@
---- gcc/configure.orig Mon Mar 8 10:06:10 1999
-+++ gcc/configure Sat Mar 13 19:08:06 1999
+--- gcc/configure.orig Sun Mar 14 02:59:02 1999
++++ gcc/configure Sat Mar 20 00:40:05 1999
@@ -2395,6 +2395,15 @@
thread_file='posix'
fi
@@ -27,18 +27,20 @@
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
- extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
+- tmake_file=i386/t-freebsd
- gas=yes
- gnu_ld=yes
- stabs=yes
++ tmake_file=t-freebsd
;;
i[34567]86-*-freebsd*)
- tm_file=i386/freebsd.h
+ tm_file="i386/i386.h i386/att.h linux.h i386/freebsd.h i386/perform.h"
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
+- tmake_file=i386/t-freebsd
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
++ tmake_file=t-freebsd
+ gas=yes
+ gnu_ld=yes
+ stabs=yes
diff --git a/lang/gcc295/files/patch-al b/lang/gcc295/files/patch-al
index 51e1b8cdee1c..c8a195127ed0 100644
--- a/lang/gcc295/files/patch-al
+++ b/lang/gcc295/files/patch-al
@@ -1,5 +1,5 @@
--- gcc/configure.in.orig Sun Mar 7 16:22:22 1999
-+++ gcc/configure.in Sat Mar 13 19:23:23 1999
++++ gcc/configure.in Sat Mar 20 00:40:58 1999
@@ -416,6 +416,15 @@
thread_file='posix'
fi
@@ -27,18 +27,20 @@
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
- extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
+- tmake_file=i386/t-freebsd
- gas=yes
- gnu_ld=yes
- stabs=yes
++ tmake_file=t-freebsd
;;
i[[34567]]86-*-freebsd*)
- tm_file=i386/freebsd.h
+ tm_file="i386/i386.h i386/att.h linux.h i386/freebsd.h i386/perform.h"
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
+- tmake_file=i386/t-freebsd
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
++ tmake_file=t-freebsd
+ gas=yes
+ gnu_ld=yes
+ stabs=yes
diff --git a/lang/gcc30/Makefile b/lang/gcc30/Makefile
index f9347a47d87e..cd5b039f398a 100644
--- a/lang/gcc30/Makefile
+++ b/lang/gcc30/Makefile
@@ -4,7 +4,7 @@
# Date created: 9 Jan 1998
# Whom: John Polstra <jdp@polstra.com>
#
-# $Id: Makefile,v 1.48 1999/03/08 07:28:27 asami Exp $
+# $Id: Makefile,v 1.50 1999/03/17 00:40:25 obrien Exp $
#
DISTNAME= egcs-1.1.2
@@ -55,21 +55,20 @@ ALL_TARGET= bootstrap
MAN1= cccp.1 g++.1 g77.1 gcc.1
pre-patch:
+ @${MV} ${WRKSRC}/gcc/config/i386/t-freebsd ${WRKSRC}/gcc/config/
@${MV} ${WRKSRC}/gcc/config/i386/freebsd.h ${WRKSRC}/gcc/config/i386/freebsd-aout.h
@${MV} ${WRKSRC}/gcc/config/i386/freebsd-elf.h ${WRKSRC}/gcc/config/i386/freebsd.h
+ @${CP} ${FILESDIR}/alpha-freebsd-elf.h ${WRKSRC}/gcc/config/alpha/freebsd-elf.h
+ @${CP} ${FILESDIR}/alpha-freebsd.h ${WRKSRC}/gcc/config/alpha/freebsd.h
pre-configure:
@# Keep from running `autoconf' and `autoheader' since we modified
@# configure.in by patching it.
@touch ${WRKSRC}/gcc/configure
@touch ${WRKSRC}/gcc/cstamp-h.in
- @(cd ${WRKSRC}/gcc/config/${ARCH}/ ; \
- MAJ=`sysctl -n kern.osreldate | ${SED} -e '/.....$$/s///'` ; \
- ${MV} freebsd-aout.h freebsd-aout.h.in ; \
- ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" freebsd-aout.h.in \
- >freebsd-aout.h ; \
- ${MV} freebsd.h freebsd.h.in ; \
- ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" freebsd.h.in >freebsd.h )
+ @(MAJ=`sysctl -n kern.osreldate | ${SED} -e '/.....$$/s///'` ; \
+ ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" ${FILESDIR}/freebsd.h \
+ >${WRKSRC}/gcc/config/freebsd.h )
.if ${PORTOBJFORMAT} == "elf" && ${MACHINE_ARCH} == "i386"
@${SED} -e 's/^@comment ELF-only://' ${PKGDIR}/PLIST >${PLIST}
.endif
diff --git a/lang/gcc30/files/alpha-freebsd.h b/lang/gcc30/files/alpha-freebsd.h
new file mode 100644
index 000000000000..60a1f07b94ba
--- /dev/null
+++ b/lang/gcc30/files/alpha-freebsd.h
@@ -0,0 +1,443 @@
+/* Definitions of target machine for GNU compiler,
+ for Alpha FreeBSD systems.
+ Copyright (C) 1998 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* This is used on Alpha platforms that use the ELF format.
+ This was taken from the NetBSD configuration, and modified
+ for FreeBSD/alpha by Hidetoshi Shimokawa <simokawa@FreeBSD.ORG> */
+
+
+/* Get generic FreeBSD definitions. */
+#include <freebsd.h>
+
+
+#undef OBJECT_FORMAT_COFF
+#undef EXTENDED_COFF
+#define OBJECT_FORMAT_ELF
+
+/* This is BSD, so it wants DBX format. */
+
+#define DBX_DEBUGGING_INFO
+
+/* This is the char to use for continuation (in case we need to turn
+ continuation back on). */
+
+#define DBX_CONTIN_CHAR '?'
+
+#undef ASM_FINAL_SPEC
+
+/* Names to predefine in the preprocessor for this target machine.
+ XXX FreeBSD, by convention, shouldn't do __alpha, but lots of applications
+ expect it because that's what OSF/1 does. */
+
+#undef TARGET_DEFAULT
+#define TARGET_DEFAULT (MASK_FP | MASK_FPREGS | MASK_GAS)
+
+#undef CPP_PREDEFINES
+#define CPP_PREDEFINES "\
+-D__alpha__ -D__alpha -Acpu(alpha) -Amachine(alpha) " \
+FBSD_CPP_PREDEFINES \
+SUB_CPP_PREDEFINES
+
+/* Make gcc agree with <machine/ansi.h> */
+
+#undef WCHAR_TYPE
+#define WCHAR_TYPE "int"
+
+#undef WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE 32
+
+/* Output assembler code to FILE to increment profiler label # LABELNO
+ for profiling a function entry. Under FreeBSD/Alpha, the assembler does
+ nothing special with -pg. */
+
+#undef FUNCTION_PROFILER
+#define FUNCTION_PROFILER(FILE, LABELNO) \
+ fputs ("\tjsr $28,_mcount\n", (FILE))
+
+/* Show that we need a GP when profiling. */
+#define TARGET_PROFILING_NEEDS_GP
+
+#undef HAS_INIT_SECTION
+
+/* Provide an ASM_SPEC appropriate for a FreeBSD/alpha target. This differs
+ from the generic FreeBSD ASM_SPEC in that no special handling of PIC is
+ necessary on the Alpha. */
+
+#undef ASM_SPEC
+#define ASM_SPEC " %| %{mcpu=*:-m%*}"
+
+/* Output at beginning of assembler file. */
+
+#undef ASM_FILE_START
+#define ASM_FILE_START(FILE) \
+{ \
+ alpha_write_verstamp (FILE); \
+ output_file_directive (FILE, main_input_filename); \
+ fprintf (FILE, "\t.version\t\"01.01\"\n"); \
+ fprintf (FILE, "\t.set noat\n"); \
+}
+
+#define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE) \
+ alpha_output_lineno (STREAM, LINE)
+extern void alpha_output_lineno ();
+
+extern void output_file_directive ();
+
+/* 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. */
+
+#define IDENT_ASM_OP ".ident"
+
+#ifdef IDENTIFY_WITH_IDENT
+#define ASM_IDENTIFY_GCC(FILE) /* nothing */
+#define ASM_IDENTIFY_LANGUAGE(FILE) \
+ fprintf(FILE, "\t%s \"GCC (%s) %s\"\n", IDENT_ASM_OP, \
+ lang_identify(), version_string)
+#else
+#define ASM_FILE_END(FILE) \
+do { \
+ fprintf ((FILE), "\t%s\t\"GCC: (GNU) %s\"\n", \
+ IDENT_ASM_OP, version_string); \
+ } while (0)
+#endif
+
+/* Allow #sccs in preprocessor. */
+
+#define SCCS_DIRECTIVE
+
+/* Output #ident as a .ident. */
+
+#define ASM_OUTPUT_IDENT(FILE, NAME) \
+ fprintf (FILE, "\t%s\t\"%s\"\n", IDENT_ASM_OP, NAME);
+
+/* This is how to allocate empty space in some section. The .zero
+ pseudo-op is used for this on most svr4 assemblers. */
+
+#define SKIP_ASM_OP ".zero"
+
+#undef ASM_OUTPUT_SKIP
+#define ASM_OUTPUT_SKIP(FILE,SIZE) \
+ fprintf (FILE, "\t%s\t%u\n", SKIP_ASM_OP, (SIZE))
+
+/* Output the label which precedes a jumptable. Note that for all svr4
+ systems where we actually generate jumptables (which is to say every
+ svr4 target except i386, where we use casesi instead) we put the jump-
+ tables into the .rodata section and since other stuff could have been
+ put into the .rodata section prior to any given jumptable, we have to
+ make sure that the location counter for the .rodata section gets pro-
+ perly re-aligned prior to the actual beginning of the jump table. */
+
+#define ALIGN_ASM_OP ".align"
+
+#ifndef ASM_OUTPUT_BEFORE_CASE_LABEL
+#define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE,PREFIX,NUM,TABLE) \
+ ASM_OUTPUT_ALIGN ((FILE), 2);
+#endif
+
+#undef ASM_OUTPUT_CASE_LABEL
+#define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,JUMPTABLE) \
+ do { \
+ ASM_OUTPUT_BEFORE_CASE_LABEL (FILE, PREFIX, NUM, JUMPTABLE) \
+ ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); \
+ } while (0)
+
+/* The standard SVR4 assembler seems to require that certain builtin
+ library routines (e.g. .udiv) be explicitly declared as .globl
+ in each assembly file where they are referenced. */
+
+#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
+ ASM_GLOBALIZE_LABEL (FILE, XSTR (FUN, 0))
+
+/* This says how to output assembler code to declare an
+ uninitialized external linkage data object. Under SVR4,
+ the linker seems to want the alignment of data objects
+ to depend on their types. We do exactly that here. */
+
+#define COMMON_ASM_OP ".comm"
+
+#undef ASM_OUTPUT_ALIGNED_COMMON
+#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
+do { \
+ fprintf ((FILE), "\t%s\t", COMMON_ASM_OP); \
+ assemble_name ((FILE), (NAME)); \
+ fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \
+} while (0)
+
+/* This says how to output assembler code to declare an
+ uninitialized internal linkage data object. Under SVR4,
+ the linker seems to want the alignment of data objects
+ to depend on their types. We do exactly that here. */
+
+#define LOCAL_ASM_OP ".local"
+
+#undef ASM_OUTPUT_ALIGNED_LOCAL
+#define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
+do { \
+ fprintf ((FILE), "\t%s\t", LOCAL_ASM_OP); \
+ assemble_name ((FILE), (NAME)); \
+ fprintf ((FILE), "\n"); \
+ ASM_OUTPUT_ALIGNED_COMMON (FILE, NAME, SIZE, ALIGN); \
+} while (0)
+
+/* This is the pseudo-op used to generate a 64-bit word of data with a
+ specific value in some section. */
+
+#define INT_ASM_OP ".quad"
+
+/* This is the pseudo-op used to generate a contiguous sequence of byte
+ values from a double-quoted string WITHOUT HAVING A TERMINATING NUL
+ AUTOMATICALLY APPENDED. This is the same for most svr4 assemblers. */
+
+#undef ASCII_DATA_ASM_OP
+#define ASCII_DATA_ASM_OP ".ascii"
+
+/* Support const sections and the ctors and dtors sections for g++.
+ Note that there appears to be two different ways to support const
+ sections at the moment. You can either #define the symbol
+ READONLY_DATA_SECTION (giving it some code which switches to the
+ readonly data section) or else you can #define the symbols
+ EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, SELECT_SECTION, and
+ SELECT_RTX_SECTION. We do both here just to be on the safe side. */
+
+#define USE_CONST_SECTION 1
+
+#define CONST_SECTION_ASM_OP ".section\t.rodata"
+
+/* Define the pseudo-ops used to switch to the .ctors and .dtors sections.
+
+ Note that we want to give these sections the SHF_WRITE attribute
+ because these sections will actually contain data (i.e. tables of
+ addresses of functions in the current root executable or shared library
+ file) and, in the case of a shared library, the relocatable addresses
+ will have to be properly resolved/relocated (and then written into) by
+ the dynamic linker when it actually attaches the given shared library
+ to the executing process. (Note that on SVR4, you may wish to use the
+ `-z text' option to the ELF linker, when building a shared library, as
+ an additional check that you are doing everything right. But if you do
+ use the `-z text' option when building a shared library, you will get
+ errors unless the .ctors and .dtors sections are marked as writable
+ via the SHF_WRITE attribute.) */
+
+#define CTORS_SECTION_ASM_OP ".section\t.ctors,\"aw\""
+#define DTORS_SECTION_ASM_OP ".section\t.dtors,\"aw\""
+
+/* On svr4, we *do* have support for the .init and .fini sections, and we
+ can put stuff in there to be executed before and after `main'. We let
+ crtstuff.c and other files know this by defining the following symbols.
+ The definitions say how to change sections to the .init and .fini
+ sections. This is the same for all known svr4 assemblers. */
+
+#define INIT_SECTION_ASM_OP ".section\t.init"
+#define FINI_SECTION_ASM_OP ".section\t.fini"
+
+/* A default list of other sections which we might be "in" at any given
+ time. For targets that use additional sections (e.g. .tdesc) you
+ should override this definition in the target-specific file which
+ includes this file. */
+
+#undef EXTRA_SECTIONS
+#define EXTRA_SECTIONS in_const, in_ctors, in_dtors
+
+/* A default list of extra section function definitions. For targets
+ that use additional sections (e.g. .tdesc) you should override this
+ definition in the target-specific file which includes this file. */
+
+#undef EXTRA_SECTION_FUNCTIONS
+#define EXTRA_SECTION_FUNCTIONS \
+ CONST_SECTION_FUNCTION \
+ CTORS_SECTION_FUNCTION \
+ DTORS_SECTION_FUNCTION
+
+#undef READONLY_DATA_SECTION
+#define READONLY_DATA_SECTION() const_section ()
+
+extern void text_section ();
+
+#define CONST_SECTION_FUNCTION \
+void \
+const_section () \
+{ \
+ if (!USE_CONST_SECTION) \
+ text_section(); \
+ else if (in_section != in_const) \
+ { \
+ fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP); \
+ in_section = in_const; \
+ } \
+}
+
+#define CTORS_SECTION_FUNCTION \
+void \
+ctors_section () \
+{ \
+ if (in_section != in_ctors) \
+ { \
+ fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP); \
+ in_section = in_ctors; \
+ } \
+}
+
+#define DTORS_SECTION_FUNCTION \
+void \
+dtors_section () \
+{ \
+ if (in_section != in_dtors) \
+ { \
+ fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP); \
+ in_section = in_dtors; \
+ } \
+}
+
+/* Switch into a generic section.
+ This is currently only used to support section attributes.
+
+ We make the section read-only and executable for a function decl,
+ read-only for a const data decl, and writable for a non-const data decl. */
+#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC) \
+ fprintf (FILE, ".section\t%s,\"%s\",@progbits\n", NAME, \
+ (DECL) && TREE_CODE (DECL) == FUNCTION_DECL ? "ax" : \
+ (DECL) && DECL_READONLY_SECTION (DECL, RELOC) ? "a" : "aw")
+
+
+/* A C statement (sans semicolon) to output an element in the table of
+ global constructors. */
+#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
+ do { \
+ ctors_section (); \
+ fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
+ assemble_name (FILE, NAME); \
+ fprintf (FILE, "\n"); \
+ } while (0)
+
+/* A C statement (sans semicolon) to output an element in the table of
+ global destructors. */
+#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
+ do { \
+ dtors_section (); \
+ fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
+ assemble_name (FILE, NAME); \
+ fprintf (FILE, "\n"); \
+ } while (0)
+
+/* A C statement or statements to switch to the appropriate
+ section for output of DECL. DECL is either a `VAR_DECL' node
+ or a constant of some sort. RELOC indicates whether forming
+ the initial value of DECL requires link-time relocations. */
+
+#define SELECT_SECTION(DECL,RELOC) \
+{ \
+ if (TREE_CODE (DECL) == STRING_CST) \
+ { \
+ if (! flag_writable_strings) \
+ const_section (); \
+ else \
+ data_section (); \
+ } \
+ else if (TREE_CODE (DECL) == VAR_DECL) \
+ { \
+ if ((flag_pic && RELOC) \
+ || !TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL) \
+ || !DECL_INITIAL (DECL) \
+ || (DECL_INITIAL (DECL) != error_mark_node \
+ && !TREE_CONSTANT (DECL_INITIAL (DECL)))) \
+ data_section (); \
+ else \
+ const_section (); \
+ } \
+ else \
+ const_section (); \
+}
+
+/* A C statement or statements to switch to the appropriate
+ section for output of RTX in mode MODE. RTX is some kind
+ of constant in RTL. The argument MODE is redundant except
+ in the case of a `const_int' rtx. Currently, these always
+ go into the const section. */
+
+#undef SELECT_RTX_SECTION
+#define SELECT_RTX_SECTION(MODE,RTX) const_section()
+
+/* Define the strings used for the special svr4 .type and .size directives.
+ These strings generally do not vary from one system running svr4 to
+ another, but if a given system (e.g. m88k running svr) needs to use
+ different pseudo-op names for these, they may be overridden in the
+ file which includes this one. */
+
+#define TYPE_ASM_OP ".type"
+#define SIZE_ASM_OP ".size"
+
+/* This is how we tell the assembler that two symbols have the same value. */
+
+#define ASM_OUTPUT_DEF(FILE,NAME1,NAME2) \
+ do { assemble_name(FILE, NAME1); \
+ fputs(" = ", FILE); \
+ assemble_name(FILE, NAME2); \
+ fputc('\n', FILE); } while (0)
+
+/* A table of bytes codes used by the ASM_OUTPUT_ASCII and
+ ASM_OUTPUT_LIMITED_STRING macros. Each byte in the table
+ corresponds to a particular byte value [0..255]. For any
+ given byte value, if the value in the corresponding table
+ position is zero, the given character can be output directly.
+ If the table value is 1, the byte must be output as a \ooo
+ octal escape. If the tables value is anything else, then the
+ byte value should be output as a \ followed by the value
+ in the table. Note that we can use standard UN*X escape
+ sequences for many control characters, but we don't use
+ \a to represent BEL because some svr4 assemblers (e.g. on
+ the i386) don't know about that. Also, we don't use \v
+ since some versions of gas, such as 2.2 did not accept it. */
+
+#define ESCAPES \
+"\1\1\1\1\1\1\1\1btn\1fr\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\0\0\"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\\\0\0\0\
+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1"
+
+/* Some svr4 assemblers have a limit on the number of characters which
+ can appear in the operand of a .string directive. If your assembler
+ has such a limitation, you should define STRING_LIMIT to reflect that
+ limit. Note that at least some svr4 assemblers have a limit on the
+ actual number of bytes in the double-quoted string, and that they
+ count each character in an escape sequence as one byte. Thus, an
+ escape sequence like \377 would count as four bytes.
+
+ If your target assembler doesn't support the .string directive, you
+ should define this to zero.
+*/
+
+#define STRING_LIMIT ((unsigned) 256)
+
+#define STRING_ASM_OP ".string"
+
+/*
+ * We always use gas here, so we don't worry about ECOFF assembler problems.
+ */
+#undef TARGET_GAS
+#define TARGET_GAS (1)
+
+#undef PREFERRED_DEBUGGING_TYPE
+#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
diff --git a/lang/gcc30/files/patch-ad b/lang/gcc30/files/patch-ad
index f8fb5803acf0..bea070deb344 100644
--- a/lang/gcc30/files/patch-ad
+++ b/lang/gcc30/files/patch-ad
@@ -1,6 +1,41 @@
--- gcc/config/i386/freebsd-aout.h.orig Mon Mar 1 14:47:33 1999
-+++ gcc/config/i386/freebsd-aout.h Sat Mar 13 19:24:50 1999
-@@ -103,19 +103,18 @@
++++ gcc/config/i386/freebsd-aout.h Sat Mar 20 00:27:02 1999
+@@ -20,6 +20,10 @@
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
++
++/* Get generic FreeBSD definitions. */
++#include <freebsd.h>
++
+ /* This goes away when the math-emulator is fixed */
+ #define TARGET_CPU_DEFAULT 0400 /* TARGET_NO_FANCY_MATH_387 */
+
+@@ -35,7 +39,7 @@
+ #include "i386/perform.h"
+
+ #undef CPP_PREDEFINES
+-#define CPP_PREDEFINES "-Dunix -Di386 -D__FreeBSD__ -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)"
++#define CPP_PREDEFINES "-Di386 -Acpu(i386) -Amachine(i386)" CPP_FBSD_PREDEFINES
+
+ /* Like the default, except no -lg. */
+ #define LIB_SPEC "%{!shared:%{!pg:-lc}%{pg:-lc_p}}"
+@@ -85,14 +89,6 @@
+ necessary when compiling PIC code. */
+
+ #define JUMP_TABLES_IN_TEXT_SECTION 1
+-
+-/* Don't default to pcc-struct-return, because gcc is the only compiler, and
+- we want to retain compatibility with older gcc versions. */
+-#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
+
+ /* i386 freebsd still uses old binutils that don't insert nops by default
+ when the .align directive demands to insert extra space in the text
+@@ -103,19 +99,18 @@
/* Profiling routines, partially copied from i386/osfrose.h. */
@@ -23,7 +58,7 @@
fprintf (FILE, "\tcall mcount\n"); \
} \
}
-@@ -133,6 +132,7 @@
+@@ -133,6 +128,7 @@
#define TYPE_ASM_OP ".type"
#define SIZE_ASM_OP ".size"
@@ -31,7 +66,7 @@
/* The following macro defines the format used to output the second
operand of the .type assembler directive. Different svr4 assemblers
-@@ -142,6 +142,12 @@
+@@ -142,6 +138,12 @@
#define TYPE_OPERAND_FMT "@%s"
@@ -44,12 +79,34 @@
/* Write the extra assembler code needed to declare a function's result.
Most svr4 assemblers don't require any special declaration of the
result value, but there are exceptions. */
-@@ -243,6 +249,8 @@
- #define STARTFILE_SPEC \
+@@ -244,29 +246,4 @@
"%{shared:c++rt0.o%s} \
%{!shared:%{pg:gcrt0.o%s}%{!pg:%{static:scrt0.o%s}%{!static:crt0.o%s}}}"
-+
-+#define MD_STARTFILE_PREFIX "/usr/lib/aout/"
- /* This is defined when gcc is compiled in the BSD-directory-tree, and must
- * make up for the gap to all the stuff done in the GNU-makefiles.
+-/* This is defined when gcc is compiled in the BSD-directory-tree, and must
+- * make up for the gap to all the stuff done in the GNU-makefiles.
+- */
+-
+-#ifdef FREEBSD_NATIVE
+-
+-#define INCLUDE_DEFAULTS { \
+- { "/usr/include", 0, 0, 0 }, \
+- { "/usr/include/g++", "G++", 1, 1 }, \
+- { 0, 0, 0, 0} \
+- }
+-
+-#undef MD_EXEC_PREFIX
+-#define MD_EXEC_PREFIX "/usr/libexec/"
+-
+-#undef STANDARD_STARTFILE_PREFIX
+-#define STANDARD_STARTFILE_PREFIX "/usr/lib"
+-
+-#if 0 /* This is very wrong!!! */
+-#define DEFAULT_TARGET_MACHINE "i386-unknown-freebsd_1.0"
+-#define GPLUSPLUS_INCLUDE_DIR "/usr/local/lib/gcc-lib/i386-unknown-freebsd_1.0/2.5.8/include"
+-#define TOOL_INCLUDE_DIR "/usr/local/i386-unknown-freebsd_1.0/include"
+-#define GCC_INCLUDE_DIR "/usr/local/lib/gcc-lib/i386-unknown-freebsd_1.0/2.5.8/include"
+-#endif
+-
+-#endif /* FREEBSD_NATIVE */
++#define MD_STARTFILE_PREFIX "/usr/lib/aout/"
diff --git a/lang/gcc30/files/patch-af b/lang/gcc30/files/patch-af
index c50ce06c8375..c1f1ba0e855f 100644
--- a/lang/gcc30/files/patch-af
+++ b/lang/gcc30/files/patch-af
@@ -1,6 +1,30 @@
--- gcc/config/i386/freebsd.h.orig Mon Mar 1 14:47:32 1999
-+++ gcc/config/i386/freebsd.h Sat Mar 13 19:25:53 1999
-@@ -113,22 +113,19 @@
++++ gcc/config/i386/freebsd.h Sun Mar 21 16:58:39 1999
+@@ -21,19 +21,13 @@
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
++
++/* Get generic FreeBSD definitions. */
++#include <freebsd.h>
++
+ #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
+-
+ /* This is how to output an element of a case-vector that is relative.
+ This is only used for PIC code. See comments by the `casesi' insn in
+ i386.md for an explanation of the expression this outputs. */
+@@ -113,22 +107,19 @@
: ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \
: (-1))
@@ -27,8 +51,18 @@
} \
}
-@@ -151,20 +148,8 @@
- #define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
+@@ -145,26 +136,16 @@
+ #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)"
++#define CPP_PREDEFINES "-Di386 -D__ELF__ -Acpu(i386) -Amachine(i386)" CPP_FBSD_PREDEFINES
+
+ #undef CPP_SPEC
+-#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
++#define CPP_SPEC \
++ "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE} %{m486:-D__i486__}"
++ /* %{pthread:-D_REENTRANT} */
#undef LIB_SPEC
-#if 1
@@ -36,16 +70,16 @@
- * want to profile or debug the C library, please add
- * -lc_p or -ggdb to LDFLAGS at the link time, respectively.
- */
- #define LIB_SPEC \
+-#define LIB_SPEC \
- "%{!shared: %{mieee-fp:-lieee} %{p:-lgmon} %{pg:-lgmon} \
- %{!ggdb:-lc} %{ggdb:-lg}}"
-#else
--#define LIB_SPEC \
+ #define LIB_SPEC \
- "%{!shared: \
- %{mieee-fp:-lieee} %{p:-lgmon -lc_p} %{pg:-lgmon -lc_p} \
- %{!p:%{!pg:%{!g*:-lc} %{g*:-lg}}}}"
-#endif
-+ "%{!shared: %{p:-lc_p} %{pg:-lc_p} %{!p:%{!pg:-lc}}}"
++ "%{!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
diff --git a/lang/gcc30/files/patch-ak b/lang/gcc30/files/patch-ak
index 19a2994f3f05..2e54beea1a61 100644
--- a/lang/gcc30/files/patch-ak
+++ b/lang/gcc30/files/patch-ak
@@ -1,5 +1,5 @@
---- gcc/configure.orig Mon Mar 8 10:06:10 1999
-+++ gcc/configure Sat Mar 13 19:08:06 1999
+--- gcc/configure.orig Sun Mar 14 02:59:02 1999
++++ gcc/configure Sat Mar 20 00:40:05 1999
@@ -2395,6 +2395,15 @@
thread_file='posix'
fi
@@ -27,18 +27,20 @@
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
- extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
+- tmake_file=i386/t-freebsd
- gas=yes
- gnu_ld=yes
- stabs=yes
++ tmake_file=t-freebsd
;;
i[34567]86-*-freebsd*)
- tm_file=i386/freebsd.h
+ tm_file="i386/i386.h i386/att.h linux.h i386/freebsd.h i386/perform.h"
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
+- tmake_file=i386/t-freebsd
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
++ tmake_file=t-freebsd
+ gas=yes
+ gnu_ld=yes
+ stabs=yes
diff --git a/lang/gcc30/files/patch-al b/lang/gcc30/files/patch-al
index 51e1b8cdee1c..c8a195127ed0 100644
--- a/lang/gcc30/files/patch-al
+++ b/lang/gcc30/files/patch-al
@@ -1,5 +1,5 @@
--- gcc/configure.in.orig Sun Mar 7 16:22:22 1999
-+++ gcc/configure.in Sat Mar 13 19:23:23 1999
++++ gcc/configure.in Sat Mar 20 00:40:58 1999
@@ -416,6 +416,15 @@
thread_file='posix'
fi
@@ -27,18 +27,20 @@
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
- extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
+- tmake_file=i386/t-freebsd
- gas=yes
- gnu_ld=yes
- stabs=yes
++ tmake_file=t-freebsd
;;
i[[34567]]86-*-freebsd*)
- tm_file=i386/freebsd.h
+ tm_file="i386/i386.h i386/att.h linux.h i386/freebsd.h i386/perform.h"
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
+- tmake_file=i386/t-freebsd
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
++ tmake_file=t-freebsd
+ gas=yes
+ gnu_ld=yes
+ stabs=yes
diff --git a/lang/gcc31/Makefile b/lang/gcc31/Makefile
index f9347a47d87e..cd5b039f398a 100644
--- a/lang/gcc31/Makefile
+++ b/lang/gcc31/Makefile
@@ -4,7 +4,7 @@
# Date created: 9 Jan 1998
# Whom: John Polstra <jdp@polstra.com>
#
-# $Id: Makefile,v 1.48 1999/03/08 07:28:27 asami Exp $
+# $Id: Makefile,v 1.50 1999/03/17 00:40:25 obrien Exp $
#
DISTNAME= egcs-1.1.2
@@ -55,21 +55,20 @@ ALL_TARGET= bootstrap
MAN1= cccp.1 g++.1 g77.1 gcc.1
pre-patch:
+ @${MV} ${WRKSRC}/gcc/config/i386/t-freebsd ${WRKSRC}/gcc/config/
@${MV} ${WRKSRC}/gcc/config/i386/freebsd.h ${WRKSRC}/gcc/config/i386/freebsd-aout.h
@${MV} ${WRKSRC}/gcc/config/i386/freebsd-elf.h ${WRKSRC}/gcc/config/i386/freebsd.h
+ @${CP} ${FILESDIR}/alpha-freebsd-elf.h ${WRKSRC}/gcc/config/alpha/freebsd-elf.h
+ @${CP} ${FILESDIR}/alpha-freebsd.h ${WRKSRC}/gcc/config/alpha/freebsd.h
pre-configure:
@# Keep from running `autoconf' and `autoheader' since we modified
@# configure.in by patching it.
@touch ${WRKSRC}/gcc/configure
@touch ${WRKSRC}/gcc/cstamp-h.in
- @(cd ${WRKSRC}/gcc/config/${ARCH}/ ; \
- MAJ=`sysctl -n kern.osreldate | ${SED} -e '/.....$$/s///'` ; \
- ${MV} freebsd-aout.h freebsd-aout.h.in ; \
- ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" freebsd-aout.h.in \
- >freebsd-aout.h ; \
- ${MV} freebsd.h freebsd.h.in ; \
- ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" freebsd.h.in >freebsd.h )
+ @(MAJ=`sysctl -n kern.osreldate | ${SED} -e '/.....$$/s///'` ; \
+ ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" ${FILESDIR}/freebsd.h \
+ >${WRKSRC}/gcc/config/freebsd.h )
.if ${PORTOBJFORMAT} == "elf" && ${MACHINE_ARCH} == "i386"
@${SED} -e 's/^@comment ELF-only://' ${PKGDIR}/PLIST >${PLIST}
.endif
diff --git a/lang/gcc31/files/alpha-freebsd.h b/lang/gcc31/files/alpha-freebsd.h
new file mode 100644
index 000000000000..60a1f07b94ba
--- /dev/null
+++ b/lang/gcc31/files/alpha-freebsd.h
@@ -0,0 +1,443 @@
+/* Definitions of target machine for GNU compiler,
+ for Alpha FreeBSD systems.
+ Copyright (C) 1998 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* This is used on Alpha platforms that use the ELF format.
+ This was taken from the NetBSD configuration, and modified
+ for FreeBSD/alpha by Hidetoshi Shimokawa <simokawa@FreeBSD.ORG> */
+
+
+/* Get generic FreeBSD definitions. */
+#include <freebsd.h>
+
+
+#undef OBJECT_FORMAT_COFF
+#undef EXTENDED_COFF
+#define OBJECT_FORMAT_ELF
+
+/* This is BSD, so it wants DBX format. */
+
+#define DBX_DEBUGGING_INFO
+
+/* This is the char to use for continuation (in case we need to turn
+ continuation back on). */
+
+#define DBX_CONTIN_CHAR '?'
+
+#undef ASM_FINAL_SPEC
+
+/* Names to predefine in the preprocessor for this target machine.
+ XXX FreeBSD, by convention, shouldn't do __alpha, but lots of applications
+ expect it because that's what OSF/1 does. */
+
+#undef TARGET_DEFAULT
+#define TARGET_DEFAULT (MASK_FP | MASK_FPREGS | MASK_GAS)
+
+#undef CPP_PREDEFINES
+#define CPP_PREDEFINES "\
+-D__alpha__ -D__alpha -Acpu(alpha) -Amachine(alpha) " \
+FBSD_CPP_PREDEFINES \
+SUB_CPP_PREDEFINES
+
+/* Make gcc agree with <machine/ansi.h> */
+
+#undef WCHAR_TYPE
+#define WCHAR_TYPE "int"
+
+#undef WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE 32
+
+/* Output assembler code to FILE to increment profiler label # LABELNO
+ for profiling a function entry. Under FreeBSD/Alpha, the assembler does
+ nothing special with -pg. */
+
+#undef FUNCTION_PROFILER
+#define FUNCTION_PROFILER(FILE, LABELNO) \
+ fputs ("\tjsr $28,_mcount\n", (FILE))
+
+/* Show that we need a GP when profiling. */
+#define TARGET_PROFILING_NEEDS_GP
+
+#undef HAS_INIT_SECTION
+
+/* Provide an ASM_SPEC appropriate for a FreeBSD/alpha target. This differs
+ from the generic FreeBSD ASM_SPEC in that no special handling of PIC is
+ necessary on the Alpha. */
+
+#undef ASM_SPEC
+#define ASM_SPEC " %| %{mcpu=*:-m%*}"
+
+/* Output at beginning of assembler file. */
+
+#undef ASM_FILE_START
+#define ASM_FILE_START(FILE) \
+{ \
+ alpha_write_verstamp (FILE); \
+ output_file_directive (FILE, main_input_filename); \
+ fprintf (FILE, "\t.version\t\"01.01\"\n"); \
+ fprintf (FILE, "\t.set noat\n"); \
+}
+
+#define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE) \
+ alpha_output_lineno (STREAM, LINE)
+extern void alpha_output_lineno ();
+
+extern void output_file_directive ();
+
+/* 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. */
+
+#define IDENT_ASM_OP ".ident"
+
+#ifdef IDENTIFY_WITH_IDENT
+#define ASM_IDENTIFY_GCC(FILE) /* nothing */
+#define ASM_IDENTIFY_LANGUAGE(FILE) \
+ fprintf(FILE, "\t%s \"GCC (%s) %s\"\n", IDENT_ASM_OP, \
+ lang_identify(), version_string)
+#else
+#define ASM_FILE_END(FILE) \
+do { \
+ fprintf ((FILE), "\t%s\t\"GCC: (GNU) %s\"\n", \
+ IDENT_ASM_OP, version_string); \
+ } while (0)
+#endif
+
+/* Allow #sccs in preprocessor. */
+
+#define SCCS_DIRECTIVE
+
+/* Output #ident as a .ident. */
+
+#define ASM_OUTPUT_IDENT(FILE, NAME) \
+ fprintf (FILE, "\t%s\t\"%s\"\n", IDENT_ASM_OP, NAME);
+
+/* This is how to allocate empty space in some section. The .zero
+ pseudo-op is used for this on most svr4 assemblers. */
+
+#define SKIP_ASM_OP ".zero"
+
+#undef ASM_OUTPUT_SKIP
+#define ASM_OUTPUT_SKIP(FILE,SIZE) \
+ fprintf (FILE, "\t%s\t%u\n", SKIP_ASM_OP, (SIZE))
+
+/* Output the label which precedes a jumptable. Note that for all svr4
+ systems where we actually generate jumptables (which is to say every
+ svr4 target except i386, where we use casesi instead) we put the jump-
+ tables into the .rodata section and since other stuff could have been
+ put into the .rodata section prior to any given jumptable, we have to
+ make sure that the location counter for the .rodata section gets pro-
+ perly re-aligned prior to the actual beginning of the jump table. */
+
+#define ALIGN_ASM_OP ".align"
+
+#ifndef ASM_OUTPUT_BEFORE_CASE_LABEL
+#define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE,PREFIX,NUM,TABLE) \
+ ASM_OUTPUT_ALIGN ((FILE), 2);
+#endif
+
+#undef ASM_OUTPUT_CASE_LABEL
+#define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,JUMPTABLE) \
+ do { \
+ ASM_OUTPUT_BEFORE_CASE_LABEL (FILE, PREFIX, NUM, JUMPTABLE) \
+ ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); \
+ } while (0)
+
+/* The standard SVR4 assembler seems to require that certain builtin
+ library routines (e.g. .udiv) be explicitly declared as .globl
+ in each assembly file where they are referenced. */
+
+#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
+ ASM_GLOBALIZE_LABEL (FILE, XSTR (FUN, 0))
+
+/* This says how to output assembler code to declare an
+ uninitialized external linkage data object. Under SVR4,
+ the linker seems to want the alignment of data objects
+ to depend on their types. We do exactly that here. */
+
+#define COMMON_ASM_OP ".comm"
+
+#undef ASM_OUTPUT_ALIGNED_COMMON
+#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
+do { \
+ fprintf ((FILE), "\t%s\t", COMMON_ASM_OP); \
+ assemble_name ((FILE), (NAME)); \
+ fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \
+} while (0)
+
+/* This says how to output assembler code to declare an
+ uninitialized internal linkage data object. Under SVR4,
+ the linker seems to want the alignment of data objects
+ to depend on their types. We do exactly that here. */
+
+#define LOCAL_ASM_OP ".local"
+
+#undef ASM_OUTPUT_ALIGNED_LOCAL
+#define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
+do { \
+ fprintf ((FILE), "\t%s\t", LOCAL_ASM_OP); \
+ assemble_name ((FILE), (NAME)); \
+ fprintf ((FILE), "\n"); \
+ ASM_OUTPUT_ALIGNED_COMMON (FILE, NAME, SIZE, ALIGN); \
+} while (0)
+
+/* This is the pseudo-op used to generate a 64-bit word of data with a
+ specific value in some section. */
+
+#define INT_ASM_OP ".quad"
+
+/* This is the pseudo-op used to generate a contiguous sequence of byte
+ values from a double-quoted string WITHOUT HAVING A TERMINATING NUL
+ AUTOMATICALLY APPENDED. This is the same for most svr4 assemblers. */
+
+#undef ASCII_DATA_ASM_OP
+#define ASCII_DATA_ASM_OP ".ascii"
+
+/* Support const sections and the ctors and dtors sections for g++.
+ Note that there appears to be two different ways to support const
+ sections at the moment. You can either #define the symbol
+ READONLY_DATA_SECTION (giving it some code which switches to the
+ readonly data section) or else you can #define the symbols
+ EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, SELECT_SECTION, and
+ SELECT_RTX_SECTION. We do both here just to be on the safe side. */
+
+#define USE_CONST_SECTION 1
+
+#define CONST_SECTION_ASM_OP ".section\t.rodata"
+
+/* Define the pseudo-ops used to switch to the .ctors and .dtors sections.
+
+ Note that we want to give these sections the SHF_WRITE attribute
+ because these sections will actually contain data (i.e. tables of
+ addresses of functions in the current root executable or shared library
+ file) and, in the case of a shared library, the relocatable addresses
+ will have to be properly resolved/relocated (and then written into) by
+ the dynamic linker when it actually attaches the given shared library
+ to the executing process. (Note that on SVR4, you may wish to use the
+ `-z text' option to the ELF linker, when building a shared library, as
+ an additional check that you are doing everything right. But if you do
+ use the `-z text' option when building a shared library, you will get
+ errors unless the .ctors and .dtors sections are marked as writable
+ via the SHF_WRITE attribute.) */
+
+#define CTORS_SECTION_ASM_OP ".section\t.ctors,\"aw\""
+#define DTORS_SECTION_ASM_OP ".section\t.dtors,\"aw\""
+
+/* On svr4, we *do* have support for the .init and .fini sections, and we
+ can put stuff in there to be executed before and after `main'. We let
+ crtstuff.c and other files know this by defining the following symbols.
+ The definitions say how to change sections to the .init and .fini
+ sections. This is the same for all known svr4 assemblers. */
+
+#define INIT_SECTION_ASM_OP ".section\t.init"
+#define FINI_SECTION_ASM_OP ".section\t.fini"
+
+/* A default list of other sections which we might be "in" at any given
+ time. For targets that use additional sections (e.g. .tdesc) you
+ should override this definition in the target-specific file which
+ includes this file. */
+
+#undef EXTRA_SECTIONS
+#define EXTRA_SECTIONS in_const, in_ctors, in_dtors
+
+/* A default list of extra section function definitions. For targets
+ that use additional sections (e.g. .tdesc) you should override this
+ definition in the target-specific file which includes this file. */
+
+#undef EXTRA_SECTION_FUNCTIONS
+#define EXTRA_SECTION_FUNCTIONS \
+ CONST_SECTION_FUNCTION \
+ CTORS_SECTION_FUNCTION \
+ DTORS_SECTION_FUNCTION
+
+#undef READONLY_DATA_SECTION
+#define READONLY_DATA_SECTION() const_section ()
+
+extern void text_section ();
+
+#define CONST_SECTION_FUNCTION \
+void \
+const_section () \
+{ \
+ if (!USE_CONST_SECTION) \
+ text_section(); \
+ else if (in_section != in_const) \
+ { \
+ fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP); \
+ in_section = in_const; \
+ } \
+}
+
+#define CTORS_SECTION_FUNCTION \
+void \
+ctors_section () \
+{ \
+ if (in_section != in_ctors) \
+ { \
+ fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP); \
+ in_section = in_ctors; \
+ } \
+}
+
+#define DTORS_SECTION_FUNCTION \
+void \
+dtors_section () \
+{ \
+ if (in_section != in_dtors) \
+ { \
+ fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP); \
+ in_section = in_dtors; \
+ } \
+}
+
+/* Switch into a generic section.
+ This is currently only used to support section attributes.
+
+ We make the section read-only and executable for a function decl,
+ read-only for a const data decl, and writable for a non-const data decl. */
+#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC) \
+ fprintf (FILE, ".section\t%s,\"%s\",@progbits\n", NAME, \
+ (DECL) && TREE_CODE (DECL) == FUNCTION_DECL ? "ax" : \
+ (DECL) && DECL_READONLY_SECTION (DECL, RELOC) ? "a" : "aw")
+
+
+/* A C statement (sans semicolon) to output an element in the table of
+ global constructors. */
+#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
+ do { \
+ ctors_section (); \
+ fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
+ assemble_name (FILE, NAME); \
+ fprintf (FILE, "\n"); \
+ } while (0)
+
+/* A C statement (sans semicolon) to output an element in the table of
+ global destructors. */
+#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
+ do { \
+ dtors_section (); \
+ fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
+ assemble_name (FILE, NAME); \
+ fprintf (FILE, "\n"); \
+ } while (0)
+
+/* A C statement or statements to switch to the appropriate
+ section for output of DECL. DECL is either a `VAR_DECL' node
+ or a constant of some sort. RELOC indicates whether forming
+ the initial value of DECL requires link-time relocations. */
+
+#define SELECT_SECTION(DECL,RELOC) \
+{ \
+ if (TREE_CODE (DECL) == STRING_CST) \
+ { \
+ if (! flag_writable_strings) \
+ const_section (); \
+ else \
+ data_section (); \
+ } \
+ else if (TREE_CODE (DECL) == VAR_DECL) \
+ { \
+ if ((flag_pic && RELOC) \
+ || !TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL) \
+ || !DECL_INITIAL (DECL) \
+ || (DECL_INITIAL (DECL) != error_mark_node \
+ && !TREE_CONSTANT (DECL_INITIAL (DECL)))) \
+ data_section (); \
+ else \
+ const_section (); \
+ } \
+ else \
+ const_section (); \
+}
+
+/* A C statement or statements to switch to the appropriate
+ section for output of RTX in mode MODE. RTX is some kind
+ of constant in RTL. The argument MODE is redundant except
+ in the case of a `const_int' rtx. Currently, these always
+ go into the const section. */
+
+#undef SELECT_RTX_SECTION
+#define SELECT_RTX_SECTION(MODE,RTX) const_section()
+
+/* Define the strings used for the special svr4 .type and .size directives.
+ These strings generally do not vary from one system running svr4 to
+ another, but if a given system (e.g. m88k running svr) needs to use
+ different pseudo-op names for these, they may be overridden in the
+ file which includes this one. */
+
+#define TYPE_ASM_OP ".type"
+#define SIZE_ASM_OP ".size"
+
+/* This is how we tell the assembler that two symbols have the same value. */
+
+#define ASM_OUTPUT_DEF(FILE,NAME1,NAME2) \
+ do { assemble_name(FILE, NAME1); \
+ fputs(" = ", FILE); \
+ assemble_name(FILE, NAME2); \
+ fputc('\n', FILE); } while (0)
+
+/* A table of bytes codes used by the ASM_OUTPUT_ASCII and
+ ASM_OUTPUT_LIMITED_STRING macros. Each byte in the table
+ corresponds to a particular byte value [0..255]. For any
+ given byte value, if the value in the corresponding table
+ position is zero, the given character can be output directly.
+ If the table value is 1, the byte must be output as a \ooo
+ octal escape. If the tables value is anything else, then the
+ byte value should be output as a \ followed by the value
+ in the table. Note that we can use standard UN*X escape
+ sequences for many control characters, but we don't use
+ \a to represent BEL because some svr4 assemblers (e.g. on
+ the i386) don't know about that. Also, we don't use \v
+ since some versions of gas, such as 2.2 did not accept it. */
+
+#define ESCAPES \
+"\1\1\1\1\1\1\1\1btn\1fr\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\0\0\"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\\\0\0\0\
+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1"
+
+/* Some svr4 assemblers have a limit on the number of characters which
+ can appear in the operand of a .string directive. If your assembler
+ has such a limitation, you should define STRING_LIMIT to reflect that
+ limit. Note that at least some svr4 assemblers have a limit on the
+ actual number of bytes in the double-quoted string, and that they
+ count each character in an escape sequence as one byte. Thus, an
+ escape sequence like \377 would count as four bytes.
+
+ If your target assembler doesn't support the .string directive, you
+ should define this to zero.
+*/
+
+#define STRING_LIMIT ((unsigned) 256)
+
+#define STRING_ASM_OP ".string"
+
+/*
+ * We always use gas here, so we don't worry about ECOFF assembler problems.
+ */
+#undef TARGET_GAS
+#define TARGET_GAS (1)
+
+#undef PREFERRED_DEBUGGING_TYPE
+#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
diff --git a/lang/gcc31/files/patch-ad b/lang/gcc31/files/patch-ad
index f8fb5803acf0..bea070deb344 100644
--- a/lang/gcc31/files/patch-ad
+++ b/lang/gcc31/files/patch-ad
@@ -1,6 +1,41 @@
--- gcc/config/i386/freebsd-aout.h.orig Mon Mar 1 14:47:33 1999
-+++ gcc/config/i386/freebsd-aout.h Sat Mar 13 19:24:50 1999
-@@ -103,19 +103,18 @@
++++ gcc/config/i386/freebsd-aout.h Sat Mar 20 00:27:02 1999
+@@ -20,6 +20,10 @@
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
++
++/* Get generic FreeBSD definitions. */
++#include <freebsd.h>
++
+ /* This goes away when the math-emulator is fixed */
+ #define TARGET_CPU_DEFAULT 0400 /* TARGET_NO_FANCY_MATH_387 */
+
+@@ -35,7 +39,7 @@
+ #include "i386/perform.h"
+
+ #undef CPP_PREDEFINES
+-#define CPP_PREDEFINES "-Dunix -Di386 -D__FreeBSD__ -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)"
++#define CPP_PREDEFINES "-Di386 -Acpu(i386) -Amachine(i386)" CPP_FBSD_PREDEFINES
+
+ /* Like the default, except no -lg. */
+ #define LIB_SPEC "%{!shared:%{!pg:-lc}%{pg:-lc_p}}"
+@@ -85,14 +89,6 @@
+ necessary when compiling PIC code. */
+
+ #define JUMP_TABLES_IN_TEXT_SECTION 1
+-
+-/* Don't default to pcc-struct-return, because gcc is the only compiler, and
+- we want to retain compatibility with older gcc versions. */
+-#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
+
+ /* i386 freebsd still uses old binutils that don't insert nops by default
+ when the .align directive demands to insert extra space in the text
+@@ -103,19 +99,18 @@
/* Profiling routines, partially copied from i386/osfrose.h. */
@@ -23,7 +58,7 @@
fprintf (FILE, "\tcall mcount\n"); \
} \
}
-@@ -133,6 +132,7 @@
+@@ -133,6 +128,7 @@
#define TYPE_ASM_OP ".type"
#define SIZE_ASM_OP ".size"
@@ -31,7 +66,7 @@
/* The following macro defines the format used to output the second
operand of the .type assembler directive. Different svr4 assemblers
-@@ -142,6 +142,12 @@
+@@ -142,6 +138,12 @@
#define TYPE_OPERAND_FMT "@%s"
@@ -44,12 +79,34 @@
/* Write the extra assembler code needed to declare a function's result.
Most svr4 assemblers don't require any special declaration of the
result value, but there are exceptions. */
-@@ -243,6 +249,8 @@
- #define STARTFILE_SPEC \
+@@ -244,29 +246,4 @@
"%{shared:c++rt0.o%s} \
%{!shared:%{pg:gcrt0.o%s}%{!pg:%{static:scrt0.o%s}%{!static:crt0.o%s}}}"
-+
-+#define MD_STARTFILE_PREFIX "/usr/lib/aout/"
- /* This is defined when gcc is compiled in the BSD-directory-tree, and must
- * make up for the gap to all the stuff done in the GNU-makefiles.
+-/* This is defined when gcc is compiled in the BSD-directory-tree, and must
+- * make up for the gap to all the stuff done in the GNU-makefiles.
+- */
+-
+-#ifdef FREEBSD_NATIVE
+-
+-#define INCLUDE_DEFAULTS { \
+- { "/usr/include", 0, 0, 0 }, \
+- { "/usr/include/g++", "G++", 1, 1 }, \
+- { 0, 0, 0, 0} \
+- }
+-
+-#undef MD_EXEC_PREFIX
+-#define MD_EXEC_PREFIX "/usr/libexec/"
+-
+-#undef STANDARD_STARTFILE_PREFIX
+-#define STANDARD_STARTFILE_PREFIX "/usr/lib"
+-
+-#if 0 /* This is very wrong!!! */
+-#define DEFAULT_TARGET_MACHINE "i386-unknown-freebsd_1.0"
+-#define GPLUSPLUS_INCLUDE_DIR "/usr/local/lib/gcc-lib/i386-unknown-freebsd_1.0/2.5.8/include"
+-#define TOOL_INCLUDE_DIR "/usr/local/i386-unknown-freebsd_1.0/include"
+-#define GCC_INCLUDE_DIR "/usr/local/lib/gcc-lib/i386-unknown-freebsd_1.0/2.5.8/include"
+-#endif
+-
+-#endif /* FREEBSD_NATIVE */
++#define MD_STARTFILE_PREFIX "/usr/lib/aout/"
diff --git a/lang/gcc31/files/patch-af b/lang/gcc31/files/patch-af
index c50ce06c8375..c1f1ba0e855f 100644
--- a/lang/gcc31/files/patch-af
+++ b/lang/gcc31/files/patch-af
@@ -1,6 +1,30 @@
--- gcc/config/i386/freebsd.h.orig Mon Mar 1 14:47:32 1999
-+++ gcc/config/i386/freebsd.h Sat Mar 13 19:25:53 1999
-@@ -113,22 +113,19 @@
++++ gcc/config/i386/freebsd.h Sun Mar 21 16:58:39 1999
+@@ -21,19 +21,13 @@
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
++
++/* Get generic FreeBSD definitions. */
++#include <freebsd.h>
++
+ #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
+-
+ /* This is how to output an element of a case-vector that is relative.
+ This is only used for PIC code. See comments by the `casesi' insn in
+ i386.md for an explanation of the expression this outputs. */
+@@ -113,22 +107,19 @@
: ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \
: (-1))
@@ -27,8 +51,18 @@
} \
}
-@@ -151,20 +148,8 @@
- #define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
+@@ -145,26 +136,16 @@
+ #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)"
++#define CPP_PREDEFINES "-Di386 -D__ELF__ -Acpu(i386) -Amachine(i386)" CPP_FBSD_PREDEFINES
+
+ #undef CPP_SPEC
+-#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
++#define CPP_SPEC \
++ "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE} %{m486:-D__i486__}"
++ /* %{pthread:-D_REENTRANT} */
#undef LIB_SPEC
-#if 1
@@ -36,16 +70,16 @@
- * want to profile or debug the C library, please add
- * -lc_p or -ggdb to LDFLAGS at the link time, respectively.
- */
- #define LIB_SPEC \
+-#define LIB_SPEC \
- "%{!shared: %{mieee-fp:-lieee} %{p:-lgmon} %{pg:-lgmon} \
- %{!ggdb:-lc} %{ggdb:-lg}}"
-#else
--#define LIB_SPEC \
+ #define LIB_SPEC \
- "%{!shared: \
- %{mieee-fp:-lieee} %{p:-lgmon -lc_p} %{pg:-lgmon -lc_p} \
- %{!p:%{!pg:%{!g*:-lc} %{g*:-lg}}}}"
-#endif
-+ "%{!shared: %{p:-lc_p} %{pg:-lc_p} %{!p:%{!pg:-lc}}}"
++ "%{!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
diff --git a/lang/gcc31/files/patch-ak b/lang/gcc31/files/patch-ak
index 19a2994f3f05..2e54beea1a61 100644
--- a/lang/gcc31/files/patch-ak
+++ b/lang/gcc31/files/patch-ak
@@ -1,5 +1,5 @@
---- gcc/configure.orig Mon Mar 8 10:06:10 1999
-+++ gcc/configure Sat Mar 13 19:08:06 1999
+--- gcc/configure.orig Sun Mar 14 02:59:02 1999
++++ gcc/configure Sat Mar 20 00:40:05 1999
@@ -2395,6 +2395,15 @@
thread_file='posix'
fi
@@ -27,18 +27,20 @@
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
- extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
+- tmake_file=i386/t-freebsd
- gas=yes
- gnu_ld=yes
- stabs=yes
++ tmake_file=t-freebsd
;;
i[34567]86-*-freebsd*)
- tm_file=i386/freebsd.h
+ tm_file="i386/i386.h i386/att.h linux.h i386/freebsd.h i386/perform.h"
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
+- tmake_file=i386/t-freebsd
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
++ tmake_file=t-freebsd
+ gas=yes
+ gnu_ld=yes
+ stabs=yes
diff --git a/lang/gcc31/files/patch-al b/lang/gcc31/files/patch-al
index 51e1b8cdee1c..c8a195127ed0 100644
--- a/lang/gcc31/files/patch-al
+++ b/lang/gcc31/files/patch-al
@@ -1,5 +1,5 @@
--- gcc/configure.in.orig Sun Mar 7 16:22:22 1999
-+++ gcc/configure.in Sat Mar 13 19:23:23 1999
++++ gcc/configure.in Sat Mar 20 00:40:58 1999
@@ -416,6 +416,15 @@
thread_file='posix'
fi
@@ -27,18 +27,20 @@
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
- extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
+- tmake_file=i386/t-freebsd
- gas=yes
- gnu_ld=yes
- stabs=yes
++ tmake_file=t-freebsd
;;
i[[34567]]86-*-freebsd*)
- tm_file=i386/freebsd.h
+ tm_file="i386/i386.h i386/att.h linux.h i386/freebsd.h i386/perform.h"
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
+- tmake_file=i386/t-freebsd
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
++ tmake_file=t-freebsd
+ gas=yes
+ gnu_ld=yes
+ stabs=yes
diff --git a/lang/gcc32/Makefile b/lang/gcc32/Makefile
index f9347a47d87e..cd5b039f398a 100644
--- a/lang/gcc32/Makefile
+++ b/lang/gcc32/Makefile
@@ -4,7 +4,7 @@
# Date created: 9 Jan 1998
# Whom: John Polstra <jdp@polstra.com>
#
-# $Id: Makefile,v 1.48 1999/03/08 07:28:27 asami Exp $
+# $Id: Makefile,v 1.50 1999/03/17 00:40:25 obrien Exp $
#
DISTNAME= egcs-1.1.2
@@ -55,21 +55,20 @@ ALL_TARGET= bootstrap
MAN1= cccp.1 g++.1 g77.1 gcc.1
pre-patch:
+ @${MV} ${WRKSRC}/gcc/config/i386/t-freebsd ${WRKSRC}/gcc/config/
@${MV} ${WRKSRC}/gcc/config/i386/freebsd.h ${WRKSRC}/gcc/config/i386/freebsd-aout.h
@${MV} ${WRKSRC}/gcc/config/i386/freebsd-elf.h ${WRKSRC}/gcc/config/i386/freebsd.h
+ @${CP} ${FILESDIR}/alpha-freebsd-elf.h ${WRKSRC}/gcc/config/alpha/freebsd-elf.h
+ @${CP} ${FILESDIR}/alpha-freebsd.h ${WRKSRC}/gcc/config/alpha/freebsd.h
pre-configure:
@# Keep from running `autoconf' and `autoheader' since we modified
@# configure.in by patching it.
@touch ${WRKSRC}/gcc/configure
@touch ${WRKSRC}/gcc/cstamp-h.in
- @(cd ${WRKSRC}/gcc/config/${ARCH}/ ; \
- MAJ=`sysctl -n kern.osreldate | ${SED} -e '/.....$$/s///'` ; \
- ${MV} freebsd-aout.h freebsd-aout.h.in ; \
- ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" freebsd-aout.h.in \
- >freebsd-aout.h ; \
- ${MV} freebsd.h freebsd.h.in ; \
- ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" freebsd.h.in >freebsd.h )
+ @(MAJ=`sysctl -n kern.osreldate | ${SED} -e '/.....$$/s///'` ; \
+ ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" ${FILESDIR}/freebsd.h \
+ >${WRKSRC}/gcc/config/freebsd.h )
.if ${PORTOBJFORMAT} == "elf" && ${MACHINE_ARCH} == "i386"
@${SED} -e 's/^@comment ELF-only://' ${PKGDIR}/PLIST >${PLIST}
.endif
diff --git a/lang/gcc32/files/alpha-freebsd.h b/lang/gcc32/files/alpha-freebsd.h
new file mode 100644
index 000000000000..60a1f07b94ba
--- /dev/null
+++ b/lang/gcc32/files/alpha-freebsd.h
@@ -0,0 +1,443 @@
+/* Definitions of target machine for GNU compiler,
+ for Alpha FreeBSD systems.
+ Copyright (C) 1998 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* This is used on Alpha platforms that use the ELF format.
+ This was taken from the NetBSD configuration, and modified
+ for FreeBSD/alpha by Hidetoshi Shimokawa <simokawa@FreeBSD.ORG> */
+
+
+/* Get generic FreeBSD definitions. */
+#include <freebsd.h>
+
+
+#undef OBJECT_FORMAT_COFF
+#undef EXTENDED_COFF
+#define OBJECT_FORMAT_ELF
+
+/* This is BSD, so it wants DBX format. */
+
+#define DBX_DEBUGGING_INFO
+
+/* This is the char to use for continuation (in case we need to turn
+ continuation back on). */
+
+#define DBX_CONTIN_CHAR '?'
+
+#undef ASM_FINAL_SPEC
+
+/* Names to predefine in the preprocessor for this target machine.
+ XXX FreeBSD, by convention, shouldn't do __alpha, but lots of applications
+ expect it because that's what OSF/1 does. */
+
+#undef TARGET_DEFAULT
+#define TARGET_DEFAULT (MASK_FP | MASK_FPREGS | MASK_GAS)
+
+#undef CPP_PREDEFINES
+#define CPP_PREDEFINES "\
+-D__alpha__ -D__alpha -Acpu(alpha) -Amachine(alpha) " \
+FBSD_CPP_PREDEFINES \
+SUB_CPP_PREDEFINES
+
+/* Make gcc agree with <machine/ansi.h> */
+
+#undef WCHAR_TYPE
+#define WCHAR_TYPE "int"
+
+#undef WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE 32
+
+/* Output assembler code to FILE to increment profiler label # LABELNO
+ for profiling a function entry. Under FreeBSD/Alpha, the assembler does
+ nothing special with -pg. */
+
+#undef FUNCTION_PROFILER
+#define FUNCTION_PROFILER(FILE, LABELNO) \
+ fputs ("\tjsr $28,_mcount\n", (FILE))
+
+/* Show that we need a GP when profiling. */
+#define TARGET_PROFILING_NEEDS_GP
+
+#undef HAS_INIT_SECTION
+
+/* Provide an ASM_SPEC appropriate for a FreeBSD/alpha target. This differs
+ from the generic FreeBSD ASM_SPEC in that no special handling of PIC is
+ necessary on the Alpha. */
+
+#undef ASM_SPEC
+#define ASM_SPEC " %| %{mcpu=*:-m%*}"
+
+/* Output at beginning of assembler file. */
+
+#undef ASM_FILE_START
+#define ASM_FILE_START(FILE) \
+{ \
+ alpha_write_verstamp (FILE); \
+ output_file_directive (FILE, main_input_filename); \
+ fprintf (FILE, "\t.version\t\"01.01\"\n"); \
+ fprintf (FILE, "\t.set noat\n"); \
+}
+
+#define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE) \
+ alpha_output_lineno (STREAM, LINE)
+extern void alpha_output_lineno ();
+
+extern void output_file_directive ();
+
+/* 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. */
+
+#define IDENT_ASM_OP ".ident"
+
+#ifdef IDENTIFY_WITH_IDENT
+#define ASM_IDENTIFY_GCC(FILE) /* nothing */
+#define ASM_IDENTIFY_LANGUAGE(FILE) \
+ fprintf(FILE, "\t%s \"GCC (%s) %s\"\n", IDENT_ASM_OP, \
+ lang_identify(), version_string)
+#else
+#define ASM_FILE_END(FILE) \
+do { \
+ fprintf ((FILE), "\t%s\t\"GCC: (GNU) %s\"\n", \
+ IDENT_ASM_OP, version_string); \
+ } while (0)
+#endif
+
+/* Allow #sccs in preprocessor. */
+
+#define SCCS_DIRECTIVE
+
+/* Output #ident as a .ident. */
+
+#define ASM_OUTPUT_IDENT(FILE, NAME) \
+ fprintf (FILE, "\t%s\t\"%s\"\n", IDENT_ASM_OP, NAME);
+
+/* This is how to allocate empty space in some section. The .zero
+ pseudo-op is used for this on most svr4 assemblers. */
+
+#define SKIP_ASM_OP ".zero"
+
+#undef ASM_OUTPUT_SKIP
+#define ASM_OUTPUT_SKIP(FILE,SIZE) \
+ fprintf (FILE, "\t%s\t%u\n", SKIP_ASM_OP, (SIZE))
+
+/* Output the label which precedes a jumptable. Note that for all svr4
+ systems where we actually generate jumptables (which is to say every
+ svr4 target except i386, where we use casesi instead) we put the jump-
+ tables into the .rodata section and since other stuff could have been
+ put into the .rodata section prior to any given jumptable, we have to
+ make sure that the location counter for the .rodata section gets pro-
+ perly re-aligned prior to the actual beginning of the jump table. */
+
+#define ALIGN_ASM_OP ".align"
+
+#ifndef ASM_OUTPUT_BEFORE_CASE_LABEL
+#define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE,PREFIX,NUM,TABLE) \
+ ASM_OUTPUT_ALIGN ((FILE), 2);
+#endif
+
+#undef ASM_OUTPUT_CASE_LABEL
+#define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,JUMPTABLE) \
+ do { \
+ ASM_OUTPUT_BEFORE_CASE_LABEL (FILE, PREFIX, NUM, JUMPTABLE) \
+ ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); \
+ } while (0)
+
+/* The standard SVR4 assembler seems to require that certain builtin
+ library routines (e.g. .udiv) be explicitly declared as .globl
+ in each assembly file where they are referenced. */
+
+#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
+ ASM_GLOBALIZE_LABEL (FILE, XSTR (FUN, 0))
+
+/* This says how to output assembler code to declare an
+ uninitialized external linkage data object. Under SVR4,
+ the linker seems to want the alignment of data objects
+ to depend on their types. We do exactly that here. */
+
+#define COMMON_ASM_OP ".comm"
+
+#undef ASM_OUTPUT_ALIGNED_COMMON
+#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
+do { \
+ fprintf ((FILE), "\t%s\t", COMMON_ASM_OP); \
+ assemble_name ((FILE), (NAME)); \
+ fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \
+} while (0)
+
+/* This says how to output assembler code to declare an
+ uninitialized internal linkage data object. Under SVR4,
+ the linker seems to want the alignment of data objects
+ to depend on their types. We do exactly that here. */
+
+#define LOCAL_ASM_OP ".local"
+
+#undef ASM_OUTPUT_ALIGNED_LOCAL
+#define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
+do { \
+ fprintf ((FILE), "\t%s\t", LOCAL_ASM_OP); \
+ assemble_name ((FILE), (NAME)); \
+ fprintf ((FILE), "\n"); \
+ ASM_OUTPUT_ALIGNED_COMMON (FILE, NAME, SIZE, ALIGN); \
+} while (0)
+
+/* This is the pseudo-op used to generate a 64-bit word of data with a
+ specific value in some section. */
+
+#define INT_ASM_OP ".quad"
+
+/* This is the pseudo-op used to generate a contiguous sequence of byte
+ values from a double-quoted string WITHOUT HAVING A TERMINATING NUL
+ AUTOMATICALLY APPENDED. This is the same for most svr4 assemblers. */
+
+#undef ASCII_DATA_ASM_OP
+#define ASCII_DATA_ASM_OP ".ascii"
+
+/* Support const sections and the ctors and dtors sections for g++.
+ Note that there appears to be two different ways to support const
+ sections at the moment. You can either #define the symbol
+ READONLY_DATA_SECTION (giving it some code which switches to the
+ readonly data section) or else you can #define the symbols
+ EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, SELECT_SECTION, and
+ SELECT_RTX_SECTION. We do both here just to be on the safe side. */
+
+#define USE_CONST_SECTION 1
+
+#define CONST_SECTION_ASM_OP ".section\t.rodata"
+
+/* Define the pseudo-ops used to switch to the .ctors and .dtors sections.
+
+ Note that we want to give these sections the SHF_WRITE attribute
+ because these sections will actually contain data (i.e. tables of
+ addresses of functions in the current root executable or shared library
+ file) and, in the case of a shared library, the relocatable addresses
+ will have to be properly resolved/relocated (and then written into) by
+ the dynamic linker when it actually attaches the given shared library
+ to the executing process. (Note that on SVR4, you may wish to use the
+ `-z text' option to the ELF linker, when building a shared library, as
+ an additional check that you are doing everything right. But if you do
+ use the `-z text' option when building a shared library, you will get
+ errors unless the .ctors and .dtors sections are marked as writable
+ via the SHF_WRITE attribute.) */
+
+#define CTORS_SECTION_ASM_OP ".section\t.ctors,\"aw\""
+#define DTORS_SECTION_ASM_OP ".section\t.dtors,\"aw\""
+
+/* On svr4, we *do* have support for the .init and .fini sections, and we
+ can put stuff in there to be executed before and after `main'. We let
+ crtstuff.c and other files know this by defining the following symbols.
+ The definitions say how to change sections to the .init and .fini
+ sections. This is the same for all known svr4 assemblers. */
+
+#define INIT_SECTION_ASM_OP ".section\t.init"
+#define FINI_SECTION_ASM_OP ".section\t.fini"
+
+/* A default list of other sections which we might be "in" at any given
+ time. For targets that use additional sections (e.g. .tdesc) you
+ should override this definition in the target-specific file which
+ includes this file. */
+
+#undef EXTRA_SECTIONS
+#define EXTRA_SECTIONS in_const, in_ctors, in_dtors
+
+/* A default list of extra section function definitions. For targets
+ that use additional sections (e.g. .tdesc) you should override this
+ definition in the target-specific file which includes this file. */
+
+#undef EXTRA_SECTION_FUNCTIONS
+#define EXTRA_SECTION_FUNCTIONS \
+ CONST_SECTION_FUNCTION \
+ CTORS_SECTION_FUNCTION \
+ DTORS_SECTION_FUNCTION
+
+#undef READONLY_DATA_SECTION
+#define READONLY_DATA_SECTION() const_section ()
+
+extern void text_section ();
+
+#define CONST_SECTION_FUNCTION \
+void \
+const_section () \
+{ \
+ if (!USE_CONST_SECTION) \
+ text_section(); \
+ else if (in_section != in_const) \
+ { \
+ fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP); \
+ in_section = in_const; \
+ } \
+}
+
+#define CTORS_SECTION_FUNCTION \
+void \
+ctors_section () \
+{ \
+ if (in_section != in_ctors) \
+ { \
+ fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP); \
+ in_section = in_ctors; \
+ } \
+}
+
+#define DTORS_SECTION_FUNCTION \
+void \
+dtors_section () \
+{ \
+ if (in_section != in_dtors) \
+ { \
+ fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP); \
+ in_section = in_dtors; \
+ } \
+}
+
+/* Switch into a generic section.
+ This is currently only used to support section attributes.
+
+ We make the section read-only and executable for a function decl,
+ read-only for a const data decl, and writable for a non-const data decl. */
+#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC) \
+ fprintf (FILE, ".section\t%s,\"%s\",@progbits\n", NAME, \
+ (DECL) && TREE_CODE (DECL) == FUNCTION_DECL ? "ax" : \
+ (DECL) && DECL_READONLY_SECTION (DECL, RELOC) ? "a" : "aw")
+
+
+/* A C statement (sans semicolon) to output an element in the table of
+ global constructors. */
+#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
+ do { \
+ ctors_section (); \
+ fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
+ assemble_name (FILE, NAME); \
+ fprintf (FILE, "\n"); \
+ } while (0)
+
+/* A C statement (sans semicolon) to output an element in the table of
+ global destructors. */
+#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
+ do { \
+ dtors_section (); \
+ fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
+ assemble_name (FILE, NAME); \
+ fprintf (FILE, "\n"); \
+ } while (0)
+
+/* A C statement or statements to switch to the appropriate
+ section for output of DECL. DECL is either a `VAR_DECL' node
+ or a constant of some sort. RELOC indicates whether forming
+ the initial value of DECL requires link-time relocations. */
+
+#define SELECT_SECTION(DECL,RELOC) \
+{ \
+ if (TREE_CODE (DECL) == STRING_CST) \
+ { \
+ if (! flag_writable_strings) \
+ const_section (); \
+ else \
+ data_section (); \
+ } \
+ else if (TREE_CODE (DECL) == VAR_DECL) \
+ { \
+ if ((flag_pic && RELOC) \
+ || !TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL) \
+ || !DECL_INITIAL (DECL) \
+ || (DECL_INITIAL (DECL) != error_mark_node \
+ && !TREE_CONSTANT (DECL_INITIAL (DECL)))) \
+ data_section (); \
+ else \
+ const_section (); \
+ } \
+ else \
+ const_section (); \
+}
+
+/* A C statement or statements to switch to the appropriate
+ section for output of RTX in mode MODE. RTX is some kind
+ of constant in RTL. The argument MODE is redundant except
+ in the case of a `const_int' rtx. Currently, these always
+ go into the const section. */
+
+#undef SELECT_RTX_SECTION
+#define SELECT_RTX_SECTION(MODE,RTX) const_section()
+
+/* Define the strings used for the special svr4 .type and .size directives.
+ These strings generally do not vary from one system running svr4 to
+ another, but if a given system (e.g. m88k running svr) needs to use
+ different pseudo-op names for these, they may be overridden in the
+ file which includes this one. */
+
+#define TYPE_ASM_OP ".type"
+#define SIZE_ASM_OP ".size"
+
+/* This is how we tell the assembler that two symbols have the same value. */
+
+#define ASM_OUTPUT_DEF(FILE,NAME1,NAME2) \
+ do { assemble_name(FILE, NAME1); \
+ fputs(" = ", FILE); \
+ assemble_name(FILE, NAME2); \
+ fputc('\n', FILE); } while (0)
+
+/* A table of bytes codes used by the ASM_OUTPUT_ASCII and
+ ASM_OUTPUT_LIMITED_STRING macros. Each byte in the table
+ corresponds to a particular byte value [0..255]. For any
+ given byte value, if the value in the corresponding table
+ position is zero, the given character can be output directly.
+ If the table value is 1, the byte must be output as a \ooo
+ octal escape. If the tables value is anything else, then the
+ byte value should be output as a \ followed by the value
+ in the table. Note that we can use standard UN*X escape
+ sequences for many control characters, but we don't use
+ \a to represent BEL because some svr4 assemblers (e.g. on
+ the i386) don't know about that. Also, we don't use \v
+ since some versions of gas, such as 2.2 did not accept it. */
+
+#define ESCAPES \
+"\1\1\1\1\1\1\1\1btn\1fr\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\0\0\"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\\\0\0\0\
+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1"
+
+/* Some svr4 assemblers have a limit on the number of characters which
+ can appear in the operand of a .string directive. If your assembler
+ has such a limitation, you should define STRING_LIMIT to reflect that
+ limit. Note that at least some svr4 assemblers have a limit on the
+ actual number of bytes in the double-quoted string, and that they
+ count each character in an escape sequence as one byte. Thus, an
+ escape sequence like \377 would count as four bytes.
+
+ If your target assembler doesn't support the .string directive, you
+ should define this to zero.
+*/
+
+#define STRING_LIMIT ((unsigned) 256)
+
+#define STRING_ASM_OP ".string"
+
+/*
+ * We always use gas here, so we don't worry about ECOFF assembler problems.
+ */
+#undef TARGET_GAS
+#define TARGET_GAS (1)
+
+#undef PREFERRED_DEBUGGING_TYPE
+#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
diff --git a/lang/gcc32/files/patch-ad b/lang/gcc32/files/patch-ad
index f8fb5803acf0..bea070deb344 100644
--- a/lang/gcc32/files/patch-ad
+++ b/lang/gcc32/files/patch-ad
@@ -1,6 +1,41 @@
--- gcc/config/i386/freebsd-aout.h.orig Mon Mar 1 14:47:33 1999
-+++ gcc/config/i386/freebsd-aout.h Sat Mar 13 19:24:50 1999
-@@ -103,19 +103,18 @@
++++ gcc/config/i386/freebsd-aout.h Sat Mar 20 00:27:02 1999
+@@ -20,6 +20,10 @@
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
++
++/* Get generic FreeBSD definitions. */
++#include <freebsd.h>
++
+ /* This goes away when the math-emulator is fixed */
+ #define TARGET_CPU_DEFAULT 0400 /* TARGET_NO_FANCY_MATH_387 */
+
+@@ -35,7 +39,7 @@
+ #include "i386/perform.h"
+
+ #undef CPP_PREDEFINES
+-#define CPP_PREDEFINES "-Dunix -Di386 -D__FreeBSD__ -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)"
++#define CPP_PREDEFINES "-Di386 -Acpu(i386) -Amachine(i386)" CPP_FBSD_PREDEFINES
+
+ /* Like the default, except no -lg. */
+ #define LIB_SPEC "%{!shared:%{!pg:-lc}%{pg:-lc_p}}"
+@@ -85,14 +89,6 @@
+ necessary when compiling PIC code. */
+
+ #define JUMP_TABLES_IN_TEXT_SECTION 1
+-
+-/* Don't default to pcc-struct-return, because gcc is the only compiler, and
+- we want to retain compatibility with older gcc versions. */
+-#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
+
+ /* i386 freebsd still uses old binutils that don't insert nops by default
+ when the .align directive demands to insert extra space in the text
+@@ -103,19 +99,18 @@
/* Profiling routines, partially copied from i386/osfrose.h. */
@@ -23,7 +58,7 @@
fprintf (FILE, "\tcall mcount\n"); \
} \
}
-@@ -133,6 +132,7 @@
+@@ -133,6 +128,7 @@
#define TYPE_ASM_OP ".type"
#define SIZE_ASM_OP ".size"
@@ -31,7 +66,7 @@
/* The following macro defines the format used to output the second
operand of the .type assembler directive. Different svr4 assemblers
-@@ -142,6 +142,12 @@
+@@ -142,6 +138,12 @@
#define TYPE_OPERAND_FMT "@%s"
@@ -44,12 +79,34 @@
/* Write the extra assembler code needed to declare a function's result.
Most svr4 assemblers don't require any special declaration of the
result value, but there are exceptions. */
-@@ -243,6 +249,8 @@
- #define STARTFILE_SPEC \
+@@ -244,29 +246,4 @@
"%{shared:c++rt0.o%s} \
%{!shared:%{pg:gcrt0.o%s}%{!pg:%{static:scrt0.o%s}%{!static:crt0.o%s}}}"
-+
-+#define MD_STARTFILE_PREFIX "/usr/lib/aout/"
- /* This is defined when gcc is compiled in the BSD-directory-tree, and must
- * make up for the gap to all the stuff done in the GNU-makefiles.
+-/* This is defined when gcc is compiled in the BSD-directory-tree, and must
+- * make up for the gap to all the stuff done in the GNU-makefiles.
+- */
+-
+-#ifdef FREEBSD_NATIVE
+-
+-#define INCLUDE_DEFAULTS { \
+- { "/usr/include", 0, 0, 0 }, \
+- { "/usr/include/g++", "G++", 1, 1 }, \
+- { 0, 0, 0, 0} \
+- }
+-
+-#undef MD_EXEC_PREFIX
+-#define MD_EXEC_PREFIX "/usr/libexec/"
+-
+-#undef STANDARD_STARTFILE_PREFIX
+-#define STANDARD_STARTFILE_PREFIX "/usr/lib"
+-
+-#if 0 /* This is very wrong!!! */
+-#define DEFAULT_TARGET_MACHINE "i386-unknown-freebsd_1.0"
+-#define GPLUSPLUS_INCLUDE_DIR "/usr/local/lib/gcc-lib/i386-unknown-freebsd_1.0/2.5.8/include"
+-#define TOOL_INCLUDE_DIR "/usr/local/i386-unknown-freebsd_1.0/include"
+-#define GCC_INCLUDE_DIR "/usr/local/lib/gcc-lib/i386-unknown-freebsd_1.0/2.5.8/include"
+-#endif
+-
+-#endif /* FREEBSD_NATIVE */
++#define MD_STARTFILE_PREFIX "/usr/lib/aout/"
diff --git a/lang/gcc32/files/patch-af b/lang/gcc32/files/patch-af
index c50ce06c8375..c1f1ba0e855f 100644
--- a/lang/gcc32/files/patch-af
+++ b/lang/gcc32/files/patch-af
@@ -1,6 +1,30 @@
--- gcc/config/i386/freebsd.h.orig Mon Mar 1 14:47:32 1999
-+++ gcc/config/i386/freebsd.h Sat Mar 13 19:25:53 1999
-@@ -113,22 +113,19 @@
++++ gcc/config/i386/freebsd.h Sun Mar 21 16:58:39 1999
+@@ -21,19 +21,13 @@
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
++
++/* Get generic FreeBSD definitions. */
++#include <freebsd.h>
++
+ #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
+-
+ /* This is how to output an element of a case-vector that is relative.
+ This is only used for PIC code. See comments by the `casesi' insn in
+ i386.md for an explanation of the expression this outputs. */
+@@ -113,22 +107,19 @@
: ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \
: (-1))
@@ -27,8 +51,18 @@
} \
}
-@@ -151,20 +148,8 @@
- #define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
+@@ -145,26 +136,16 @@
+ #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)"
++#define CPP_PREDEFINES "-Di386 -D__ELF__ -Acpu(i386) -Amachine(i386)" CPP_FBSD_PREDEFINES
+
+ #undef CPP_SPEC
+-#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
++#define CPP_SPEC \
++ "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE} %{m486:-D__i486__}"
++ /* %{pthread:-D_REENTRANT} */
#undef LIB_SPEC
-#if 1
@@ -36,16 +70,16 @@
- * want to profile or debug the C library, please add
- * -lc_p or -ggdb to LDFLAGS at the link time, respectively.
- */
- #define LIB_SPEC \
+-#define LIB_SPEC \
- "%{!shared: %{mieee-fp:-lieee} %{p:-lgmon} %{pg:-lgmon} \
- %{!ggdb:-lc} %{ggdb:-lg}}"
-#else
--#define LIB_SPEC \
+ #define LIB_SPEC \
- "%{!shared: \
- %{mieee-fp:-lieee} %{p:-lgmon -lc_p} %{pg:-lgmon -lc_p} \
- %{!p:%{!pg:%{!g*:-lc} %{g*:-lg}}}}"
-#endif
-+ "%{!shared: %{p:-lc_p} %{pg:-lc_p} %{!p:%{!pg:-lc}}}"
++ "%{!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
diff --git a/lang/gcc32/files/patch-ak b/lang/gcc32/files/patch-ak
index 19a2994f3f05..2e54beea1a61 100644
--- a/lang/gcc32/files/patch-ak
+++ b/lang/gcc32/files/patch-ak
@@ -1,5 +1,5 @@
---- gcc/configure.orig Mon Mar 8 10:06:10 1999
-+++ gcc/configure Sat Mar 13 19:08:06 1999
+--- gcc/configure.orig Sun Mar 14 02:59:02 1999
++++ gcc/configure Sat Mar 20 00:40:05 1999
@@ -2395,6 +2395,15 @@
thread_file='posix'
fi
@@ -27,18 +27,20 @@
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
- extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
+- tmake_file=i386/t-freebsd
- gas=yes
- gnu_ld=yes
- stabs=yes
++ tmake_file=t-freebsd
;;
i[34567]86-*-freebsd*)
- tm_file=i386/freebsd.h
+ tm_file="i386/i386.h i386/att.h linux.h i386/freebsd.h i386/perform.h"
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
+- tmake_file=i386/t-freebsd
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
++ tmake_file=t-freebsd
+ gas=yes
+ gnu_ld=yes
+ stabs=yes
diff --git a/lang/gcc32/files/patch-al b/lang/gcc32/files/patch-al
index 51e1b8cdee1c..c8a195127ed0 100644
--- a/lang/gcc32/files/patch-al
+++ b/lang/gcc32/files/patch-al
@@ -1,5 +1,5 @@
--- gcc/configure.in.orig Sun Mar 7 16:22:22 1999
-+++ gcc/configure.in Sat Mar 13 19:23:23 1999
++++ gcc/configure.in Sat Mar 20 00:40:58 1999
@@ -416,6 +416,15 @@
thread_file='posix'
fi
@@ -27,18 +27,20 @@
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
- extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
+- tmake_file=i386/t-freebsd
- gas=yes
- gnu_ld=yes
- stabs=yes
++ tmake_file=t-freebsd
;;
i[[34567]]86-*-freebsd*)
- tm_file=i386/freebsd.h
+ tm_file="i386/i386.h i386/att.h linux.h i386/freebsd.h i386/perform.h"
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
+- tmake_file=i386/t-freebsd
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
++ tmake_file=t-freebsd
+ gas=yes
+ gnu_ld=yes
+ stabs=yes
diff --git a/lang/gcc33/Makefile b/lang/gcc33/Makefile
index f9347a47d87e..cd5b039f398a 100644
--- a/lang/gcc33/Makefile
+++ b/lang/gcc33/Makefile
@@ -4,7 +4,7 @@
# Date created: 9 Jan 1998
# Whom: John Polstra <jdp@polstra.com>
#
-# $Id: Makefile,v 1.48 1999/03/08 07:28:27 asami Exp $
+# $Id: Makefile,v 1.50 1999/03/17 00:40:25 obrien Exp $
#
DISTNAME= egcs-1.1.2
@@ -55,21 +55,20 @@ ALL_TARGET= bootstrap
MAN1= cccp.1 g++.1 g77.1 gcc.1
pre-patch:
+ @${MV} ${WRKSRC}/gcc/config/i386/t-freebsd ${WRKSRC}/gcc/config/
@${MV} ${WRKSRC}/gcc/config/i386/freebsd.h ${WRKSRC}/gcc/config/i386/freebsd-aout.h
@${MV} ${WRKSRC}/gcc/config/i386/freebsd-elf.h ${WRKSRC}/gcc/config/i386/freebsd.h
+ @${CP} ${FILESDIR}/alpha-freebsd-elf.h ${WRKSRC}/gcc/config/alpha/freebsd-elf.h
+ @${CP} ${FILESDIR}/alpha-freebsd.h ${WRKSRC}/gcc/config/alpha/freebsd.h
pre-configure:
@# Keep from running `autoconf' and `autoheader' since we modified
@# configure.in by patching it.
@touch ${WRKSRC}/gcc/configure
@touch ${WRKSRC}/gcc/cstamp-h.in
- @(cd ${WRKSRC}/gcc/config/${ARCH}/ ; \
- MAJ=`sysctl -n kern.osreldate | ${SED} -e '/.....$$/s///'` ; \
- ${MV} freebsd-aout.h freebsd-aout.h.in ; \
- ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" freebsd-aout.h.in \
- >freebsd-aout.h ; \
- ${MV} freebsd.h freebsd.h.in ; \
- ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" freebsd.h.in >freebsd.h )
+ @(MAJ=`sysctl -n kern.osreldate | ${SED} -e '/.....$$/s///'` ; \
+ ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" ${FILESDIR}/freebsd.h \
+ >${WRKSRC}/gcc/config/freebsd.h )
.if ${PORTOBJFORMAT} == "elf" && ${MACHINE_ARCH} == "i386"
@${SED} -e 's/^@comment ELF-only://' ${PKGDIR}/PLIST >${PLIST}
.endif
diff --git a/lang/gcc33/files/alpha-freebsd.h b/lang/gcc33/files/alpha-freebsd.h
new file mode 100644
index 000000000000..60a1f07b94ba
--- /dev/null
+++ b/lang/gcc33/files/alpha-freebsd.h
@@ -0,0 +1,443 @@
+/* Definitions of target machine for GNU compiler,
+ for Alpha FreeBSD systems.
+ Copyright (C) 1998 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* This is used on Alpha platforms that use the ELF format.
+ This was taken from the NetBSD configuration, and modified
+ for FreeBSD/alpha by Hidetoshi Shimokawa <simokawa@FreeBSD.ORG> */
+
+
+/* Get generic FreeBSD definitions. */
+#include <freebsd.h>
+
+
+#undef OBJECT_FORMAT_COFF
+#undef EXTENDED_COFF
+#define OBJECT_FORMAT_ELF
+
+/* This is BSD, so it wants DBX format. */
+
+#define DBX_DEBUGGING_INFO
+
+/* This is the char to use for continuation (in case we need to turn
+ continuation back on). */
+
+#define DBX_CONTIN_CHAR '?'
+
+#undef ASM_FINAL_SPEC
+
+/* Names to predefine in the preprocessor for this target machine.
+ XXX FreeBSD, by convention, shouldn't do __alpha, but lots of applications
+ expect it because that's what OSF/1 does. */
+
+#undef TARGET_DEFAULT
+#define TARGET_DEFAULT (MASK_FP | MASK_FPREGS | MASK_GAS)
+
+#undef CPP_PREDEFINES
+#define CPP_PREDEFINES "\
+-D__alpha__ -D__alpha -Acpu(alpha) -Amachine(alpha) " \
+FBSD_CPP_PREDEFINES \
+SUB_CPP_PREDEFINES
+
+/* Make gcc agree with <machine/ansi.h> */
+
+#undef WCHAR_TYPE
+#define WCHAR_TYPE "int"
+
+#undef WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE 32
+
+/* Output assembler code to FILE to increment profiler label # LABELNO
+ for profiling a function entry. Under FreeBSD/Alpha, the assembler does
+ nothing special with -pg. */
+
+#undef FUNCTION_PROFILER
+#define FUNCTION_PROFILER(FILE, LABELNO) \
+ fputs ("\tjsr $28,_mcount\n", (FILE))
+
+/* Show that we need a GP when profiling. */
+#define TARGET_PROFILING_NEEDS_GP
+
+#undef HAS_INIT_SECTION
+
+/* Provide an ASM_SPEC appropriate for a FreeBSD/alpha target. This differs
+ from the generic FreeBSD ASM_SPEC in that no special handling of PIC is
+ necessary on the Alpha. */
+
+#undef ASM_SPEC
+#define ASM_SPEC " %| %{mcpu=*:-m%*}"
+
+/* Output at beginning of assembler file. */
+
+#undef ASM_FILE_START
+#define ASM_FILE_START(FILE) \
+{ \
+ alpha_write_verstamp (FILE); \
+ output_file_directive (FILE, main_input_filename); \
+ fprintf (FILE, "\t.version\t\"01.01\"\n"); \
+ fprintf (FILE, "\t.set noat\n"); \
+}
+
+#define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE) \
+ alpha_output_lineno (STREAM, LINE)
+extern void alpha_output_lineno ();
+
+extern void output_file_directive ();
+
+/* 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. */
+
+#define IDENT_ASM_OP ".ident"
+
+#ifdef IDENTIFY_WITH_IDENT
+#define ASM_IDENTIFY_GCC(FILE) /* nothing */
+#define ASM_IDENTIFY_LANGUAGE(FILE) \
+ fprintf(FILE, "\t%s \"GCC (%s) %s\"\n", IDENT_ASM_OP, \
+ lang_identify(), version_string)
+#else
+#define ASM_FILE_END(FILE) \
+do { \
+ fprintf ((FILE), "\t%s\t\"GCC: (GNU) %s\"\n", \
+ IDENT_ASM_OP, version_string); \
+ } while (0)
+#endif
+
+/* Allow #sccs in preprocessor. */
+
+#define SCCS_DIRECTIVE
+
+/* Output #ident as a .ident. */
+
+#define ASM_OUTPUT_IDENT(FILE, NAME) \
+ fprintf (FILE, "\t%s\t\"%s\"\n", IDENT_ASM_OP, NAME);
+
+/* This is how to allocate empty space in some section. The .zero
+ pseudo-op is used for this on most svr4 assemblers. */
+
+#define SKIP_ASM_OP ".zero"
+
+#undef ASM_OUTPUT_SKIP
+#define ASM_OUTPUT_SKIP(FILE,SIZE) \
+ fprintf (FILE, "\t%s\t%u\n", SKIP_ASM_OP, (SIZE))
+
+/* Output the label which precedes a jumptable. Note that for all svr4
+ systems where we actually generate jumptables (which is to say every
+ svr4 target except i386, where we use casesi instead) we put the jump-
+ tables into the .rodata section and since other stuff could have been
+ put into the .rodata section prior to any given jumptable, we have to
+ make sure that the location counter for the .rodata section gets pro-
+ perly re-aligned prior to the actual beginning of the jump table. */
+
+#define ALIGN_ASM_OP ".align"
+
+#ifndef ASM_OUTPUT_BEFORE_CASE_LABEL
+#define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE,PREFIX,NUM,TABLE) \
+ ASM_OUTPUT_ALIGN ((FILE), 2);
+#endif
+
+#undef ASM_OUTPUT_CASE_LABEL
+#define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,JUMPTABLE) \
+ do { \
+ ASM_OUTPUT_BEFORE_CASE_LABEL (FILE, PREFIX, NUM, JUMPTABLE) \
+ ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); \
+ } while (0)
+
+/* The standard SVR4 assembler seems to require that certain builtin
+ library routines (e.g. .udiv) be explicitly declared as .globl
+ in each assembly file where they are referenced. */
+
+#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
+ ASM_GLOBALIZE_LABEL (FILE, XSTR (FUN, 0))
+
+/* This says how to output assembler code to declare an
+ uninitialized external linkage data object. Under SVR4,
+ the linker seems to want the alignment of data objects
+ to depend on their types. We do exactly that here. */
+
+#define COMMON_ASM_OP ".comm"
+
+#undef ASM_OUTPUT_ALIGNED_COMMON
+#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
+do { \
+ fprintf ((FILE), "\t%s\t", COMMON_ASM_OP); \
+ assemble_name ((FILE), (NAME)); \
+ fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \
+} while (0)
+
+/* This says how to output assembler code to declare an
+ uninitialized internal linkage data object. Under SVR4,
+ the linker seems to want the alignment of data objects
+ to depend on their types. We do exactly that here. */
+
+#define LOCAL_ASM_OP ".local"
+
+#undef ASM_OUTPUT_ALIGNED_LOCAL
+#define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
+do { \
+ fprintf ((FILE), "\t%s\t", LOCAL_ASM_OP); \
+ assemble_name ((FILE), (NAME)); \
+ fprintf ((FILE), "\n"); \
+ ASM_OUTPUT_ALIGNED_COMMON (FILE, NAME, SIZE, ALIGN); \
+} while (0)
+
+/* This is the pseudo-op used to generate a 64-bit word of data with a
+ specific value in some section. */
+
+#define INT_ASM_OP ".quad"
+
+/* This is the pseudo-op used to generate a contiguous sequence of byte
+ values from a double-quoted string WITHOUT HAVING A TERMINATING NUL
+ AUTOMATICALLY APPENDED. This is the same for most svr4 assemblers. */
+
+#undef ASCII_DATA_ASM_OP
+#define ASCII_DATA_ASM_OP ".ascii"
+
+/* Support const sections and the ctors and dtors sections for g++.
+ Note that there appears to be two different ways to support const
+ sections at the moment. You can either #define the symbol
+ READONLY_DATA_SECTION (giving it some code which switches to the
+ readonly data section) or else you can #define the symbols
+ EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, SELECT_SECTION, and
+ SELECT_RTX_SECTION. We do both here just to be on the safe side. */
+
+#define USE_CONST_SECTION 1
+
+#define CONST_SECTION_ASM_OP ".section\t.rodata"
+
+/* Define the pseudo-ops used to switch to the .ctors and .dtors sections.
+
+ Note that we want to give these sections the SHF_WRITE attribute
+ because these sections will actually contain data (i.e. tables of
+ addresses of functions in the current root executable or shared library
+ file) and, in the case of a shared library, the relocatable addresses
+ will have to be properly resolved/relocated (and then written into) by
+ the dynamic linker when it actually attaches the given shared library
+ to the executing process. (Note that on SVR4, you may wish to use the
+ `-z text' option to the ELF linker, when building a shared library, as
+ an additional check that you are doing everything right. But if you do
+ use the `-z text' option when building a shared library, you will get
+ errors unless the .ctors and .dtors sections are marked as writable
+ via the SHF_WRITE attribute.) */
+
+#define CTORS_SECTION_ASM_OP ".section\t.ctors,\"aw\""
+#define DTORS_SECTION_ASM_OP ".section\t.dtors,\"aw\""
+
+/* On svr4, we *do* have support for the .init and .fini sections, and we
+ can put stuff in there to be executed before and after `main'. We let
+ crtstuff.c and other files know this by defining the following symbols.
+ The definitions say how to change sections to the .init and .fini
+ sections. This is the same for all known svr4 assemblers. */
+
+#define INIT_SECTION_ASM_OP ".section\t.init"
+#define FINI_SECTION_ASM_OP ".section\t.fini"
+
+/* A default list of other sections which we might be "in" at any given
+ time. For targets that use additional sections (e.g. .tdesc) you
+ should override this definition in the target-specific file which
+ includes this file. */
+
+#undef EXTRA_SECTIONS
+#define EXTRA_SECTIONS in_const, in_ctors, in_dtors
+
+/* A default list of extra section function definitions. For targets
+ that use additional sections (e.g. .tdesc) you should override this
+ definition in the target-specific file which includes this file. */
+
+#undef EXTRA_SECTION_FUNCTIONS
+#define EXTRA_SECTION_FUNCTIONS \
+ CONST_SECTION_FUNCTION \
+ CTORS_SECTION_FUNCTION \
+ DTORS_SECTION_FUNCTION
+
+#undef READONLY_DATA_SECTION
+#define READONLY_DATA_SECTION() const_section ()
+
+extern void text_section ();
+
+#define CONST_SECTION_FUNCTION \
+void \
+const_section () \
+{ \
+ if (!USE_CONST_SECTION) \
+ text_section(); \
+ else if (in_section != in_const) \
+ { \
+ fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP); \
+ in_section = in_const; \
+ } \
+}
+
+#define CTORS_SECTION_FUNCTION \
+void \
+ctors_section () \
+{ \
+ if (in_section != in_ctors) \
+ { \
+ fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP); \
+ in_section = in_ctors; \
+ } \
+}
+
+#define DTORS_SECTION_FUNCTION \
+void \
+dtors_section () \
+{ \
+ if (in_section != in_dtors) \
+ { \
+ fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP); \
+ in_section = in_dtors; \
+ } \
+}
+
+/* Switch into a generic section.
+ This is currently only used to support section attributes.
+
+ We make the section read-only and executable for a function decl,
+ read-only for a const data decl, and writable for a non-const data decl. */
+#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC) \
+ fprintf (FILE, ".section\t%s,\"%s\",@progbits\n", NAME, \
+ (DECL) && TREE_CODE (DECL) == FUNCTION_DECL ? "ax" : \
+ (DECL) && DECL_READONLY_SECTION (DECL, RELOC) ? "a" : "aw")
+
+
+/* A C statement (sans semicolon) to output an element in the table of
+ global constructors. */
+#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
+ do { \
+ ctors_section (); \
+ fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
+ assemble_name (FILE, NAME); \
+ fprintf (FILE, "\n"); \
+ } while (0)
+
+/* A C statement (sans semicolon) to output an element in the table of
+ global destructors. */
+#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
+ do { \
+ dtors_section (); \
+ fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
+ assemble_name (FILE, NAME); \
+ fprintf (FILE, "\n"); \
+ } while (0)
+
+/* A C statement or statements to switch to the appropriate
+ section for output of DECL. DECL is either a `VAR_DECL' node
+ or a constant of some sort. RELOC indicates whether forming
+ the initial value of DECL requires link-time relocations. */
+
+#define SELECT_SECTION(DECL,RELOC) \
+{ \
+ if (TREE_CODE (DECL) == STRING_CST) \
+ { \
+ if (! flag_writable_strings) \
+ const_section (); \
+ else \
+ data_section (); \
+ } \
+ else if (TREE_CODE (DECL) == VAR_DECL) \
+ { \
+ if ((flag_pic && RELOC) \
+ || !TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL) \
+ || !DECL_INITIAL (DECL) \
+ || (DECL_INITIAL (DECL) != error_mark_node \
+ && !TREE_CONSTANT (DECL_INITIAL (DECL)))) \
+ data_section (); \
+ else \
+ const_section (); \
+ } \
+ else \
+ const_section (); \
+}
+
+/* A C statement or statements to switch to the appropriate
+ section for output of RTX in mode MODE. RTX is some kind
+ of constant in RTL. The argument MODE is redundant except
+ in the case of a `const_int' rtx. Currently, these always
+ go into the const section. */
+
+#undef SELECT_RTX_SECTION
+#define SELECT_RTX_SECTION(MODE,RTX) const_section()
+
+/* Define the strings used for the special svr4 .type and .size directives.
+ These strings generally do not vary from one system running svr4 to
+ another, but if a given system (e.g. m88k running svr) needs to use
+ different pseudo-op names for these, they may be overridden in the
+ file which includes this one. */
+
+#define TYPE_ASM_OP ".type"
+#define SIZE_ASM_OP ".size"
+
+/* This is how we tell the assembler that two symbols have the same value. */
+
+#define ASM_OUTPUT_DEF(FILE,NAME1,NAME2) \
+ do { assemble_name(FILE, NAME1); \
+ fputs(" = ", FILE); \
+ assemble_name(FILE, NAME2); \
+ fputc('\n', FILE); } while (0)
+
+/* A table of bytes codes used by the ASM_OUTPUT_ASCII and
+ ASM_OUTPUT_LIMITED_STRING macros. Each byte in the table
+ corresponds to a particular byte value [0..255]. For any
+ given byte value, if the value in the corresponding table
+ position is zero, the given character can be output directly.
+ If the table value is 1, the byte must be output as a \ooo
+ octal escape. If the tables value is anything else, then the
+ byte value should be output as a \ followed by the value
+ in the table. Note that we can use standard UN*X escape
+ sequences for many control characters, but we don't use
+ \a to represent BEL because some svr4 assemblers (e.g. on
+ the i386) don't know about that. Also, we don't use \v
+ since some versions of gas, such as 2.2 did not accept it. */
+
+#define ESCAPES \
+"\1\1\1\1\1\1\1\1btn\1fr\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\0\0\"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\\\0\0\0\
+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1"
+
+/* Some svr4 assemblers have a limit on the number of characters which
+ can appear in the operand of a .string directive. If your assembler
+ has such a limitation, you should define STRING_LIMIT to reflect that
+ limit. Note that at least some svr4 assemblers have a limit on the
+ actual number of bytes in the double-quoted string, and that they
+ count each character in an escape sequence as one byte. Thus, an
+ escape sequence like \377 would count as four bytes.
+
+ If your target assembler doesn't support the .string directive, you
+ should define this to zero.
+*/
+
+#define STRING_LIMIT ((unsigned) 256)
+
+#define STRING_ASM_OP ".string"
+
+/*
+ * We always use gas here, so we don't worry about ECOFF assembler problems.
+ */
+#undef TARGET_GAS
+#define TARGET_GAS (1)
+
+#undef PREFERRED_DEBUGGING_TYPE
+#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
diff --git a/lang/gcc33/files/patch-ad b/lang/gcc33/files/patch-ad
index f8fb5803acf0..bea070deb344 100644
--- a/lang/gcc33/files/patch-ad
+++ b/lang/gcc33/files/patch-ad
@@ -1,6 +1,41 @@
--- gcc/config/i386/freebsd-aout.h.orig Mon Mar 1 14:47:33 1999
-+++ gcc/config/i386/freebsd-aout.h Sat Mar 13 19:24:50 1999
-@@ -103,19 +103,18 @@
++++ gcc/config/i386/freebsd-aout.h Sat Mar 20 00:27:02 1999
+@@ -20,6 +20,10 @@
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
++
++/* Get generic FreeBSD definitions. */
++#include <freebsd.h>
++
+ /* This goes away when the math-emulator is fixed */
+ #define TARGET_CPU_DEFAULT 0400 /* TARGET_NO_FANCY_MATH_387 */
+
+@@ -35,7 +39,7 @@
+ #include "i386/perform.h"
+
+ #undef CPP_PREDEFINES
+-#define CPP_PREDEFINES "-Dunix -Di386 -D__FreeBSD__ -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)"
++#define CPP_PREDEFINES "-Di386 -Acpu(i386) -Amachine(i386)" CPP_FBSD_PREDEFINES
+
+ /* Like the default, except no -lg. */
+ #define LIB_SPEC "%{!shared:%{!pg:-lc}%{pg:-lc_p}}"
+@@ -85,14 +89,6 @@
+ necessary when compiling PIC code. */
+
+ #define JUMP_TABLES_IN_TEXT_SECTION 1
+-
+-/* Don't default to pcc-struct-return, because gcc is the only compiler, and
+- we want to retain compatibility with older gcc versions. */
+-#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
+
+ /* i386 freebsd still uses old binutils that don't insert nops by default
+ when the .align directive demands to insert extra space in the text
+@@ -103,19 +99,18 @@
/* Profiling routines, partially copied from i386/osfrose.h. */
@@ -23,7 +58,7 @@
fprintf (FILE, "\tcall mcount\n"); \
} \
}
-@@ -133,6 +132,7 @@
+@@ -133,6 +128,7 @@
#define TYPE_ASM_OP ".type"
#define SIZE_ASM_OP ".size"
@@ -31,7 +66,7 @@
/* The following macro defines the format used to output the second
operand of the .type assembler directive. Different svr4 assemblers
-@@ -142,6 +142,12 @@
+@@ -142,6 +138,12 @@
#define TYPE_OPERAND_FMT "@%s"
@@ -44,12 +79,34 @@
/* Write the extra assembler code needed to declare a function's result.
Most svr4 assemblers don't require any special declaration of the
result value, but there are exceptions. */
-@@ -243,6 +249,8 @@
- #define STARTFILE_SPEC \
+@@ -244,29 +246,4 @@
"%{shared:c++rt0.o%s} \
%{!shared:%{pg:gcrt0.o%s}%{!pg:%{static:scrt0.o%s}%{!static:crt0.o%s}}}"
-+
-+#define MD_STARTFILE_PREFIX "/usr/lib/aout/"
- /* This is defined when gcc is compiled in the BSD-directory-tree, and must
- * make up for the gap to all the stuff done in the GNU-makefiles.
+-/* This is defined when gcc is compiled in the BSD-directory-tree, and must
+- * make up for the gap to all the stuff done in the GNU-makefiles.
+- */
+-
+-#ifdef FREEBSD_NATIVE
+-
+-#define INCLUDE_DEFAULTS { \
+- { "/usr/include", 0, 0, 0 }, \
+- { "/usr/include/g++", "G++", 1, 1 }, \
+- { 0, 0, 0, 0} \
+- }
+-
+-#undef MD_EXEC_PREFIX
+-#define MD_EXEC_PREFIX "/usr/libexec/"
+-
+-#undef STANDARD_STARTFILE_PREFIX
+-#define STANDARD_STARTFILE_PREFIX "/usr/lib"
+-
+-#if 0 /* This is very wrong!!! */
+-#define DEFAULT_TARGET_MACHINE "i386-unknown-freebsd_1.0"
+-#define GPLUSPLUS_INCLUDE_DIR "/usr/local/lib/gcc-lib/i386-unknown-freebsd_1.0/2.5.8/include"
+-#define TOOL_INCLUDE_DIR "/usr/local/i386-unknown-freebsd_1.0/include"
+-#define GCC_INCLUDE_DIR "/usr/local/lib/gcc-lib/i386-unknown-freebsd_1.0/2.5.8/include"
+-#endif
+-
+-#endif /* FREEBSD_NATIVE */
++#define MD_STARTFILE_PREFIX "/usr/lib/aout/"
diff --git a/lang/gcc33/files/patch-af b/lang/gcc33/files/patch-af
index c50ce06c8375..c1f1ba0e855f 100644
--- a/lang/gcc33/files/patch-af
+++ b/lang/gcc33/files/patch-af
@@ -1,6 +1,30 @@
--- gcc/config/i386/freebsd.h.orig Mon Mar 1 14:47:32 1999
-+++ gcc/config/i386/freebsd.h Sat Mar 13 19:25:53 1999
-@@ -113,22 +113,19 @@
++++ gcc/config/i386/freebsd.h Sun Mar 21 16:58:39 1999
+@@ -21,19 +21,13 @@
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
++
++/* Get generic FreeBSD definitions. */
++#include <freebsd.h>
++
+ #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
+-
+ /* This is how to output an element of a case-vector that is relative.
+ This is only used for PIC code. See comments by the `casesi' insn in
+ i386.md for an explanation of the expression this outputs. */
+@@ -113,22 +107,19 @@
: ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \
: (-1))
@@ -27,8 +51,18 @@
} \
}
-@@ -151,20 +148,8 @@
- #define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
+@@ -145,26 +136,16 @@
+ #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)"
++#define CPP_PREDEFINES "-Di386 -D__ELF__ -Acpu(i386) -Amachine(i386)" CPP_FBSD_PREDEFINES
+
+ #undef CPP_SPEC
+-#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
++#define CPP_SPEC \
++ "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE} %{m486:-D__i486__}"
++ /* %{pthread:-D_REENTRANT} */
#undef LIB_SPEC
-#if 1
@@ -36,16 +70,16 @@
- * want to profile or debug the C library, please add
- * -lc_p or -ggdb to LDFLAGS at the link time, respectively.
- */
- #define LIB_SPEC \
+-#define LIB_SPEC \
- "%{!shared: %{mieee-fp:-lieee} %{p:-lgmon} %{pg:-lgmon} \
- %{!ggdb:-lc} %{ggdb:-lg}}"
-#else
--#define LIB_SPEC \
+ #define LIB_SPEC \
- "%{!shared: \
- %{mieee-fp:-lieee} %{p:-lgmon -lc_p} %{pg:-lgmon -lc_p} \
- %{!p:%{!pg:%{!g*:-lc} %{g*:-lg}}}}"
-#endif
-+ "%{!shared: %{p:-lc_p} %{pg:-lc_p} %{!p:%{!pg:-lc}}}"
++ "%{!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
diff --git a/lang/gcc33/files/patch-ak b/lang/gcc33/files/patch-ak
index 19a2994f3f05..2e54beea1a61 100644
--- a/lang/gcc33/files/patch-ak
+++ b/lang/gcc33/files/patch-ak
@@ -1,5 +1,5 @@
---- gcc/configure.orig Mon Mar 8 10:06:10 1999
-+++ gcc/configure Sat Mar 13 19:08:06 1999
+--- gcc/configure.orig Sun Mar 14 02:59:02 1999
++++ gcc/configure Sat Mar 20 00:40:05 1999
@@ -2395,6 +2395,15 @@
thread_file='posix'
fi
@@ -27,18 +27,20 @@
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
- extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
+- tmake_file=i386/t-freebsd
- gas=yes
- gnu_ld=yes
- stabs=yes
++ tmake_file=t-freebsd
;;
i[34567]86-*-freebsd*)
- tm_file=i386/freebsd.h
+ tm_file="i386/i386.h i386/att.h linux.h i386/freebsd.h i386/perform.h"
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
+- tmake_file=i386/t-freebsd
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
++ tmake_file=t-freebsd
+ gas=yes
+ gnu_ld=yes
+ stabs=yes
diff --git a/lang/gcc33/files/patch-al b/lang/gcc33/files/patch-al
index 51e1b8cdee1c..c8a195127ed0 100644
--- a/lang/gcc33/files/patch-al
+++ b/lang/gcc33/files/patch-al
@@ -1,5 +1,5 @@
--- gcc/configure.in.orig Sun Mar 7 16:22:22 1999
-+++ gcc/configure.in Sat Mar 13 19:23:23 1999
++++ gcc/configure.in Sat Mar 20 00:40:58 1999
@@ -416,6 +416,15 @@
thread_file='posix'
fi
@@ -27,18 +27,20 @@
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
- extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
+- tmake_file=i386/t-freebsd
- gas=yes
- gnu_ld=yes
- stabs=yes
++ tmake_file=t-freebsd
;;
i[[34567]]86-*-freebsd*)
- tm_file=i386/freebsd.h
+ tm_file="i386/i386.h i386/att.h linux.h i386/freebsd.h i386/perform.h"
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
+- tmake_file=i386/t-freebsd
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
++ tmake_file=t-freebsd
+ gas=yes
+ gnu_ld=yes
+ stabs=yes
diff --git a/lang/gcc34/Makefile b/lang/gcc34/Makefile
index f9347a47d87e..cd5b039f398a 100644
--- a/lang/gcc34/Makefile
+++ b/lang/gcc34/Makefile
@@ -4,7 +4,7 @@
# Date created: 9 Jan 1998
# Whom: John Polstra <jdp@polstra.com>
#
-# $Id: Makefile,v 1.48 1999/03/08 07:28:27 asami Exp $
+# $Id: Makefile,v 1.50 1999/03/17 00:40:25 obrien Exp $
#
DISTNAME= egcs-1.1.2
@@ -55,21 +55,20 @@ ALL_TARGET= bootstrap
MAN1= cccp.1 g++.1 g77.1 gcc.1
pre-patch:
+ @${MV} ${WRKSRC}/gcc/config/i386/t-freebsd ${WRKSRC}/gcc/config/
@${MV} ${WRKSRC}/gcc/config/i386/freebsd.h ${WRKSRC}/gcc/config/i386/freebsd-aout.h
@${MV} ${WRKSRC}/gcc/config/i386/freebsd-elf.h ${WRKSRC}/gcc/config/i386/freebsd.h
+ @${CP} ${FILESDIR}/alpha-freebsd-elf.h ${WRKSRC}/gcc/config/alpha/freebsd-elf.h
+ @${CP} ${FILESDIR}/alpha-freebsd.h ${WRKSRC}/gcc/config/alpha/freebsd.h
pre-configure:
@# Keep from running `autoconf' and `autoheader' since we modified
@# configure.in by patching it.
@touch ${WRKSRC}/gcc/configure
@touch ${WRKSRC}/gcc/cstamp-h.in
- @(cd ${WRKSRC}/gcc/config/${ARCH}/ ; \
- MAJ=`sysctl -n kern.osreldate | ${SED} -e '/.....$$/s///'` ; \
- ${MV} freebsd-aout.h freebsd-aout.h.in ; \
- ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" freebsd-aout.h.in \
- >freebsd-aout.h ; \
- ${MV} freebsd.h freebsd.h.in ; \
- ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" freebsd.h.in >freebsd.h )
+ @(MAJ=`sysctl -n kern.osreldate | ${SED} -e '/.....$$/s///'` ; \
+ ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" ${FILESDIR}/freebsd.h \
+ >${WRKSRC}/gcc/config/freebsd.h )
.if ${PORTOBJFORMAT} == "elf" && ${MACHINE_ARCH} == "i386"
@${SED} -e 's/^@comment ELF-only://' ${PKGDIR}/PLIST >${PLIST}
.endif
diff --git a/lang/gcc34/files/alpha-freebsd.h b/lang/gcc34/files/alpha-freebsd.h
new file mode 100644
index 000000000000..60a1f07b94ba
--- /dev/null
+++ b/lang/gcc34/files/alpha-freebsd.h
@@ -0,0 +1,443 @@
+/* Definitions of target machine for GNU compiler,
+ for Alpha FreeBSD systems.
+ Copyright (C) 1998 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* This is used on Alpha platforms that use the ELF format.
+ This was taken from the NetBSD configuration, and modified
+ for FreeBSD/alpha by Hidetoshi Shimokawa <simokawa@FreeBSD.ORG> */
+
+
+/* Get generic FreeBSD definitions. */
+#include <freebsd.h>
+
+
+#undef OBJECT_FORMAT_COFF
+#undef EXTENDED_COFF
+#define OBJECT_FORMAT_ELF
+
+/* This is BSD, so it wants DBX format. */
+
+#define DBX_DEBUGGING_INFO
+
+/* This is the char to use for continuation (in case we need to turn
+ continuation back on). */
+
+#define DBX_CONTIN_CHAR '?'
+
+#undef ASM_FINAL_SPEC
+
+/* Names to predefine in the preprocessor for this target machine.
+ XXX FreeBSD, by convention, shouldn't do __alpha, but lots of applications
+ expect it because that's what OSF/1 does. */
+
+#undef TARGET_DEFAULT
+#define TARGET_DEFAULT (MASK_FP | MASK_FPREGS | MASK_GAS)
+
+#undef CPP_PREDEFINES
+#define CPP_PREDEFINES "\
+-D__alpha__ -D__alpha -Acpu(alpha) -Amachine(alpha) " \
+FBSD_CPP_PREDEFINES \
+SUB_CPP_PREDEFINES
+
+/* Make gcc agree with <machine/ansi.h> */
+
+#undef WCHAR_TYPE
+#define WCHAR_TYPE "int"
+
+#undef WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE 32
+
+/* Output assembler code to FILE to increment profiler label # LABELNO
+ for profiling a function entry. Under FreeBSD/Alpha, the assembler does
+ nothing special with -pg. */
+
+#undef FUNCTION_PROFILER
+#define FUNCTION_PROFILER(FILE, LABELNO) \
+ fputs ("\tjsr $28,_mcount\n", (FILE))
+
+/* Show that we need a GP when profiling. */
+#define TARGET_PROFILING_NEEDS_GP
+
+#undef HAS_INIT_SECTION
+
+/* Provide an ASM_SPEC appropriate for a FreeBSD/alpha target. This differs
+ from the generic FreeBSD ASM_SPEC in that no special handling of PIC is
+ necessary on the Alpha. */
+
+#undef ASM_SPEC
+#define ASM_SPEC " %| %{mcpu=*:-m%*}"
+
+/* Output at beginning of assembler file. */
+
+#undef ASM_FILE_START
+#define ASM_FILE_START(FILE) \
+{ \
+ alpha_write_verstamp (FILE); \
+ output_file_directive (FILE, main_input_filename); \
+ fprintf (FILE, "\t.version\t\"01.01\"\n"); \
+ fprintf (FILE, "\t.set noat\n"); \
+}
+
+#define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE) \
+ alpha_output_lineno (STREAM, LINE)
+extern void alpha_output_lineno ();
+
+extern void output_file_directive ();
+
+/* 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. */
+
+#define IDENT_ASM_OP ".ident"
+
+#ifdef IDENTIFY_WITH_IDENT
+#define ASM_IDENTIFY_GCC(FILE) /* nothing */
+#define ASM_IDENTIFY_LANGUAGE(FILE) \
+ fprintf(FILE, "\t%s \"GCC (%s) %s\"\n", IDENT_ASM_OP, \
+ lang_identify(), version_string)
+#else
+#define ASM_FILE_END(FILE) \
+do { \
+ fprintf ((FILE), "\t%s\t\"GCC: (GNU) %s\"\n", \
+ IDENT_ASM_OP, version_string); \
+ } while (0)
+#endif
+
+/* Allow #sccs in preprocessor. */
+
+#define SCCS_DIRECTIVE
+
+/* Output #ident as a .ident. */
+
+#define ASM_OUTPUT_IDENT(FILE, NAME) \
+ fprintf (FILE, "\t%s\t\"%s\"\n", IDENT_ASM_OP, NAME);
+
+/* This is how to allocate empty space in some section. The .zero
+ pseudo-op is used for this on most svr4 assemblers. */
+
+#define SKIP_ASM_OP ".zero"
+
+#undef ASM_OUTPUT_SKIP
+#define ASM_OUTPUT_SKIP(FILE,SIZE) \
+ fprintf (FILE, "\t%s\t%u\n", SKIP_ASM_OP, (SIZE))
+
+/* Output the label which precedes a jumptable. Note that for all svr4
+ systems where we actually generate jumptables (which is to say every
+ svr4 target except i386, where we use casesi instead) we put the jump-
+ tables into the .rodata section and since other stuff could have been
+ put into the .rodata section prior to any given jumptable, we have to
+ make sure that the location counter for the .rodata section gets pro-
+ perly re-aligned prior to the actual beginning of the jump table. */
+
+#define ALIGN_ASM_OP ".align"
+
+#ifndef ASM_OUTPUT_BEFORE_CASE_LABEL
+#define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE,PREFIX,NUM,TABLE) \
+ ASM_OUTPUT_ALIGN ((FILE), 2);
+#endif
+
+#undef ASM_OUTPUT_CASE_LABEL
+#define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,JUMPTABLE) \
+ do { \
+ ASM_OUTPUT_BEFORE_CASE_LABEL (FILE, PREFIX, NUM, JUMPTABLE) \
+ ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); \
+ } while (0)
+
+/* The standard SVR4 assembler seems to require that certain builtin
+ library routines (e.g. .udiv) be explicitly declared as .globl
+ in each assembly file where they are referenced. */
+
+#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
+ ASM_GLOBALIZE_LABEL (FILE, XSTR (FUN, 0))
+
+/* This says how to output assembler code to declare an
+ uninitialized external linkage data object. Under SVR4,
+ the linker seems to want the alignment of data objects
+ to depend on their types. We do exactly that here. */
+
+#define COMMON_ASM_OP ".comm"
+
+#undef ASM_OUTPUT_ALIGNED_COMMON
+#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
+do { \
+ fprintf ((FILE), "\t%s\t", COMMON_ASM_OP); \
+ assemble_name ((FILE), (NAME)); \
+ fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \
+} while (0)
+
+/* This says how to output assembler code to declare an
+ uninitialized internal linkage data object. Under SVR4,
+ the linker seems to want the alignment of data objects
+ to depend on their types. We do exactly that here. */
+
+#define LOCAL_ASM_OP ".local"
+
+#undef ASM_OUTPUT_ALIGNED_LOCAL
+#define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
+do { \
+ fprintf ((FILE), "\t%s\t", LOCAL_ASM_OP); \
+ assemble_name ((FILE), (NAME)); \
+ fprintf ((FILE), "\n"); \
+ ASM_OUTPUT_ALIGNED_COMMON (FILE, NAME, SIZE, ALIGN); \
+} while (0)
+
+/* This is the pseudo-op used to generate a 64-bit word of data with a
+ specific value in some section. */
+
+#define INT_ASM_OP ".quad"
+
+/* This is the pseudo-op used to generate a contiguous sequence of byte
+ values from a double-quoted string WITHOUT HAVING A TERMINATING NUL
+ AUTOMATICALLY APPENDED. This is the same for most svr4 assemblers. */
+
+#undef ASCII_DATA_ASM_OP
+#define ASCII_DATA_ASM_OP ".ascii"
+
+/* Support const sections and the ctors and dtors sections for g++.
+ Note that there appears to be two different ways to support const
+ sections at the moment. You can either #define the symbol
+ READONLY_DATA_SECTION (giving it some code which switches to the
+ readonly data section) or else you can #define the symbols
+ EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, SELECT_SECTION, and
+ SELECT_RTX_SECTION. We do both here just to be on the safe side. */
+
+#define USE_CONST_SECTION 1
+
+#define CONST_SECTION_ASM_OP ".section\t.rodata"
+
+/* Define the pseudo-ops used to switch to the .ctors and .dtors sections.
+
+ Note that we want to give these sections the SHF_WRITE attribute
+ because these sections will actually contain data (i.e. tables of
+ addresses of functions in the current root executable or shared library
+ file) and, in the case of a shared library, the relocatable addresses
+ will have to be properly resolved/relocated (and then written into) by
+ the dynamic linker when it actually attaches the given shared library
+ to the executing process. (Note that on SVR4, you may wish to use the
+ `-z text' option to the ELF linker, when building a shared library, as
+ an additional check that you are doing everything right. But if you do
+ use the `-z text' option when building a shared library, you will get
+ errors unless the .ctors and .dtors sections are marked as writable
+ via the SHF_WRITE attribute.) */
+
+#define CTORS_SECTION_ASM_OP ".section\t.ctors,\"aw\""
+#define DTORS_SECTION_ASM_OP ".section\t.dtors,\"aw\""
+
+/* On svr4, we *do* have support for the .init and .fini sections, and we
+ can put stuff in there to be executed before and after `main'. We let
+ crtstuff.c and other files know this by defining the following symbols.
+ The definitions say how to change sections to the .init and .fini
+ sections. This is the same for all known svr4 assemblers. */
+
+#define INIT_SECTION_ASM_OP ".section\t.init"
+#define FINI_SECTION_ASM_OP ".section\t.fini"
+
+/* A default list of other sections which we might be "in" at any given
+ time. For targets that use additional sections (e.g. .tdesc) you
+ should override this definition in the target-specific file which
+ includes this file. */
+
+#undef EXTRA_SECTIONS
+#define EXTRA_SECTIONS in_const, in_ctors, in_dtors
+
+/* A default list of extra section function definitions. For targets
+ that use additional sections (e.g. .tdesc) you should override this
+ definition in the target-specific file which includes this file. */
+
+#undef EXTRA_SECTION_FUNCTIONS
+#define EXTRA_SECTION_FUNCTIONS \
+ CONST_SECTION_FUNCTION \
+ CTORS_SECTION_FUNCTION \
+ DTORS_SECTION_FUNCTION
+
+#undef READONLY_DATA_SECTION
+#define READONLY_DATA_SECTION() const_section ()
+
+extern void text_section ();
+
+#define CONST_SECTION_FUNCTION \
+void \
+const_section () \
+{ \
+ if (!USE_CONST_SECTION) \
+ text_section(); \
+ else if (in_section != in_const) \
+ { \
+ fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP); \
+ in_section = in_const; \
+ } \
+}
+
+#define CTORS_SECTION_FUNCTION \
+void \
+ctors_section () \
+{ \
+ if (in_section != in_ctors) \
+ { \
+ fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP); \
+ in_section = in_ctors; \
+ } \
+}
+
+#define DTORS_SECTION_FUNCTION \
+void \
+dtors_section () \
+{ \
+ if (in_section != in_dtors) \
+ { \
+ fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP); \
+ in_section = in_dtors; \
+ } \
+}
+
+/* Switch into a generic section.
+ This is currently only used to support section attributes.
+
+ We make the section read-only and executable for a function decl,
+ read-only for a const data decl, and writable for a non-const data decl. */
+#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC) \
+ fprintf (FILE, ".section\t%s,\"%s\",@progbits\n", NAME, \
+ (DECL) && TREE_CODE (DECL) == FUNCTION_DECL ? "ax" : \
+ (DECL) && DECL_READONLY_SECTION (DECL, RELOC) ? "a" : "aw")
+
+
+/* A C statement (sans semicolon) to output an element in the table of
+ global constructors. */
+#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
+ do { \
+ ctors_section (); \
+ fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
+ assemble_name (FILE, NAME); \
+ fprintf (FILE, "\n"); \
+ } while (0)
+
+/* A C statement (sans semicolon) to output an element in the table of
+ global destructors. */
+#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
+ do { \
+ dtors_section (); \
+ fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
+ assemble_name (FILE, NAME); \
+ fprintf (FILE, "\n"); \
+ } while (0)
+
+/* A C statement or statements to switch to the appropriate
+ section for output of DECL. DECL is either a `VAR_DECL' node
+ or a constant of some sort. RELOC indicates whether forming
+ the initial value of DECL requires link-time relocations. */
+
+#define SELECT_SECTION(DECL,RELOC) \
+{ \
+ if (TREE_CODE (DECL) == STRING_CST) \
+ { \
+ if (! flag_writable_strings) \
+ const_section (); \
+ else \
+ data_section (); \
+ } \
+ else if (TREE_CODE (DECL) == VAR_DECL) \
+ { \
+ if ((flag_pic && RELOC) \
+ || !TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL) \
+ || !DECL_INITIAL (DECL) \
+ || (DECL_INITIAL (DECL) != error_mark_node \
+ && !TREE_CONSTANT (DECL_INITIAL (DECL)))) \
+ data_section (); \
+ else \
+ const_section (); \
+ } \
+ else \
+ const_section (); \
+}
+
+/* A C statement or statements to switch to the appropriate
+ section for output of RTX in mode MODE. RTX is some kind
+ of constant in RTL. The argument MODE is redundant except
+ in the case of a `const_int' rtx. Currently, these always
+ go into the const section. */
+
+#undef SELECT_RTX_SECTION
+#define SELECT_RTX_SECTION(MODE,RTX) const_section()
+
+/* Define the strings used for the special svr4 .type and .size directives.
+ These strings generally do not vary from one system running svr4 to
+ another, but if a given system (e.g. m88k running svr) needs to use
+ different pseudo-op names for these, they may be overridden in the
+ file which includes this one. */
+
+#define TYPE_ASM_OP ".type"
+#define SIZE_ASM_OP ".size"
+
+/* This is how we tell the assembler that two symbols have the same value. */
+
+#define ASM_OUTPUT_DEF(FILE,NAME1,NAME2) \
+ do { assemble_name(FILE, NAME1); \
+ fputs(" = ", FILE); \
+ assemble_name(FILE, NAME2); \
+ fputc('\n', FILE); } while (0)
+
+/* A table of bytes codes used by the ASM_OUTPUT_ASCII and
+ ASM_OUTPUT_LIMITED_STRING macros. Each byte in the table
+ corresponds to a particular byte value [0..255]. For any
+ given byte value, if the value in the corresponding table
+ position is zero, the given character can be output directly.
+ If the table value is 1, the byte must be output as a \ooo
+ octal escape. If the tables value is anything else, then the
+ byte value should be output as a \ followed by the value
+ in the table. Note that we can use standard UN*X escape
+ sequences for many control characters, but we don't use
+ \a to represent BEL because some svr4 assemblers (e.g. on
+ the i386) don't know about that. Also, we don't use \v
+ since some versions of gas, such as 2.2 did not accept it. */
+
+#define ESCAPES \
+"\1\1\1\1\1\1\1\1btn\1fr\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\0\0\"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\\\0\0\0\
+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1"
+
+/* Some svr4 assemblers have a limit on the number of characters which
+ can appear in the operand of a .string directive. If your assembler
+ has such a limitation, you should define STRING_LIMIT to reflect that
+ limit. Note that at least some svr4 assemblers have a limit on the
+ actual number of bytes in the double-quoted string, and that they
+ count each character in an escape sequence as one byte. Thus, an
+ escape sequence like \377 would count as four bytes.
+
+ If your target assembler doesn't support the .string directive, you
+ should define this to zero.
+*/
+
+#define STRING_LIMIT ((unsigned) 256)
+
+#define STRING_ASM_OP ".string"
+
+/*
+ * We always use gas here, so we don't worry about ECOFF assembler problems.
+ */
+#undef TARGET_GAS
+#define TARGET_GAS (1)
+
+#undef PREFERRED_DEBUGGING_TYPE
+#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
diff --git a/lang/gcc34/files/patch-ad b/lang/gcc34/files/patch-ad
index f8fb5803acf0..bea070deb344 100644
--- a/lang/gcc34/files/patch-ad
+++ b/lang/gcc34/files/patch-ad
@@ -1,6 +1,41 @@
--- gcc/config/i386/freebsd-aout.h.orig Mon Mar 1 14:47:33 1999
-+++ gcc/config/i386/freebsd-aout.h Sat Mar 13 19:24:50 1999
-@@ -103,19 +103,18 @@
++++ gcc/config/i386/freebsd-aout.h Sat Mar 20 00:27:02 1999
+@@ -20,6 +20,10 @@
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
++
++/* Get generic FreeBSD definitions. */
++#include <freebsd.h>
++
+ /* This goes away when the math-emulator is fixed */
+ #define TARGET_CPU_DEFAULT 0400 /* TARGET_NO_FANCY_MATH_387 */
+
+@@ -35,7 +39,7 @@
+ #include "i386/perform.h"
+
+ #undef CPP_PREDEFINES
+-#define CPP_PREDEFINES "-Dunix -Di386 -D__FreeBSD__ -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)"
++#define CPP_PREDEFINES "-Di386 -Acpu(i386) -Amachine(i386)" CPP_FBSD_PREDEFINES
+
+ /* Like the default, except no -lg. */
+ #define LIB_SPEC "%{!shared:%{!pg:-lc}%{pg:-lc_p}}"
+@@ -85,14 +89,6 @@
+ necessary when compiling PIC code. */
+
+ #define JUMP_TABLES_IN_TEXT_SECTION 1
+-
+-/* Don't default to pcc-struct-return, because gcc is the only compiler, and
+- we want to retain compatibility with older gcc versions. */
+-#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
+
+ /* i386 freebsd still uses old binutils that don't insert nops by default
+ when the .align directive demands to insert extra space in the text
+@@ -103,19 +99,18 @@
/* Profiling routines, partially copied from i386/osfrose.h. */
@@ -23,7 +58,7 @@
fprintf (FILE, "\tcall mcount\n"); \
} \
}
-@@ -133,6 +132,7 @@
+@@ -133,6 +128,7 @@
#define TYPE_ASM_OP ".type"
#define SIZE_ASM_OP ".size"
@@ -31,7 +66,7 @@
/* The following macro defines the format used to output the second
operand of the .type assembler directive. Different svr4 assemblers
-@@ -142,6 +142,12 @@
+@@ -142,6 +138,12 @@
#define TYPE_OPERAND_FMT "@%s"
@@ -44,12 +79,34 @@
/* Write the extra assembler code needed to declare a function's result.
Most svr4 assemblers don't require any special declaration of the
result value, but there are exceptions. */
-@@ -243,6 +249,8 @@
- #define STARTFILE_SPEC \
+@@ -244,29 +246,4 @@
"%{shared:c++rt0.o%s} \
%{!shared:%{pg:gcrt0.o%s}%{!pg:%{static:scrt0.o%s}%{!static:crt0.o%s}}}"
-+
-+#define MD_STARTFILE_PREFIX "/usr/lib/aout/"
- /* This is defined when gcc is compiled in the BSD-directory-tree, and must
- * make up for the gap to all the stuff done in the GNU-makefiles.
+-/* This is defined when gcc is compiled in the BSD-directory-tree, and must
+- * make up for the gap to all the stuff done in the GNU-makefiles.
+- */
+-
+-#ifdef FREEBSD_NATIVE
+-
+-#define INCLUDE_DEFAULTS { \
+- { "/usr/include", 0, 0, 0 }, \
+- { "/usr/include/g++", "G++", 1, 1 }, \
+- { 0, 0, 0, 0} \
+- }
+-
+-#undef MD_EXEC_PREFIX
+-#define MD_EXEC_PREFIX "/usr/libexec/"
+-
+-#undef STANDARD_STARTFILE_PREFIX
+-#define STANDARD_STARTFILE_PREFIX "/usr/lib"
+-
+-#if 0 /* This is very wrong!!! */
+-#define DEFAULT_TARGET_MACHINE "i386-unknown-freebsd_1.0"
+-#define GPLUSPLUS_INCLUDE_DIR "/usr/local/lib/gcc-lib/i386-unknown-freebsd_1.0/2.5.8/include"
+-#define TOOL_INCLUDE_DIR "/usr/local/i386-unknown-freebsd_1.0/include"
+-#define GCC_INCLUDE_DIR "/usr/local/lib/gcc-lib/i386-unknown-freebsd_1.0/2.5.8/include"
+-#endif
+-
+-#endif /* FREEBSD_NATIVE */
++#define MD_STARTFILE_PREFIX "/usr/lib/aout/"
diff --git a/lang/gcc34/files/patch-af b/lang/gcc34/files/patch-af
index c50ce06c8375..c1f1ba0e855f 100644
--- a/lang/gcc34/files/patch-af
+++ b/lang/gcc34/files/patch-af
@@ -1,6 +1,30 @@
--- gcc/config/i386/freebsd.h.orig Mon Mar 1 14:47:32 1999
-+++ gcc/config/i386/freebsd.h Sat Mar 13 19:25:53 1999
-@@ -113,22 +113,19 @@
++++ gcc/config/i386/freebsd.h Sun Mar 21 16:58:39 1999
+@@ -21,19 +21,13 @@
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
++
++/* Get generic FreeBSD definitions. */
++#include <freebsd.h>
++
+ #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
+-
+ /* This is how to output an element of a case-vector that is relative.
+ This is only used for PIC code. See comments by the `casesi' insn in
+ i386.md for an explanation of the expression this outputs. */
+@@ -113,22 +107,19 @@
: ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \
: (-1))
@@ -27,8 +51,18 @@
} \
}
-@@ -151,20 +148,8 @@
- #define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
+@@ -145,26 +136,16 @@
+ #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)"
++#define CPP_PREDEFINES "-Di386 -D__ELF__ -Acpu(i386) -Amachine(i386)" CPP_FBSD_PREDEFINES
+
+ #undef CPP_SPEC
+-#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
++#define CPP_SPEC \
++ "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE} %{m486:-D__i486__}"
++ /* %{pthread:-D_REENTRANT} */
#undef LIB_SPEC
-#if 1
@@ -36,16 +70,16 @@
- * want to profile or debug the C library, please add
- * -lc_p or -ggdb to LDFLAGS at the link time, respectively.
- */
- #define LIB_SPEC \
+-#define LIB_SPEC \
- "%{!shared: %{mieee-fp:-lieee} %{p:-lgmon} %{pg:-lgmon} \
- %{!ggdb:-lc} %{ggdb:-lg}}"
-#else
--#define LIB_SPEC \
+ #define LIB_SPEC \
- "%{!shared: \
- %{mieee-fp:-lieee} %{p:-lgmon -lc_p} %{pg:-lgmon -lc_p} \
- %{!p:%{!pg:%{!g*:-lc} %{g*:-lg}}}}"
-#endif
-+ "%{!shared: %{p:-lc_p} %{pg:-lc_p} %{!p:%{!pg:-lc}}}"
++ "%{!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
diff --git a/lang/gcc34/files/patch-ak b/lang/gcc34/files/patch-ak
index 19a2994f3f05..2e54beea1a61 100644
--- a/lang/gcc34/files/patch-ak
+++ b/lang/gcc34/files/patch-ak
@@ -1,5 +1,5 @@
---- gcc/configure.orig Mon Mar 8 10:06:10 1999
-+++ gcc/configure Sat Mar 13 19:08:06 1999
+--- gcc/configure.orig Sun Mar 14 02:59:02 1999
++++ gcc/configure Sat Mar 20 00:40:05 1999
@@ -2395,6 +2395,15 @@
thread_file='posix'
fi
@@ -27,18 +27,20 @@
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
- extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
+- tmake_file=i386/t-freebsd
- gas=yes
- gnu_ld=yes
- stabs=yes
++ tmake_file=t-freebsd
;;
i[34567]86-*-freebsd*)
- tm_file=i386/freebsd.h
+ tm_file="i386/i386.h i386/att.h linux.h i386/freebsd.h i386/perform.h"
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
+- tmake_file=i386/t-freebsd
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
++ tmake_file=t-freebsd
+ gas=yes
+ gnu_ld=yes
+ stabs=yes
diff --git a/lang/gcc34/files/patch-al b/lang/gcc34/files/patch-al
index 51e1b8cdee1c..c8a195127ed0 100644
--- a/lang/gcc34/files/patch-al
+++ b/lang/gcc34/files/patch-al
@@ -1,5 +1,5 @@
--- gcc/configure.in.orig Sun Mar 7 16:22:22 1999
-+++ gcc/configure.in Sat Mar 13 19:23:23 1999
++++ gcc/configure.in Sat Mar 20 00:40:58 1999
@@ -416,6 +416,15 @@
thread_file='posix'
fi
@@ -27,18 +27,20 @@
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
- extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
+- tmake_file=i386/t-freebsd
- gas=yes
- gnu_ld=yes
- stabs=yes
++ tmake_file=t-freebsd
;;
i[[34567]]86-*-freebsd*)
- tm_file=i386/freebsd.h
+ tm_file="i386/i386.h i386/att.h linux.h i386/freebsd.h i386/perform.h"
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
+- tmake_file=i386/t-freebsd
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
++ tmake_file=t-freebsd
+ gas=yes
+ gnu_ld=yes
+ stabs=yes
diff --git a/lang/gcc35/Makefile b/lang/gcc35/Makefile
index f9347a47d87e..cd5b039f398a 100644
--- a/lang/gcc35/Makefile
+++ b/lang/gcc35/Makefile
@@ -4,7 +4,7 @@
# Date created: 9 Jan 1998
# Whom: John Polstra <jdp@polstra.com>
#
-# $Id: Makefile,v 1.48 1999/03/08 07:28:27 asami Exp $
+# $Id: Makefile,v 1.50 1999/03/17 00:40:25 obrien Exp $
#
DISTNAME= egcs-1.1.2
@@ -55,21 +55,20 @@ ALL_TARGET= bootstrap
MAN1= cccp.1 g++.1 g77.1 gcc.1
pre-patch:
+ @${MV} ${WRKSRC}/gcc/config/i386/t-freebsd ${WRKSRC}/gcc/config/
@${MV} ${WRKSRC}/gcc/config/i386/freebsd.h ${WRKSRC}/gcc/config/i386/freebsd-aout.h
@${MV} ${WRKSRC}/gcc/config/i386/freebsd-elf.h ${WRKSRC}/gcc/config/i386/freebsd.h
+ @${CP} ${FILESDIR}/alpha-freebsd-elf.h ${WRKSRC}/gcc/config/alpha/freebsd-elf.h
+ @${CP} ${FILESDIR}/alpha-freebsd.h ${WRKSRC}/gcc/config/alpha/freebsd.h
pre-configure:
@# Keep from running `autoconf' and `autoheader' since we modified
@# configure.in by patching it.
@touch ${WRKSRC}/gcc/configure
@touch ${WRKSRC}/gcc/cstamp-h.in
- @(cd ${WRKSRC}/gcc/config/${ARCH}/ ; \
- MAJ=`sysctl -n kern.osreldate | ${SED} -e '/.....$$/s///'` ; \
- ${MV} freebsd-aout.h freebsd-aout.h.in ; \
- ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" freebsd-aout.h.in \
- >freebsd-aout.h ; \
- ${MV} freebsd.h freebsd.h.in ; \
- ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" freebsd.h.in >freebsd.h )
+ @(MAJ=`sysctl -n kern.osreldate | ${SED} -e '/.....$$/s///'` ; \
+ ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" ${FILESDIR}/freebsd.h \
+ >${WRKSRC}/gcc/config/freebsd.h )
.if ${PORTOBJFORMAT} == "elf" && ${MACHINE_ARCH} == "i386"
@${SED} -e 's/^@comment ELF-only://' ${PKGDIR}/PLIST >${PLIST}
.endif
diff --git a/lang/gcc35/files/alpha-freebsd.h b/lang/gcc35/files/alpha-freebsd.h
new file mode 100644
index 000000000000..60a1f07b94ba
--- /dev/null
+++ b/lang/gcc35/files/alpha-freebsd.h
@@ -0,0 +1,443 @@
+/* Definitions of target machine for GNU compiler,
+ for Alpha FreeBSD systems.
+ Copyright (C) 1998 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* This is used on Alpha platforms that use the ELF format.
+ This was taken from the NetBSD configuration, and modified
+ for FreeBSD/alpha by Hidetoshi Shimokawa <simokawa@FreeBSD.ORG> */
+
+
+/* Get generic FreeBSD definitions. */
+#include <freebsd.h>
+
+
+#undef OBJECT_FORMAT_COFF
+#undef EXTENDED_COFF
+#define OBJECT_FORMAT_ELF
+
+/* This is BSD, so it wants DBX format. */
+
+#define DBX_DEBUGGING_INFO
+
+/* This is the char to use for continuation (in case we need to turn
+ continuation back on). */
+
+#define DBX_CONTIN_CHAR '?'
+
+#undef ASM_FINAL_SPEC
+
+/* Names to predefine in the preprocessor for this target machine.
+ XXX FreeBSD, by convention, shouldn't do __alpha, but lots of applications
+ expect it because that's what OSF/1 does. */
+
+#undef TARGET_DEFAULT
+#define TARGET_DEFAULT (MASK_FP | MASK_FPREGS | MASK_GAS)
+
+#undef CPP_PREDEFINES
+#define CPP_PREDEFINES "\
+-D__alpha__ -D__alpha -Acpu(alpha) -Amachine(alpha) " \
+FBSD_CPP_PREDEFINES \
+SUB_CPP_PREDEFINES
+
+/* Make gcc agree with <machine/ansi.h> */
+
+#undef WCHAR_TYPE
+#define WCHAR_TYPE "int"
+
+#undef WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE 32
+
+/* Output assembler code to FILE to increment profiler label # LABELNO
+ for profiling a function entry. Under FreeBSD/Alpha, the assembler does
+ nothing special with -pg. */
+
+#undef FUNCTION_PROFILER
+#define FUNCTION_PROFILER(FILE, LABELNO) \
+ fputs ("\tjsr $28,_mcount\n", (FILE))
+
+/* Show that we need a GP when profiling. */
+#define TARGET_PROFILING_NEEDS_GP
+
+#undef HAS_INIT_SECTION
+
+/* Provide an ASM_SPEC appropriate for a FreeBSD/alpha target. This differs
+ from the generic FreeBSD ASM_SPEC in that no special handling of PIC is
+ necessary on the Alpha. */
+
+#undef ASM_SPEC
+#define ASM_SPEC " %| %{mcpu=*:-m%*}"
+
+/* Output at beginning of assembler file. */
+
+#undef ASM_FILE_START
+#define ASM_FILE_START(FILE) \
+{ \
+ alpha_write_verstamp (FILE); \
+ output_file_directive (FILE, main_input_filename); \
+ fprintf (FILE, "\t.version\t\"01.01\"\n"); \
+ fprintf (FILE, "\t.set noat\n"); \
+}
+
+#define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE) \
+ alpha_output_lineno (STREAM, LINE)
+extern void alpha_output_lineno ();
+
+extern void output_file_directive ();
+
+/* 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. */
+
+#define IDENT_ASM_OP ".ident"
+
+#ifdef IDENTIFY_WITH_IDENT
+#define ASM_IDENTIFY_GCC(FILE) /* nothing */
+#define ASM_IDENTIFY_LANGUAGE(FILE) \
+ fprintf(FILE, "\t%s \"GCC (%s) %s\"\n", IDENT_ASM_OP, \
+ lang_identify(), version_string)
+#else
+#define ASM_FILE_END(FILE) \
+do { \
+ fprintf ((FILE), "\t%s\t\"GCC: (GNU) %s\"\n", \
+ IDENT_ASM_OP, version_string); \
+ } while (0)
+#endif
+
+/* Allow #sccs in preprocessor. */
+
+#define SCCS_DIRECTIVE
+
+/* Output #ident as a .ident. */
+
+#define ASM_OUTPUT_IDENT(FILE, NAME) \
+ fprintf (FILE, "\t%s\t\"%s\"\n", IDENT_ASM_OP, NAME);
+
+/* This is how to allocate empty space in some section. The .zero
+ pseudo-op is used for this on most svr4 assemblers. */
+
+#define SKIP_ASM_OP ".zero"
+
+#undef ASM_OUTPUT_SKIP
+#define ASM_OUTPUT_SKIP(FILE,SIZE) \
+ fprintf (FILE, "\t%s\t%u\n", SKIP_ASM_OP, (SIZE))
+
+/* Output the label which precedes a jumptable. Note that for all svr4
+ systems where we actually generate jumptables (which is to say every
+ svr4 target except i386, where we use casesi instead) we put the jump-
+ tables into the .rodata section and since other stuff could have been
+ put into the .rodata section prior to any given jumptable, we have to
+ make sure that the location counter for the .rodata section gets pro-
+ perly re-aligned prior to the actual beginning of the jump table. */
+
+#define ALIGN_ASM_OP ".align"
+
+#ifndef ASM_OUTPUT_BEFORE_CASE_LABEL
+#define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE,PREFIX,NUM,TABLE) \
+ ASM_OUTPUT_ALIGN ((FILE), 2);
+#endif
+
+#undef ASM_OUTPUT_CASE_LABEL
+#define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,JUMPTABLE) \
+ do { \
+ ASM_OUTPUT_BEFORE_CASE_LABEL (FILE, PREFIX, NUM, JUMPTABLE) \
+ ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); \
+ } while (0)
+
+/* The standard SVR4 assembler seems to require that certain builtin
+ library routines (e.g. .udiv) be explicitly declared as .globl
+ in each assembly file where they are referenced. */
+
+#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
+ ASM_GLOBALIZE_LABEL (FILE, XSTR (FUN, 0))
+
+/* This says how to output assembler code to declare an
+ uninitialized external linkage data object. Under SVR4,
+ the linker seems to want the alignment of data objects
+ to depend on their types. We do exactly that here. */
+
+#define COMMON_ASM_OP ".comm"
+
+#undef ASM_OUTPUT_ALIGNED_COMMON
+#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
+do { \
+ fprintf ((FILE), "\t%s\t", COMMON_ASM_OP); \
+ assemble_name ((FILE), (NAME)); \
+ fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \
+} while (0)
+
+/* This says how to output assembler code to declare an
+ uninitialized internal linkage data object. Under SVR4,
+ the linker seems to want the alignment of data objects
+ to depend on their types. We do exactly that here. */
+
+#define LOCAL_ASM_OP ".local"
+
+#undef ASM_OUTPUT_ALIGNED_LOCAL
+#define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
+do { \
+ fprintf ((FILE), "\t%s\t", LOCAL_ASM_OP); \
+ assemble_name ((FILE), (NAME)); \
+ fprintf ((FILE), "\n"); \
+ ASM_OUTPUT_ALIGNED_COMMON (FILE, NAME, SIZE, ALIGN); \
+} while (0)
+
+/* This is the pseudo-op used to generate a 64-bit word of data with a
+ specific value in some section. */
+
+#define INT_ASM_OP ".quad"
+
+/* This is the pseudo-op used to generate a contiguous sequence of byte
+ values from a double-quoted string WITHOUT HAVING A TERMINATING NUL
+ AUTOMATICALLY APPENDED. This is the same for most svr4 assemblers. */
+
+#undef ASCII_DATA_ASM_OP
+#define ASCII_DATA_ASM_OP ".ascii"
+
+/* Support const sections and the ctors and dtors sections for g++.
+ Note that there appears to be two different ways to support const
+ sections at the moment. You can either #define the symbol
+ READONLY_DATA_SECTION (giving it some code which switches to the
+ readonly data section) or else you can #define the symbols
+ EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, SELECT_SECTION, and
+ SELECT_RTX_SECTION. We do both here just to be on the safe side. */
+
+#define USE_CONST_SECTION 1
+
+#define CONST_SECTION_ASM_OP ".section\t.rodata"
+
+/* Define the pseudo-ops used to switch to the .ctors and .dtors sections.
+
+ Note that we want to give these sections the SHF_WRITE attribute
+ because these sections will actually contain data (i.e. tables of
+ addresses of functions in the current root executable or shared library
+ file) and, in the case of a shared library, the relocatable addresses
+ will have to be properly resolved/relocated (and then written into) by
+ the dynamic linker when it actually attaches the given shared library
+ to the executing process. (Note that on SVR4, you may wish to use the
+ `-z text' option to the ELF linker, when building a shared library, as
+ an additional check that you are doing everything right. But if you do
+ use the `-z text' option when building a shared library, you will get
+ errors unless the .ctors and .dtors sections are marked as writable
+ via the SHF_WRITE attribute.) */
+
+#define CTORS_SECTION_ASM_OP ".section\t.ctors,\"aw\""
+#define DTORS_SECTION_ASM_OP ".section\t.dtors,\"aw\""
+
+/* On svr4, we *do* have support for the .init and .fini sections, and we
+ can put stuff in there to be executed before and after `main'. We let
+ crtstuff.c and other files know this by defining the following symbols.
+ The definitions say how to change sections to the .init and .fini
+ sections. This is the same for all known svr4 assemblers. */
+
+#define INIT_SECTION_ASM_OP ".section\t.init"
+#define FINI_SECTION_ASM_OP ".section\t.fini"
+
+/* A default list of other sections which we might be "in" at any given
+ time. For targets that use additional sections (e.g. .tdesc) you
+ should override this definition in the target-specific file which
+ includes this file. */
+
+#undef EXTRA_SECTIONS
+#define EXTRA_SECTIONS in_const, in_ctors, in_dtors
+
+/* A default list of extra section function definitions. For targets
+ that use additional sections (e.g. .tdesc) you should override this
+ definition in the target-specific file which includes this file. */
+
+#undef EXTRA_SECTION_FUNCTIONS
+#define EXTRA_SECTION_FUNCTIONS \
+ CONST_SECTION_FUNCTION \
+ CTORS_SECTION_FUNCTION \
+ DTORS_SECTION_FUNCTION
+
+#undef READONLY_DATA_SECTION
+#define READONLY_DATA_SECTION() const_section ()
+
+extern void text_section ();
+
+#define CONST_SECTION_FUNCTION \
+void \
+const_section () \
+{ \
+ if (!USE_CONST_SECTION) \
+ text_section(); \
+ else if (in_section != in_const) \
+ { \
+ fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP); \
+ in_section = in_const; \
+ } \
+}
+
+#define CTORS_SECTION_FUNCTION \
+void \
+ctors_section () \
+{ \
+ if (in_section != in_ctors) \
+ { \
+ fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP); \
+ in_section = in_ctors; \
+ } \
+}
+
+#define DTORS_SECTION_FUNCTION \
+void \
+dtors_section () \
+{ \
+ if (in_section != in_dtors) \
+ { \
+ fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP); \
+ in_section = in_dtors; \
+ } \
+}
+
+/* Switch into a generic section.
+ This is currently only used to support section attributes.
+
+ We make the section read-only and executable for a function decl,
+ read-only for a const data decl, and writable for a non-const data decl. */
+#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC) \
+ fprintf (FILE, ".section\t%s,\"%s\",@progbits\n", NAME, \
+ (DECL) && TREE_CODE (DECL) == FUNCTION_DECL ? "ax" : \
+ (DECL) && DECL_READONLY_SECTION (DECL, RELOC) ? "a" : "aw")
+
+
+/* A C statement (sans semicolon) to output an element in the table of
+ global constructors. */
+#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
+ do { \
+ ctors_section (); \
+ fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
+ assemble_name (FILE, NAME); \
+ fprintf (FILE, "\n"); \
+ } while (0)
+
+/* A C statement (sans semicolon) to output an element in the table of
+ global destructors. */
+#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
+ do { \
+ dtors_section (); \
+ fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
+ assemble_name (FILE, NAME); \
+ fprintf (FILE, "\n"); \
+ } while (0)
+
+/* A C statement or statements to switch to the appropriate
+ section for output of DECL. DECL is either a `VAR_DECL' node
+ or a constant of some sort. RELOC indicates whether forming
+ the initial value of DECL requires link-time relocations. */
+
+#define SELECT_SECTION(DECL,RELOC) \
+{ \
+ if (TREE_CODE (DECL) == STRING_CST) \
+ { \
+ if (! flag_writable_strings) \
+ const_section (); \
+ else \
+ data_section (); \
+ } \
+ else if (TREE_CODE (DECL) == VAR_DECL) \
+ { \
+ if ((flag_pic && RELOC) \
+ || !TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL) \
+ || !DECL_INITIAL (DECL) \
+ || (DECL_INITIAL (DECL) != error_mark_node \
+ && !TREE_CONSTANT (DECL_INITIAL (DECL)))) \
+ data_section (); \
+ else \
+ const_section (); \
+ } \
+ else \
+ const_section (); \
+}
+
+/* A C statement or statements to switch to the appropriate
+ section for output of RTX in mode MODE. RTX is some kind
+ of constant in RTL. The argument MODE is redundant except
+ in the case of a `const_int' rtx. Currently, these always
+ go into the const section. */
+
+#undef SELECT_RTX_SECTION
+#define SELECT_RTX_SECTION(MODE,RTX) const_section()
+
+/* Define the strings used for the special svr4 .type and .size directives.
+ These strings generally do not vary from one system running svr4 to
+ another, but if a given system (e.g. m88k running svr) needs to use
+ different pseudo-op names for these, they may be overridden in the
+ file which includes this one. */
+
+#define TYPE_ASM_OP ".type"
+#define SIZE_ASM_OP ".size"
+
+/* This is how we tell the assembler that two symbols have the same value. */
+
+#define ASM_OUTPUT_DEF(FILE,NAME1,NAME2) \
+ do { assemble_name(FILE, NAME1); \
+ fputs(" = ", FILE); \
+ assemble_name(FILE, NAME2); \
+ fputc('\n', FILE); } while (0)
+
+/* A table of bytes codes used by the ASM_OUTPUT_ASCII and
+ ASM_OUTPUT_LIMITED_STRING macros. Each byte in the table
+ corresponds to a particular byte value [0..255]. For any
+ given byte value, if the value in the corresponding table
+ position is zero, the given character can be output directly.
+ If the table value is 1, the byte must be output as a \ooo
+ octal escape. If the tables value is anything else, then the
+ byte value should be output as a \ followed by the value
+ in the table. Note that we can use standard UN*X escape
+ sequences for many control characters, but we don't use
+ \a to represent BEL because some svr4 assemblers (e.g. on
+ the i386) don't know about that. Also, we don't use \v
+ since some versions of gas, such as 2.2 did not accept it. */
+
+#define ESCAPES \
+"\1\1\1\1\1\1\1\1btn\1fr\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\0\0\"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\\\0\0\0\
+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1"
+
+/* Some svr4 assemblers have a limit on the number of characters which
+ can appear in the operand of a .string directive. If your assembler
+ has such a limitation, you should define STRING_LIMIT to reflect that
+ limit. Note that at least some svr4 assemblers have a limit on the
+ actual number of bytes in the double-quoted string, and that they
+ count each character in an escape sequence as one byte. Thus, an
+ escape sequence like \377 would count as four bytes.
+
+ If your target assembler doesn't support the .string directive, you
+ should define this to zero.
+*/
+
+#define STRING_LIMIT ((unsigned) 256)
+
+#define STRING_ASM_OP ".string"
+
+/*
+ * We always use gas here, so we don't worry about ECOFF assembler problems.
+ */
+#undef TARGET_GAS
+#define TARGET_GAS (1)
+
+#undef PREFERRED_DEBUGGING_TYPE
+#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
diff --git a/lang/gcc35/files/patch-ad b/lang/gcc35/files/patch-ad
index f8fb5803acf0..bea070deb344 100644
--- a/lang/gcc35/files/patch-ad
+++ b/lang/gcc35/files/patch-ad
@@ -1,6 +1,41 @@
--- gcc/config/i386/freebsd-aout.h.orig Mon Mar 1 14:47:33 1999
-+++ gcc/config/i386/freebsd-aout.h Sat Mar 13 19:24:50 1999
-@@ -103,19 +103,18 @@
++++ gcc/config/i386/freebsd-aout.h Sat Mar 20 00:27:02 1999
+@@ -20,6 +20,10 @@
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
++
++/* Get generic FreeBSD definitions. */
++#include <freebsd.h>
++
+ /* This goes away when the math-emulator is fixed */
+ #define TARGET_CPU_DEFAULT 0400 /* TARGET_NO_FANCY_MATH_387 */
+
+@@ -35,7 +39,7 @@
+ #include "i386/perform.h"
+
+ #undef CPP_PREDEFINES
+-#define CPP_PREDEFINES "-Dunix -Di386 -D__FreeBSD__ -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)"
++#define CPP_PREDEFINES "-Di386 -Acpu(i386) -Amachine(i386)" CPP_FBSD_PREDEFINES
+
+ /* Like the default, except no -lg. */
+ #define LIB_SPEC "%{!shared:%{!pg:-lc}%{pg:-lc_p}}"
+@@ -85,14 +89,6 @@
+ necessary when compiling PIC code. */
+
+ #define JUMP_TABLES_IN_TEXT_SECTION 1
+-
+-/* Don't default to pcc-struct-return, because gcc is the only compiler, and
+- we want to retain compatibility with older gcc versions. */
+-#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
+
+ /* i386 freebsd still uses old binutils that don't insert nops by default
+ when the .align directive demands to insert extra space in the text
+@@ -103,19 +99,18 @@
/* Profiling routines, partially copied from i386/osfrose.h. */
@@ -23,7 +58,7 @@
fprintf (FILE, "\tcall mcount\n"); \
} \
}
-@@ -133,6 +132,7 @@
+@@ -133,6 +128,7 @@
#define TYPE_ASM_OP ".type"
#define SIZE_ASM_OP ".size"
@@ -31,7 +66,7 @@
/* The following macro defines the format used to output the second
operand of the .type assembler directive. Different svr4 assemblers
-@@ -142,6 +142,12 @@
+@@ -142,6 +138,12 @@
#define TYPE_OPERAND_FMT "@%s"
@@ -44,12 +79,34 @@
/* Write the extra assembler code needed to declare a function's result.
Most svr4 assemblers don't require any special declaration of the
result value, but there are exceptions. */
-@@ -243,6 +249,8 @@
- #define STARTFILE_SPEC \
+@@ -244,29 +246,4 @@
"%{shared:c++rt0.o%s} \
%{!shared:%{pg:gcrt0.o%s}%{!pg:%{static:scrt0.o%s}%{!static:crt0.o%s}}}"
-+
-+#define MD_STARTFILE_PREFIX "/usr/lib/aout/"
- /* This is defined when gcc is compiled in the BSD-directory-tree, and must
- * make up for the gap to all the stuff done in the GNU-makefiles.
+-/* This is defined when gcc is compiled in the BSD-directory-tree, and must
+- * make up for the gap to all the stuff done in the GNU-makefiles.
+- */
+-
+-#ifdef FREEBSD_NATIVE
+-
+-#define INCLUDE_DEFAULTS { \
+- { "/usr/include", 0, 0, 0 }, \
+- { "/usr/include/g++", "G++", 1, 1 }, \
+- { 0, 0, 0, 0} \
+- }
+-
+-#undef MD_EXEC_PREFIX
+-#define MD_EXEC_PREFIX "/usr/libexec/"
+-
+-#undef STANDARD_STARTFILE_PREFIX
+-#define STANDARD_STARTFILE_PREFIX "/usr/lib"
+-
+-#if 0 /* This is very wrong!!! */
+-#define DEFAULT_TARGET_MACHINE "i386-unknown-freebsd_1.0"
+-#define GPLUSPLUS_INCLUDE_DIR "/usr/local/lib/gcc-lib/i386-unknown-freebsd_1.0/2.5.8/include"
+-#define TOOL_INCLUDE_DIR "/usr/local/i386-unknown-freebsd_1.0/include"
+-#define GCC_INCLUDE_DIR "/usr/local/lib/gcc-lib/i386-unknown-freebsd_1.0/2.5.8/include"
+-#endif
+-
+-#endif /* FREEBSD_NATIVE */
++#define MD_STARTFILE_PREFIX "/usr/lib/aout/"
diff --git a/lang/gcc35/files/patch-af b/lang/gcc35/files/patch-af
index c50ce06c8375..c1f1ba0e855f 100644
--- a/lang/gcc35/files/patch-af
+++ b/lang/gcc35/files/patch-af
@@ -1,6 +1,30 @@
--- gcc/config/i386/freebsd.h.orig Mon Mar 1 14:47:32 1999
-+++ gcc/config/i386/freebsd.h Sat Mar 13 19:25:53 1999
-@@ -113,22 +113,19 @@
++++ gcc/config/i386/freebsd.h Sun Mar 21 16:58:39 1999
+@@ -21,19 +21,13 @@
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
++
++/* Get generic FreeBSD definitions. */
++#include <freebsd.h>
++
+ #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
+-
+ /* This is how to output an element of a case-vector that is relative.
+ This is only used for PIC code. See comments by the `casesi' insn in
+ i386.md for an explanation of the expression this outputs. */
+@@ -113,22 +107,19 @@
: ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \
: (-1))
@@ -27,8 +51,18 @@
} \
}
-@@ -151,20 +148,8 @@
- #define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
+@@ -145,26 +136,16 @@
+ #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)"
++#define CPP_PREDEFINES "-Di386 -D__ELF__ -Acpu(i386) -Amachine(i386)" CPP_FBSD_PREDEFINES
+
+ #undef CPP_SPEC
+-#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
++#define CPP_SPEC \
++ "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE} %{m486:-D__i486__}"
++ /* %{pthread:-D_REENTRANT} */
#undef LIB_SPEC
-#if 1
@@ -36,16 +70,16 @@
- * want to profile or debug the C library, please add
- * -lc_p or -ggdb to LDFLAGS at the link time, respectively.
- */
- #define LIB_SPEC \
+-#define LIB_SPEC \
- "%{!shared: %{mieee-fp:-lieee} %{p:-lgmon} %{pg:-lgmon} \
- %{!ggdb:-lc} %{ggdb:-lg}}"
-#else
--#define LIB_SPEC \
+ #define LIB_SPEC \
- "%{!shared: \
- %{mieee-fp:-lieee} %{p:-lgmon -lc_p} %{pg:-lgmon -lc_p} \
- %{!p:%{!pg:%{!g*:-lc} %{g*:-lg}}}}"
-#endif
-+ "%{!shared: %{p:-lc_p} %{pg:-lc_p} %{!p:%{!pg:-lc}}}"
++ "%{!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
diff --git a/lang/gcc35/files/patch-ak b/lang/gcc35/files/patch-ak
index 19a2994f3f05..2e54beea1a61 100644
--- a/lang/gcc35/files/patch-ak
+++ b/lang/gcc35/files/patch-ak
@@ -1,5 +1,5 @@
---- gcc/configure.orig Mon Mar 8 10:06:10 1999
-+++ gcc/configure Sat Mar 13 19:08:06 1999
+--- gcc/configure.orig Sun Mar 14 02:59:02 1999
++++ gcc/configure Sat Mar 20 00:40:05 1999
@@ -2395,6 +2395,15 @@
thread_file='posix'
fi
@@ -27,18 +27,20 @@
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
- extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
+- tmake_file=i386/t-freebsd
- gas=yes
- gnu_ld=yes
- stabs=yes
++ tmake_file=t-freebsd
;;
i[34567]86-*-freebsd*)
- tm_file=i386/freebsd.h
+ tm_file="i386/i386.h i386/att.h linux.h i386/freebsd.h i386/perform.h"
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
+- tmake_file=i386/t-freebsd
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
++ tmake_file=t-freebsd
+ gas=yes
+ gnu_ld=yes
+ stabs=yes
diff --git a/lang/gcc35/files/patch-al b/lang/gcc35/files/patch-al
index 51e1b8cdee1c..c8a195127ed0 100644
--- a/lang/gcc35/files/patch-al
+++ b/lang/gcc35/files/patch-al
@@ -1,5 +1,5 @@
--- gcc/configure.in.orig Sun Mar 7 16:22:22 1999
-+++ gcc/configure.in Sat Mar 13 19:23:23 1999
++++ gcc/configure.in Sat Mar 20 00:40:58 1999
@@ -416,6 +416,15 @@
thread_file='posix'
fi
@@ -27,18 +27,20 @@
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
- extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
+- tmake_file=i386/t-freebsd
- gas=yes
- gnu_ld=yes
- stabs=yes
++ tmake_file=t-freebsd
;;
i[[34567]]86-*-freebsd*)
- tm_file=i386/freebsd.h
+ tm_file="i386/i386.h i386/att.h linux.h i386/freebsd.h i386/perform.h"
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
+- tmake_file=i386/t-freebsd
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
++ tmake_file=t-freebsd
+ gas=yes
+ gnu_ld=yes
+ stabs=yes
diff --git a/lang/gcc40/Makefile b/lang/gcc40/Makefile
index f9347a47d87e..cd5b039f398a 100644
--- a/lang/gcc40/Makefile
+++ b/lang/gcc40/Makefile
@@ -4,7 +4,7 @@
# Date created: 9 Jan 1998
# Whom: John Polstra <jdp@polstra.com>
#
-# $Id: Makefile,v 1.48 1999/03/08 07:28:27 asami Exp $
+# $Id: Makefile,v 1.50 1999/03/17 00:40:25 obrien Exp $
#
DISTNAME= egcs-1.1.2
@@ -55,21 +55,20 @@ ALL_TARGET= bootstrap
MAN1= cccp.1 g++.1 g77.1 gcc.1
pre-patch:
+ @${MV} ${WRKSRC}/gcc/config/i386/t-freebsd ${WRKSRC}/gcc/config/
@${MV} ${WRKSRC}/gcc/config/i386/freebsd.h ${WRKSRC}/gcc/config/i386/freebsd-aout.h
@${MV} ${WRKSRC}/gcc/config/i386/freebsd-elf.h ${WRKSRC}/gcc/config/i386/freebsd.h
+ @${CP} ${FILESDIR}/alpha-freebsd-elf.h ${WRKSRC}/gcc/config/alpha/freebsd-elf.h
+ @${CP} ${FILESDIR}/alpha-freebsd.h ${WRKSRC}/gcc/config/alpha/freebsd.h
pre-configure:
@# Keep from running `autoconf' and `autoheader' since we modified
@# configure.in by patching it.
@touch ${WRKSRC}/gcc/configure
@touch ${WRKSRC}/gcc/cstamp-h.in
- @(cd ${WRKSRC}/gcc/config/${ARCH}/ ; \
- MAJ=`sysctl -n kern.osreldate | ${SED} -e '/.....$$/s///'` ; \
- ${MV} freebsd-aout.h freebsd-aout.h.in ; \
- ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" freebsd-aout.h.in \
- >freebsd-aout.h ; \
- ${MV} freebsd.h freebsd.h.in ; \
- ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" freebsd.h.in >freebsd.h )
+ @(MAJ=`sysctl -n kern.osreldate | ${SED} -e '/.....$$/s///'` ; \
+ ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" ${FILESDIR}/freebsd.h \
+ >${WRKSRC}/gcc/config/freebsd.h )
.if ${PORTOBJFORMAT} == "elf" && ${MACHINE_ARCH} == "i386"
@${SED} -e 's/^@comment ELF-only://' ${PKGDIR}/PLIST >${PLIST}
.endif
diff --git a/lang/gcc40/files/alpha-freebsd.h b/lang/gcc40/files/alpha-freebsd.h
new file mode 100644
index 000000000000..60a1f07b94ba
--- /dev/null
+++ b/lang/gcc40/files/alpha-freebsd.h
@@ -0,0 +1,443 @@
+/* Definitions of target machine for GNU compiler,
+ for Alpha FreeBSD systems.
+ Copyright (C) 1998 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* This is used on Alpha platforms that use the ELF format.
+ This was taken from the NetBSD configuration, and modified
+ for FreeBSD/alpha by Hidetoshi Shimokawa <simokawa@FreeBSD.ORG> */
+
+
+/* Get generic FreeBSD definitions. */
+#include <freebsd.h>
+
+
+#undef OBJECT_FORMAT_COFF
+#undef EXTENDED_COFF
+#define OBJECT_FORMAT_ELF
+
+/* This is BSD, so it wants DBX format. */
+
+#define DBX_DEBUGGING_INFO
+
+/* This is the char to use for continuation (in case we need to turn
+ continuation back on). */
+
+#define DBX_CONTIN_CHAR '?'
+
+#undef ASM_FINAL_SPEC
+
+/* Names to predefine in the preprocessor for this target machine.
+ XXX FreeBSD, by convention, shouldn't do __alpha, but lots of applications
+ expect it because that's what OSF/1 does. */
+
+#undef TARGET_DEFAULT
+#define TARGET_DEFAULT (MASK_FP | MASK_FPREGS | MASK_GAS)
+
+#undef CPP_PREDEFINES
+#define CPP_PREDEFINES "\
+-D__alpha__ -D__alpha -Acpu(alpha) -Amachine(alpha) " \
+FBSD_CPP_PREDEFINES \
+SUB_CPP_PREDEFINES
+
+/* Make gcc agree with <machine/ansi.h> */
+
+#undef WCHAR_TYPE
+#define WCHAR_TYPE "int"
+
+#undef WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE 32
+
+/* Output assembler code to FILE to increment profiler label # LABELNO
+ for profiling a function entry. Under FreeBSD/Alpha, the assembler does
+ nothing special with -pg. */
+
+#undef FUNCTION_PROFILER
+#define FUNCTION_PROFILER(FILE, LABELNO) \
+ fputs ("\tjsr $28,_mcount\n", (FILE))
+
+/* Show that we need a GP when profiling. */
+#define TARGET_PROFILING_NEEDS_GP
+
+#undef HAS_INIT_SECTION
+
+/* Provide an ASM_SPEC appropriate for a FreeBSD/alpha target. This differs
+ from the generic FreeBSD ASM_SPEC in that no special handling of PIC is
+ necessary on the Alpha. */
+
+#undef ASM_SPEC
+#define ASM_SPEC " %| %{mcpu=*:-m%*}"
+
+/* Output at beginning of assembler file. */
+
+#undef ASM_FILE_START
+#define ASM_FILE_START(FILE) \
+{ \
+ alpha_write_verstamp (FILE); \
+ output_file_directive (FILE, main_input_filename); \
+ fprintf (FILE, "\t.version\t\"01.01\"\n"); \
+ fprintf (FILE, "\t.set noat\n"); \
+}
+
+#define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE) \
+ alpha_output_lineno (STREAM, LINE)
+extern void alpha_output_lineno ();
+
+extern void output_file_directive ();
+
+/* 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. */
+
+#define IDENT_ASM_OP ".ident"
+
+#ifdef IDENTIFY_WITH_IDENT
+#define ASM_IDENTIFY_GCC(FILE) /* nothing */
+#define ASM_IDENTIFY_LANGUAGE(FILE) \
+ fprintf(FILE, "\t%s \"GCC (%s) %s\"\n", IDENT_ASM_OP, \
+ lang_identify(), version_string)
+#else
+#define ASM_FILE_END(FILE) \
+do { \
+ fprintf ((FILE), "\t%s\t\"GCC: (GNU) %s\"\n", \
+ IDENT_ASM_OP, version_string); \
+ } while (0)
+#endif
+
+/* Allow #sccs in preprocessor. */
+
+#define SCCS_DIRECTIVE
+
+/* Output #ident as a .ident. */
+
+#define ASM_OUTPUT_IDENT(FILE, NAME) \
+ fprintf (FILE, "\t%s\t\"%s\"\n", IDENT_ASM_OP, NAME);
+
+/* This is how to allocate empty space in some section. The .zero
+ pseudo-op is used for this on most svr4 assemblers. */
+
+#define SKIP_ASM_OP ".zero"
+
+#undef ASM_OUTPUT_SKIP
+#define ASM_OUTPUT_SKIP(FILE,SIZE) \
+ fprintf (FILE, "\t%s\t%u\n", SKIP_ASM_OP, (SIZE))
+
+/* Output the label which precedes a jumptable. Note that for all svr4
+ systems where we actually generate jumptables (which is to say every
+ svr4 target except i386, where we use casesi instead) we put the jump-
+ tables into the .rodata section and since other stuff could have been
+ put into the .rodata section prior to any given jumptable, we have to
+ make sure that the location counter for the .rodata section gets pro-
+ perly re-aligned prior to the actual beginning of the jump table. */
+
+#define ALIGN_ASM_OP ".align"
+
+#ifndef ASM_OUTPUT_BEFORE_CASE_LABEL
+#define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE,PREFIX,NUM,TABLE) \
+ ASM_OUTPUT_ALIGN ((FILE), 2);
+#endif
+
+#undef ASM_OUTPUT_CASE_LABEL
+#define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,JUMPTABLE) \
+ do { \
+ ASM_OUTPUT_BEFORE_CASE_LABEL (FILE, PREFIX, NUM, JUMPTABLE) \
+ ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); \
+ } while (0)
+
+/* The standard SVR4 assembler seems to require that certain builtin
+ library routines (e.g. .udiv) be explicitly declared as .globl
+ in each assembly file where they are referenced. */
+
+#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
+ ASM_GLOBALIZE_LABEL (FILE, XSTR (FUN, 0))
+
+/* This says how to output assembler code to declare an
+ uninitialized external linkage data object. Under SVR4,
+ the linker seems to want the alignment of data objects
+ to depend on their types. We do exactly that here. */
+
+#define COMMON_ASM_OP ".comm"
+
+#undef ASM_OUTPUT_ALIGNED_COMMON
+#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
+do { \
+ fprintf ((FILE), "\t%s\t", COMMON_ASM_OP); \
+ assemble_name ((FILE), (NAME)); \
+ fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \
+} while (0)
+
+/* This says how to output assembler code to declare an
+ uninitialized internal linkage data object. Under SVR4,
+ the linker seems to want the alignment of data objects
+ to depend on their types. We do exactly that here. */
+
+#define LOCAL_ASM_OP ".local"
+
+#undef ASM_OUTPUT_ALIGNED_LOCAL
+#define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
+do { \
+ fprintf ((FILE), "\t%s\t", LOCAL_ASM_OP); \
+ assemble_name ((FILE), (NAME)); \
+ fprintf ((FILE), "\n"); \
+ ASM_OUTPUT_ALIGNED_COMMON (FILE, NAME, SIZE, ALIGN); \
+} while (0)
+
+/* This is the pseudo-op used to generate a 64-bit word of data with a
+ specific value in some section. */
+
+#define INT_ASM_OP ".quad"
+
+/* This is the pseudo-op used to generate a contiguous sequence of byte
+ values from a double-quoted string WITHOUT HAVING A TERMINATING NUL
+ AUTOMATICALLY APPENDED. This is the same for most svr4 assemblers. */
+
+#undef ASCII_DATA_ASM_OP
+#define ASCII_DATA_ASM_OP ".ascii"
+
+/* Support const sections and the ctors and dtors sections for g++.
+ Note that there appears to be two different ways to support const
+ sections at the moment. You can either #define the symbol
+ READONLY_DATA_SECTION (giving it some code which switches to the
+ readonly data section) or else you can #define the symbols
+ EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, SELECT_SECTION, and
+ SELECT_RTX_SECTION. We do both here just to be on the safe side. */
+
+#define USE_CONST_SECTION 1
+
+#define CONST_SECTION_ASM_OP ".section\t.rodata"
+
+/* Define the pseudo-ops used to switch to the .ctors and .dtors sections.
+
+ Note that we want to give these sections the SHF_WRITE attribute
+ because these sections will actually contain data (i.e. tables of
+ addresses of functions in the current root executable or shared library
+ file) and, in the case of a shared library, the relocatable addresses
+ will have to be properly resolved/relocated (and then written into) by
+ the dynamic linker when it actually attaches the given shared library
+ to the executing process. (Note that on SVR4, you may wish to use the
+ `-z text' option to the ELF linker, when building a shared library, as
+ an additional check that you are doing everything right. But if you do
+ use the `-z text' option when building a shared library, you will get
+ errors unless the .ctors and .dtors sections are marked as writable
+ via the SHF_WRITE attribute.) */
+
+#define CTORS_SECTION_ASM_OP ".section\t.ctors,\"aw\""
+#define DTORS_SECTION_ASM_OP ".section\t.dtors,\"aw\""
+
+/* On svr4, we *do* have support for the .init and .fini sections, and we
+ can put stuff in there to be executed before and after `main'. We let
+ crtstuff.c and other files know this by defining the following symbols.
+ The definitions say how to change sections to the .init and .fini
+ sections. This is the same for all known svr4 assemblers. */
+
+#define INIT_SECTION_ASM_OP ".section\t.init"
+#define FINI_SECTION_ASM_OP ".section\t.fini"
+
+/* A default list of other sections which we might be "in" at any given
+ time. For targets that use additional sections (e.g. .tdesc) you
+ should override this definition in the target-specific file which
+ includes this file. */
+
+#undef EXTRA_SECTIONS
+#define EXTRA_SECTIONS in_const, in_ctors, in_dtors
+
+/* A default list of extra section function definitions. For targets
+ that use additional sections (e.g. .tdesc) you should override this
+ definition in the target-specific file which includes this file. */
+
+#undef EXTRA_SECTION_FUNCTIONS
+#define EXTRA_SECTION_FUNCTIONS \
+ CONST_SECTION_FUNCTION \
+ CTORS_SECTION_FUNCTION \
+ DTORS_SECTION_FUNCTION
+
+#undef READONLY_DATA_SECTION
+#define READONLY_DATA_SECTION() const_section ()
+
+extern void text_section ();
+
+#define CONST_SECTION_FUNCTION \
+void \
+const_section () \
+{ \
+ if (!USE_CONST_SECTION) \
+ text_section(); \
+ else if (in_section != in_const) \
+ { \
+ fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP); \
+ in_section = in_const; \
+ } \
+}
+
+#define CTORS_SECTION_FUNCTION \
+void \
+ctors_section () \
+{ \
+ if (in_section != in_ctors) \
+ { \
+ fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP); \
+ in_section = in_ctors; \
+ } \
+}
+
+#define DTORS_SECTION_FUNCTION \
+void \
+dtors_section () \
+{ \
+ if (in_section != in_dtors) \
+ { \
+ fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP); \
+ in_section = in_dtors; \
+ } \
+}
+
+/* Switch into a generic section.
+ This is currently only used to support section attributes.
+
+ We make the section read-only and executable for a function decl,
+ read-only for a const data decl, and writable for a non-const data decl. */
+#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC) \
+ fprintf (FILE, ".section\t%s,\"%s\",@progbits\n", NAME, \
+ (DECL) && TREE_CODE (DECL) == FUNCTION_DECL ? "ax" : \
+ (DECL) && DECL_READONLY_SECTION (DECL, RELOC) ? "a" : "aw")
+
+
+/* A C statement (sans semicolon) to output an element in the table of
+ global constructors. */
+#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
+ do { \
+ ctors_section (); \
+ fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
+ assemble_name (FILE, NAME); \
+ fprintf (FILE, "\n"); \
+ } while (0)
+
+/* A C statement (sans semicolon) to output an element in the table of
+ global destructors. */
+#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
+ do { \
+ dtors_section (); \
+ fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
+ assemble_name (FILE, NAME); \
+ fprintf (FILE, "\n"); \
+ } while (0)
+
+/* A C statement or statements to switch to the appropriate
+ section for output of DECL. DECL is either a `VAR_DECL' node
+ or a constant of some sort. RELOC indicates whether forming
+ the initial value of DECL requires link-time relocations. */
+
+#define SELECT_SECTION(DECL,RELOC) \
+{ \
+ if (TREE_CODE (DECL) == STRING_CST) \
+ { \
+ if (! flag_writable_strings) \
+ const_section (); \
+ else \
+ data_section (); \
+ } \
+ else if (TREE_CODE (DECL) == VAR_DECL) \
+ { \
+ if ((flag_pic && RELOC) \
+ || !TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL) \
+ || !DECL_INITIAL (DECL) \
+ || (DECL_INITIAL (DECL) != error_mark_node \
+ && !TREE_CONSTANT (DECL_INITIAL (DECL)))) \
+ data_section (); \
+ else \
+ const_section (); \
+ } \
+ else \
+ const_section (); \
+}
+
+/* A C statement or statements to switch to the appropriate
+ section for output of RTX in mode MODE. RTX is some kind
+ of constant in RTL. The argument MODE is redundant except
+ in the case of a `const_int' rtx. Currently, these always
+ go into the const section. */
+
+#undef SELECT_RTX_SECTION
+#define SELECT_RTX_SECTION(MODE,RTX) const_section()
+
+/* Define the strings used for the special svr4 .type and .size directives.
+ These strings generally do not vary from one system running svr4 to
+ another, but if a given system (e.g. m88k running svr) needs to use
+ different pseudo-op names for these, they may be overridden in the
+ file which includes this one. */
+
+#define TYPE_ASM_OP ".type"
+#define SIZE_ASM_OP ".size"
+
+/* This is how we tell the assembler that two symbols have the same value. */
+
+#define ASM_OUTPUT_DEF(FILE,NAME1,NAME2) \
+ do { assemble_name(FILE, NAME1); \
+ fputs(" = ", FILE); \
+ assemble_name(FILE, NAME2); \
+ fputc('\n', FILE); } while (0)
+
+/* A table of bytes codes used by the ASM_OUTPUT_ASCII and
+ ASM_OUTPUT_LIMITED_STRING macros. Each byte in the table
+ corresponds to a particular byte value [0..255]. For any
+ given byte value, if the value in the corresponding table
+ position is zero, the given character can be output directly.
+ If the table value is 1, the byte must be output as a \ooo
+ octal escape. If the tables value is anything else, then the
+ byte value should be output as a \ followed by the value
+ in the table. Note that we can use standard UN*X escape
+ sequences for many control characters, but we don't use
+ \a to represent BEL because some svr4 assemblers (e.g. on
+ the i386) don't know about that. Also, we don't use \v
+ since some versions of gas, such as 2.2 did not accept it. */
+
+#define ESCAPES \
+"\1\1\1\1\1\1\1\1btn\1fr\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\0\0\"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\\\0\0\0\
+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1"
+
+/* Some svr4 assemblers have a limit on the number of characters which
+ can appear in the operand of a .string directive. If your assembler
+ has such a limitation, you should define STRING_LIMIT to reflect that
+ limit. Note that at least some svr4 assemblers have a limit on the
+ actual number of bytes in the double-quoted string, and that they
+ count each character in an escape sequence as one byte. Thus, an
+ escape sequence like \377 would count as four bytes.
+
+ If your target assembler doesn't support the .string directive, you
+ should define this to zero.
+*/
+
+#define STRING_LIMIT ((unsigned) 256)
+
+#define STRING_ASM_OP ".string"
+
+/*
+ * We always use gas here, so we don't worry about ECOFF assembler problems.
+ */
+#undef TARGET_GAS
+#define TARGET_GAS (1)
+
+#undef PREFERRED_DEBUGGING_TYPE
+#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
diff --git a/lang/gcc40/files/patch-ad b/lang/gcc40/files/patch-ad
index f8fb5803acf0..bea070deb344 100644
--- a/lang/gcc40/files/patch-ad
+++ b/lang/gcc40/files/patch-ad
@@ -1,6 +1,41 @@
--- gcc/config/i386/freebsd-aout.h.orig Mon Mar 1 14:47:33 1999
-+++ gcc/config/i386/freebsd-aout.h Sat Mar 13 19:24:50 1999
-@@ -103,19 +103,18 @@
++++ gcc/config/i386/freebsd-aout.h Sat Mar 20 00:27:02 1999
+@@ -20,6 +20,10 @@
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
++
++/* Get generic FreeBSD definitions. */
++#include <freebsd.h>
++
+ /* This goes away when the math-emulator is fixed */
+ #define TARGET_CPU_DEFAULT 0400 /* TARGET_NO_FANCY_MATH_387 */
+
+@@ -35,7 +39,7 @@
+ #include "i386/perform.h"
+
+ #undef CPP_PREDEFINES
+-#define CPP_PREDEFINES "-Dunix -Di386 -D__FreeBSD__ -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)"
++#define CPP_PREDEFINES "-Di386 -Acpu(i386) -Amachine(i386)" CPP_FBSD_PREDEFINES
+
+ /* Like the default, except no -lg. */
+ #define LIB_SPEC "%{!shared:%{!pg:-lc}%{pg:-lc_p}}"
+@@ -85,14 +89,6 @@
+ necessary when compiling PIC code. */
+
+ #define JUMP_TABLES_IN_TEXT_SECTION 1
+-
+-/* Don't default to pcc-struct-return, because gcc is the only compiler, and
+- we want to retain compatibility with older gcc versions. */
+-#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
+
+ /* i386 freebsd still uses old binutils that don't insert nops by default
+ when the .align directive demands to insert extra space in the text
+@@ -103,19 +99,18 @@
/* Profiling routines, partially copied from i386/osfrose.h. */
@@ -23,7 +58,7 @@
fprintf (FILE, "\tcall mcount\n"); \
} \
}
-@@ -133,6 +132,7 @@
+@@ -133,6 +128,7 @@
#define TYPE_ASM_OP ".type"
#define SIZE_ASM_OP ".size"
@@ -31,7 +66,7 @@
/* The following macro defines the format used to output the second
operand of the .type assembler directive. Different svr4 assemblers
-@@ -142,6 +142,12 @@
+@@ -142,6 +138,12 @@
#define TYPE_OPERAND_FMT "@%s"
@@ -44,12 +79,34 @@
/* Write the extra assembler code needed to declare a function's result.
Most svr4 assemblers don't require any special declaration of the
result value, but there are exceptions. */
-@@ -243,6 +249,8 @@
- #define STARTFILE_SPEC \
+@@ -244,29 +246,4 @@
"%{shared:c++rt0.o%s} \
%{!shared:%{pg:gcrt0.o%s}%{!pg:%{static:scrt0.o%s}%{!static:crt0.o%s}}}"
-+
-+#define MD_STARTFILE_PREFIX "/usr/lib/aout/"
- /* This is defined when gcc is compiled in the BSD-directory-tree, and must
- * make up for the gap to all the stuff done in the GNU-makefiles.
+-/* This is defined when gcc is compiled in the BSD-directory-tree, and must
+- * make up for the gap to all the stuff done in the GNU-makefiles.
+- */
+-
+-#ifdef FREEBSD_NATIVE
+-
+-#define INCLUDE_DEFAULTS { \
+- { "/usr/include", 0, 0, 0 }, \
+- { "/usr/include/g++", "G++", 1, 1 }, \
+- { 0, 0, 0, 0} \
+- }
+-
+-#undef MD_EXEC_PREFIX
+-#define MD_EXEC_PREFIX "/usr/libexec/"
+-
+-#undef STANDARD_STARTFILE_PREFIX
+-#define STANDARD_STARTFILE_PREFIX "/usr/lib"
+-
+-#if 0 /* This is very wrong!!! */
+-#define DEFAULT_TARGET_MACHINE "i386-unknown-freebsd_1.0"
+-#define GPLUSPLUS_INCLUDE_DIR "/usr/local/lib/gcc-lib/i386-unknown-freebsd_1.0/2.5.8/include"
+-#define TOOL_INCLUDE_DIR "/usr/local/i386-unknown-freebsd_1.0/include"
+-#define GCC_INCLUDE_DIR "/usr/local/lib/gcc-lib/i386-unknown-freebsd_1.0/2.5.8/include"
+-#endif
+-
+-#endif /* FREEBSD_NATIVE */
++#define MD_STARTFILE_PREFIX "/usr/lib/aout/"
diff --git a/lang/gcc40/files/patch-af b/lang/gcc40/files/patch-af
index c50ce06c8375..c1f1ba0e855f 100644
--- a/lang/gcc40/files/patch-af
+++ b/lang/gcc40/files/patch-af
@@ -1,6 +1,30 @@
--- gcc/config/i386/freebsd.h.orig Mon Mar 1 14:47:32 1999
-+++ gcc/config/i386/freebsd.h Sat Mar 13 19:25:53 1999
-@@ -113,22 +113,19 @@
++++ gcc/config/i386/freebsd.h Sun Mar 21 16:58:39 1999
+@@ -21,19 +21,13 @@
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
++
++/* Get generic FreeBSD definitions. */
++#include <freebsd.h>
++
+ #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
+-
+ /* This is how to output an element of a case-vector that is relative.
+ This is only used for PIC code. See comments by the `casesi' insn in
+ i386.md for an explanation of the expression this outputs. */
+@@ -113,22 +107,19 @@
: ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \
: (-1))
@@ -27,8 +51,18 @@
} \
}
-@@ -151,20 +148,8 @@
- #define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
+@@ -145,26 +136,16 @@
+ #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)"
++#define CPP_PREDEFINES "-Di386 -D__ELF__ -Acpu(i386) -Amachine(i386)" CPP_FBSD_PREDEFINES
+
+ #undef CPP_SPEC
+-#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
++#define CPP_SPEC \
++ "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE} %{m486:-D__i486__}"
++ /* %{pthread:-D_REENTRANT} */
#undef LIB_SPEC
-#if 1
@@ -36,16 +70,16 @@
- * want to profile or debug the C library, please add
- * -lc_p or -ggdb to LDFLAGS at the link time, respectively.
- */
- #define LIB_SPEC \
+-#define LIB_SPEC \
- "%{!shared: %{mieee-fp:-lieee} %{p:-lgmon} %{pg:-lgmon} \
- %{!ggdb:-lc} %{ggdb:-lg}}"
-#else
--#define LIB_SPEC \
+ #define LIB_SPEC \
- "%{!shared: \
- %{mieee-fp:-lieee} %{p:-lgmon -lc_p} %{pg:-lgmon -lc_p} \
- %{!p:%{!pg:%{!g*:-lc} %{g*:-lg}}}}"
-#endif
-+ "%{!shared: %{p:-lc_p} %{pg:-lc_p} %{!p:%{!pg:-lc}}}"
++ "%{!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
diff --git a/lang/gcc40/files/patch-ak b/lang/gcc40/files/patch-ak
index 19a2994f3f05..2e54beea1a61 100644
--- a/lang/gcc40/files/patch-ak
+++ b/lang/gcc40/files/patch-ak
@@ -1,5 +1,5 @@
---- gcc/configure.orig Mon Mar 8 10:06:10 1999
-+++ gcc/configure Sat Mar 13 19:08:06 1999
+--- gcc/configure.orig Sun Mar 14 02:59:02 1999
++++ gcc/configure Sat Mar 20 00:40:05 1999
@@ -2395,6 +2395,15 @@
thread_file='posix'
fi
@@ -27,18 +27,20 @@
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
- extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
+- tmake_file=i386/t-freebsd
- gas=yes
- gnu_ld=yes
- stabs=yes
++ tmake_file=t-freebsd
;;
i[34567]86-*-freebsd*)
- tm_file=i386/freebsd.h
+ tm_file="i386/i386.h i386/att.h linux.h i386/freebsd.h i386/perform.h"
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
+- tmake_file=i386/t-freebsd
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
++ tmake_file=t-freebsd
+ gas=yes
+ gnu_ld=yes
+ stabs=yes
diff --git a/lang/gcc40/files/patch-al b/lang/gcc40/files/patch-al
index 51e1b8cdee1c..c8a195127ed0 100644
--- a/lang/gcc40/files/patch-al
+++ b/lang/gcc40/files/patch-al
@@ -1,5 +1,5 @@
--- gcc/configure.in.orig Sun Mar 7 16:22:22 1999
-+++ gcc/configure.in Sat Mar 13 19:23:23 1999
++++ gcc/configure.in Sat Mar 20 00:40:58 1999
@@ -416,6 +416,15 @@
thread_file='posix'
fi
@@ -27,18 +27,20 @@
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
- extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
+- tmake_file=i386/t-freebsd
- gas=yes
- gnu_ld=yes
- stabs=yes
++ tmake_file=t-freebsd
;;
i[[34567]]86-*-freebsd*)
- tm_file=i386/freebsd.h
+ tm_file="i386/i386.h i386/att.h linux.h i386/freebsd.h i386/perform.h"
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
+- tmake_file=i386/t-freebsd
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
++ tmake_file=t-freebsd
+ gas=yes
+ gnu_ld=yes
+ stabs=yes
diff --git a/lang/gcc41/Makefile b/lang/gcc41/Makefile
index f9347a47d87e..cd5b039f398a 100644
--- a/lang/gcc41/Makefile
+++ b/lang/gcc41/Makefile
@@ -4,7 +4,7 @@
# Date created: 9 Jan 1998
# Whom: John Polstra <jdp@polstra.com>
#
-# $Id: Makefile,v 1.48 1999/03/08 07:28:27 asami Exp $
+# $Id: Makefile,v 1.50 1999/03/17 00:40:25 obrien Exp $
#
DISTNAME= egcs-1.1.2
@@ -55,21 +55,20 @@ ALL_TARGET= bootstrap
MAN1= cccp.1 g++.1 g77.1 gcc.1
pre-patch:
+ @${MV} ${WRKSRC}/gcc/config/i386/t-freebsd ${WRKSRC}/gcc/config/
@${MV} ${WRKSRC}/gcc/config/i386/freebsd.h ${WRKSRC}/gcc/config/i386/freebsd-aout.h
@${MV} ${WRKSRC}/gcc/config/i386/freebsd-elf.h ${WRKSRC}/gcc/config/i386/freebsd.h
+ @${CP} ${FILESDIR}/alpha-freebsd-elf.h ${WRKSRC}/gcc/config/alpha/freebsd-elf.h
+ @${CP} ${FILESDIR}/alpha-freebsd.h ${WRKSRC}/gcc/config/alpha/freebsd.h
pre-configure:
@# Keep from running `autoconf' and `autoheader' since we modified
@# configure.in by patching it.
@touch ${WRKSRC}/gcc/configure
@touch ${WRKSRC}/gcc/cstamp-h.in
- @(cd ${WRKSRC}/gcc/config/${ARCH}/ ; \
- MAJ=`sysctl -n kern.osreldate | ${SED} -e '/.....$$/s///'` ; \
- ${MV} freebsd-aout.h freebsd-aout.h.in ; \
- ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" freebsd-aout.h.in \
- >freebsd-aout.h ; \
- ${MV} freebsd.h freebsd.h.in ; \
- ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" freebsd.h.in >freebsd.h )
+ @(MAJ=`sysctl -n kern.osreldate | ${SED} -e '/.....$$/s///'` ; \
+ ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" ${FILESDIR}/freebsd.h \
+ >${WRKSRC}/gcc/config/freebsd.h )
.if ${PORTOBJFORMAT} == "elf" && ${MACHINE_ARCH} == "i386"
@${SED} -e 's/^@comment ELF-only://' ${PKGDIR}/PLIST >${PLIST}
.endif
diff --git a/lang/gcc41/files/alpha-freebsd.h b/lang/gcc41/files/alpha-freebsd.h
new file mode 100644
index 000000000000..60a1f07b94ba
--- /dev/null
+++ b/lang/gcc41/files/alpha-freebsd.h
@@ -0,0 +1,443 @@
+/* Definitions of target machine for GNU compiler,
+ for Alpha FreeBSD systems.
+ Copyright (C) 1998 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* This is used on Alpha platforms that use the ELF format.
+ This was taken from the NetBSD configuration, and modified
+ for FreeBSD/alpha by Hidetoshi Shimokawa <simokawa@FreeBSD.ORG> */
+
+
+/* Get generic FreeBSD definitions. */
+#include <freebsd.h>
+
+
+#undef OBJECT_FORMAT_COFF
+#undef EXTENDED_COFF
+#define OBJECT_FORMAT_ELF
+
+/* This is BSD, so it wants DBX format. */
+
+#define DBX_DEBUGGING_INFO
+
+/* This is the char to use for continuation (in case we need to turn
+ continuation back on). */
+
+#define DBX_CONTIN_CHAR '?'
+
+#undef ASM_FINAL_SPEC
+
+/* Names to predefine in the preprocessor for this target machine.
+ XXX FreeBSD, by convention, shouldn't do __alpha, but lots of applications
+ expect it because that's what OSF/1 does. */
+
+#undef TARGET_DEFAULT
+#define TARGET_DEFAULT (MASK_FP | MASK_FPREGS | MASK_GAS)
+
+#undef CPP_PREDEFINES
+#define CPP_PREDEFINES "\
+-D__alpha__ -D__alpha -Acpu(alpha) -Amachine(alpha) " \
+FBSD_CPP_PREDEFINES \
+SUB_CPP_PREDEFINES
+
+/* Make gcc agree with <machine/ansi.h> */
+
+#undef WCHAR_TYPE
+#define WCHAR_TYPE "int"
+
+#undef WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE 32
+
+/* Output assembler code to FILE to increment profiler label # LABELNO
+ for profiling a function entry. Under FreeBSD/Alpha, the assembler does
+ nothing special with -pg. */
+
+#undef FUNCTION_PROFILER
+#define FUNCTION_PROFILER(FILE, LABELNO) \
+ fputs ("\tjsr $28,_mcount\n", (FILE))
+
+/* Show that we need a GP when profiling. */
+#define TARGET_PROFILING_NEEDS_GP
+
+#undef HAS_INIT_SECTION
+
+/* Provide an ASM_SPEC appropriate for a FreeBSD/alpha target. This differs
+ from the generic FreeBSD ASM_SPEC in that no special handling of PIC is
+ necessary on the Alpha. */
+
+#undef ASM_SPEC
+#define ASM_SPEC " %| %{mcpu=*:-m%*}"
+
+/* Output at beginning of assembler file. */
+
+#undef ASM_FILE_START
+#define ASM_FILE_START(FILE) \
+{ \
+ alpha_write_verstamp (FILE); \
+ output_file_directive (FILE, main_input_filename); \
+ fprintf (FILE, "\t.version\t\"01.01\"\n"); \
+ fprintf (FILE, "\t.set noat\n"); \
+}
+
+#define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE) \
+ alpha_output_lineno (STREAM, LINE)
+extern void alpha_output_lineno ();
+
+extern void output_file_directive ();
+
+/* 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. */
+
+#define IDENT_ASM_OP ".ident"
+
+#ifdef IDENTIFY_WITH_IDENT
+#define ASM_IDENTIFY_GCC(FILE) /* nothing */
+#define ASM_IDENTIFY_LANGUAGE(FILE) \
+ fprintf(FILE, "\t%s \"GCC (%s) %s\"\n", IDENT_ASM_OP, \
+ lang_identify(), version_string)
+#else
+#define ASM_FILE_END(FILE) \
+do { \
+ fprintf ((FILE), "\t%s\t\"GCC: (GNU) %s\"\n", \
+ IDENT_ASM_OP, version_string); \
+ } while (0)
+#endif
+
+/* Allow #sccs in preprocessor. */
+
+#define SCCS_DIRECTIVE
+
+/* Output #ident as a .ident. */
+
+#define ASM_OUTPUT_IDENT(FILE, NAME) \
+ fprintf (FILE, "\t%s\t\"%s\"\n", IDENT_ASM_OP, NAME);
+
+/* This is how to allocate empty space in some section. The .zero
+ pseudo-op is used for this on most svr4 assemblers. */
+
+#define SKIP_ASM_OP ".zero"
+
+#undef ASM_OUTPUT_SKIP
+#define ASM_OUTPUT_SKIP(FILE,SIZE) \
+ fprintf (FILE, "\t%s\t%u\n", SKIP_ASM_OP, (SIZE))
+
+/* Output the label which precedes a jumptable. Note that for all svr4
+ systems where we actually generate jumptables (which is to say every
+ svr4 target except i386, where we use casesi instead) we put the jump-
+ tables into the .rodata section and since other stuff could have been
+ put into the .rodata section prior to any given jumptable, we have to
+ make sure that the location counter for the .rodata section gets pro-
+ perly re-aligned prior to the actual beginning of the jump table. */
+
+#define ALIGN_ASM_OP ".align"
+
+#ifndef ASM_OUTPUT_BEFORE_CASE_LABEL
+#define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE,PREFIX,NUM,TABLE) \
+ ASM_OUTPUT_ALIGN ((FILE), 2);
+#endif
+
+#undef ASM_OUTPUT_CASE_LABEL
+#define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,JUMPTABLE) \
+ do { \
+ ASM_OUTPUT_BEFORE_CASE_LABEL (FILE, PREFIX, NUM, JUMPTABLE) \
+ ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); \
+ } while (0)
+
+/* The standard SVR4 assembler seems to require that certain builtin
+ library routines (e.g. .udiv) be explicitly declared as .globl
+ in each assembly file where they are referenced. */
+
+#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
+ ASM_GLOBALIZE_LABEL (FILE, XSTR (FUN, 0))
+
+/* This says how to output assembler code to declare an
+ uninitialized external linkage data object. Under SVR4,
+ the linker seems to want the alignment of data objects
+ to depend on their types. We do exactly that here. */
+
+#define COMMON_ASM_OP ".comm"
+
+#undef ASM_OUTPUT_ALIGNED_COMMON
+#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
+do { \
+ fprintf ((FILE), "\t%s\t", COMMON_ASM_OP); \
+ assemble_name ((FILE), (NAME)); \
+ fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \
+} while (0)
+
+/* This says how to output assembler code to declare an
+ uninitialized internal linkage data object. Under SVR4,
+ the linker seems to want the alignment of data objects
+ to depend on their types. We do exactly that here. */
+
+#define LOCAL_ASM_OP ".local"
+
+#undef ASM_OUTPUT_ALIGNED_LOCAL
+#define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
+do { \
+ fprintf ((FILE), "\t%s\t", LOCAL_ASM_OP); \
+ assemble_name ((FILE), (NAME)); \
+ fprintf ((FILE), "\n"); \
+ ASM_OUTPUT_ALIGNED_COMMON (FILE, NAME, SIZE, ALIGN); \
+} while (0)
+
+/* This is the pseudo-op used to generate a 64-bit word of data with a
+ specific value in some section. */
+
+#define INT_ASM_OP ".quad"
+
+/* This is the pseudo-op used to generate a contiguous sequence of byte
+ values from a double-quoted string WITHOUT HAVING A TERMINATING NUL
+ AUTOMATICALLY APPENDED. This is the same for most svr4 assemblers. */
+
+#undef ASCII_DATA_ASM_OP
+#define ASCII_DATA_ASM_OP ".ascii"
+
+/* Support const sections and the ctors and dtors sections for g++.
+ Note that there appears to be two different ways to support const
+ sections at the moment. You can either #define the symbol
+ READONLY_DATA_SECTION (giving it some code which switches to the
+ readonly data section) or else you can #define the symbols
+ EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, SELECT_SECTION, and
+ SELECT_RTX_SECTION. We do both here just to be on the safe side. */
+
+#define USE_CONST_SECTION 1
+
+#define CONST_SECTION_ASM_OP ".section\t.rodata"
+
+/* Define the pseudo-ops used to switch to the .ctors and .dtors sections.
+
+ Note that we want to give these sections the SHF_WRITE attribute
+ because these sections will actually contain data (i.e. tables of
+ addresses of functions in the current root executable or shared library
+ file) and, in the case of a shared library, the relocatable addresses
+ will have to be properly resolved/relocated (and then written into) by
+ the dynamic linker when it actually attaches the given shared library
+ to the executing process. (Note that on SVR4, you may wish to use the
+ `-z text' option to the ELF linker, when building a shared library, as
+ an additional check that you are doing everything right. But if you do
+ use the `-z text' option when building a shared library, you will get
+ errors unless the .ctors and .dtors sections are marked as writable
+ via the SHF_WRITE attribute.) */
+
+#define CTORS_SECTION_ASM_OP ".section\t.ctors,\"aw\""
+#define DTORS_SECTION_ASM_OP ".section\t.dtors,\"aw\""
+
+/* On svr4, we *do* have support for the .init and .fini sections, and we
+ can put stuff in there to be executed before and after `main'. We let
+ crtstuff.c and other files know this by defining the following symbols.
+ The definitions say how to change sections to the .init and .fini
+ sections. This is the same for all known svr4 assemblers. */
+
+#define INIT_SECTION_ASM_OP ".section\t.init"
+#define FINI_SECTION_ASM_OP ".section\t.fini"
+
+/* A default list of other sections which we might be "in" at any given
+ time. For targets that use additional sections (e.g. .tdesc) you
+ should override this definition in the target-specific file which
+ includes this file. */
+
+#undef EXTRA_SECTIONS
+#define EXTRA_SECTIONS in_const, in_ctors, in_dtors
+
+/* A default list of extra section function definitions. For targets
+ that use additional sections (e.g. .tdesc) you should override this
+ definition in the target-specific file which includes this file. */
+
+#undef EXTRA_SECTION_FUNCTIONS
+#define EXTRA_SECTION_FUNCTIONS \
+ CONST_SECTION_FUNCTION \
+ CTORS_SECTION_FUNCTION \
+ DTORS_SECTION_FUNCTION
+
+#undef READONLY_DATA_SECTION
+#define READONLY_DATA_SECTION() const_section ()
+
+extern void text_section ();
+
+#define CONST_SECTION_FUNCTION \
+void \
+const_section () \
+{ \
+ if (!USE_CONST_SECTION) \
+ text_section(); \
+ else if (in_section != in_const) \
+ { \
+ fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP); \
+ in_section = in_const; \
+ } \
+}
+
+#define CTORS_SECTION_FUNCTION \
+void \
+ctors_section () \
+{ \
+ if (in_section != in_ctors) \
+ { \
+ fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP); \
+ in_section = in_ctors; \
+ } \
+}
+
+#define DTORS_SECTION_FUNCTION \
+void \
+dtors_section () \
+{ \
+ if (in_section != in_dtors) \
+ { \
+ fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP); \
+ in_section = in_dtors; \
+ } \
+}
+
+/* Switch into a generic section.
+ This is currently only used to support section attributes.
+
+ We make the section read-only and executable for a function decl,
+ read-only for a const data decl, and writable for a non-const data decl. */
+#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC) \
+ fprintf (FILE, ".section\t%s,\"%s\",@progbits\n", NAME, \
+ (DECL) && TREE_CODE (DECL) == FUNCTION_DECL ? "ax" : \
+ (DECL) && DECL_READONLY_SECTION (DECL, RELOC) ? "a" : "aw")
+
+
+/* A C statement (sans semicolon) to output an element in the table of
+ global constructors. */
+#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
+ do { \
+ ctors_section (); \
+ fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
+ assemble_name (FILE, NAME); \
+ fprintf (FILE, "\n"); \
+ } while (0)
+
+/* A C statement (sans semicolon) to output an element in the table of
+ global destructors. */
+#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
+ do { \
+ dtors_section (); \
+ fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
+ assemble_name (FILE, NAME); \
+ fprintf (FILE, "\n"); \
+ } while (0)
+
+/* A C statement or statements to switch to the appropriate
+ section for output of DECL. DECL is either a `VAR_DECL' node
+ or a constant of some sort. RELOC indicates whether forming
+ the initial value of DECL requires link-time relocations. */
+
+#define SELECT_SECTION(DECL,RELOC) \
+{ \
+ if (TREE_CODE (DECL) == STRING_CST) \
+ { \
+ if (! flag_writable_strings) \
+ const_section (); \
+ else \
+ data_section (); \
+ } \
+ else if (TREE_CODE (DECL) == VAR_DECL) \
+ { \
+ if ((flag_pic && RELOC) \
+ || !TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL) \
+ || !DECL_INITIAL (DECL) \
+ || (DECL_INITIAL (DECL) != error_mark_node \
+ && !TREE_CONSTANT (DECL_INITIAL (DECL)))) \
+ data_section (); \
+ else \
+ const_section (); \
+ } \
+ else \
+ const_section (); \
+}
+
+/* A C statement or statements to switch to the appropriate
+ section for output of RTX in mode MODE. RTX is some kind
+ of constant in RTL. The argument MODE is redundant except
+ in the case of a `const_int' rtx. Currently, these always
+ go into the const section. */
+
+#undef SELECT_RTX_SECTION
+#define SELECT_RTX_SECTION(MODE,RTX) const_section()
+
+/* Define the strings used for the special svr4 .type and .size directives.
+ These strings generally do not vary from one system running svr4 to
+ another, but if a given system (e.g. m88k running svr) needs to use
+ different pseudo-op names for these, they may be overridden in the
+ file which includes this one. */
+
+#define TYPE_ASM_OP ".type"
+#define SIZE_ASM_OP ".size"
+
+/* This is how we tell the assembler that two symbols have the same value. */
+
+#define ASM_OUTPUT_DEF(FILE,NAME1,NAME2) \
+ do { assemble_name(FILE, NAME1); \
+ fputs(" = ", FILE); \
+ assemble_name(FILE, NAME2); \
+ fputc('\n', FILE); } while (0)
+
+/* A table of bytes codes used by the ASM_OUTPUT_ASCII and
+ ASM_OUTPUT_LIMITED_STRING macros. Each byte in the table
+ corresponds to a particular byte value [0..255]. For any
+ given byte value, if the value in the corresponding table
+ position is zero, the given character can be output directly.
+ If the table value is 1, the byte must be output as a \ooo
+ octal escape. If the tables value is anything else, then the
+ byte value should be output as a \ followed by the value
+ in the table. Note that we can use standard UN*X escape
+ sequences for many control characters, but we don't use
+ \a to represent BEL because some svr4 assemblers (e.g. on
+ the i386) don't know about that. Also, we don't use \v
+ since some versions of gas, such as 2.2 did not accept it. */
+
+#define ESCAPES \
+"\1\1\1\1\1\1\1\1btn\1fr\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\0\0\"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\\\0\0\0\
+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1"
+
+/* Some svr4 assemblers have a limit on the number of characters which
+ can appear in the operand of a .string directive. If your assembler
+ has such a limitation, you should define STRING_LIMIT to reflect that
+ limit. Note that at least some svr4 assemblers have a limit on the
+ actual number of bytes in the double-quoted string, and that they
+ count each character in an escape sequence as one byte. Thus, an
+ escape sequence like \377 would count as four bytes.
+
+ If your target assembler doesn't support the .string directive, you
+ should define this to zero.
+*/
+
+#define STRING_LIMIT ((unsigned) 256)
+
+#define STRING_ASM_OP ".string"
+
+/*
+ * We always use gas here, so we don't worry about ECOFF assembler problems.
+ */
+#undef TARGET_GAS
+#define TARGET_GAS (1)
+
+#undef PREFERRED_DEBUGGING_TYPE
+#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
diff --git a/lang/gcc41/files/patch-ad b/lang/gcc41/files/patch-ad
index f8fb5803acf0..bea070deb344 100644
--- a/lang/gcc41/files/patch-ad
+++ b/lang/gcc41/files/patch-ad
@@ -1,6 +1,41 @@
--- gcc/config/i386/freebsd-aout.h.orig Mon Mar 1 14:47:33 1999
-+++ gcc/config/i386/freebsd-aout.h Sat Mar 13 19:24:50 1999
-@@ -103,19 +103,18 @@
++++ gcc/config/i386/freebsd-aout.h Sat Mar 20 00:27:02 1999
+@@ -20,6 +20,10 @@
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
++
++/* Get generic FreeBSD definitions. */
++#include <freebsd.h>
++
+ /* This goes away when the math-emulator is fixed */
+ #define TARGET_CPU_DEFAULT 0400 /* TARGET_NO_FANCY_MATH_387 */
+
+@@ -35,7 +39,7 @@
+ #include "i386/perform.h"
+
+ #undef CPP_PREDEFINES
+-#define CPP_PREDEFINES "-Dunix -Di386 -D__FreeBSD__ -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)"
++#define CPP_PREDEFINES "-Di386 -Acpu(i386) -Amachine(i386)" CPP_FBSD_PREDEFINES
+
+ /* Like the default, except no -lg. */
+ #define LIB_SPEC "%{!shared:%{!pg:-lc}%{pg:-lc_p}}"
+@@ -85,14 +89,6 @@
+ necessary when compiling PIC code. */
+
+ #define JUMP_TABLES_IN_TEXT_SECTION 1
+-
+-/* Don't default to pcc-struct-return, because gcc is the only compiler, and
+- we want to retain compatibility with older gcc versions. */
+-#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
+
+ /* i386 freebsd still uses old binutils that don't insert nops by default
+ when the .align directive demands to insert extra space in the text
+@@ -103,19 +99,18 @@
/* Profiling routines, partially copied from i386/osfrose.h. */
@@ -23,7 +58,7 @@
fprintf (FILE, "\tcall mcount\n"); \
} \
}
-@@ -133,6 +132,7 @@
+@@ -133,6 +128,7 @@
#define TYPE_ASM_OP ".type"
#define SIZE_ASM_OP ".size"
@@ -31,7 +66,7 @@
/* The following macro defines the format used to output the second
operand of the .type assembler directive. Different svr4 assemblers
-@@ -142,6 +142,12 @@
+@@ -142,6 +138,12 @@
#define TYPE_OPERAND_FMT "@%s"
@@ -44,12 +79,34 @@
/* Write the extra assembler code needed to declare a function's result.
Most svr4 assemblers don't require any special declaration of the
result value, but there are exceptions. */
-@@ -243,6 +249,8 @@
- #define STARTFILE_SPEC \
+@@ -244,29 +246,4 @@
"%{shared:c++rt0.o%s} \
%{!shared:%{pg:gcrt0.o%s}%{!pg:%{static:scrt0.o%s}%{!static:crt0.o%s}}}"
-+
-+#define MD_STARTFILE_PREFIX "/usr/lib/aout/"
- /* This is defined when gcc is compiled in the BSD-directory-tree, and must
- * make up for the gap to all the stuff done in the GNU-makefiles.
+-/* This is defined when gcc is compiled in the BSD-directory-tree, and must
+- * make up for the gap to all the stuff done in the GNU-makefiles.
+- */
+-
+-#ifdef FREEBSD_NATIVE
+-
+-#define INCLUDE_DEFAULTS { \
+- { "/usr/include", 0, 0, 0 }, \
+- { "/usr/include/g++", "G++", 1, 1 }, \
+- { 0, 0, 0, 0} \
+- }
+-
+-#undef MD_EXEC_PREFIX
+-#define MD_EXEC_PREFIX "/usr/libexec/"
+-
+-#undef STANDARD_STARTFILE_PREFIX
+-#define STANDARD_STARTFILE_PREFIX "/usr/lib"
+-
+-#if 0 /* This is very wrong!!! */
+-#define DEFAULT_TARGET_MACHINE "i386-unknown-freebsd_1.0"
+-#define GPLUSPLUS_INCLUDE_DIR "/usr/local/lib/gcc-lib/i386-unknown-freebsd_1.0/2.5.8/include"
+-#define TOOL_INCLUDE_DIR "/usr/local/i386-unknown-freebsd_1.0/include"
+-#define GCC_INCLUDE_DIR "/usr/local/lib/gcc-lib/i386-unknown-freebsd_1.0/2.5.8/include"
+-#endif
+-
+-#endif /* FREEBSD_NATIVE */
++#define MD_STARTFILE_PREFIX "/usr/lib/aout/"
diff --git a/lang/gcc41/files/patch-af b/lang/gcc41/files/patch-af
index c50ce06c8375..c1f1ba0e855f 100644
--- a/lang/gcc41/files/patch-af
+++ b/lang/gcc41/files/patch-af
@@ -1,6 +1,30 @@
--- gcc/config/i386/freebsd.h.orig Mon Mar 1 14:47:32 1999
-+++ gcc/config/i386/freebsd.h Sat Mar 13 19:25:53 1999
-@@ -113,22 +113,19 @@
++++ gcc/config/i386/freebsd.h Sun Mar 21 16:58:39 1999
+@@ -21,19 +21,13 @@
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
++
++/* Get generic FreeBSD definitions. */
++#include <freebsd.h>
++
+ #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
+-
+ /* This is how to output an element of a case-vector that is relative.
+ This is only used for PIC code. See comments by the `casesi' insn in
+ i386.md for an explanation of the expression this outputs. */
+@@ -113,22 +107,19 @@
: ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \
: (-1))
@@ -27,8 +51,18 @@
} \
}
-@@ -151,20 +148,8 @@
- #define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
+@@ -145,26 +136,16 @@
+ #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)"
++#define CPP_PREDEFINES "-Di386 -D__ELF__ -Acpu(i386) -Amachine(i386)" CPP_FBSD_PREDEFINES
+
+ #undef CPP_SPEC
+-#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
++#define CPP_SPEC \
++ "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE} %{m486:-D__i486__}"
++ /* %{pthread:-D_REENTRANT} */
#undef LIB_SPEC
-#if 1
@@ -36,16 +70,16 @@
- * want to profile or debug the C library, please add
- * -lc_p or -ggdb to LDFLAGS at the link time, respectively.
- */
- #define LIB_SPEC \
+-#define LIB_SPEC \
- "%{!shared: %{mieee-fp:-lieee} %{p:-lgmon} %{pg:-lgmon} \
- %{!ggdb:-lc} %{ggdb:-lg}}"
-#else
--#define LIB_SPEC \
+ #define LIB_SPEC \
- "%{!shared: \
- %{mieee-fp:-lieee} %{p:-lgmon -lc_p} %{pg:-lgmon -lc_p} \
- %{!p:%{!pg:%{!g*:-lc} %{g*:-lg}}}}"
-#endif
-+ "%{!shared: %{p:-lc_p} %{pg:-lc_p} %{!p:%{!pg:-lc}}}"
++ "%{!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
diff --git a/lang/gcc41/files/patch-ak b/lang/gcc41/files/patch-ak
index 19a2994f3f05..2e54beea1a61 100644
--- a/lang/gcc41/files/patch-ak
+++ b/lang/gcc41/files/patch-ak
@@ -1,5 +1,5 @@
---- gcc/configure.orig Mon Mar 8 10:06:10 1999
-+++ gcc/configure Sat Mar 13 19:08:06 1999
+--- gcc/configure.orig Sun Mar 14 02:59:02 1999
++++ gcc/configure Sat Mar 20 00:40:05 1999
@@ -2395,6 +2395,15 @@
thread_file='posix'
fi
@@ -27,18 +27,20 @@
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
- extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
+- tmake_file=i386/t-freebsd
- gas=yes
- gnu_ld=yes
- stabs=yes
++ tmake_file=t-freebsd
;;
i[34567]86-*-freebsd*)
- tm_file=i386/freebsd.h
+ tm_file="i386/i386.h i386/att.h linux.h i386/freebsd.h i386/perform.h"
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
+- tmake_file=i386/t-freebsd
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
++ tmake_file=t-freebsd
+ gas=yes
+ gnu_ld=yes
+ stabs=yes
diff --git a/lang/gcc41/files/patch-al b/lang/gcc41/files/patch-al
index 51e1b8cdee1c..c8a195127ed0 100644
--- a/lang/gcc41/files/patch-al
+++ b/lang/gcc41/files/patch-al
@@ -1,5 +1,5 @@
--- gcc/configure.in.orig Sun Mar 7 16:22:22 1999
-+++ gcc/configure.in Sat Mar 13 19:23:23 1999
++++ gcc/configure.in Sat Mar 20 00:40:58 1999
@@ -416,6 +416,15 @@
thread_file='posix'
fi
@@ -27,18 +27,20 @@
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
- extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
+- tmake_file=i386/t-freebsd
- gas=yes
- gnu_ld=yes
- stabs=yes
++ tmake_file=t-freebsd
;;
i[[34567]]86-*-freebsd*)
- tm_file=i386/freebsd.h
+ tm_file="i386/i386.h i386/att.h linux.h i386/freebsd.h i386/perform.h"
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
+- tmake_file=i386/t-freebsd
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
++ tmake_file=t-freebsd
+ gas=yes
+ gnu_ld=yes
+ stabs=yes
diff --git a/lang/gcc42/Makefile b/lang/gcc42/Makefile
index f9347a47d87e..cd5b039f398a 100644
--- a/lang/gcc42/Makefile
+++ b/lang/gcc42/Makefile
@@ -4,7 +4,7 @@
# Date created: 9 Jan 1998
# Whom: John Polstra <jdp@polstra.com>
#
-# $Id: Makefile,v 1.48 1999/03/08 07:28:27 asami Exp $
+# $Id: Makefile,v 1.50 1999/03/17 00:40:25 obrien Exp $
#
DISTNAME= egcs-1.1.2
@@ -55,21 +55,20 @@ ALL_TARGET= bootstrap
MAN1= cccp.1 g++.1 g77.1 gcc.1
pre-patch:
+ @${MV} ${WRKSRC}/gcc/config/i386/t-freebsd ${WRKSRC}/gcc/config/
@${MV} ${WRKSRC}/gcc/config/i386/freebsd.h ${WRKSRC}/gcc/config/i386/freebsd-aout.h
@${MV} ${WRKSRC}/gcc/config/i386/freebsd-elf.h ${WRKSRC}/gcc/config/i386/freebsd.h
+ @${CP} ${FILESDIR}/alpha-freebsd-elf.h ${WRKSRC}/gcc/config/alpha/freebsd-elf.h
+ @${CP} ${FILESDIR}/alpha-freebsd.h ${WRKSRC}/gcc/config/alpha/freebsd.h
pre-configure:
@# Keep from running `autoconf' and `autoheader' since we modified
@# configure.in by patching it.
@touch ${WRKSRC}/gcc/configure
@touch ${WRKSRC}/gcc/cstamp-h.in
- @(cd ${WRKSRC}/gcc/config/${ARCH}/ ; \
- MAJ=`sysctl -n kern.osreldate | ${SED} -e '/.....$$/s///'` ; \
- ${MV} freebsd-aout.h freebsd-aout.h.in ; \
- ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" freebsd-aout.h.in \
- >freebsd-aout.h ; \
- ${MV} freebsd.h freebsd.h.in ; \
- ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" freebsd.h.in >freebsd.h )
+ @(MAJ=`sysctl -n kern.osreldate | ${SED} -e '/.....$$/s///'` ; \
+ ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" ${FILESDIR}/freebsd.h \
+ >${WRKSRC}/gcc/config/freebsd.h )
.if ${PORTOBJFORMAT} == "elf" && ${MACHINE_ARCH} == "i386"
@${SED} -e 's/^@comment ELF-only://' ${PKGDIR}/PLIST >${PLIST}
.endif
diff --git a/lang/gcc42/files/alpha-freebsd.h b/lang/gcc42/files/alpha-freebsd.h
new file mode 100644
index 000000000000..60a1f07b94ba
--- /dev/null
+++ b/lang/gcc42/files/alpha-freebsd.h
@@ -0,0 +1,443 @@
+/* Definitions of target machine for GNU compiler,
+ for Alpha FreeBSD systems.
+ Copyright (C) 1998 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* This is used on Alpha platforms that use the ELF format.
+ This was taken from the NetBSD configuration, and modified
+ for FreeBSD/alpha by Hidetoshi Shimokawa <simokawa@FreeBSD.ORG> */
+
+
+/* Get generic FreeBSD definitions. */
+#include <freebsd.h>
+
+
+#undef OBJECT_FORMAT_COFF
+#undef EXTENDED_COFF
+#define OBJECT_FORMAT_ELF
+
+/* This is BSD, so it wants DBX format. */
+
+#define DBX_DEBUGGING_INFO
+
+/* This is the char to use for continuation (in case we need to turn
+ continuation back on). */
+
+#define DBX_CONTIN_CHAR '?'
+
+#undef ASM_FINAL_SPEC
+
+/* Names to predefine in the preprocessor for this target machine.
+ XXX FreeBSD, by convention, shouldn't do __alpha, but lots of applications
+ expect it because that's what OSF/1 does. */
+
+#undef TARGET_DEFAULT
+#define TARGET_DEFAULT (MASK_FP | MASK_FPREGS | MASK_GAS)
+
+#undef CPP_PREDEFINES
+#define CPP_PREDEFINES "\
+-D__alpha__ -D__alpha -Acpu(alpha) -Amachine(alpha) " \
+FBSD_CPP_PREDEFINES \
+SUB_CPP_PREDEFINES
+
+/* Make gcc agree with <machine/ansi.h> */
+
+#undef WCHAR_TYPE
+#define WCHAR_TYPE "int"
+
+#undef WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE 32
+
+/* Output assembler code to FILE to increment profiler label # LABELNO
+ for profiling a function entry. Under FreeBSD/Alpha, the assembler does
+ nothing special with -pg. */
+
+#undef FUNCTION_PROFILER
+#define FUNCTION_PROFILER(FILE, LABELNO) \
+ fputs ("\tjsr $28,_mcount\n", (FILE))
+
+/* Show that we need a GP when profiling. */
+#define TARGET_PROFILING_NEEDS_GP
+
+#undef HAS_INIT_SECTION
+
+/* Provide an ASM_SPEC appropriate for a FreeBSD/alpha target. This differs
+ from the generic FreeBSD ASM_SPEC in that no special handling of PIC is
+ necessary on the Alpha. */
+
+#undef ASM_SPEC
+#define ASM_SPEC " %| %{mcpu=*:-m%*}"
+
+/* Output at beginning of assembler file. */
+
+#undef ASM_FILE_START
+#define ASM_FILE_START(FILE) \
+{ \
+ alpha_write_verstamp (FILE); \
+ output_file_directive (FILE, main_input_filename); \
+ fprintf (FILE, "\t.version\t\"01.01\"\n"); \
+ fprintf (FILE, "\t.set noat\n"); \
+}
+
+#define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE) \
+ alpha_output_lineno (STREAM, LINE)
+extern void alpha_output_lineno ();
+
+extern void output_file_directive ();
+
+/* 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. */
+
+#define IDENT_ASM_OP ".ident"
+
+#ifdef IDENTIFY_WITH_IDENT
+#define ASM_IDENTIFY_GCC(FILE) /* nothing */
+#define ASM_IDENTIFY_LANGUAGE(FILE) \
+ fprintf(FILE, "\t%s \"GCC (%s) %s\"\n", IDENT_ASM_OP, \
+ lang_identify(), version_string)
+#else
+#define ASM_FILE_END(FILE) \
+do { \
+ fprintf ((FILE), "\t%s\t\"GCC: (GNU) %s\"\n", \
+ IDENT_ASM_OP, version_string); \
+ } while (0)
+#endif
+
+/* Allow #sccs in preprocessor. */
+
+#define SCCS_DIRECTIVE
+
+/* Output #ident as a .ident. */
+
+#define ASM_OUTPUT_IDENT(FILE, NAME) \
+ fprintf (FILE, "\t%s\t\"%s\"\n", IDENT_ASM_OP, NAME);
+
+/* This is how to allocate empty space in some section. The .zero
+ pseudo-op is used for this on most svr4 assemblers. */
+
+#define SKIP_ASM_OP ".zero"
+
+#undef ASM_OUTPUT_SKIP
+#define ASM_OUTPUT_SKIP(FILE,SIZE) \
+ fprintf (FILE, "\t%s\t%u\n", SKIP_ASM_OP, (SIZE))
+
+/* Output the label which precedes a jumptable. Note that for all svr4
+ systems where we actually generate jumptables (which is to say every
+ svr4 target except i386, where we use casesi instead) we put the jump-
+ tables into the .rodata section and since other stuff could have been
+ put into the .rodata section prior to any given jumptable, we have to
+ make sure that the location counter for the .rodata section gets pro-
+ perly re-aligned prior to the actual beginning of the jump table. */
+
+#define ALIGN_ASM_OP ".align"
+
+#ifndef ASM_OUTPUT_BEFORE_CASE_LABEL
+#define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE,PREFIX,NUM,TABLE) \
+ ASM_OUTPUT_ALIGN ((FILE), 2);
+#endif
+
+#undef ASM_OUTPUT_CASE_LABEL
+#define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,JUMPTABLE) \
+ do { \
+ ASM_OUTPUT_BEFORE_CASE_LABEL (FILE, PREFIX, NUM, JUMPTABLE) \
+ ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); \
+ } while (0)
+
+/* The standard SVR4 assembler seems to require that certain builtin
+ library routines (e.g. .udiv) be explicitly declared as .globl
+ in each assembly file where they are referenced. */
+
+#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
+ ASM_GLOBALIZE_LABEL (FILE, XSTR (FUN, 0))
+
+/* This says how to output assembler code to declare an
+ uninitialized external linkage data object. Under SVR4,
+ the linker seems to want the alignment of data objects
+ to depend on their types. We do exactly that here. */
+
+#define COMMON_ASM_OP ".comm"
+
+#undef ASM_OUTPUT_ALIGNED_COMMON
+#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
+do { \
+ fprintf ((FILE), "\t%s\t", COMMON_ASM_OP); \
+ assemble_name ((FILE), (NAME)); \
+ fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \
+} while (0)
+
+/* This says how to output assembler code to declare an
+ uninitialized internal linkage data object. Under SVR4,
+ the linker seems to want the alignment of data objects
+ to depend on their types. We do exactly that here. */
+
+#define LOCAL_ASM_OP ".local"
+
+#undef ASM_OUTPUT_ALIGNED_LOCAL
+#define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
+do { \
+ fprintf ((FILE), "\t%s\t", LOCAL_ASM_OP); \
+ assemble_name ((FILE), (NAME)); \
+ fprintf ((FILE), "\n"); \
+ ASM_OUTPUT_ALIGNED_COMMON (FILE, NAME, SIZE, ALIGN); \
+} while (0)
+
+/* This is the pseudo-op used to generate a 64-bit word of data with a
+ specific value in some section. */
+
+#define INT_ASM_OP ".quad"
+
+/* This is the pseudo-op used to generate a contiguous sequence of byte
+ values from a double-quoted string WITHOUT HAVING A TERMINATING NUL
+ AUTOMATICALLY APPENDED. This is the same for most svr4 assemblers. */
+
+#undef ASCII_DATA_ASM_OP
+#define ASCII_DATA_ASM_OP ".ascii"
+
+/* Support const sections and the ctors and dtors sections for g++.
+ Note that there appears to be two different ways to support const
+ sections at the moment. You can either #define the symbol
+ READONLY_DATA_SECTION (giving it some code which switches to the
+ readonly data section) or else you can #define the symbols
+ EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, SELECT_SECTION, and
+ SELECT_RTX_SECTION. We do both here just to be on the safe side. */
+
+#define USE_CONST_SECTION 1
+
+#define CONST_SECTION_ASM_OP ".section\t.rodata"
+
+/* Define the pseudo-ops used to switch to the .ctors and .dtors sections.
+
+ Note that we want to give these sections the SHF_WRITE attribute
+ because these sections will actually contain data (i.e. tables of
+ addresses of functions in the current root executable or shared library
+ file) and, in the case of a shared library, the relocatable addresses
+ will have to be properly resolved/relocated (and then written into) by
+ the dynamic linker when it actually attaches the given shared library
+ to the executing process. (Note that on SVR4, you may wish to use the
+ `-z text' option to the ELF linker, when building a shared library, as
+ an additional check that you are doing everything right. But if you do
+ use the `-z text' option when building a shared library, you will get
+ errors unless the .ctors and .dtors sections are marked as writable
+ via the SHF_WRITE attribute.) */
+
+#define CTORS_SECTION_ASM_OP ".section\t.ctors,\"aw\""
+#define DTORS_SECTION_ASM_OP ".section\t.dtors,\"aw\""
+
+/* On svr4, we *do* have support for the .init and .fini sections, and we
+ can put stuff in there to be executed before and after `main'. We let
+ crtstuff.c and other files know this by defining the following symbols.
+ The definitions say how to change sections to the .init and .fini
+ sections. This is the same for all known svr4 assemblers. */
+
+#define INIT_SECTION_ASM_OP ".section\t.init"
+#define FINI_SECTION_ASM_OP ".section\t.fini"
+
+/* A default list of other sections which we might be "in" at any given
+ time. For targets that use additional sections (e.g. .tdesc) you
+ should override this definition in the target-specific file which
+ includes this file. */
+
+#undef EXTRA_SECTIONS
+#define EXTRA_SECTIONS in_const, in_ctors, in_dtors
+
+/* A default list of extra section function definitions. For targets
+ that use additional sections (e.g. .tdesc) you should override this
+ definition in the target-specific file which includes this file. */
+
+#undef EXTRA_SECTION_FUNCTIONS
+#define EXTRA_SECTION_FUNCTIONS \
+ CONST_SECTION_FUNCTION \
+ CTORS_SECTION_FUNCTION \
+ DTORS_SECTION_FUNCTION
+
+#undef READONLY_DATA_SECTION
+#define READONLY_DATA_SECTION() const_section ()
+
+extern void text_section ();
+
+#define CONST_SECTION_FUNCTION \
+void \
+const_section () \
+{ \
+ if (!USE_CONST_SECTION) \
+ text_section(); \
+ else if (in_section != in_const) \
+ { \
+ fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP); \
+ in_section = in_const; \
+ } \
+}
+
+#define CTORS_SECTION_FUNCTION \
+void \
+ctors_section () \
+{ \
+ if (in_section != in_ctors) \
+ { \
+ fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP); \
+ in_section = in_ctors; \
+ } \
+}
+
+#define DTORS_SECTION_FUNCTION \
+void \
+dtors_section () \
+{ \
+ if (in_section != in_dtors) \
+ { \
+ fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP); \
+ in_section = in_dtors; \
+ } \
+}
+
+/* Switch into a generic section.
+ This is currently only used to support section attributes.
+
+ We make the section read-only and executable for a function decl,
+ read-only for a const data decl, and writable for a non-const data decl. */
+#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC) \
+ fprintf (FILE, ".section\t%s,\"%s\",@progbits\n", NAME, \
+ (DECL) && TREE_CODE (DECL) == FUNCTION_DECL ? "ax" : \
+ (DECL) && DECL_READONLY_SECTION (DECL, RELOC) ? "a" : "aw")
+
+
+/* A C statement (sans semicolon) to output an element in the table of
+ global constructors. */
+#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
+ do { \
+ ctors_section (); \
+ fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
+ assemble_name (FILE, NAME); \
+ fprintf (FILE, "\n"); \
+ } while (0)
+
+/* A C statement (sans semicolon) to output an element in the table of
+ global destructors. */
+#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
+ do { \
+ dtors_section (); \
+ fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
+ assemble_name (FILE, NAME); \
+ fprintf (FILE, "\n"); \
+ } while (0)
+
+/* A C statement or statements to switch to the appropriate
+ section for output of DECL. DECL is either a `VAR_DECL' node
+ or a constant of some sort. RELOC indicates whether forming
+ the initial value of DECL requires link-time relocations. */
+
+#define SELECT_SECTION(DECL,RELOC) \
+{ \
+ if (TREE_CODE (DECL) == STRING_CST) \
+ { \
+ if (! flag_writable_strings) \
+ const_section (); \
+ else \
+ data_section (); \
+ } \
+ else if (TREE_CODE (DECL) == VAR_DECL) \
+ { \
+ if ((flag_pic && RELOC) \
+ || !TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL) \
+ || !DECL_INITIAL (DECL) \
+ || (DECL_INITIAL (DECL) != error_mark_node \
+ && !TREE_CONSTANT (DECL_INITIAL (DECL)))) \
+ data_section (); \
+ else \
+ const_section (); \
+ } \
+ else \
+ const_section (); \
+}
+
+/* A C statement or statements to switch to the appropriate
+ section for output of RTX in mode MODE. RTX is some kind
+ of constant in RTL. The argument MODE is redundant except
+ in the case of a `const_int' rtx. Currently, these always
+ go into the const section. */
+
+#undef SELECT_RTX_SECTION
+#define SELECT_RTX_SECTION(MODE,RTX) const_section()
+
+/* Define the strings used for the special svr4 .type and .size directives.
+ These strings generally do not vary from one system running svr4 to
+ another, but if a given system (e.g. m88k running svr) needs to use
+ different pseudo-op names for these, they may be overridden in the
+ file which includes this one. */
+
+#define TYPE_ASM_OP ".type"
+#define SIZE_ASM_OP ".size"
+
+/* This is how we tell the assembler that two symbols have the same value. */
+
+#define ASM_OUTPUT_DEF(FILE,NAME1,NAME2) \
+ do { assemble_name(FILE, NAME1); \
+ fputs(" = ", FILE); \
+ assemble_name(FILE, NAME2); \
+ fputc('\n', FILE); } while (0)
+
+/* A table of bytes codes used by the ASM_OUTPUT_ASCII and
+ ASM_OUTPUT_LIMITED_STRING macros. Each byte in the table
+ corresponds to a particular byte value [0..255]. For any
+ given byte value, if the value in the corresponding table
+ position is zero, the given character can be output directly.
+ If the table value is 1, the byte must be output as a \ooo
+ octal escape. If the tables value is anything else, then the
+ byte value should be output as a \ followed by the value
+ in the table. Note that we can use standard UN*X escape
+ sequences for many control characters, but we don't use
+ \a to represent BEL because some svr4 assemblers (e.g. on
+ the i386) don't know about that. Also, we don't use \v
+ since some versions of gas, such as 2.2 did not accept it. */
+
+#define ESCAPES \
+"\1\1\1\1\1\1\1\1btn\1fr\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\0\0\"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\\\0\0\0\
+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1"
+
+/* Some svr4 assemblers have a limit on the number of characters which
+ can appear in the operand of a .string directive. If your assembler
+ has such a limitation, you should define STRING_LIMIT to reflect that
+ limit. Note that at least some svr4 assemblers have a limit on the
+ actual number of bytes in the double-quoted string, and that they
+ count each character in an escape sequence as one byte. Thus, an
+ escape sequence like \377 would count as four bytes.
+
+ If your target assembler doesn't support the .string directive, you
+ should define this to zero.
+*/
+
+#define STRING_LIMIT ((unsigned) 256)
+
+#define STRING_ASM_OP ".string"
+
+/*
+ * We always use gas here, so we don't worry about ECOFF assembler problems.
+ */
+#undef TARGET_GAS
+#define TARGET_GAS (1)
+
+#undef PREFERRED_DEBUGGING_TYPE
+#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
diff --git a/lang/gcc42/files/patch-ad b/lang/gcc42/files/patch-ad
index f8fb5803acf0..bea070deb344 100644
--- a/lang/gcc42/files/patch-ad
+++ b/lang/gcc42/files/patch-ad
@@ -1,6 +1,41 @@
--- gcc/config/i386/freebsd-aout.h.orig Mon Mar 1 14:47:33 1999
-+++ gcc/config/i386/freebsd-aout.h Sat Mar 13 19:24:50 1999
-@@ -103,19 +103,18 @@
++++ gcc/config/i386/freebsd-aout.h Sat Mar 20 00:27:02 1999
+@@ -20,6 +20,10 @@
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
++
++/* Get generic FreeBSD definitions. */
++#include <freebsd.h>
++
+ /* This goes away when the math-emulator is fixed */
+ #define TARGET_CPU_DEFAULT 0400 /* TARGET_NO_FANCY_MATH_387 */
+
+@@ -35,7 +39,7 @@
+ #include "i386/perform.h"
+
+ #undef CPP_PREDEFINES
+-#define CPP_PREDEFINES "-Dunix -Di386 -D__FreeBSD__ -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)"
++#define CPP_PREDEFINES "-Di386 -Acpu(i386) -Amachine(i386)" CPP_FBSD_PREDEFINES
+
+ /* Like the default, except no -lg. */
+ #define LIB_SPEC "%{!shared:%{!pg:-lc}%{pg:-lc_p}}"
+@@ -85,14 +89,6 @@
+ necessary when compiling PIC code. */
+
+ #define JUMP_TABLES_IN_TEXT_SECTION 1
+-
+-/* Don't default to pcc-struct-return, because gcc is the only compiler, and
+- we want to retain compatibility with older gcc versions. */
+-#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
+
+ /* i386 freebsd still uses old binutils that don't insert nops by default
+ when the .align directive demands to insert extra space in the text
+@@ -103,19 +99,18 @@
/* Profiling routines, partially copied from i386/osfrose.h. */
@@ -23,7 +58,7 @@
fprintf (FILE, "\tcall mcount\n"); \
} \
}
-@@ -133,6 +132,7 @@
+@@ -133,6 +128,7 @@
#define TYPE_ASM_OP ".type"
#define SIZE_ASM_OP ".size"
@@ -31,7 +66,7 @@
/* The following macro defines the format used to output the second
operand of the .type assembler directive. Different svr4 assemblers
-@@ -142,6 +142,12 @@
+@@ -142,6 +138,12 @@
#define TYPE_OPERAND_FMT "@%s"
@@ -44,12 +79,34 @@
/* Write the extra assembler code needed to declare a function's result.
Most svr4 assemblers don't require any special declaration of the
result value, but there are exceptions. */
-@@ -243,6 +249,8 @@
- #define STARTFILE_SPEC \
+@@ -244,29 +246,4 @@
"%{shared:c++rt0.o%s} \
%{!shared:%{pg:gcrt0.o%s}%{!pg:%{static:scrt0.o%s}%{!static:crt0.o%s}}}"
-+
-+#define MD_STARTFILE_PREFIX "/usr/lib/aout/"
- /* This is defined when gcc is compiled in the BSD-directory-tree, and must
- * make up for the gap to all the stuff done in the GNU-makefiles.
+-/* This is defined when gcc is compiled in the BSD-directory-tree, and must
+- * make up for the gap to all the stuff done in the GNU-makefiles.
+- */
+-
+-#ifdef FREEBSD_NATIVE
+-
+-#define INCLUDE_DEFAULTS { \
+- { "/usr/include", 0, 0, 0 }, \
+- { "/usr/include/g++", "G++", 1, 1 }, \
+- { 0, 0, 0, 0} \
+- }
+-
+-#undef MD_EXEC_PREFIX
+-#define MD_EXEC_PREFIX "/usr/libexec/"
+-
+-#undef STANDARD_STARTFILE_PREFIX
+-#define STANDARD_STARTFILE_PREFIX "/usr/lib"
+-
+-#if 0 /* This is very wrong!!! */
+-#define DEFAULT_TARGET_MACHINE "i386-unknown-freebsd_1.0"
+-#define GPLUSPLUS_INCLUDE_DIR "/usr/local/lib/gcc-lib/i386-unknown-freebsd_1.0/2.5.8/include"
+-#define TOOL_INCLUDE_DIR "/usr/local/i386-unknown-freebsd_1.0/include"
+-#define GCC_INCLUDE_DIR "/usr/local/lib/gcc-lib/i386-unknown-freebsd_1.0/2.5.8/include"
+-#endif
+-
+-#endif /* FREEBSD_NATIVE */
++#define MD_STARTFILE_PREFIX "/usr/lib/aout/"
diff --git a/lang/gcc42/files/patch-af b/lang/gcc42/files/patch-af
index c50ce06c8375..c1f1ba0e855f 100644
--- a/lang/gcc42/files/patch-af
+++ b/lang/gcc42/files/patch-af
@@ -1,6 +1,30 @@
--- gcc/config/i386/freebsd.h.orig Mon Mar 1 14:47:32 1999
-+++ gcc/config/i386/freebsd.h Sat Mar 13 19:25:53 1999
-@@ -113,22 +113,19 @@
++++ gcc/config/i386/freebsd.h Sun Mar 21 16:58:39 1999
+@@ -21,19 +21,13 @@
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
++
++/* Get generic FreeBSD definitions. */
++#include <freebsd.h>
++
+ #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
+-
+ /* This is how to output an element of a case-vector that is relative.
+ This is only used for PIC code. See comments by the `casesi' insn in
+ i386.md for an explanation of the expression this outputs. */
+@@ -113,22 +107,19 @@
: ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \
: (-1))
@@ -27,8 +51,18 @@
} \
}
-@@ -151,20 +148,8 @@
- #define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
+@@ -145,26 +136,16 @@
+ #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)"
++#define CPP_PREDEFINES "-Di386 -D__ELF__ -Acpu(i386) -Amachine(i386)" CPP_FBSD_PREDEFINES
+
+ #undef CPP_SPEC
+-#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
++#define CPP_SPEC \
++ "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE} %{m486:-D__i486__}"
++ /* %{pthread:-D_REENTRANT} */
#undef LIB_SPEC
-#if 1
@@ -36,16 +70,16 @@
- * want to profile or debug the C library, please add
- * -lc_p or -ggdb to LDFLAGS at the link time, respectively.
- */
- #define LIB_SPEC \
+-#define LIB_SPEC \
- "%{!shared: %{mieee-fp:-lieee} %{p:-lgmon} %{pg:-lgmon} \
- %{!ggdb:-lc} %{ggdb:-lg}}"
-#else
--#define LIB_SPEC \
+ #define LIB_SPEC \
- "%{!shared: \
- %{mieee-fp:-lieee} %{p:-lgmon -lc_p} %{pg:-lgmon -lc_p} \
- %{!p:%{!pg:%{!g*:-lc} %{g*:-lg}}}}"
-#endif
-+ "%{!shared: %{p:-lc_p} %{pg:-lc_p} %{!p:%{!pg:-lc}}}"
++ "%{!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
diff --git a/lang/gcc42/files/patch-ak b/lang/gcc42/files/patch-ak
index 19a2994f3f05..2e54beea1a61 100644
--- a/lang/gcc42/files/patch-ak
+++ b/lang/gcc42/files/patch-ak
@@ -1,5 +1,5 @@
---- gcc/configure.orig Mon Mar 8 10:06:10 1999
-+++ gcc/configure Sat Mar 13 19:08:06 1999
+--- gcc/configure.orig Sun Mar 14 02:59:02 1999
++++ gcc/configure Sat Mar 20 00:40:05 1999
@@ -2395,6 +2395,15 @@
thread_file='posix'
fi
@@ -27,18 +27,20 @@
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
- extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
+- tmake_file=i386/t-freebsd
- gas=yes
- gnu_ld=yes
- stabs=yes
++ tmake_file=t-freebsd
;;
i[34567]86-*-freebsd*)
- tm_file=i386/freebsd.h
+ tm_file="i386/i386.h i386/att.h linux.h i386/freebsd.h i386/perform.h"
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
+- tmake_file=i386/t-freebsd
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
++ tmake_file=t-freebsd
+ gas=yes
+ gnu_ld=yes
+ stabs=yes
diff --git a/lang/gcc42/files/patch-al b/lang/gcc42/files/patch-al
index 51e1b8cdee1c..c8a195127ed0 100644
--- a/lang/gcc42/files/patch-al
+++ b/lang/gcc42/files/patch-al
@@ -1,5 +1,5 @@
--- gcc/configure.in.orig Sun Mar 7 16:22:22 1999
-+++ gcc/configure.in Sat Mar 13 19:23:23 1999
++++ gcc/configure.in Sat Mar 20 00:40:58 1999
@@ -416,6 +416,15 @@
thread_file='posix'
fi
@@ -27,18 +27,20 @@
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
- extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
+- tmake_file=i386/t-freebsd
- gas=yes
- gnu_ld=yes
- stabs=yes
++ tmake_file=t-freebsd
;;
i[[34567]]86-*-freebsd*)
- tm_file=i386/freebsd.h
+ tm_file="i386/i386.h i386/att.h linux.h i386/freebsd.h i386/perform.h"
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
+- tmake_file=i386/t-freebsd
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
++ tmake_file=t-freebsd
+ gas=yes
+ gnu_ld=yes
+ stabs=yes
diff --git a/lang/gcc43/Makefile b/lang/gcc43/Makefile
index f9347a47d87e..cd5b039f398a 100644
--- a/lang/gcc43/Makefile
+++ b/lang/gcc43/Makefile
@@ -4,7 +4,7 @@
# Date created: 9 Jan 1998
# Whom: John Polstra <jdp@polstra.com>
#
-# $Id: Makefile,v 1.48 1999/03/08 07:28:27 asami Exp $
+# $Id: Makefile,v 1.50 1999/03/17 00:40:25 obrien Exp $
#
DISTNAME= egcs-1.1.2
@@ -55,21 +55,20 @@ ALL_TARGET= bootstrap
MAN1= cccp.1 g++.1 g77.1 gcc.1
pre-patch:
+ @${MV} ${WRKSRC}/gcc/config/i386/t-freebsd ${WRKSRC}/gcc/config/
@${MV} ${WRKSRC}/gcc/config/i386/freebsd.h ${WRKSRC}/gcc/config/i386/freebsd-aout.h
@${MV} ${WRKSRC}/gcc/config/i386/freebsd-elf.h ${WRKSRC}/gcc/config/i386/freebsd.h
+ @${CP} ${FILESDIR}/alpha-freebsd-elf.h ${WRKSRC}/gcc/config/alpha/freebsd-elf.h
+ @${CP} ${FILESDIR}/alpha-freebsd.h ${WRKSRC}/gcc/config/alpha/freebsd.h
pre-configure:
@# Keep from running `autoconf' and `autoheader' since we modified
@# configure.in by patching it.
@touch ${WRKSRC}/gcc/configure
@touch ${WRKSRC}/gcc/cstamp-h.in
- @(cd ${WRKSRC}/gcc/config/${ARCH}/ ; \
- MAJ=`sysctl -n kern.osreldate | ${SED} -e '/.....$$/s///'` ; \
- ${MV} freebsd-aout.h freebsd-aout.h.in ; \
- ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" freebsd-aout.h.in \
- >freebsd-aout.h ; \
- ${MV} freebsd.h freebsd.h.in ; \
- ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" freebsd.h.in >freebsd.h )
+ @(MAJ=`sysctl -n kern.osreldate | ${SED} -e '/.....$$/s///'` ; \
+ ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" ${FILESDIR}/freebsd.h \
+ >${WRKSRC}/gcc/config/freebsd.h )
.if ${PORTOBJFORMAT} == "elf" && ${MACHINE_ARCH} == "i386"
@${SED} -e 's/^@comment ELF-only://' ${PKGDIR}/PLIST >${PLIST}
.endif
diff --git a/lang/gcc43/files/alpha-freebsd.h b/lang/gcc43/files/alpha-freebsd.h
new file mode 100644
index 000000000000..60a1f07b94ba
--- /dev/null
+++ b/lang/gcc43/files/alpha-freebsd.h
@@ -0,0 +1,443 @@
+/* Definitions of target machine for GNU compiler,
+ for Alpha FreeBSD systems.
+ Copyright (C) 1998 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* This is used on Alpha platforms that use the ELF format.
+ This was taken from the NetBSD configuration, and modified
+ for FreeBSD/alpha by Hidetoshi Shimokawa <simokawa@FreeBSD.ORG> */
+
+
+/* Get generic FreeBSD definitions. */
+#include <freebsd.h>
+
+
+#undef OBJECT_FORMAT_COFF
+#undef EXTENDED_COFF
+#define OBJECT_FORMAT_ELF
+
+/* This is BSD, so it wants DBX format. */
+
+#define DBX_DEBUGGING_INFO
+
+/* This is the char to use for continuation (in case we need to turn
+ continuation back on). */
+
+#define DBX_CONTIN_CHAR '?'
+
+#undef ASM_FINAL_SPEC
+
+/* Names to predefine in the preprocessor for this target machine.
+ XXX FreeBSD, by convention, shouldn't do __alpha, but lots of applications
+ expect it because that's what OSF/1 does. */
+
+#undef TARGET_DEFAULT
+#define TARGET_DEFAULT (MASK_FP | MASK_FPREGS | MASK_GAS)
+
+#undef CPP_PREDEFINES
+#define CPP_PREDEFINES "\
+-D__alpha__ -D__alpha -Acpu(alpha) -Amachine(alpha) " \
+FBSD_CPP_PREDEFINES \
+SUB_CPP_PREDEFINES
+
+/* Make gcc agree with <machine/ansi.h> */
+
+#undef WCHAR_TYPE
+#define WCHAR_TYPE "int"
+
+#undef WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE 32
+
+/* Output assembler code to FILE to increment profiler label # LABELNO
+ for profiling a function entry. Under FreeBSD/Alpha, the assembler does
+ nothing special with -pg. */
+
+#undef FUNCTION_PROFILER
+#define FUNCTION_PROFILER(FILE, LABELNO) \
+ fputs ("\tjsr $28,_mcount\n", (FILE))
+
+/* Show that we need a GP when profiling. */
+#define TARGET_PROFILING_NEEDS_GP
+
+#undef HAS_INIT_SECTION
+
+/* Provide an ASM_SPEC appropriate for a FreeBSD/alpha target. This differs
+ from the generic FreeBSD ASM_SPEC in that no special handling of PIC is
+ necessary on the Alpha. */
+
+#undef ASM_SPEC
+#define ASM_SPEC " %| %{mcpu=*:-m%*}"
+
+/* Output at beginning of assembler file. */
+
+#undef ASM_FILE_START
+#define ASM_FILE_START(FILE) \
+{ \
+ alpha_write_verstamp (FILE); \
+ output_file_directive (FILE, main_input_filename); \
+ fprintf (FILE, "\t.version\t\"01.01\"\n"); \
+ fprintf (FILE, "\t.set noat\n"); \
+}
+
+#define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE) \
+ alpha_output_lineno (STREAM, LINE)
+extern void alpha_output_lineno ();
+
+extern void output_file_directive ();
+
+/* 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. */
+
+#define IDENT_ASM_OP ".ident"
+
+#ifdef IDENTIFY_WITH_IDENT
+#define ASM_IDENTIFY_GCC(FILE) /* nothing */
+#define ASM_IDENTIFY_LANGUAGE(FILE) \
+ fprintf(FILE, "\t%s \"GCC (%s) %s\"\n", IDENT_ASM_OP, \
+ lang_identify(), version_string)
+#else
+#define ASM_FILE_END(FILE) \
+do { \
+ fprintf ((FILE), "\t%s\t\"GCC: (GNU) %s\"\n", \
+ IDENT_ASM_OP, version_string); \
+ } while (0)
+#endif
+
+/* Allow #sccs in preprocessor. */
+
+#define SCCS_DIRECTIVE
+
+/* Output #ident as a .ident. */
+
+#define ASM_OUTPUT_IDENT(FILE, NAME) \
+ fprintf (FILE, "\t%s\t\"%s\"\n", IDENT_ASM_OP, NAME);
+
+/* This is how to allocate empty space in some section. The .zero
+ pseudo-op is used for this on most svr4 assemblers. */
+
+#define SKIP_ASM_OP ".zero"
+
+#undef ASM_OUTPUT_SKIP
+#define ASM_OUTPUT_SKIP(FILE,SIZE) \
+ fprintf (FILE, "\t%s\t%u\n", SKIP_ASM_OP, (SIZE))
+
+/* Output the label which precedes a jumptable. Note that for all svr4
+ systems where we actually generate jumptables (which is to say every
+ svr4 target except i386, where we use casesi instead) we put the jump-
+ tables into the .rodata section and since other stuff could have been
+ put into the .rodata section prior to any given jumptable, we have to
+ make sure that the location counter for the .rodata section gets pro-
+ perly re-aligned prior to the actual beginning of the jump table. */
+
+#define ALIGN_ASM_OP ".align"
+
+#ifndef ASM_OUTPUT_BEFORE_CASE_LABEL
+#define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE,PREFIX,NUM,TABLE) \
+ ASM_OUTPUT_ALIGN ((FILE), 2);
+#endif
+
+#undef ASM_OUTPUT_CASE_LABEL
+#define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,JUMPTABLE) \
+ do { \
+ ASM_OUTPUT_BEFORE_CASE_LABEL (FILE, PREFIX, NUM, JUMPTABLE) \
+ ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); \
+ } while (0)
+
+/* The standard SVR4 assembler seems to require that certain builtin
+ library routines (e.g. .udiv) be explicitly declared as .globl
+ in each assembly file where they are referenced. */
+
+#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
+ ASM_GLOBALIZE_LABEL (FILE, XSTR (FUN, 0))
+
+/* This says how to output assembler code to declare an
+ uninitialized external linkage data object. Under SVR4,
+ the linker seems to want the alignment of data objects
+ to depend on their types. We do exactly that here. */
+
+#define COMMON_ASM_OP ".comm"
+
+#undef ASM_OUTPUT_ALIGNED_COMMON
+#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
+do { \
+ fprintf ((FILE), "\t%s\t", COMMON_ASM_OP); \
+ assemble_name ((FILE), (NAME)); \
+ fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \
+} while (0)
+
+/* This says how to output assembler code to declare an
+ uninitialized internal linkage data object. Under SVR4,
+ the linker seems to want the alignment of data objects
+ to depend on their types. We do exactly that here. */
+
+#define LOCAL_ASM_OP ".local"
+
+#undef ASM_OUTPUT_ALIGNED_LOCAL
+#define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
+do { \
+ fprintf ((FILE), "\t%s\t", LOCAL_ASM_OP); \
+ assemble_name ((FILE), (NAME)); \
+ fprintf ((FILE), "\n"); \
+ ASM_OUTPUT_ALIGNED_COMMON (FILE, NAME, SIZE, ALIGN); \
+} while (0)
+
+/* This is the pseudo-op used to generate a 64-bit word of data with a
+ specific value in some section. */
+
+#define INT_ASM_OP ".quad"
+
+/* This is the pseudo-op used to generate a contiguous sequence of byte
+ values from a double-quoted string WITHOUT HAVING A TERMINATING NUL
+ AUTOMATICALLY APPENDED. This is the same for most svr4 assemblers. */
+
+#undef ASCII_DATA_ASM_OP
+#define ASCII_DATA_ASM_OP ".ascii"
+
+/* Support const sections and the ctors and dtors sections for g++.
+ Note that there appears to be two different ways to support const
+ sections at the moment. You can either #define the symbol
+ READONLY_DATA_SECTION (giving it some code which switches to the
+ readonly data section) or else you can #define the symbols
+ EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, SELECT_SECTION, and
+ SELECT_RTX_SECTION. We do both here just to be on the safe side. */
+
+#define USE_CONST_SECTION 1
+
+#define CONST_SECTION_ASM_OP ".section\t.rodata"
+
+/* Define the pseudo-ops used to switch to the .ctors and .dtors sections.
+
+ Note that we want to give these sections the SHF_WRITE attribute
+ because these sections will actually contain data (i.e. tables of
+ addresses of functions in the current root executable or shared library
+ file) and, in the case of a shared library, the relocatable addresses
+ will have to be properly resolved/relocated (and then written into) by
+ the dynamic linker when it actually attaches the given shared library
+ to the executing process. (Note that on SVR4, you may wish to use the
+ `-z text' option to the ELF linker, when building a shared library, as
+ an additional check that you are doing everything right. But if you do
+ use the `-z text' option when building a shared library, you will get
+ errors unless the .ctors and .dtors sections are marked as writable
+ via the SHF_WRITE attribute.) */
+
+#define CTORS_SECTION_ASM_OP ".section\t.ctors,\"aw\""
+#define DTORS_SECTION_ASM_OP ".section\t.dtors,\"aw\""
+
+/* On svr4, we *do* have support for the .init and .fini sections, and we
+ can put stuff in there to be executed before and after `main'. We let
+ crtstuff.c and other files know this by defining the following symbols.
+ The definitions say how to change sections to the .init and .fini
+ sections. This is the same for all known svr4 assemblers. */
+
+#define INIT_SECTION_ASM_OP ".section\t.init"
+#define FINI_SECTION_ASM_OP ".section\t.fini"
+
+/* A default list of other sections which we might be "in" at any given
+ time. For targets that use additional sections (e.g. .tdesc) you
+ should override this definition in the target-specific file which
+ includes this file. */
+
+#undef EXTRA_SECTIONS
+#define EXTRA_SECTIONS in_const, in_ctors, in_dtors
+
+/* A default list of extra section function definitions. For targets
+ that use additional sections (e.g. .tdesc) you should override this
+ definition in the target-specific file which includes this file. */
+
+#undef EXTRA_SECTION_FUNCTIONS
+#define EXTRA_SECTION_FUNCTIONS \
+ CONST_SECTION_FUNCTION \
+ CTORS_SECTION_FUNCTION \
+ DTORS_SECTION_FUNCTION
+
+#undef READONLY_DATA_SECTION
+#define READONLY_DATA_SECTION() const_section ()
+
+extern void text_section ();
+
+#define CONST_SECTION_FUNCTION \
+void \
+const_section () \
+{ \
+ if (!USE_CONST_SECTION) \
+ text_section(); \
+ else if (in_section != in_const) \
+ { \
+ fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP); \
+ in_section = in_const; \
+ } \
+}
+
+#define CTORS_SECTION_FUNCTION \
+void \
+ctors_section () \
+{ \
+ if (in_section != in_ctors) \
+ { \
+ fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP); \
+ in_section = in_ctors; \
+ } \
+}
+
+#define DTORS_SECTION_FUNCTION \
+void \
+dtors_section () \
+{ \
+ if (in_section != in_dtors) \
+ { \
+ fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP); \
+ in_section = in_dtors; \
+ } \
+}
+
+/* Switch into a generic section.
+ This is currently only used to support section attributes.
+
+ We make the section read-only and executable for a function decl,
+ read-only for a const data decl, and writable for a non-const data decl. */
+#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC) \
+ fprintf (FILE, ".section\t%s,\"%s\",@progbits\n", NAME, \
+ (DECL) && TREE_CODE (DECL) == FUNCTION_DECL ? "ax" : \
+ (DECL) && DECL_READONLY_SECTION (DECL, RELOC) ? "a" : "aw")
+
+
+/* A C statement (sans semicolon) to output an element in the table of
+ global constructors. */
+#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
+ do { \
+ ctors_section (); \
+ fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
+ assemble_name (FILE, NAME); \
+ fprintf (FILE, "\n"); \
+ } while (0)
+
+/* A C statement (sans semicolon) to output an element in the table of
+ global destructors. */
+#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
+ do { \
+ dtors_section (); \
+ fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
+ assemble_name (FILE, NAME); \
+ fprintf (FILE, "\n"); \
+ } while (0)
+
+/* A C statement or statements to switch to the appropriate
+ section for output of DECL. DECL is either a `VAR_DECL' node
+ or a constant of some sort. RELOC indicates whether forming
+ the initial value of DECL requires link-time relocations. */
+
+#define SELECT_SECTION(DECL,RELOC) \
+{ \
+ if (TREE_CODE (DECL) == STRING_CST) \
+ { \
+ if (! flag_writable_strings) \
+ const_section (); \
+ else \
+ data_section (); \
+ } \
+ else if (TREE_CODE (DECL) == VAR_DECL) \
+ { \
+ if ((flag_pic && RELOC) \
+ || !TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL) \
+ || !DECL_INITIAL (DECL) \
+ || (DECL_INITIAL (DECL) != error_mark_node \
+ && !TREE_CONSTANT (DECL_INITIAL (DECL)))) \
+ data_section (); \
+ else \
+ const_section (); \
+ } \
+ else \
+ const_section (); \
+}
+
+/* A C statement or statements to switch to the appropriate
+ section for output of RTX in mode MODE. RTX is some kind
+ of constant in RTL. The argument MODE is redundant except
+ in the case of a `const_int' rtx. Currently, these always
+ go into the const section. */
+
+#undef SELECT_RTX_SECTION
+#define SELECT_RTX_SECTION(MODE,RTX) const_section()
+
+/* Define the strings used for the special svr4 .type and .size directives.
+ These strings generally do not vary from one system running svr4 to
+ another, but if a given system (e.g. m88k running svr) needs to use
+ different pseudo-op names for these, they may be overridden in the
+ file which includes this one. */
+
+#define TYPE_ASM_OP ".type"
+#define SIZE_ASM_OP ".size"
+
+/* This is how we tell the assembler that two symbols have the same value. */
+
+#define ASM_OUTPUT_DEF(FILE,NAME1,NAME2) \
+ do { assemble_name(FILE, NAME1); \
+ fputs(" = ", FILE); \
+ assemble_name(FILE, NAME2); \
+ fputc('\n', FILE); } while (0)
+
+/* A table of bytes codes used by the ASM_OUTPUT_ASCII and
+ ASM_OUTPUT_LIMITED_STRING macros. Each byte in the table
+ corresponds to a particular byte value [0..255]. For any
+ given byte value, if the value in the corresponding table
+ position is zero, the given character can be output directly.
+ If the table value is 1, the byte must be output as a \ooo
+ octal escape. If the tables value is anything else, then the
+ byte value should be output as a \ followed by the value
+ in the table. Note that we can use standard UN*X escape
+ sequences for many control characters, but we don't use
+ \a to represent BEL because some svr4 assemblers (e.g. on
+ the i386) don't know about that. Also, we don't use \v
+ since some versions of gas, such as 2.2 did not accept it. */
+
+#define ESCAPES \
+"\1\1\1\1\1\1\1\1btn\1fr\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\0\0\"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\\\0\0\0\
+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1"
+
+/* Some svr4 assemblers have a limit on the number of characters which
+ can appear in the operand of a .string directive. If your assembler
+ has such a limitation, you should define STRING_LIMIT to reflect that
+ limit. Note that at least some svr4 assemblers have a limit on the
+ actual number of bytes in the double-quoted string, and that they
+ count each character in an escape sequence as one byte. Thus, an
+ escape sequence like \377 would count as four bytes.
+
+ If your target assembler doesn't support the .string directive, you
+ should define this to zero.
+*/
+
+#define STRING_LIMIT ((unsigned) 256)
+
+#define STRING_ASM_OP ".string"
+
+/*
+ * We always use gas here, so we don't worry about ECOFF assembler problems.
+ */
+#undef TARGET_GAS
+#define TARGET_GAS (1)
+
+#undef PREFERRED_DEBUGGING_TYPE
+#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
diff --git a/lang/gcc43/files/patch-ad b/lang/gcc43/files/patch-ad
index f8fb5803acf0..bea070deb344 100644
--- a/lang/gcc43/files/patch-ad
+++ b/lang/gcc43/files/patch-ad
@@ -1,6 +1,41 @@
--- gcc/config/i386/freebsd-aout.h.orig Mon Mar 1 14:47:33 1999
-+++ gcc/config/i386/freebsd-aout.h Sat Mar 13 19:24:50 1999
-@@ -103,19 +103,18 @@
++++ gcc/config/i386/freebsd-aout.h Sat Mar 20 00:27:02 1999
+@@ -20,6 +20,10 @@
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
++
++/* Get generic FreeBSD definitions. */
++#include <freebsd.h>
++
+ /* This goes away when the math-emulator is fixed */
+ #define TARGET_CPU_DEFAULT 0400 /* TARGET_NO_FANCY_MATH_387 */
+
+@@ -35,7 +39,7 @@
+ #include "i386/perform.h"
+
+ #undef CPP_PREDEFINES
+-#define CPP_PREDEFINES "-Dunix -Di386 -D__FreeBSD__ -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)"
++#define CPP_PREDEFINES "-Di386 -Acpu(i386) -Amachine(i386)" CPP_FBSD_PREDEFINES
+
+ /* Like the default, except no -lg. */
+ #define LIB_SPEC "%{!shared:%{!pg:-lc}%{pg:-lc_p}}"
+@@ -85,14 +89,6 @@
+ necessary when compiling PIC code. */
+
+ #define JUMP_TABLES_IN_TEXT_SECTION 1
+-
+-/* Don't default to pcc-struct-return, because gcc is the only compiler, and
+- we want to retain compatibility with older gcc versions. */
+-#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
+
+ /* i386 freebsd still uses old binutils that don't insert nops by default
+ when the .align directive demands to insert extra space in the text
+@@ -103,19 +99,18 @@
/* Profiling routines, partially copied from i386/osfrose.h. */
@@ -23,7 +58,7 @@
fprintf (FILE, "\tcall mcount\n"); \
} \
}
-@@ -133,6 +132,7 @@
+@@ -133,6 +128,7 @@
#define TYPE_ASM_OP ".type"
#define SIZE_ASM_OP ".size"
@@ -31,7 +66,7 @@
/* The following macro defines the format used to output the second
operand of the .type assembler directive. Different svr4 assemblers
-@@ -142,6 +142,12 @@
+@@ -142,6 +138,12 @@
#define TYPE_OPERAND_FMT "@%s"
@@ -44,12 +79,34 @@
/* Write the extra assembler code needed to declare a function's result.
Most svr4 assemblers don't require any special declaration of the
result value, but there are exceptions. */
-@@ -243,6 +249,8 @@
- #define STARTFILE_SPEC \
+@@ -244,29 +246,4 @@
"%{shared:c++rt0.o%s} \
%{!shared:%{pg:gcrt0.o%s}%{!pg:%{static:scrt0.o%s}%{!static:crt0.o%s}}}"
-+
-+#define MD_STARTFILE_PREFIX "/usr/lib/aout/"
- /* This is defined when gcc is compiled in the BSD-directory-tree, and must
- * make up for the gap to all the stuff done in the GNU-makefiles.
+-/* This is defined when gcc is compiled in the BSD-directory-tree, and must
+- * make up for the gap to all the stuff done in the GNU-makefiles.
+- */
+-
+-#ifdef FREEBSD_NATIVE
+-
+-#define INCLUDE_DEFAULTS { \
+- { "/usr/include", 0, 0, 0 }, \
+- { "/usr/include/g++", "G++", 1, 1 }, \
+- { 0, 0, 0, 0} \
+- }
+-
+-#undef MD_EXEC_PREFIX
+-#define MD_EXEC_PREFIX "/usr/libexec/"
+-
+-#undef STANDARD_STARTFILE_PREFIX
+-#define STANDARD_STARTFILE_PREFIX "/usr/lib"
+-
+-#if 0 /* This is very wrong!!! */
+-#define DEFAULT_TARGET_MACHINE "i386-unknown-freebsd_1.0"
+-#define GPLUSPLUS_INCLUDE_DIR "/usr/local/lib/gcc-lib/i386-unknown-freebsd_1.0/2.5.8/include"
+-#define TOOL_INCLUDE_DIR "/usr/local/i386-unknown-freebsd_1.0/include"
+-#define GCC_INCLUDE_DIR "/usr/local/lib/gcc-lib/i386-unknown-freebsd_1.0/2.5.8/include"
+-#endif
+-
+-#endif /* FREEBSD_NATIVE */
++#define MD_STARTFILE_PREFIX "/usr/lib/aout/"
diff --git a/lang/gcc43/files/patch-af b/lang/gcc43/files/patch-af
index c50ce06c8375..c1f1ba0e855f 100644
--- a/lang/gcc43/files/patch-af
+++ b/lang/gcc43/files/patch-af
@@ -1,6 +1,30 @@
--- gcc/config/i386/freebsd.h.orig Mon Mar 1 14:47:32 1999
-+++ gcc/config/i386/freebsd.h Sat Mar 13 19:25:53 1999
-@@ -113,22 +113,19 @@
++++ gcc/config/i386/freebsd.h Sun Mar 21 16:58:39 1999
+@@ -21,19 +21,13 @@
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
++
++/* Get generic FreeBSD definitions. */
++#include <freebsd.h>
++
+ #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
+-
+ /* This is how to output an element of a case-vector that is relative.
+ This is only used for PIC code. See comments by the `casesi' insn in
+ i386.md for an explanation of the expression this outputs. */
+@@ -113,22 +107,19 @@
: ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \
: (-1))
@@ -27,8 +51,18 @@
} \
}
-@@ -151,20 +148,8 @@
- #define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
+@@ -145,26 +136,16 @@
+ #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)"
++#define CPP_PREDEFINES "-Di386 -D__ELF__ -Acpu(i386) -Amachine(i386)" CPP_FBSD_PREDEFINES
+
+ #undef CPP_SPEC
+-#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
++#define CPP_SPEC \
++ "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE} %{m486:-D__i486__}"
++ /* %{pthread:-D_REENTRANT} */
#undef LIB_SPEC
-#if 1
@@ -36,16 +70,16 @@
- * want to profile or debug the C library, please add
- * -lc_p or -ggdb to LDFLAGS at the link time, respectively.
- */
- #define LIB_SPEC \
+-#define LIB_SPEC \
- "%{!shared: %{mieee-fp:-lieee} %{p:-lgmon} %{pg:-lgmon} \
- %{!ggdb:-lc} %{ggdb:-lg}}"
-#else
--#define LIB_SPEC \
+ #define LIB_SPEC \
- "%{!shared: \
- %{mieee-fp:-lieee} %{p:-lgmon -lc_p} %{pg:-lgmon -lc_p} \
- %{!p:%{!pg:%{!g*:-lc} %{g*:-lg}}}}"
-#endif
-+ "%{!shared: %{p:-lc_p} %{pg:-lc_p} %{!p:%{!pg:-lc}}}"
++ "%{!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
diff --git a/lang/gcc43/files/patch-ak b/lang/gcc43/files/patch-ak
index 19a2994f3f05..2e54beea1a61 100644
--- a/lang/gcc43/files/patch-ak
+++ b/lang/gcc43/files/patch-ak
@@ -1,5 +1,5 @@
---- gcc/configure.orig Mon Mar 8 10:06:10 1999
-+++ gcc/configure Sat Mar 13 19:08:06 1999
+--- gcc/configure.orig Sun Mar 14 02:59:02 1999
++++ gcc/configure Sat Mar 20 00:40:05 1999
@@ -2395,6 +2395,15 @@
thread_file='posix'
fi
@@ -27,18 +27,20 @@
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
- extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
+- tmake_file=i386/t-freebsd
- gas=yes
- gnu_ld=yes
- stabs=yes
++ tmake_file=t-freebsd
;;
i[34567]86-*-freebsd*)
- tm_file=i386/freebsd.h
+ tm_file="i386/i386.h i386/att.h linux.h i386/freebsd.h i386/perform.h"
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
+- tmake_file=i386/t-freebsd
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
++ tmake_file=t-freebsd
+ gas=yes
+ gnu_ld=yes
+ stabs=yes
diff --git a/lang/gcc43/files/patch-al b/lang/gcc43/files/patch-al
index 51e1b8cdee1c..c8a195127ed0 100644
--- a/lang/gcc43/files/patch-al
+++ b/lang/gcc43/files/patch-al
@@ -1,5 +1,5 @@
--- gcc/configure.in.orig Sun Mar 7 16:22:22 1999
-+++ gcc/configure.in Sat Mar 13 19:23:23 1999
++++ gcc/configure.in Sat Mar 20 00:40:58 1999
@@ -416,6 +416,15 @@
thread_file='posix'
fi
@@ -27,18 +27,20 @@
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
- extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
+- tmake_file=i386/t-freebsd
- gas=yes
- gnu_ld=yes
- stabs=yes
++ tmake_file=t-freebsd
;;
i[[34567]]86-*-freebsd*)
- tm_file=i386/freebsd.h
+ tm_file="i386/i386.h i386/att.h linux.h i386/freebsd.h i386/perform.h"
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
+- tmake_file=i386/t-freebsd
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
++ tmake_file=t-freebsd
+ gas=yes
+ gnu_ld=yes
+ stabs=yes
diff --git a/lang/gcc44/Makefile b/lang/gcc44/Makefile
index f9347a47d87e..cd5b039f398a 100644
--- a/lang/gcc44/Makefile
+++ b/lang/gcc44/Makefile
@@ -4,7 +4,7 @@
# Date created: 9 Jan 1998
# Whom: John Polstra <jdp@polstra.com>
#
-# $Id: Makefile,v 1.48 1999/03/08 07:28:27 asami Exp $
+# $Id: Makefile,v 1.50 1999/03/17 00:40:25 obrien Exp $
#
DISTNAME= egcs-1.1.2
@@ -55,21 +55,20 @@ ALL_TARGET= bootstrap
MAN1= cccp.1 g++.1 g77.1 gcc.1
pre-patch:
+ @${MV} ${WRKSRC}/gcc/config/i386/t-freebsd ${WRKSRC}/gcc/config/
@${MV} ${WRKSRC}/gcc/config/i386/freebsd.h ${WRKSRC}/gcc/config/i386/freebsd-aout.h
@${MV} ${WRKSRC}/gcc/config/i386/freebsd-elf.h ${WRKSRC}/gcc/config/i386/freebsd.h
+ @${CP} ${FILESDIR}/alpha-freebsd-elf.h ${WRKSRC}/gcc/config/alpha/freebsd-elf.h
+ @${CP} ${FILESDIR}/alpha-freebsd.h ${WRKSRC}/gcc/config/alpha/freebsd.h
pre-configure:
@# Keep from running `autoconf' and `autoheader' since we modified
@# configure.in by patching it.
@touch ${WRKSRC}/gcc/configure
@touch ${WRKSRC}/gcc/cstamp-h.in
- @(cd ${WRKSRC}/gcc/config/${ARCH}/ ; \
- MAJ=`sysctl -n kern.osreldate | ${SED} -e '/.....$$/s///'` ; \
- ${MV} freebsd-aout.h freebsd-aout.h.in ; \
- ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" freebsd-aout.h.in \
- >freebsd-aout.h ; \
- ${MV} freebsd.h freebsd.h.in ; \
- ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" freebsd.h.in >freebsd.h )
+ @(MAJ=`sysctl -n kern.osreldate | ${SED} -e '/.....$$/s///'` ; \
+ ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" ${FILESDIR}/freebsd.h \
+ >${WRKSRC}/gcc/config/freebsd.h )
.if ${PORTOBJFORMAT} == "elf" && ${MACHINE_ARCH} == "i386"
@${SED} -e 's/^@comment ELF-only://' ${PKGDIR}/PLIST >${PLIST}
.endif
diff --git a/lang/gcc44/files/alpha-freebsd.h b/lang/gcc44/files/alpha-freebsd.h
new file mode 100644
index 000000000000..60a1f07b94ba
--- /dev/null
+++ b/lang/gcc44/files/alpha-freebsd.h
@@ -0,0 +1,443 @@
+/* Definitions of target machine for GNU compiler,
+ for Alpha FreeBSD systems.
+ Copyright (C) 1998 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* This is used on Alpha platforms that use the ELF format.
+ This was taken from the NetBSD configuration, and modified
+ for FreeBSD/alpha by Hidetoshi Shimokawa <simokawa@FreeBSD.ORG> */
+
+
+/* Get generic FreeBSD definitions. */
+#include <freebsd.h>
+
+
+#undef OBJECT_FORMAT_COFF
+#undef EXTENDED_COFF
+#define OBJECT_FORMAT_ELF
+
+/* This is BSD, so it wants DBX format. */
+
+#define DBX_DEBUGGING_INFO
+
+/* This is the char to use for continuation (in case we need to turn
+ continuation back on). */
+
+#define DBX_CONTIN_CHAR '?'
+
+#undef ASM_FINAL_SPEC
+
+/* Names to predefine in the preprocessor for this target machine.
+ XXX FreeBSD, by convention, shouldn't do __alpha, but lots of applications
+ expect it because that's what OSF/1 does. */
+
+#undef TARGET_DEFAULT
+#define TARGET_DEFAULT (MASK_FP | MASK_FPREGS | MASK_GAS)
+
+#undef CPP_PREDEFINES
+#define CPP_PREDEFINES "\
+-D__alpha__ -D__alpha -Acpu(alpha) -Amachine(alpha) " \
+FBSD_CPP_PREDEFINES \
+SUB_CPP_PREDEFINES
+
+/* Make gcc agree with <machine/ansi.h> */
+
+#undef WCHAR_TYPE
+#define WCHAR_TYPE "int"
+
+#undef WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE 32
+
+/* Output assembler code to FILE to increment profiler label # LABELNO
+ for profiling a function entry. Under FreeBSD/Alpha, the assembler does
+ nothing special with -pg. */
+
+#undef FUNCTION_PROFILER
+#define FUNCTION_PROFILER(FILE, LABELNO) \
+ fputs ("\tjsr $28,_mcount\n", (FILE))
+
+/* Show that we need a GP when profiling. */
+#define TARGET_PROFILING_NEEDS_GP
+
+#undef HAS_INIT_SECTION
+
+/* Provide an ASM_SPEC appropriate for a FreeBSD/alpha target. This differs
+ from the generic FreeBSD ASM_SPEC in that no special handling of PIC is
+ necessary on the Alpha. */
+
+#undef ASM_SPEC
+#define ASM_SPEC " %| %{mcpu=*:-m%*}"
+
+/* Output at beginning of assembler file. */
+
+#undef ASM_FILE_START
+#define ASM_FILE_START(FILE) \
+{ \
+ alpha_write_verstamp (FILE); \
+ output_file_directive (FILE, main_input_filename); \
+ fprintf (FILE, "\t.version\t\"01.01\"\n"); \
+ fprintf (FILE, "\t.set noat\n"); \
+}
+
+#define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE) \
+ alpha_output_lineno (STREAM, LINE)
+extern void alpha_output_lineno ();
+
+extern void output_file_directive ();
+
+/* 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. */
+
+#define IDENT_ASM_OP ".ident"
+
+#ifdef IDENTIFY_WITH_IDENT
+#define ASM_IDENTIFY_GCC(FILE) /* nothing */
+#define ASM_IDENTIFY_LANGUAGE(FILE) \
+ fprintf(FILE, "\t%s \"GCC (%s) %s\"\n", IDENT_ASM_OP, \
+ lang_identify(), version_string)
+#else
+#define ASM_FILE_END(FILE) \
+do { \
+ fprintf ((FILE), "\t%s\t\"GCC: (GNU) %s\"\n", \
+ IDENT_ASM_OP, version_string); \
+ } while (0)
+#endif
+
+/* Allow #sccs in preprocessor. */
+
+#define SCCS_DIRECTIVE
+
+/* Output #ident as a .ident. */
+
+#define ASM_OUTPUT_IDENT(FILE, NAME) \
+ fprintf (FILE, "\t%s\t\"%s\"\n", IDENT_ASM_OP, NAME);
+
+/* This is how to allocate empty space in some section. The .zero
+ pseudo-op is used for this on most svr4 assemblers. */
+
+#define SKIP_ASM_OP ".zero"
+
+#undef ASM_OUTPUT_SKIP
+#define ASM_OUTPUT_SKIP(FILE,SIZE) \
+ fprintf (FILE, "\t%s\t%u\n", SKIP_ASM_OP, (SIZE))
+
+/* Output the label which precedes a jumptable. Note that for all svr4
+ systems where we actually generate jumptables (which is to say every
+ svr4 target except i386, where we use casesi instead) we put the jump-
+ tables into the .rodata section and since other stuff could have been
+ put into the .rodata section prior to any given jumptable, we have to
+ make sure that the location counter for the .rodata section gets pro-
+ perly re-aligned prior to the actual beginning of the jump table. */
+
+#define ALIGN_ASM_OP ".align"
+
+#ifndef ASM_OUTPUT_BEFORE_CASE_LABEL
+#define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE,PREFIX,NUM,TABLE) \
+ ASM_OUTPUT_ALIGN ((FILE), 2);
+#endif
+
+#undef ASM_OUTPUT_CASE_LABEL
+#define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,JUMPTABLE) \
+ do { \
+ ASM_OUTPUT_BEFORE_CASE_LABEL (FILE, PREFIX, NUM, JUMPTABLE) \
+ ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); \
+ } while (0)
+
+/* The standard SVR4 assembler seems to require that certain builtin
+ library routines (e.g. .udiv) be explicitly declared as .globl
+ in each assembly file where they are referenced. */
+
+#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
+ ASM_GLOBALIZE_LABEL (FILE, XSTR (FUN, 0))
+
+/* This says how to output assembler code to declare an
+ uninitialized external linkage data object. Under SVR4,
+ the linker seems to want the alignment of data objects
+ to depend on their types. We do exactly that here. */
+
+#define COMMON_ASM_OP ".comm"
+
+#undef ASM_OUTPUT_ALIGNED_COMMON
+#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
+do { \
+ fprintf ((FILE), "\t%s\t", COMMON_ASM_OP); \
+ assemble_name ((FILE), (NAME)); \
+ fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \
+} while (0)
+
+/* This says how to output assembler code to declare an
+ uninitialized internal linkage data object. Under SVR4,
+ the linker seems to want the alignment of data objects
+ to depend on their types. We do exactly that here. */
+
+#define LOCAL_ASM_OP ".local"
+
+#undef ASM_OUTPUT_ALIGNED_LOCAL
+#define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
+do { \
+ fprintf ((FILE), "\t%s\t", LOCAL_ASM_OP); \
+ assemble_name ((FILE), (NAME)); \
+ fprintf ((FILE), "\n"); \
+ ASM_OUTPUT_ALIGNED_COMMON (FILE, NAME, SIZE, ALIGN); \
+} while (0)
+
+/* This is the pseudo-op used to generate a 64-bit word of data with a
+ specific value in some section. */
+
+#define INT_ASM_OP ".quad"
+
+/* This is the pseudo-op used to generate a contiguous sequence of byte
+ values from a double-quoted string WITHOUT HAVING A TERMINATING NUL
+ AUTOMATICALLY APPENDED. This is the same for most svr4 assemblers. */
+
+#undef ASCII_DATA_ASM_OP
+#define ASCII_DATA_ASM_OP ".ascii"
+
+/* Support const sections and the ctors and dtors sections for g++.
+ Note that there appears to be two different ways to support const
+ sections at the moment. You can either #define the symbol
+ READONLY_DATA_SECTION (giving it some code which switches to the
+ readonly data section) or else you can #define the symbols
+ EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, SELECT_SECTION, and
+ SELECT_RTX_SECTION. We do both here just to be on the safe side. */
+
+#define USE_CONST_SECTION 1
+
+#define CONST_SECTION_ASM_OP ".section\t.rodata"
+
+/* Define the pseudo-ops used to switch to the .ctors and .dtors sections.
+
+ Note that we want to give these sections the SHF_WRITE attribute
+ because these sections will actually contain data (i.e. tables of
+ addresses of functions in the current root executable or shared library
+ file) and, in the case of a shared library, the relocatable addresses
+ will have to be properly resolved/relocated (and then written into) by
+ the dynamic linker when it actually attaches the given shared library
+ to the executing process. (Note that on SVR4, you may wish to use the
+ `-z text' option to the ELF linker, when building a shared library, as
+ an additional check that you are doing everything right. But if you do
+ use the `-z text' option when building a shared library, you will get
+ errors unless the .ctors and .dtors sections are marked as writable
+ via the SHF_WRITE attribute.) */
+
+#define CTORS_SECTION_ASM_OP ".section\t.ctors,\"aw\""
+#define DTORS_SECTION_ASM_OP ".section\t.dtors,\"aw\""
+
+/* On svr4, we *do* have support for the .init and .fini sections, and we
+ can put stuff in there to be executed before and after `main'. We let
+ crtstuff.c and other files know this by defining the following symbols.
+ The definitions say how to change sections to the .init and .fini
+ sections. This is the same for all known svr4 assemblers. */
+
+#define INIT_SECTION_ASM_OP ".section\t.init"
+#define FINI_SECTION_ASM_OP ".section\t.fini"
+
+/* A default list of other sections which we might be "in" at any given
+ time. For targets that use additional sections (e.g. .tdesc) you
+ should override this definition in the target-specific file which
+ includes this file. */
+
+#undef EXTRA_SECTIONS
+#define EXTRA_SECTIONS in_const, in_ctors, in_dtors
+
+/* A default list of extra section function definitions. For targets
+ that use additional sections (e.g. .tdesc) you should override this
+ definition in the target-specific file which includes this file. */
+
+#undef EXTRA_SECTION_FUNCTIONS
+#define EXTRA_SECTION_FUNCTIONS \
+ CONST_SECTION_FUNCTION \
+ CTORS_SECTION_FUNCTION \
+ DTORS_SECTION_FUNCTION
+
+#undef READONLY_DATA_SECTION
+#define READONLY_DATA_SECTION() const_section ()
+
+extern void text_section ();
+
+#define CONST_SECTION_FUNCTION \
+void \
+const_section () \
+{ \
+ if (!USE_CONST_SECTION) \
+ text_section(); \
+ else if (in_section != in_const) \
+ { \
+ fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP); \
+ in_section = in_const; \
+ } \
+}
+
+#define CTORS_SECTION_FUNCTION \
+void \
+ctors_section () \
+{ \
+ if (in_section != in_ctors) \
+ { \
+ fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP); \
+ in_section = in_ctors; \
+ } \
+}
+
+#define DTORS_SECTION_FUNCTION \
+void \
+dtors_section () \
+{ \
+ if (in_section != in_dtors) \
+ { \
+ fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP); \
+ in_section = in_dtors; \
+ } \
+}
+
+/* Switch into a generic section.
+ This is currently only used to support section attributes.
+
+ We make the section read-only and executable for a function decl,
+ read-only for a const data decl, and writable for a non-const data decl. */
+#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC) \
+ fprintf (FILE, ".section\t%s,\"%s\",@progbits\n", NAME, \
+ (DECL) && TREE_CODE (DECL) == FUNCTION_DECL ? "ax" : \
+ (DECL) && DECL_READONLY_SECTION (DECL, RELOC) ? "a" : "aw")
+
+
+/* A C statement (sans semicolon) to output an element in the table of
+ global constructors. */
+#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
+ do { \
+ ctors_section (); \
+ fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
+ assemble_name (FILE, NAME); \
+ fprintf (FILE, "\n"); \
+ } while (0)
+
+/* A C statement (sans semicolon) to output an element in the table of
+ global destructors. */
+#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
+ do { \
+ dtors_section (); \
+ fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
+ assemble_name (FILE, NAME); \
+ fprintf (FILE, "\n"); \
+ } while (0)
+
+/* A C statement or statements to switch to the appropriate
+ section for output of DECL. DECL is either a `VAR_DECL' node
+ or a constant of some sort. RELOC indicates whether forming
+ the initial value of DECL requires link-time relocations. */
+
+#define SELECT_SECTION(DECL,RELOC) \
+{ \
+ if (TREE_CODE (DECL) == STRING_CST) \
+ { \
+ if (! flag_writable_strings) \
+ const_section (); \
+ else \
+ data_section (); \
+ } \
+ else if (TREE_CODE (DECL) == VAR_DECL) \
+ { \
+ if ((flag_pic && RELOC) \
+ || !TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL) \
+ || !DECL_INITIAL (DECL) \
+ || (DECL_INITIAL (DECL) != error_mark_node \
+ && !TREE_CONSTANT (DECL_INITIAL (DECL)))) \
+ data_section (); \
+ else \
+ const_section (); \
+ } \
+ else \
+ const_section (); \
+}
+
+/* A C statement or statements to switch to the appropriate
+ section for output of RTX in mode MODE. RTX is some kind
+ of constant in RTL. The argument MODE is redundant except
+ in the case of a `const_int' rtx. Currently, these always
+ go into the const section. */
+
+#undef SELECT_RTX_SECTION
+#define SELECT_RTX_SECTION(MODE,RTX) const_section()
+
+/* Define the strings used for the special svr4 .type and .size directives.
+ These strings generally do not vary from one system running svr4 to
+ another, but if a given system (e.g. m88k running svr) needs to use
+ different pseudo-op names for these, they may be overridden in the
+ file which includes this one. */
+
+#define TYPE_ASM_OP ".type"
+#define SIZE_ASM_OP ".size"
+
+/* This is how we tell the assembler that two symbols have the same value. */
+
+#define ASM_OUTPUT_DEF(FILE,NAME1,NAME2) \
+ do { assemble_name(FILE, NAME1); \
+ fputs(" = ", FILE); \
+ assemble_name(FILE, NAME2); \
+ fputc('\n', FILE); } while (0)
+
+/* A table of bytes codes used by the ASM_OUTPUT_ASCII and
+ ASM_OUTPUT_LIMITED_STRING macros. Each byte in the table
+ corresponds to a particular byte value [0..255]. For any
+ given byte value, if the value in the corresponding table
+ position is zero, the given character can be output directly.
+ If the table value is 1, the byte must be output as a \ooo
+ octal escape. If the tables value is anything else, then the
+ byte value should be output as a \ followed by the value
+ in the table. Note that we can use standard UN*X escape
+ sequences for many control characters, but we don't use
+ \a to represent BEL because some svr4 assemblers (e.g. on
+ the i386) don't know about that. Also, we don't use \v
+ since some versions of gas, such as 2.2 did not accept it. */
+
+#define ESCAPES \
+"\1\1\1\1\1\1\1\1btn\1fr\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\0\0\"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\\\0\0\0\
+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1"
+
+/* Some svr4 assemblers have a limit on the number of characters which
+ can appear in the operand of a .string directive. If your assembler
+ has such a limitation, you should define STRING_LIMIT to reflect that
+ limit. Note that at least some svr4 assemblers have a limit on the
+ actual number of bytes in the double-quoted string, and that they
+ count each character in an escape sequence as one byte. Thus, an
+ escape sequence like \377 would count as four bytes.
+
+ If your target assembler doesn't support the .string directive, you
+ should define this to zero.
+*/
+
+#define STRING_LIMIT ((unsigned) 256)
+
+#define STRING_ASM_OP ".string"
+
+/*
+ * We always use gas here, so we don't worry about ECOFF assembler problems.
+ */
+#undef TARGET_GAS
+#define TARGET_GAS (1)
+
+#undef PREFERRED_DEBUGGING_TYPE
+#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
diff --git a/lang/gcc44/files/patch-ad b/lang/gcc44/files/patch-ad
index f8fb5803acf0..bea070deb344 100644
--- a/lang/gcc44/files/patch-ad
+++ b/lang/gcc44/files/patch-ad
@@ -1,6 +1,41 @@
--- gcc/config/i386/freebsd-aout.h.orig Mon Mar 1 14:47:33 1999
-+++ gcc/config/i386/freebsd-aout.h Sat Mar 13 19:24:50 1999
-@@ -103,19 +103,18 @@
++++ gcc/config/i386/freebsd-aout.h Sat Mar 20 00:27:02 1999
+@@ -20,6 +20,10 @@
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
++
++/* Get generic FreeBSD definitions. */
++#include <freebsd.h>
++
+ /* This goes away when the math-emulator is fixed */
+ #define TARGET_CPU_DEFAULT 0400 /* TARGET_NO_FANCY_MATH_387 */
+
+@@ -35,7 +39,7 @@
+ #include "i386/perform.h"
+
+ #undef CPP_PREDEFINES
+-#define CPP_PREDEFINES "-Dunix -Di386 -D__FreeBSD__ -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)"
++#define CPP_PREDEFINES "-Di386 -Acpu(i386) -Amachine(i386)" CPP_FBSD_PREDEFINES
+
+ /* Like the default, except no -lg. */
+ #define LIB_SPEC "%{!shared:%{!pg:-lc}%{pg:-lc_p}}"
+@@ -85,14 +89,6 @@
+ necessary when compiling PIC code. */
+
+ #define JUMP_TABLES_IN_TEXT_SECTION 1
+-
+-/* Don't default to pcc-struct-return, because gcc is the only compiler, and
+- we want to retain compatibility with older gcc versions. */
+-#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
+
+ /* i386 freebsd still uses old binutils that don't insert nops by default
+ when the .align directive demands to insert extra space in the text
+@@ -103,19 +99,18 @@
/* Profiling routines, partially copied from i386/osfrose.h. */
@@ -23,7 +58,7 @@
fprintf (FILE, "\tcall mcount\n"); \
} \
}
-@@ -133,6 +132,7 @@
+@@ -133,6 +128,7 @@
#define TYPE_ASM_OP ".type"
#define SIZE_ASM_OP ".size"
@@ -31,7 +66,7 @@
/* The following macro defines the format used to output the second
operand of the .type assembler directive. Different svr4 assemblers
-@@ -142,6 +142,12 @@
+@@ -142,6 +138,12 @@
#define TYPE_OPERAND_FMT "@%s"
@@ -44,12 +79,34 @@
/* Write the extra assembler code needed to declare a function's result.
Most svr4 assemblers don't require any special declaration of the
result value, but there are exceptions. */
-@@ -243,6 +249,8 @@
- #define STARTFILE_SPEC \
+@@ -244,29 +246,4 @@
"%{shared:c++rt0.o%s} \
%{!shared:%{pg:gcrt0.o%s}%{!pg:%{static:scrt0.o%s}%{!static:crt0.o%s}}}"
-+
-+#define MD_STARTFILE_PREFIX "/usr/lib/aout/"
- /* This is defined when gcc is compiled in the BSD-directory-tree, and must
- * make up for the gap to all the stuff done in the GNU-makefiles.
+-/* This is defined when gcc is compiled in the BSD-directory-tree, and must
+- * make up for the gap to all the stuff done in the GNU-makefiles.
+- */
+-
+-#ifdef FREEBSD_NATIVE
+-
+-#define INCLUDE_DEFAULTS { \
+- { "/usr/include", 0, 0, 0 }, \
+- { "/usr/include/g++", "G++", 1, 1 }, \
+- { 0, 0, 0, 0} \
+- }
+-
+-#undef MD_EXEC_PREFIX
+-#define MD_EXEC_PREFIX "/usr/libexec/"
+-
+-#undef STANDARD_STARTFILE_PREFIX
+-#define STANDARD_STARTFILE_PREFIX "/usr/lib"
+-
+-#if 0 /* This is very wrong!!! */
+-#define DEFAULT_TARGET_MACHINE "i386-unknown-freebsd_1.0"
+-#define GPLUSPLUS_INCLUDE_DIR "/usr/local/lib/gcc-lib/i386-unknown-freebsd_1.0/2.5.8/include"
+-#define TOOL_INCLUDE_DIR "/usr/local/i386-unknown-freebsd_1.0/include"
+-#define GCC_INCLUDE_DIR "/usr/local/lib/gcc-lib/i386-unknown-freebsd_1.0/2.5.8/include"
+-#endif
+-
+-#endif /* FREEBSD_NATIVE */
++#define MD_STARTFILE_PREFIX "/usr/lib/aout/"
diff --git a/lang/gcc44/files/patch-af b/lang/gcc44/files/patch-af
index c50ce06c8375..c1f1ba0e855f 100644
--- a/lang/gcc44/files/patch-af
+++ b/lang/gcc44/files/patch-af
@@ -1,6 +1,30 @@
--- gcc/config/i386/freebsd.h.orig Mon Mar 1 14:47:32 1999
-+++ gcc/config/i386/freebsd.h Sat Mar 13 19:25:53 1999
-@@ -113,22 +113,19 @@
++++ gcc/config/i386/freebsd.h Sun Mar 21 16:58:39 1999
+@@ -21,19 +21,13 @@
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
++
++/* Get generic FreeBSD definitions. */
++#include <freebsd.h>
++
+ #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
+-
+ /* This is how to output an element of a case-vector that is relative.
+ This is only used for PIC code. See comments by the `casesi' insn in
+ i386.md for an explanation of the expression this outputs. */
+@@ -113,22 +107,19 @@
: ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \
: (-1))
@@ -27,8 +51,18 @@
} \
}
-@@ -151,20 +148,8 @@
- #define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
+@@ -145,26 +136,16 @@
+ #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)"
++#define CPP_PREDEFINES "-Di386 -D__ELF__ -Acpu(i386) -Amachine(i386)" CPP_FBSD_PREDEFINES
+
+ #undef CPP_SPEC
+-#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
++#define CPP_SPEC \
++ "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE} %{m486:-D__i486__}"
++ /* %{pthread:-D_REENTRANT} */
#undef LIB_SPEC
-#if 1
@@ -36,16 +70,16 @@
- * want to profile or debug the C library, please add
- * -lc_p or -ggdb to LDFLAGS at the link time, respectively.
- */
- #define LIB_SPEC \
+-#define LIB_SPEC \
- "%{!shared: %{mieee-fp:-lieee} %{p:-lgmon} %{pg:-lgmon} \
- %{!ggdb:-lc} %{ggdb:-lg}}"
-#else
--#define LIB_SPEC \
+ #define LIB_SPEC \
- "%{!shared: \
- %{mieee-fp:-lieee} %{p:-lgmon -lc_p} %{pg:-lgmon -lc_p} \
- %{!p:%{!pg:%{!g*:-lc} %{g*:-lg}}}}"
-#endif
-+ "%{!shared: %{p:-lc_p} %{pg:-lc_p} %{!p:%{!pg:-lc}}}"
++ "%{!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
diff --git a/lang/gcc44/files/patch-ak b/lang/gcc44/files/patch-ak
index 19a2994f3f05..2e54beea1a61 100644
--- a/lang/gcc44/files/patch-ak
+++ b/lang/gcc44/files/patch-ak
@@ -1,5 +1,5 @@
---- gcc/configure.orig Mon Mar 8 10:06:10 1999
-+++ gcc/configure Sat Mar 13 19:08:06 1999
+--- gcc/configure.orig Sun Mar 14 02:59:02 1999
++++ gcc/configure Sat Mar 20 00:40:05 1999
@@ -2395,6 +2395,15 @@
thread_file='posix'
fi
@@ -27,18 +27,20 @@
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
- extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
+- tmake_file=i386/t-freebsd
- gas=yes
- gnu_ld=yes
- stabs=yes
++ tmake_file=t-freebsd
;;
i[34567]86-*-freebsd*)
- tm_file=i386/freebsd.h
+ tm_file="i386/i386.h i386/att.h linux.h i386/freebsd.h i386/perform.h"
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
+- tmake_file=i386/t-freebsd
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
++ tmake_file=t-freebsd
+ gas=yes
+ gnu_ld=yes
+ stabs=yes
diff --git a/lang/gcc44/files/patch-al b/lang/gcc44/files/patch-al
index 51e1b8cdee1c..c8a195127ed0 100644
--- a/lang/gcc44/files/patch-al
+++ b/lang/gcc44/files/patch-al
@@ -1,5 +1,5 @@
--- gcc/configure.in.orig Sun Mar 7 16:22:22 1999
-+++ gcc/configure.in Sat Mar 13 19:23:23 1999
++++ gcc/configure.in Sat Mar 20 00:40:58 1999
@@ -416,6 +416,15 @@
thread_file='posix'
fi
@@ -27,18 +27,20 @@
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
- extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
+- tmake_file=i386/t-freebsd
- gas=yes
- gnu_ld=yes
- stabs=yes
++ tmake_file=t-freebsd
;;
i[[34567]]86-*-freebsd*)
- tm_file=i386/freebsd.h
+ tm_file="i386/i386.h i386/att.h linux.h i386/freebsd.h i386/perform.h"
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
+- tmake_file=i386/t-freebsd
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
++ tmake_file=t-freebsd
+ gas=yes
+ gnu_ld=yes
+ stabs=yes
diff --git a/lang/gcc45/Makefile b/lang/gcc45/Makefile
index f9347a47d87e..cd5b039f398a 100644
--- a/lang/gcc45/Makefile
+++ b/lang/gcc45/Makefile
@@ -4,7 +4,7 @@
# Date created: 9 Jan 1998
# Whom: John Polstra <jdp@polstra.com>
#
-# $Id: Makefile,v 1.48 1999/03/08 07:28:27 asami Exp $
+# $Id: Makefile,v 1.50 1999/03/17 00:40:25 obrien Exp $
#
DISTNAME= egcs-1.1.2
@@ -55,21 +55,20 @@ ALL_TARGET= bootstrap
MAN1= cccp.1 g++.1 g77.1 gcc.1
pre-patch:
+ @${MV} ${WRKSRC}/gcc/config/i386/t-freebsd ${WRKSRC}/gcc/config/
@${MV} ${WRKSRC}/gcc/config/i386/freebsd.h ${WRKSRC}/gcc/config/i386/freebsd-aout.h
@${MV} ${WRKSRC}/gcc/config/i386/freebsd-elf.h ${WRKSRC}/gcc/config/i386/freebsd.h
+ @${CP} ${FILESDIR}/alpha-freebsd-elf.h ${WRKSRC}/gcc/config/alpha/freebsd-elf.h
+ @${CP} ${FILESDIR}/alpha-freebsd.h ${WRKSRC}/gcc/config/alpha/freebsd.h
pre-configure:
@# Keep from running `autoconf' and `autoheader' since we modified
@# configure.in by patching it.
@touch ${WRKSRC}/gcc/configure
@touch ${WRKSRC}/gcc/cstamp-h.in
- @(cd ${WRKSRC}/gcc/config/${ARCH}/ ; \
- MAJ=`sysctl -n kern.osreldate | ${SED} -e '/.....$$/s///'` ; \
- ${MV} freebsd-aout.h freebsd-aout.h.in ; \
- ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" freebsd-aout.h.in \
- >freebsd-aout.h ; \
- ${MV} freebsd.h freebsd.h.in ; \
- ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" freebsd.h.in >freebsd.h )
+ @(MAJ=`sysctl -n kern.osreldate | ${SED} -e '/.....$$/s///'` ; \
+ ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" ${FILESDIR}/freebsd.h \
+ >${WRKSRC}/gcc/config/freebsd.h )
.if ${PORTOBJFORMAT} == "elf" && ${MACHINE_ARCH} == "i386"
@${SED} -e 's/^@comment ELF-only://' ${PKGDIR}/PLIST >${PLIST}
.endif
diff --git a/lang/gcc45/files/alpha-freebsd.h b/lang/gcc45/files/alpha-freebsd.h
new file mode 100644
index 000000000000..60a1f07b94ba
--- /dev/null
+++ b/lang/gcc45/files/alpha-freebsd.h
@@ -0,0 +1,443 @@
+/* Definitions of target machine for GNU compiler,
+ for Alpha FreeBSD systems.
+ Copyright (C) 1998 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* This is used on Alpha platforms that use the ELF format.
+ This was taken from the NetBSD configuration, and modified
+ for FreeBSD/alpha by Hidetoshi Shimokawa <simokawa@FreeBSD.ORG> */
+
+
+/* Get generic FreeBSD definitions. */
+#include <freebsd.h>
+
+
+#undef OBJECT_FORMAT_COFF
+#undef EXTENDED_COFF
+#define OBJECT_FORMAT_ELF
+
+/* This is BSD, so it wants DBX format. */
+
+#define DBX_DEBUGGING_INFO
+
+/* This is the char to use for continuation (in case we need to turn
+ continuation back on). */
+
+#define DBX_CONTIN_CHAR '?'
+
+#undef ASM_FINAL_SPEC
+
+/* Names to predefine in the preprocessor for this target machine.
+ XXX FreeBSD, by convention, shouldn't do __alpha, but lots of applications
+ expect it because that's what OSF/1 does. */
+
+#undef TARGET_DEFAULT
+#define TARGET_DEFAULT (MASK_FP | MASK_FPREGS | MASK_GAS)
+
+#undef CPP_PREDEFINES
+#define CPP_PREDEFINES "\
+-D__alpha__ -D__alpha -Acpu(alpha) -Amachine(alpha) " \
+FBSD_CPP_PREDEFINES \
+SUB_CPP_PREDEFINES
+
+/* Make gcc agree with <machine/ansi.h> */
+
+#undef WCHAR_TYPE
+#define WCHAR_TYPE "int"
+
+#undef WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE 32
+
+/* Output assembler code to FILE to increment profiler label # LABELNO
+ for profiling a function entry. Under FreeBSD/Alpha, the assembler does
+ nothing special with -pg. */
+
+#undef FUNCTION_PROFILER
+#define FUNCTION_PROFILER(FILE, LABELNO) \
+ fputs ("\tjsr $28,_mcount\n", (FILE))
+
+/* Show that we need a GP when profiling. */
+#define TARGET_PROFILING_NEEDS_GP
+
+#undef HAS_INIT_SECTION
+
+/* Provide an ASM_SPEC appropriate for a FreeBSD/alpha target. This differs
+ from the generic FreeBSD ASM_SPEC in that no special handling of PIC is
+ necessary on the Alpha. */
+
+#undef ASM_SPEC
+#define ASM_SPEC " %| %{mcpu=*:-m%*}"
+
+/* Output at beginning of assembler file. */
+
+#undef ASM_FILE_START
+#define ASM_FILE_START(FILE) \
+{ \
+ alpha_write_verstamp (FILE); \
+ output_file_directive (FILE, main_input_filename); \
+ fprintf (FILE, "\t.version\t\"01.01\"\n"); \
+ fprintf (FILE, "\t.set noat\n"); \
+}
+
+#define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE) \
+ alpha_output_lineno (STREAM, LINE)
+extern void alpha_output_lineno ();
+
+extern void output_file_directive ();
+
+/* 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. */
+
+#define IDENT_ASM_OP ".ident"
+
+#ifdef IDENTIFY_WITH_IDENT
+#define ASM_IDENTIFY_GCC(FILE) /* nothing */
+#define ASM_IDENTIFY_LANGUAGE(FILE) \
+ fprintf(FILE, "\t%s \"GCC (%s) %s\"\n", IDENT_ASM_OP, \
+ lang_identify(), version_string)
+#else
+#define ASM_FILE_END(FILE) \
+do { \
+ fprintf ((FILE), "\t%s\t\"GCC: (GNU) %s\"\n", \
+ IDENT_ASM_OP, version_string); \
+ } while (0)
+#endif
+
+/* Allow #sccs in preprocessor. */
+
+#define SCCS_DIRECTIVE
+
+/* Output #ident as a .ident. */
+
+#define ASM_OUTPUT_IDENT(FILE, NAME) \
+ fprintf (FILE, "\t%s\t\"%s\"\n", IDENT_ASM_OP, NAME);
+
+/* This is how to allocate empty space in some section. The .zero
+ pseudo-op is used for this on most svr4 assemblers. */
+
+#define SKIP_ASM_OP ".zero"
+
+#undef ASM_OUTPUT_SKIP
+#define ASM_OUTPUT_SKIP(FILE,SIZE) \
+ fprintf (FILE, "\t%s\t%u\n", SKIP_ASM_OP, (SIZE))
+
+/* Output the label which precedes a jumptable. Note that for all svr4
+ systems where we actually generate jumptables (which is to say every
+ svr4 target except i386, where we use casesi instead) we put the jump-
+ tables into the .rodata section and since other stuff could have been
+ put into the .rodata section prior to any given jumptable, we have to
+ make sure that the location counter for the .rodata section gets pro-
+ perly re-aligned prior to the actual beginning of the jump table. */
+
+#define ALIGN_ASM_OP ".align"
+
+#ifndef ASM_OUTPUT_BEFORE_CASE_LABEL
+#define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE,PREFIX,NUM,TABLE) \
+ ASM_OUTPUT_ALIGN ((FILE), 2);
+#endif
+
+#undef ASM_OUTPUT_CASE_LABEL
+#define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,JUMPTABLE) \
+ do { \
+ ASM_OUTPUT_BEFORE_CASE_LABEL (FILE, PREFIX, NUM, JUMPTABLE) \
+ ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); \
+ } while (0)
+
+/* The standard SVR4 assembler seems to require that certain builtin
+ library routines (e.g. .udiv) be explicitly declared as .globl
+ in each assembly file where they are referenced. */
+
+#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
+ ASM_GLOBALIZE_LABEL (FILE, XSTR (FUN, 0))
+
+/* This says how to output assembler code to declare an
+ uninitialized external linkage data object. Under SVR4,
+ the linker seems to want the alignment of data objects
+ to depend on their types. We do exactly that here. */
+
+#define COMMON_ASM_OP ".comm"
+
+#undef ASM_OUTPUT_ALIGNED_COMMON
+#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
+do { \
+ fprintf ((FILE), "\t%s\t", COMMON_ASM_OP); \
+ assemble_name ((FILE), (NAME)); \
+ fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \
+} while (0)
+
+/* This says how to output assembler code to declare an
+ uninitialized internal linkage data object. Under SVR4,
+ the linker seems to want the alignment of data objects
+ to depend on their types. We do exactly that here. */
+
+#define LOCAL_ASM_OP ".local"
+
+#undef ASM_OUTPUT_ALIGNED_LOCAL
+#define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
+do { \
+ fprintf ((FILE), "\t%s\t", LOCAL_ASM_OP); \
+ assemble_name ((FILE), (NAME)); \
+ fprintf ((FILE), "\n"); \
+ ASM_OUTPUT_ALIGNED_COMMON (FILE, NAME, SIZE, ALIGN); \
+} while (0)
+
+/* This is the pseudo-op used to generate a 64-bit word of data with a
+ specific value in some section. */
+
+#define INT_ASM_OP ".quad"
+
+/* This is the pseudo-op used to generate a contiguous sequence of byte
+ values from a double-quoted string WITHOUT HAVING A TERMINATING NUL
+ AUTOMATICALLY APPENDED. This is the same for most svr4 assemblers. */
+
+#undef ASCII_DATA_ASM_OP
+#define ASCII_DATA_ASM_OP ".ascii"
+
+/* Support const sections and the ctors and dtors sections for g++.
+ Note that there appears to be two different ways to support const
+ sections at the moment. You can either #define the symbol
+ READONLY_DATA_SECTION (giving it some code which switches to the
+ readonly data section) or else you can #define the symbols
+ EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, SELECT_SECTION, and
+ SELECT_RTX_SECTION. We do both here just to be on the safe side. */
+
+#define USE_CONST_SECTION 1
+
+#define CONST_SECTION_ASM_OP ".section\t.rodata"
+
+/* Define the pseudo-ops used to switch to the .ctors and .dtors sections.
+
+ Note that we want to give these sections the SHF_WRITE attribute
+ because these sections will actually contain data (i.e. tables of
+ addresses of functions in the current root executable or shared library
+ file) and, in the case of a shared library, the relocatable addresses
+ will have to be properly resolved/relocated (and then written into) by
+ the dynamic linker when it actually attaches the given shared library
+ to the executing process. (Note that on SVR4, you may wish to use the
+ `-z text' option to the ELF linker, when building a shared library, as
+ an additional check that you are doing everything right. But if you do
+ use the `-z text' option when building a shared library, you will get
+ errors unless the .ctors and .dtors sections are marked as writable
+ via the SHF_WRITE attribute.) */
+
+#define CTORS_SECTION_ASM_OP ".section\t.ctors,\"aw\""
+#define DTORS_SECTION_ASM_OP ".section\t.dtors,\"aw\""
+
+/* On svr4, we *do* have support for the .init and .fini sections, and we
+ can put stuff in there to be executed before and after `main'. We let
+ crtstuff.c and other files know this by defining the following symbols.
+ The definitions say how to change sections to the .init and .fini
+ sections. This is the same for all known svr4 assemblers. */
+
+#define INIT_SECTION_ASM_OP ".section\t.init"
+#define FINI_SECTION_ASM_OP ".section\t.fini"
+
+/* A default list of other sections which we might be "in" at any given
+ time. For targets that use additional sections (e.g. .tdesc) you
+ should override this definition in the target-specific file which
+ includes this file. */
+
+#undef EXTRA_SECTIONS
+#define EXTRA_SECTIONS in_const, in_ctors, in_dtors
+
+/* A default list of extra section function definitions. For targets
+ that use additional sections (e.g. .tdesc) you should override this
+ definition in the target-specific file which includes this file. */
+
+#undef EXTRA_SECTION_FUNCTIONS
+#define EXTRA_SECTION_FUNCTIONS \
+ CONST_SECTION_FUNCTION \
+ CTORS_SECTION_FUNCTION \
+ DTORS_SECTION_FUNCTION
+
+#undef READONLY_DATA_SECTION
+#define READONLY_DATA_SECTION() const_section ()
+
+extern void text_section ();
+
+#define CONST_SECTION_FUNCTION \
+void \
+const_section () \
+{ \
+ if (!USE_CONST_SECTION) \
+ text_section(); \
+ else if (in_section != in_const) \
+ { \
+ fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP); \
+ in_section = in_const; \
+ } \
+}
+
+#define CTORS_SECTION_FUNCTION \
+void \
+ctors_section () \
+{ \
+ if (in_section != in_ctors) \
+ { \
+ fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP); \
+ in_section = in_ctors; \
+ } \
+}
+
+#define DTORS_SECTION_FUNCTION \
+void \
+dtors_section () \
+{ \
+ if (in_section != in_dtors) \
+ { \
+ fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP); \
+ in_section = in_dtors; \
+ } \
+}
+
+/* Switch into a generic section.
+ This is currently only used to support section attributes.
+
+ We make the section read-only and executable for a function decl,
+ read-only for a const data decl, and writable for a non-const data decl. */
+#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC) \
+ fprintf (FILE, ".section\t%s,\"%s\",@progbits\n", NAME, \
+ (DECL) && TREE_CODE (DECL) == FUNCTION_DECL ? "ax" : \
+ (DECL) && DECL_READONLY_SECTION (DECL, RELOC) ? "a" : "aw")
+
+
+/* A C statement (sans semicolon) to output an element in the table of
+ global constructors. */
+#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
+ do { \
+ ctors_section (); \
+ fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
+ assemble_name (FILE, NAME); \
+ fprintf (FILE, "\n"); \
+ } while (0)
+
+/* A C statement (sans semicolon) to output an element in the table of
+ global destructors. */
+#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
+ do { \
+ dtors_section (); \
+ fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
+ assemble_name (FILE, NAME); \
+ fprintf (FILE, "\n"); \
+ } while (0)
+
+/* A C statement or statements to switch to the appropriate
+ section for output of DECL. DECL is either a `VAR_DECL' node
+ or a constant of some sort. RELOC indicates whether forming
+ the initial value of DECL requires link-time relocations. */
+
+#define SELECT_SECTION(DECL,RELOC) \
+{ \
+ if (TREE_CODE (DECL) == STRING_CST) \
+ { \
+ if (! flag_writable_strings) \
+ const_section (); \
+ else \
+ data_section (); \
+ } \
+ else if (TREE_CODE (DECL) == VAR_DECL) \
+ { \
+ if ((flag_pic && RELOC) \
+ || !TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL) \
+ || !DECL_INITIAL (DECL) \
+ || (DECL_INITIAL (DECL) != error_mark_node \
+ && !TREE_CONSTANT (DECL_INITIAL (DECL)))) \
+ data_section (); \
+ else \
+ const_section (); \
+ } \
+ else \
+ const_section (); \
+}
+
+/* A C statement or statements to switch to the appropriate
+ section for output of RTX in mode MODE. RTX is some kind
+ of constant in RTL. The argument MODE is redundant except
+ in the case of a `const_int' rtx. Currently, these always
+ go into the const section. */
+
+#undef SELECT_RTX_SECTION
+#define SELECT_RTX_SECTION(MODE,RTX) const_section()
+
+/* Define the strings used for the special svr4 .type and .size directives.
+ These strings generally do not vary from one system running svr4 to
+ another, but if a given system (e.g. m88k running svr) needs to use
+ different pseudo-op names for these, they may be overridden in the
+ file which includes this one. */
+
+#define TYPE_ASM_OP ".type"
+#define SIZE_ASM_OP ".size"
+
+/* This is how we tell the assembler that two symbols have the same value. */
+
+#define ASM_OUTPUT_DEF(FILE,NAME1,NAME2) \
+ do { assemble_name(FILE, NAME1); \
+ fputs(" = ", FILE); \
+ assemble_name(FILE, NAME2); \
+ fputc('\n', FILE); } while (0)
+
+/* A table of bytes codes used by the ASM_OUTPUT_ASCII and
+ ASM_OUTPUT_LIMITED_STRING macros. Each byte in the table
+ corresponds to a particular byte value [0..255]. For any
+ given byte value, if the value in the corresponding table
+ position is zero, the given character can be output directly.
+ If the table value is 1, the byte must be output as a \ooo
+ octal escape. If the tables value is anything else, then the
+ byte value should be output as a \ followed by the value
+ in the table. Note that we can use standard UN*X escape
+ sequences for many control characters, but we don't use
+ \a to represent BEL because some svr4 assemblers (e.g. on
+ the i386) don't know about that. Also, we don't use \v
+ since some versions of gas, such as 2.2 did not accept it. */
+
+#define ESCAPES \
+"\1\1\1\1\1\1\1\1btn\1fr\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\0\0\"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\\\0\0\0\
+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1"
+
+/* Some svr4 assemblers have a limit on the number of characters which
+ can appear in the operand of a .string directive. If your assembler
+ has such a limitation, you should define STRING_LIMIT to reflect that
+ limit. Note that at least some svr4 assemblers have a limit on the
+ actual number of bytes in the double-quoted string, and that they
+ count each character in an escape sequence as one byte. Thus, an
+ escape sequence like \377 would count as four bytes.
+
+ If your target assembler doesn't support the .string directive, you
+ should define this to zero.
+*/
+
+#define STRING_LIMIT ((unsigned) 256)
+
+#define STRING_ASM_OP ".string"
+
+/*
+ * We always use gas here, so we don't worry about ECOFF assembler problems.
+ */
+#undef TARGET_GAS
+#define TARGET_GAS (1)
+
+#undef PREFERRED_DEBUGGING_TYPE
+#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
diff --git a/lang/gcc45/files/patch-ad b/lang/gcc45/files/patch-ad
index f8fb5803acf0..bea070deb344 100644
--- a/lang/gcc45/files/patch-ad
+++ b/lang/gcc45/files/patch-ad
@@ -1,6 +1,41 @@
--- gcc/config/i386/freebsd-aout.h.orig Mon Mar 1 14:47:33 1999
-+++ gcc/config/i386/freebsd-aout.h Sat Mar 13 19:24:50 1999
-@@ -103,19 +103,18 @@
++++ gcc/config/i386/freebsd-aout.h Sat Mar 20 00:27:02 1999
+@@ -20,6 +20,10 @@
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
++
++/* Get generic FreeBSD definitions. */
++#include <freebsd.h>
++
+ /* This goes away when the math-emulator is fixed */
+ #define TARGET_CPU_DEFAULT 0400 /* TARGET_NO_FANCY_MATH_387 */
+
+@@ -35,7 +39,7 @@
+ #include "i386/perform.h"
+
+ #undef CPP_PREDEFINES
+-#define CPP_PREDEFINES "-Dunix -Di386 -D__FreeBSD__ -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)"
++#define CPP_PREDEFINES "-Di386 -Acpu(i386) -Amachine(i386)" CPP_FBSD_PREDEFINES
+
+ /* Like the default, except no -lg. */
+ #define LIB_SPEC "%{!shared:%{!pg:-lc}%{pg:-lc_p}}"
+@@ -85,14 +89,6 @@
+ necessary when compiling PIC code. */
+
+ #define JUMP_TABLES_IN_TEXT_SECTION 1
+-
+-/* Don't default to pcc-struct-return, because gcc is the only compiler, and
+- we want to retain compatibility with older gcc versions. */
+-#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
+
+ /* i386 freebsd still uses old binutils that don't insert nops by default
+ when the .align directive demands to insert extra space in the text
+@@ -103,19 +99,18 @@
/* Profiling routines, partially copied from i386/osfrose.h. */
@@ -23,7 +58,7 @@
fprintf (FILE, "\tcall mcount\n"); \
} \
}
-@@ -133,6 +132,7 @@
+@@ -133,6 +128,7 @@
#define TYPE_ASM_OP ".type"
#define SIZE_ASM_OP ".size"
@@ -31,7 +66,7 @@
/* The following macro defines the format used to output the second
operand of the .type assembler directive. Different svr4 assemblers
-@@ -142,6 +142,12 @@
+@@ -142,6 +138,12 @@
#define TYPE_OPERAND_FMT "@%s"
@@ -44,12 +79,34 @@
/* Write the extra assembler code needed to declare a function's result.
Most svr4 assemblers don't require any special declaration of the
result value, but there are exceptions. */
-@@ -243,6 +249,8 @@
- #define STARTFILE_SPEC \
+@@ -244,29 +246,4 @@
"%{shared:c++rt0.o%s} \
%{!shared:%{pg:gcrt0.o%s}%{!pg:%{static:scrt0.o%s}%{!static:crt0.o%s}}}"
-+
-+#define MD_STARTFILE_PREFIX "/usr/lib/aout/"
- /* This is defined when gcc is compiled in the BSD-directory-tree, and must
- * make up for the gap to all the stuff done in the GNU-makefiles.
+-/* This is defined when gcc is compiled in the BSD-directory-tree, and must
+- * make up for the gap to all the stuff done in the GNU-makefiles.
+- */
+-
+-#ifdef FREEBSD_NATIVE
+-
+-#define INCLUDE_DEFAULTS { \
+- { "/usr/include", 0, 0, 0 }, \
+- { "/usr/include/g++", "G++", 1, 1 }, \
+- { 0, 0, 0, 0} \
+- }
+-
+-#undef MD_EXEC_PREFIX
+-#define MD_EXEC_PREFIX "/usr/libexec/"
+-
+-#undef STANDARD_STARTFILE_PREFIX
+-#define STANDARD_STARTFILE_PREFIX "/usr/lib"
+-
+-#if 0 /* This is very wrong!!! */
+-#define DEFAULT_TARGET_MACHINE "i386-unknown-freebsd_1.0"
+-#define GPLUSPLUS_INCLUDE_DIR "/usr/local/lib/gcc-lib/i386-unknown-freebsd_1.0/2.5.8/include"
+-#define TOOL_INCLUDE_DIR "/usr/local/i386-unknown-freebsd_1.0/include"
+-#define GCC_INCLUDE_DIR "/usr/local/lib/gcc-lib/i386-unknown-freebsd_1.0/2.5.8/include"
+-#endif
+-
+-#endif /* FREEBSD_NATIVE */
++#define MD_STARTFILE_PREFIX "/usr/lib/aout/"
diff --git a/lang/gcc45/files/patch-af b/lang/gcc45/files/patch-af
index c50ce06c8375..c1f1ba0e855f 100644
--- a/lang/gcc45/files/patch-af
+++ b/lang/gcc45/files/patch-af
@@ -1,6 +1,30 @@
--- gcc/config/i386/freebsd.h.orig Mon Mar 1 14:47:32 1999
-+++ gcc/config/i386/freebsd.h Sat Mar 13 19:25:53 1999
-@@ -113,22 +113,19 @@
++++ gcc/config/i386/freebsd.h Sun Mar 21 16:58:39 1999
+@@ -21,19 +21,13 @@
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
++
++/* Get generic FreeBSD definitions. */
++#include <freebsd.h>
++
+ #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
+-
+ /* This is how to output an element of a case-vector that is relative.
+ This is only used for PIC code. See comments by the `casesi' insn in
+ i386.md for an explanation of the expression this outputs. */
+@@ -113,22 +107,19 @@
: ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \
: (-1))
@@ -27,8 +51,18 @@
} \
}
-@@ -151,20 +148,8 @@
- #define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
+@@ -145,26 +136,16 @@
+ #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)"
++#define CPP_PREDEFINES "-Di386 -D__ELF__ -Acpu(i386) -Amachine(i386)" CPP_FBSD_PREDEFINES
+
+ #undef CPP_SPEC
+-#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
++#define CPP_SPEC \
++ "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE} %{m486:-D__i486__}"
++ /* %{pthread:-D_REENTRANT} */
#undef LIB_SPEC
-#if 1
@@ -36,16 +70,16 @@
- * want to profile or debug the C library, please add
- * -lc_p or -ggdb to LDFLAGS at the link time, respectively.
- */
- #define LIB_SPEC \
+-#define LIB_SPEC \
- "%{!shared: %{mieee-fp:-lieee} %{p:-lgmon} %{pg:-lgmon} \
- %{!ggdb:-lc} %{ggdb:-lg}}"
-#else
--#define LIB_SPEC \
+ #define LIB_SPEC \
- "%{!shared: \
- %{mieee-fp:-lieee} %{p:-lgmon -lc_p} %{pg:-lgmon -lc_p} \
- %{!p:%{!pg:%{!g*:-lc} %{g*:-lg}}}}"
-#endif
-+ "%{!shared: %{p:-lc_p} %{pg:-lc_p} %{!p:%{!pg:-lc}}}"
++ "%{!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
diff --git a/lang/gcc45/files/patch-ak b/lang/gcc45/files/patch-ak
index 19a2994f3f05..2e54beea1a61 100644
--- a/lang/gcc45/files/patch-ak
+++ b/lang/gcc45/files/patch-ak
@@ -1,5 +1,5 @@
---- gcc/configure.orig Mon Mar 8 10:06:10 1999
-+++ gcc/configure Sat Mar 13 19:08:06 1999
+--- gcc/configure.orig Sun Mar 14 02:59:02 1999
++++ gcc/configure Sat Mar 20 00:40:05 1999
@@ -2395,6 +2395,15 @@
thread_file='posix'
fi
@@ -27,18 +27,20 @@
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
- extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
+- tmake_file=i386/t-freebsd
- gas=yes
- gnu_ld=yes
- stabs=yes
++ tmake_file=t-freebsd
;;
i[34567]86-*-freebsd*)
- tm_file=i386/freebsd.h
+ tm_file="i386/i386.h i386/att.h linux.h i386/freebsd.h i386/perform.h"
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
+- tmake_file=i386/t-freebsd
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
++ tmake_file=t-freebsd
+ gas=yes
+ gnu_ld=yes
+ stabs=yes
diff --git a/lang/gcc45/files/patch-al b/lang/gcc45/files/patch-al
index 51e1b8cdee1c..c8a195127ed0 100644
--- a/lang/gcc45/files/patch-al
+++ b/lang/gcc45/files/patch-al
@@ -1,5 +1,5 @@
--- gcc/configure.in.orig Sun Mar 7 16:22:22 1999
-+++ gcc/configure.in Sat Mar 13 19:23:23 1999
++++ gcc/configure.in Sat Mar 20 00:40:58 1999
@@ -416,6 +416,15 @@
thread_file='posix'
fi
@@ -27,18 +27,20 @@
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
- extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
+- tmake_file=i386/t-freebsd
- gas=yes
- gnu_ld=yes
- stabs=yes
++ tmake_file=t-freebsd
;;
i[[34567]]86-*-freebsd*)
- tm_file=i386/freebsd.h
+ tm_file="i386/i386.h i386/att.h linux.h i386/freebsd.h i386/perform.h"
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
+- tmake_file=i386/t-freebsd
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
++ tmake_file=t-freebsd
+ gas=yes
+ gnu_ld=yes
+ stabs=yes
diff --git a/lang/gcc46/Makefile b/lang/gcc46/Makefile
index f9347a47d87e..cd5b039f398a 100644
--- a/lang/gcc46/Makefile
+++ b/lang/gcc46/Makefile
@@ -4,7 +4,7 @@
# Date created: 9 Jan 1998
# Whom: John Polstra <jdp@polstra.com>
#
-# $Id: Makefile,v 1.48 1999/03/08 07:28:27 asami Exp $
+# $Id: Makefile,v 1.50 1999/03/17 00:40:25 obrien Exp $
#
DISTNAME= egcs-1.1.2
@@ -55,21 +55,20 @@ ALL_TARGET= bootstrap
MAN1= cccp.1 g++.1 g77.1 gcc.1
pre-patch:
+ @${MV} ${WRKSRC}/gcc/config/i386/t-freebsd ${WRKSRC}/gcc/config/
@${MV} ${WRKSRC}/gcc/config/i386/freebsd.h ${WRKSRC}/gcc/config/i386/freebsd-aout.h
@${MV} ${WRKSRC}/gcc/config/i386/freebsd-elf.h ${WRKSRC}/gcc/config/i386/freebsd.h
+ @${CP} ${FILESDIR}/alpha-freebsd-elf.h ${WRKSRC}/gcc/config/alpha/freebsd-elf.h
+ @${CP} ${FILESDIR}/alpha-freebsd.h ${WRKSRC}/gcc/config/alpha/freebsd.h
pre-configure:
@# Keep from running `autoconf' and `autoheader' since we modified
@# configure.in by patching it.
@touch ${WRKSRC}/gcc/configure
@touch ${WRKSRC}/gcc/cstamp-h.in
- @(cd ${WRKSRC}/gcc/config/${ARCH}/ ; \
- MAJ=`sysctl -n kern.osreldate | ${SED} -e '/.....$$/s///'` ; \
- ${MV} freebsd-aout.h freebsd-aout.h.in ; \
- ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" freebsd-aout.h.in \
- >freebsd-aout.h ; \
- ${MV} freebsd.h freebsd.h.in ; \
- ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" freebsd.h.in >freebsd.h )
+ @(MAJ=`sysctl -n kern.osreldate | ${SED} -e '/.....$$/s///'` ; \
+ ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" ${FILESDIR}/freebsd.h \
+ >${WRKSRC}/gcc/config/freebsd.h )
.if ${PORTOBJFORMAT} == "elf" && ${MACHINE_ARCH} == "i386"
@${SED} -e 's/^@comment ELF-only://' ${PKGDIR}/PLIST >${PLIST}
.endif
diff --git a/lang/gcc46/files/alpha-freebsd.h b/lang/gcc46/files/alpha-freebsd.h
new file mode 100644
index 000000000000..60a1f07b94ba
--- /dev/null
+++ b/lang/gcc46/files/alpha-freebsd.h
@@ -0,0 +1,443 @@
+/* Definitions of target machine for GNU compiler,
+ for Alpha FreeBSD systems.
+ Copyright (C) 1998 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* This is used on Alpha platforms that use the ELF format.
+ This was taken from the NetBSD configuration, and modified
+ for FreeBSD/alpha by Hidetoshi Shimokawa <simokawa@FreeBSD.ORG> */
+
+
+/* Get generic FreeBSD definitions. */
+#include <freebsd.h>
+
+
+#undef OBJECT_FORMAT_COFF
+#undef EXTENDED_COFF
+#define OBJECT_FORMAT_ELF
+
+/* This is BSD, so it wants DBX format. */
+
+#define DBX_DEBUGGING_INFO
+
+/* This is the char to use for continuation (in case we need to turn
+ continuation back on). */
+
+#define DBX_CONTIN_CHAR '?'
+
+#undef ASM_FINAL_SPEC
+
+/* Names to predefine in the preprocessor for this target machine.
+ XXX FreeBSD, by convention, shouldn't do __alpha, but lots of applications
+ expect it because that's what OSF/1 does. */
+
+#undef TARGET_DEFAULT
+#define TARGET_DEFAULT (MASK_FP | MASK_FPREGS | MASK_GAS)
+
+#undef CPP_PREDEFINES
+#define CPP_PREDEFINES "\
+-D__alpha__ -D__alpha -Acpu(alpha) -Amachine(alpha) " \
+FBSD_CPP_PREDEFINES \
+SUB_CPP_PREDEFINES
+
+/* Make gcc agree with <machine/ansi.h> */
+
+#undef WCHAR_TYPE
+#define WCHAR_TYPE "int"
+
+#undef WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE 32
+
+/* Output assembler code to FILE to increment profiler label # LABELNO
+ for profiling a function entry. Under FreeBSD/Alpha, the assembler does
+ nothing special with -pg. */
+
+#undef FUNCTION_PROFILER
+#define FUNCTION_PROFILER(FILE, LABELNO) \
+ fputs ("\tjsr $28,_mcount\n", (FILE))
+
+/* Show that we need a GP when profiling. */
+#define TARGET_PROFILING_NEEDS_GP
+
+#undef HAS_INIT_SECTION
+
+/* Provide an ASM_SPEC appropriate for a FreeBSD/alpha target. This differs
+ from the generic FreeBSD ASM_SPEC in that no special handling of PIC is
+ necessary on the Alpha. */
+
+#undef ASM_SPEC
+#define ASM_SPEC " %| %{mcpu=*:-m%*}"
+
+/* Output at beginning of assembler file. */
+
+#undef ASM_FILE_START
+#define ASM_FILE_START(FILE) \
+{ \
+ alpha_write_verstamp (FILE); \
+ output_file_directive (FILE, main_input_filename); \
+ fprintf (FILE, "\t.version\t\"01.01\"\n"); \
+ fprintf (FILE, "\t.set noat\n"); \
+}
+
+#define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE) \
+ alpha_output_lineno (STREAM, LINE)
+extern void alpha_output_lineno ();
+
+extern void output_file_directive ();
+
+/* 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. */
+
+#define IDENT_ASM_OP ".ident"
+
+#ifdef IDENTIFY_WITH_IDENT
+#define ASM_IDENTIFY_GCC(FILE) /* nothing */
+#define ASM_IDENTIFY_LANGUAGE(FILE) \
+ fprintf(FILE, "\t%s \"GCC (%s) %s\"\n", IDENT_ASM_OP, \
+ lang_identify(), version_string)
+#else
+#define ASM_FILE_END(FILE) \
+do { \
+ fprintf ((FILE), "\t%s\t\"GCC: (GNU) %s\"\n", \
+ IDENT_ASM_OP, version_string); \
+ } while (0)
+#endif
+
+/* Allow #sccs in preprocessor. */
+
+#define SCCS_DIRECTIVE
+
+/* Output #ident as a .ident. */
+
+#define ASM_OUTPUT_IDENT(FILE, NAME) \
+ fprintf (FILE, "\t%s\t\"%s\"\n", IDENT_ASM_OP, NAME);
+
+/* This is how to allocate empty space in some section. The .zero
+ pseudo-op is used for this on most svr4 assemblers. */
+
+#define SKIP_ASM_OP ".zero"
+
+#undef ASM_OUTPUT_SKIP
+#define ASM_OUTPUT_SKIP(FILE,SIZE) \
+ fprintf (FILE, "\t%s\t%u\n", SKIP_ASM_OP, (SIZE))
+
+/* Output the label which precedes a jumptable. Note that for all svr4
+ systems where we actually generate jumptables (which is to say every
+ svr4 target except i386, where we use casesi instead) we put the jump-
+ tables into the .rodata section and since other stuff could have been
+ put into the .rodata section prior to any given jumptable, we have to
+ make sure that the location counter for the .rodata section gets pro-
+ perly re-aligned prior to the actual beginning of the jump table. */
+
+#define ALIGN_ASM_OP ".align"
+
+#ifndef ASM_OUTPUT_BEFORE_CASE_LABEL
+#define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE,PREFIX,NUM,TABLE) \
+ ASM_OUTPUT_ALIGN ((FILE), 2);
+#endif
+
+#undef ASM_OUTPUT_CASE_LABEL
+#define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,JUMPTABLE) \
+ do { \
+ ASM_OUTPUT_BEFORE_CASE_LABEL (FILE, PREFIX, NUM, JUMPTABLE) \
+ ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); \
+ } while (0)
+
+/* The standard SVR4 assembler seems to require that certain builtin
+ library routines (e.g. .udiv) be explicitly declared as .globl
+ in each assembly file where they are referenced. */
+
+#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
+ ASM_GLOBALIZE_LABEL (FILE, XSTR (FUN, 0))
+
+/* This says how to output assembler code to declare an
+ uninitialized external linkage data object. Under SVR4,
+ the linker seems to want the alignment of data objects
+ to depend on their types. We do exactly that here. */
+
+#define COMMON_ASM_OP ".comm"
+
+#undef ASM_OUTPUT_ALIGNED_COMMON
+#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
+do { \
+ fprintf ((FILE), "\t%s\t", COMMON_ASM_OP); \
+ assemble_name ((FILE), (NAME)); \
+ fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \
+} while (0)
+
+/* This says how to output assembler code to declare an
+ uninitialized internal linkage data object. Under SVR4,
+ the linker seems to want the alignment of data objects
+ to depend on their types. We do exactly that here. */
+
+#define LOCAL_ASM_OP ".local"
+
+#undef ASM_OUTPUT_ALIGNED_LOCAL
+#define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
+do { \
+ fprintf ((FILE), "\t%s\t", LOCAL_ASM_OP); \
+ assemble_name ((FILE), (NAME)); \
+ fprintf ((FILE), "\n"); \
+ ASM_OUTPUT_ALIGNED_COMMON (FILE, NAME, SIZE, ALIGN); \
+} while (0)
+
+/* This is the pseudo-op used to generate a 64-bit word of data with a
+ specific value in some section. */
+
+#define INT_ASM_OP ".quad"
+
+/* This is the pseudo-op used to generate a contiguous sequence of byte
+ values from a double-quoted string WITHOUT HAVING A TERMINATING NUL
+ AUTOMATICALLY APPENDED. This is the same for most svr4 assemblers. */
+
+#undef ASCII_DATA_ASM_OP
+#define ASCII_DATA_ASM_OP ".ascii"
+
+/* Support const sections and the ctors and dtors sections for g++.
+ Note that there appears to be two different ways to support const
+ sections at the moment. You can either #define the symbol
+ READONLY_DATA_SECTION (giving it some code which switches to the
+ readonly data section) or else you can #define the symbols
+ EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, SELECT_SECTION, and
+ SELECT_RTX_SECTION. We do both here just to be on the safe side. */
+
+#define USE_CONST_SECTION 1
+
+#define CONST_SECTION_ASM_OP ".section\t.rodata"
+
+/* Define the pseudo-ops used to switch to the .ctors and .dtors sections.
+
+ Note that we want to give these sections the SHF_WRITE attribute
+ because these sections will actually contain data (i.e. tables of
+ addresses of functions in the current root executable or shared library
+ file) and, in the case of a shared library, the relocatable addresses
+ will have to be properly resolved/relocated (and then written into) by
+ the dynamic linker when it actually attaches the given shared library
+ to the executing process. (Note that on SVR4, you may wish to use the
+ `-z text' option to the ELF linker, when building a shared library, as
+ an additional check that you are doing everything right. But if you do
+ use the `-z text' option when building a shared library, you will get
+ errors unless the .ctors and .dtors sections are marked as writable
+ via the SHF_WRITE attribute.) */
+
+#define CTORS_SECTION_ASM_OP ".section\t.ctors,\"aw\""
+#define DTORS_SECTION_ASM_OP ".section\t.dtors,\"aw\""
+
+/* On svr4, we *do* have support for the .init and .fini sections, and we
+ can put stuff in there to be executed before and after `main'. We let
+ crtstuff.c and other files know this by defining the following symbols.
+ The definitions say how to change sections to the .init and .fini
+ sections. This is the same for all known svr4 assemblers. */
+
+#define INIT_SECTION_ASM_OP ".section\t.init"
+#define FINI_SECTION_ASM_OP ".section\t.fini"
+
+/* A default list of other sections which we might be "in" at any given
+ time. For targets that use additional sections (e.g. .tdesc) you
+ should override this definition in the target-specific file which
+ includes this file. */
+
+#undef EXTRA_SECTIONS
+#define EXTRA_SECTIONS in_const, in_ctors, in_dtors
+
+/* A default list of extra section function definitions. For targets
+ that use additional sections (e.g. .tdesc) you should override this
+ definition in the target-specific file which includes this file. */
+
+#undef EXTRA_SECTION_FUNCTIONS
+#define EXTRA_SECTION_FUNCTIONS \
+ CONST_SECTION_FUNCTION \
+ CTORS_SECTION_FUNCTION \
+ DTORS_SECTION_FUNCTION
+
+#undef READONLY_DATA_SECTION
+#define READONLY_DATA_SECTION() const_section ()
+
+extern void text_section ();
+
+#define CONST_SECTION_FUNCTION \
+void \
+const_section () \
+{ \
+ if (!USE_CONST_SECTION) \
+ text_section(); \
+ else if (in_section != in_const) \
+ { \
+ fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP); \
+ in_section = in_const; \
+ } \
+}
+
+#define CTORS_SECTION_FUNCTION \
+void \
+ctors_section () \
+{ \
+ if (in_section != in_ctors) \
+ { \
+ fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP); \
+ in_section = in_ctors; \
+ } \
+}
+
+#define DTORS_SECTION_FUNCTION \
+void \
+dtors_section () \
+{ \
+ if (in_section != in_dtors) \
+ { \
+ fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP); \
+ in_section = in_dtors; \
+ } \
+}
+
+/* Switch into a generic section.
+ This is currently only used to support section attributes.
+
+ We make the section read-only and executable for a function decl,
+ read-only for a const data decl, and writable for a non-const data decl. */
+#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC) \
+ fprintf (FILE, ".section\t%s,\"%s\",@progbits\n", NAME, \
+ (DECL) && TREE_CODE (DECL) == FUNCTION_DECL ? "ax" : \
+ (DECL) && DECL_READONLY_SECTION (DECL, RELOC) ? "a" : "aw")
+
+
+/* A C statement (sans semicolon) to output an element in the table of
+ global constructors. */
+#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
+ do { \
+ ctors_section (); \
+ fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
+ assemble_name (FILE, NAME); \
+ fprintf (FILE, "\n"); \
+ } while (0)
+
+/* A C statement (sans semicolon) to output an element in the table of
+ global destructors. */
+#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
+ do { \
+ dtors_section (); \
+ fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
+ assemble_name (FILE, NAME); \
+ fprintf (FILE, "\n"); \
+ } while (0)
+
+/* A C statement or statements to switch to the appropriate
+ section for output of DECL. DECL is either a `VAR_DECL' node
+ or a constant of some sort. RELOC indicates whether forming
+ the initial value of DECL requires link-time relocations. */
+
+#define SELECT_SECTION(DECL,RELOC) \
+{ \
+ if (TREE_CODE (DECL) == STRING_CST) \
+ { \
+ if (! flag_writable_strings) \
+ const_section (); \
+ else \
+ data_section (); \
+ } \
+ else if (TREE_CODE (DECL) == VAR_DECL) \
+ { \
+ if ((flag_pic && RELOC) \
+ || !TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL) \
+ || !DECL_INITIAL (DECL) \
+ || (DECL_INITIAL (DECL) != error_mark_node \
+ && !TREE_CONSTANT (DECL_INITIAL (DECL)))) \
+ data_section (); \
+ else \
+ const_section (); \
+ } \
+ else \
+ const_section (); \
+}
+
+/* A C statement or statements to switch to the appropriate
+ section for output of RTX in mode MODE. RTX is some kind
+ of constant in RTL. The argument MODE is redundant except
+ in the case of a `const_int' rtx. Currently, these always
+ go into the const section. */
+
+#undef SELECT_RTX_SECTION
+#define SELECT_RTX_SECTION(MODE,RTX) const_section()
+
+/* Define the strings used for the special svr4 .type and .size directives.
+ These strings generally do not vary from one system running svr4 to
+ another, but if a given system (e.g. m88k running svr) needs to use
+ different pseudo-op names for these, they may be overridden in the
+ file which includes this one. */
+
+#define TYPE_ASM_OP ".type"
+#define SIZE_ASM_OP ".size"
+
+/* This is how we tell the assembler that two symbols have the same value. */
+
+#define ASM_OUTPUT_DEF(FILE,NAME1,NAME2) \
+ do { assemble_name(FILE, NAME1); \
+ fputs(" = ", FILE); \
+ assemble_name(FILE, NAME2); \
+ fputc('\n', FILE); } while (0)
+
+/* A table of bytes codes used by the ASM_OUTPUT_ASCII and
+ ASM_OUTPUT_LIMITED_STRING macros. Each byte in the table
+ corresponds to a particular byte value [0..255]. For any
+ given byte value, if the value in the corresponding table
+ position is zero, the given character can be output directly.
+ If the table value is 1, the byte must be output as a \ooo
+ octal escape. If the tables value is anything else, then the
+ byte value should be output as a \ followed by the value
+ in the table. Note that we can use standard UN*X escape
+ sequences for many control characters, but we don't use
+ \a to represent BEL because some svr4 assemblers (e.g. on
+ the i386) don't know about that. Also, we don't use \v
+ since some versions of gas, such as 2.2 did not accept it. */
+
+#define ESCAPES \
+"\1\1\1\1\1\1\1\1btn\1fr\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\0\0\"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\\\0\0\0\
+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1"
+
+/* Some svr4 assemblers have a limit on the number of characters which
+ can appear in the operand of a .string directive. If your assembler
+ has such a limitation, you should define STRING_LIMIT to reflect that
+ limit. Note that at least some svr4 assemblers have a limit on the
+ actual number of bytes in the double-quoted string, and that they
+ count each character in an escape sequence as one byte. Thus, an
+ escape sequence like \377 would count as four bytes.
+
+ If your target assembler doesn't support the .string directive, you
+ should define this to zero.
+*/
+
+#define STRING_LIMIT ((unsigned) 256)
+
+#define STRING_ASM_OP ".string"
+
+/*
+ * We always use gas here, so we don't worry about ECOFF assembler problems.
+ */
+#undef TARGET_GAS
+#define TARGET_GAS (1)
+
+#undef PREFERRED_DEBUGGING_TYPE
+#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
diff --git a/lang/gcc46/files/patch-ad b/lang/gcc46/files/patch-ad
index f8fb5803acf0..bea070deb344 100644
--- a/lang/gcc46/files/patch-ad
+++ b/lang/gcc46/files/patch-ad
@@ -1,6 +1,41 @@
--- gcc/config/i386/freebsd-aout.h.orig Mon Mar 1 14:47:33 1999
-+++ gcc/config/i386/freebsd-aout.h Sat Mar 13 19:24:50 1999
-@@ -103,19 +103,18 @@
++++ gcc/config/i386/freebsd-aout.h Sat Mar 20 00:27:02 1999
+@@ -20,6 +20,10 @@
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
++
++/* Get generic FreeBSD definitions. */
++#include <freebsd.h>
++
+ /* This goes away when the math-emulator is fixed */
+ #define TARGET_CPU_DEFAULT 0400 /* TARGET_NO_FANCY_MATH_387 */
+
+@@ -35,7 +39,7 @@
+ #include "i386/perform.h"
+
+ #undef CPP_PREDEFINES
+-#define CPP_PREDEFINES "-Dunix -Di386 -D__FreeBSD__ -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)"
++#define CPP_PREDEFINES "-Di386 -Acpu(i386) -Amachine(i386)" CPP_FBSD_PREDEFINES
+
+ /* Like the default, except no -lg. */
+ #define LIB_SPEC "%{!shared:%{!pg:-lc}%{pg:-lc_p}}"
+@@ -85,14 +89,6 @@
+ necessary when compiling PIC code. */
+
+ #define JUMP_TABLES_IN_TEXT_SECTION 1
+-
+-/* Don't default to pcc-struct-return, because gcc is the only compiler, and
+- we want to retain compatibility with older gcc versions. */
+-#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
+
+ /* i386 freebsd still uses old binutils that don't insert nops by default
+ when the .align directive demands to insert extra space in the text
+@@ -103,19 +99,18 @@
/* Profiling routines, partially copied from i386/osfrose.h. */
@@ -23,7 +58,7 @@
fprintf (FILE, "\tcall mcount\n"); \
} \
}
-@@ -133,6 +132,7 @@
+@@ -133,6 +128,7 @@
#define TYPE_ASM_OP ".type"
#define SIZE_ASM_OP ".size"
@@ -31,7 +66,7 @@
/* The following macro defines the format used to output the second
operand of the .type assembler directive. Different svr4 assemblers
-@@ -142,6 +142,12 @@
+@@ -142,6 +138,12 @@
#define TYPE_OPERAND_FMT "@%s"
@@ -44,12 +79,34 @@
/* Write the extra assembler code needed to declare a function's result.
Most svr4 assemblers don't require any special declaration of the
result value, but there are exceptions. */
-@@ -243,6 +249,8 @@
- #define STARTFILE_SPEC \
+@@ -244,29 +246,4 @@
"%{shared:c++rt0.o%s} \
%{!shared:%{pg:gcrt0.o%s}%{!pg:%{static:scrt0.o%s}%{!static:crt0.o%s}}}"
-+
-+#define MD_STARTFILE_PREFIX "/usr/lib/aout/"
- /* This is defined when gcc is compiled in the BSD-directory-tree, and must
- * make up for the gap to all the stuff done in the GNU-makefiles.
+-/* This is defined when gcc is compiled in the BSD-directory-tree, and must
+- * make up for the gap to all the stuff done in the GNU-makefiles.
+- */
+-
+-#ifdef FREEBSD_NATIVE
+-
+-#define INCLUDE_DEFAULTS { \
+- { "/usr/include", 0, 0, 0 }, \
+- { "/usr/include/g++", "G++", 1, 1 }, \
+- { 0, 0, 0, 0} \
+- }
+-
+-#undef MD_EXEC_PREFIX
+-#define MD_EXEC_PREFIX "/usr/libexec/"
+-
+-#undef STANDARD_STARTFILE_PREFIX
+-#define STANDARD_STARTFILE_PREFIX "/usr/lib"
+-
+-#if 0 /* This is very wrong!!! */
+-#define DEFAULT_TARGET_MACHINE "i386-unknown-freebsd_1.0"
+-#define GPLUSPLUS_INCLUDE_DIR "/usr/local/lib/gcc-lib/i386-unknown-freebsd_1.0/2.5.8/include"
+-#define TOOL_INCLUDE_DIR "/usr/local/i386-unknown-freebsd_1.0/include"
+-#define GCC_INCLUDE_DIR "/usr/local/lib/gcc-lib/i386-unknown-freebsd_1.0/2.5.8/include"
+-#endif
+-
+-#endif /* FREEBSD_NATIVE */
++#define MD_STARTFILE_PREFIX "/usr/lib/aout/"
diff --git a/lang/gcc46/files/patch-af b/lang/gcc46/files/patch-af
index c50ce06c8375..c1f1ba0e855f 100644
--- a/lang/gcc46/files/patch-af
+++ b/lang/gcc46/files/patch-af
@@ -1,6 +1,30 @@
--- gcc/config/i386/freebsd.h.orig Mon Mar 1 14:47:32 1999
-+++ gcc/config/i386/freebsd.h Sat Mar 13 19:25:53 1999
-@@ -113,22 +113,19 @@
++++ gcc/config/i386/freebsd.h Sun Mar 21 16:58:39 1999
+@@ -21,19 +21,13 @@
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
++
++/* Get generic FreeBSD definitions. */
++#include <freebsd.h>
++
+ #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
+-
+ /* This is how to output an element of a case-vector that is relative.
+ This is only used for PIC code. See comments by the `casesi' insn in
+ i386.md for an explanation of the expression this outputs. */
+@@ -113,22 +107,19 @@
: ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \
: (-1))
@@ -27,8 +51,18 @@
} \
}
-@@ -151,20 +148,8 @@
- #define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
+@@ -145,26 +136,16 @@
+ #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)"
++#define CPP_PREDEFINES "-Di386 -D__ELF__ -Acpu(i386) -Amachine(i386)" CPP_FBSD_PREDEFINES
+
+ #undef CPP_SPEC
+-#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
++#define CPP_SPEC \
++ "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE} %{m486:-D__i486__}"
++ /* %{pthread:-D_REENTRANT} */
#undef LIB_SPEC
-#if 1
@@ -36,16 +70,16 @@
- * want to profile or debug the C library, please add
- * -lc_p or -ggdb to LDFLAGS at the link time, respectively.
- */
- #define LIB_SPEC \
+-#define LIB_SPEC \
- "%{!shared: %{mieee-fp:-lieee} %{p:-lgmon} %{pg:-lgmon} \
- %{!ggdb:-lc} %{ggdb:-lg}}"
-#else
--#define LIB_SPEC \
+ #define LIB_SPEC \
- "%{!shared: \
- %{mieee-fp:-lieee} %{p:-lgmon -lc_p} %{pg:-lgmon -lc_p} \
- %{!p:%{!pg:%{!g*:-lc} %{g*:-lg}}}}"
-#endif
-+ "%{!shared: %{p:-lc_p} %{pg:-lc_p} %{!p:%{!pg:-lc}}}"
++ "%{!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
diff --git a/lang/gcc46/files/patch-ak b/lang/gcc46/files/patch-ak
index 19a2994f3f05..2e54beea1a61 100644
--- a/lang/gcc46/files/patch-ak
+++ b/lang/gcc46/files/patch-ak
@@ -1,5 +1,5 @@
---- gcc/configure.orig Mon Mar 8 10:06:10 1999
-+++ gcc/configure Sat Mar 13 19:08:06 1999
+--- gcc/configure.orig Sun Mar 14 02:59:02 1999
++++ gcc/configure Sat Mar 20 00:40:05 1999
@@ -2395,6 +2395,15 @@
thread_file='posix'
fi
@@ -27,18 +27,20 @@
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
- extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
+- tmake_file=i386/t-freebsd
- gas=yes
- gnu_ld=yes
- stabs=yes
++ tmake_file=t-freebsd
;;
i[34567]86-*-freebsd*)
- tm_file=i386/freebsd.h
+ tm_file="i386/i386.h i386/att.h linux.h i386/freebsd.h i386/perform.h"
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
+- tmake_file=i386/t-freebsd
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
++ tmake_file=t-freebsd
+ gas=yes
+ gnu_ld=yes
+ stabs=yes
diff --git a/lang/gcc46/files/patch-al b/lang/gcc46/files/patch-al
index 51e1b8cdee1c..c8a195127ed0 100644
--- a/lang/gcc46/files/patch-al
+++ b/lang/gcc46/files/patch-al
@@ -1,5 +1,5 @@
--- gcc/configure.in.orig Sun Mar 7 16:22:22 1999
-+++ gcc/configure.in Sat Mar 13 19:23:23 1999
++++ gcc/configure.in Sat Mar 20 00:40:58 1999
@@ -416,6 +416,15 @@
thread_file='posix'
fi
@@ -27,18 +27,20 @@
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
- extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
+- tmake_file=i386/t-freebsd
- gas=yes
- gnu_ld=yes
- stabs=yes
++ tmake_file=t-freebsd
;;
i[[34567]]86-*-freebsd*)
- tm_file=i386/freebsd.h
+ tm_file="i386/i386.h i386/att.h linux.h i386/freebsd.h i386/perform.h"
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
+- tmake_file=i386/t-freebsd
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
++ tmake_file=t-freebsd
+ gas=yes
+ gnu_ld=yes
+ stabs=yes
diff --git a/lang/gcc47/Makefile b/lang/gcc47/Makefile
index f9347a47d87e..cd5b039f398a 100644
--- a/lang/gcc47/Makefile
+++ b/lang/gcc47/Makefile
@@ -4,7 +4,7 @@
# Date created: 9 Jan 1998
# Whom: John Polstra <jdp@polstra.com>
#
-# $Id: Makefile,v 1.48 1999/03/08 07:28:27 asami Exp $
+# $Id: Makefile,v 1.50 1999/03/17 00:40:25 obrien Exp $
#
DISTNAME= egcs-1.1.2
@@ -55,21 +55,20 @@ ALL_TARGET= bootstrap
MAN1= cccp.1 g++.1 g77.1 gcc.1
pre-patch:
+ @${MV} ${WRKSRC}/gcc/config/i386/t-freebsd ${WRKSRC}/gcc/config/
@${MV} ${WRKSRC}/gcc/config/i386/freebsd.h ${WRKSRC}/gcc/config/i386/freebsd-aout.h
@${MV} ${WRKSRC}/gcc/config/i386/freebsd-elf.h ${WRKSRC}/gcc/config/i386/freebsd.h
+ @${CP} ${FILESDIR}/alpha-freebsd-elf.h ${WRKSRC}/gcc/config/alpha/freebsd-elf.h
+ @${CP} ${FILESDIR}/alpha-freebsd.h ${WRKSRC}/gcc/config/alpha/freebsd.h
pre-configure:
@# Keep from running `autoconf' and `autoheader' since we modified
@# configure.in by patching it.
@touch ${WRKSRC}/gcc/configure
@touch ${WRKSRC}/gcc/cstamp-h.in
- @(cd ${WRKSRC}/gcc/config/${ARCH}/ ; \
- MAJ=`sysctl -n kern.osreldate | ${SED} -e '/.....$$/s///'` ; \
- ${MV} freebsd-aout.h freebsd-aout.h.in ; \
- ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" freebsd-aout.h.in \
- >freebsd-aout.h ; \
- ${MV} freebsd.h freebsd.h.in ; \
- ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" freebsd.h.in >freebsd.h )
+ @(MAJ=`sysctl -n kern.osreldate | ${SED} -e '/.....$$/s///'` ; \
+ ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" ${FILESDIR}/freebsd.h \
+ >${WRKSRC}/gcc/config/freebsd.h )
.if ${PORTOBJFORMAT} == "elf" && ${MACHINE_ARCH} == "i386"
@${SED} -e 's/^@comment ELF-only://' ${PKGDIR}/PLIST >${PLIST}
.endif
diff --git a/lang/gcc47/files/alpha-freebsd.h b/lang/gcc47/files/alpha-freebsd.h
new file mode 100644
index 000000000000..60a1f07b94ba
--- /dev/null
+++ b/lang/gcc47/files/alpha-freebsd.h
@@ -0,0 +1,443 @@
+/* Definitions of target machine for GNU compiler,
+ for Alpha FreeBSD systems.
+ Copyright (C) 1998 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* This is used on Alpha platforms that use the ELF format.
+ This was taken from the NetBSD configuration, and modified
+ for FreeBSD/alpha by Hidetoshi Shimokawa <simokawa@FreeBSD.ORG> */
+
+
+/* Get generic FreeBSD definitions. */
+#include <freebsd.h>
+
+
+#undef OBJECT_FORMAT_COFF
+#undef EXTENDED_COFF
+#define OBJECT_FORMAT_ELF
+
+/* This is BSD, so it wants DBX format. */
+
+#define DBX_DEBUGGING_INFO
+
+/* This is the char to use for continuation (in case we need to turn
+ continuation back on). */
+
+#define DBX_CONTIN_CHAR '?'
+
+#undef ASM_FINAL_SPEC
+
+/* Names to predefine in the preprocessor for this target machine.
+ XXX FreeBSD, by convention, shouldn't do __alpha, but lots of applications
+ expect it because that's what OSF/1 does. */
+
+#undef TARGET_DEFAULT
+#define TARGET_DEFAULT (MASK_FP | MASK_FPREGS | MASK_GAS)
+
+#undef CPP_PREDEFINES
+#define CPP_PREDEFINES "\
+-D__alpha__ -D__alpha -Acpu(alpha) -Amachine(alpha) " \
+FBSD_CPP_PREDEFINES \
+SUB_CPP_PREDEFINES
+
+/* Make gcc agree with <machine/ansi.h> */
+
+#undef WCHAR_TYPE
+#define WCHAR_TYPE "int"
+
+#undef WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE 32
+
+/* Output assembler code to FILE to increment profiler label # LABELNO
+ for profiling a function entry. Under FreeBSD/Alpha, the assembler does
+ nothing special with -pg. */
+
+#undef FUNCTION_PROFILER
+#define FUNCTION_PROFILER(FILE, LABELNO) \
+ fputs ("\tjsr $28,_mcount\n", (FILE))
+
+/* Show that we need a GP when profiling. */
+#define TARGET_PROFILING_NEEDS_GP
+
+#undef HAS_INIT_SECTION
+
+/* Provide an ASM_SPEC appropriate for a FreeBSD/alpha target. This differs
+ from the generic FreeBSD ASM_SPEC in that no special handling of PIC is
+ necessary on the Alpha. */
+
+#undef ASM_SPEC
+#define ASM_SPEC " %| %{mcpu=*:-m%*}"
+
+/* Output at beginning of assembler file. */
+
+#undef ASM_FILE_START
+#define ASM_FILE_START(FILE) \
+{ \
+ alpha_write_verstamp (FILE); \
+ output_file_directive (FILE, main_input_filename); \
+ fprintf (FILE, "\t.version\t\"01.01\"\n"); \
+ fprintf (FILE, "\t.set noat\n"); \
+}
+
+#define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE) \
+ alpha_output_lineno (STREAM, LINE)
+extern void alpha_output_lineno ();
+
+extern void output_file_directive ();
+
+/* 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. */
+
+#define IDENT_ASM_OP ".ident"
+
+#ifdef IDENTIFY_WITH_IDENT
+#define ASM_IDENTIFY_GCC(FILE) /* nothing */
+#define ASM_IDENTIFY_LANGUAGE(FILE) \
+ fprintf(FILE, "\t%s \"GCC (%s) %s\"\n", IDENT_ASM_OP, \
+ lang_identify(), version_string)
+#else
+#define ASM_FILE_END(FILE) \
+do { \
+ fprintf ((FILE), "\t%s\t\"GCC: (GNU) %s\"\n", \
+ IDENT_ASM_OP, version_string); \
+ } while (0)
+#endif
+
+/* Allow #sccs in preprocessor. */
+
+#define SCCS_DIRECTIVE
+
+/* Output #ident as a .ident. */
+
+#define ASM_OUTPUT_IDENT(FILE, NAME) \
+ fprintf (FILE, "\t%s\t\"%s\"\n", IDENT_ASM_OP, NAME);
+
+/* This is how to allocate empty space in some section. The .zero
+ pseudo-op is used for this on most svr4 assemblers. */
+
+#define SKIP_ASM_OP ".zero"
+
+#undef ASM_OUTPUT_SKIP
+#define ASM_OUTPUT_SKIP(FILE,SIZE) \
+ fprintf (FILE, "\t%s\t%u\n", SKIP_ASM_OP, (SIZE))
+
+/* Output the label which precedes a jumptable. Note that for all svr4
+ systems where we actually generate jumptables (which is to say every
+ svr4 target except i386, where we use casesi instead) we put the jump-
+ tables into the .rodata section and since other stuff could have been
+ put into the .rodata section prior to any given jumptable, we have to
+ make sure that the location counter for the .rodata section gets pro-
+ perly re-aligned prior to the actual beginning of the jump table. */
+
+#define ALIGN_ASM_OP ".align"
+
+#ifndef ASM_OUTPUT_BEFORE_CASE_LABEL
+#define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE,PREFIX,NUM,TABLE) \
+ ASM_OUTPUT_ALIGN ((FILE), 2);
+#endif
+
+#undef ASM_OUTPUT_CASE_LABEL
+#define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,JUMPTABLE) \
+ do { \
+ ASM_OUTPUT_BEFORE_CASE_LABEL (FILE, PREFIX, NUM, JUMPTABLE) \
+ ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); \
+ } while (0)
+
+/* The standard SVR4 assembler seems to require that certain builtin
+ library routines (e.g. .udiv) be explicitly declared as .globl
+ in each assembly file where they are referenced. */
+
+#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
+ ASM_GLOBALIZE_LABEL (FILE, XSTR (FUN, 0))
+
+/* This says how to output assembler code to declare an
+ uninitialized external linkage data object. Under SVR4,
+ the linker seems to want the alignment of data objects
+ to depend on their types. We do exactly that here. */
+
+#define COMMON_ASM_OP ".comm"
+
+#undef ASM_OUTPUT_ALIGNED_COMMON
+#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
+do { \
+ fprintf ((FILE), "\t%s\t", COMMON_ASM_OP); \
+ assemble_name ((FILE), (NAME)); \
+ fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \
+} while (0)
+
+/* This says how to output assembler code to declare an
+ uninitialized internal linkage data object. Under SVR4,
+ the linker seems to want the alignment of data objects
+ to depend on their types. We do exactly that here. */
+
+#define LOCAL_ASM_OP ".local"
+
+#undef ASM_OUTPUT_ALIGNED_LOCAL
+#define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
+do { \
+ fprintf ((FILE), "\t%s\t", LOCAL_ASM_OP); \
+ assemble_name ((FILE), (NAME)); \
+ fprintf ((FILE), "\n"); \
+ ASM_OUTPUT_ALIGNED_COMMON (FILE, NAME, SIZE, ALIGN); \
+} while (0)
+
+/* This is the pseudo-op used to generate a 64-bit word of data with a
+ specific value in some section. */
+
+#define INT_ASM_OP ".quad"
+
+/* This is the pseudo-op used to generate a contiguous sequence of byte
+ values from a double-quoted string WITHOUT HAVING A TERMINATING NUL
+ AUTOMATICALLY APPENDED. This is the same for most svr4 assemblers. */
+
+#undef ASCII_DATA_ASM_OP
+#define ASCII_DATA_ASM_OP ".ascii"
+
+/* Support const sections and the ctors and dtors sections for g++.
+ Note that there appears to be two different ways to support const
+ sections at the moment. You can either #define the symbol
+ READONLY_DATA_SECTION (giving it some code which switches to the
+ readonly data section) or else you can #define the symbols
+ EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, SELECT_SECTION, and
+ SELECT_RTX_SECTION. We do both here just to be on the safe side. */
+
+#define USE_CONST_SECTION 1
+
+#define CONST_SECTION_ASM_OP ".section\t.rodata"
+
+/* Define the pseudo-ops used to switch to the .ctors and .dtors sections.
+
+ Note that we want to give these sections the SHF_WRITE attribute
+ because these sections will actually contain data (i.e. tables of
+ addresses of functions in the current root executable or shared library
+ file) and, in the case of a shared library, the relocatable addresses
+ will have to be properly resolved/relocated (and then written into) by
+ the dynamic linker when it actually attaches the given shared library
+ to the executing process. (Note that on SVR4, you may wish to use the
+ `-z text' option to the ELF linker, when building a shared library, as
+ an additional check that you are doing everything right. But if you do
+ use the `-z text' option when building a shared library, you will get
+ errors unless the .ctors and .dtors sections are marked as writable
+ via the SHF_WRITE attribute.) */
+
+#define CTORS_SECTION_ASM_OP ".section\t.ctors,\"aw\""
+#define DTORS_SECTION_ASM_OP ".section\t.dtors,\"aw\""
+
+/* On svr4, we *do* have support for the .init and .fini sections, and we
+ can put stuff in there to be executed before and after `main'. We let
+ crtstuff.c and other files know this by defining the following symbols.
+ The definitions say how to change sections to the .init and .fini
+ sections. This is the same for all known svr4 assemblers. */
+
+#define INIT_SECTION_ASM_OP ".section\t.init"
+#define FINI_SECTION_ASM_OP ".section\t.fini"
+
+/* A default list of other sections which we might be "in" at any given
+ time. For targets that use additional sections (e.g. .tdesc) you
+ should override this definition in the target-specific file which
+ includes this file. */
+
+#undef EXTRA_SECTIONS
+#define EXTRA_SECTIONS in_const, in_ctors, in_dtors
+
+/* A default list of extra section function definitions. For targets
+ that use additional sections (e.g. .tdesc) you should override this
+ definition in the target-specific file which includes this file. */
+
+#undef EXTRA_SECTION_FUNCTIONS
+#define EXTRA_SECTION_FUNCTIONS \
+ CONST_SECTION_FUNCTION \
+ CTORS_SECTION_FUNCTION \
+ DTORS_SECTION_FUNCTION
+
+#undef READONLY_DATA_SECTION
+#define READONLY_DATA_SECTION() const_section ()
+
+extern void text_section ();
+
+#define CONST_SECTION_FUNCTION \
+void \
+const_section () \
+{ \
+ if (!USE_CONST_SECTION) \
+ text_section(); \
+ else if (in_section != in_const) \
+ { \
+ fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP); \
+ in_section = in_const; \
+ } \
+}
+
+#define CTORS_SECTION_FUNCTION \
+void \
+ctors_section () \
+{ \
+ if (in_section != in_ctors) \
+ { \
+ fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP); \
+ in_section = in_ctors; \
+ } \
+}
+
+#define DTORS_SECTION_FUNCTION \
+void \
+dtors_section () \
+{ \
+ if (in_section != in_dtors) \
+ { \
+ fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP); \
+ in_section = in_dtors; \
+ } \
+}
+
+/* Switch into a generic section.
+ This is currently only used to support section attributes.
+
+ We make the section read-only and executable for a function decl,
+ read-only for a const data decl, and writable for a non-const data decl. */
+#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC) \
+ fprintf (FILE, ".section\t%s,\"%s\",@progbits\n", NAME, \
+ (DECL) && TREE_CODE (DECL) == FUNCTION_DECL ? "ax" : \
+ (DECL) && DECL_READONLY_SECTION (DECL, RELOC) ? "a" : "aw")
+
+
+/* A C statement (sans semicolon) to output an element in the table of
+ global constructors. */
+#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
+ do { \
+ ctors_section (); \
+ fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
+ assemble_name (FILE, NAME); \
+ fprintf (FILE, "\n"); \
+ } while (0)
+
+/* A C statement (sans semicolon) to output an element in the table of
+ global destructors. */
+#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
+ do { \
+ dtors_section (); \
+ fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
+ assemble_name (FILE, NAME); \
+ fprintf (FILE, "\n"); \
+ } while (0)
+
+/* A C statement or statements to switch to the appropriate
+ section for output of DECL. DECL is either a `VAR_DECL' node
+ or a constant of some sort. RELOC indicates whether forming
+ the initial value of DECL requires link-time relocations. */
+
+#define SELECT_SECTION(DECL,RELOC) \
+{ \
+ if (TREE_CODE (DECL) == STRING_CST) \
+ { \
+ if (! flag_writable_strings) \
+ const_section (); \
+ else \
+ data_section (); \
+ } \
+ else if (TREE_CODE (DECL) == VAR_DECL) \
+ { \
+ if ((flag_pic && RELOC) \
+ || !TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL) \
+ || !DECL_INITIAL (DECL) \
+ || (DECL_INITIAL (DECL) != error_mark_node \
+ && !TREE_CONSTANT (DECL_INITIAL (DECL)))) \
+ data_section (); \
+ else \
+ const_section (); \
+ } \
+ else \
+ const_section (); \
+}
+
+/* A C statement or statements to switch to the appropriate
+ section for output of RTX in mode MODE. RTX is some kind
+ of constant in RTL. The argument MODE is redundant except
+ in the case of a `const_int' rtx. Currently, these always
+ go into the const section. */
+
+#undef SELECT_RTX_SECTION
+#define SELECT_RTX_SECTION(MODE,RTX) const_section()
+
+/* Define the strings used for the special svr4 .type and .size directives.
+ These strings generally do not vary from one system running svr4 to
+ another, but if a given system (e.g. m88k running svr) needs to use
+ different pseudo-op names for these, they may be overridden in the
+ file which includes this one. */
+
+#define TYPE_ASM_OP ".type"
+#define SIZE_ASM_OP ".size"
+
+/* This is how we tell the assembler that two symbols have the same value. */
+
+#define ASM_OUTPUT_DEF(FILE,NAME1,NAME2) \
+ do { assemble_name(FILE, NAME1); \
+ fputs(" = ", FILE); \
+ assemble_name(FILE, NAME2); \
+ fputc('\n', FILE); } while (0)
+
+/* A table of bytes codes used by the ASM_OUTPUT_ASCII and
+ ASM_OUTPUT_LIMITED_STRING macros. Each byte in the table
+ corresponds to a particular byte value [0..255]. For any
+ given byte value, if the value in the corresponding table
+ position is zero, the given character can be output directly.
+ If the table value is 1, the byte must be output as a \ooo
+ octal escape. If the tables value is anything else, then the
+ byte value should be output as a \ followed by the value
+ in the table. Note that we can use standard UN*X escape
+ sequences for many control characters, but we don't use
+ \a to represent BEL because some svr4 assemblers (e.g. on
+ the i386) don't know about that. Also, we don't use \v
+ since some versions of gas, such as 2.2 did not accept it. */
+
+#define ESCAPES \
+"\1\1\1\1\1\1\1\1btn\1fr\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\0\0\"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\\\0\0\0\
+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1"
+
+/* Some svr4 assemblers have a limit on the number of characters which
+ can appear in the operand of a .string directive. If your assembler
+ has such a limitation, you should define STRING_LIMIT to reflect that
+ limit. Note that at least some svr4 assemblers have a limit on the
+ actual number of bytes in the double-quoted string, and that they
+ count each character in an escape sequence as one byte. Thus, an
+ escape sequence like \377 would count as four bytes.
+
+ If your target assembler doesn't support the .string directive, you
+ should define this to zero.
+*/
+
+#define STRING_LIMIT ((unsigned) 256)
+
+#define STRING_ASM_OP ".string"
+
+/*
+ * We always use gas here, so we don't worry about ECOFF assembler problems.
+ */
+#undef TARGET_GAS
+#define TARGET_GAS (1)
+
+#undef PREFERRED_DEBUGGING_TYPE
+#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
diff --git a/lang/gcc47/files/patch-ad b/lang/gcc47/files/patch-ad
index f8fb5803acf0..bea070deb344 100644
--- a/lang/gcc47/files/patch-ad
+++ b/lang/gcc47/files/patch-ad
@@ -1,6 +1,41 @@
--- gcc/config/i386/freebsd-aout.h.orig Mon Mar 1 14:47:33 1999
-+++ gcc/config/i386/freebsd-aout.h Sat Mar 13 19:24:50 1999
-@@ -103,19 +103,18 @@
++++ gcc/config/i386/freebsd-aout.h Sat Mar 20 00:27:02 1999
+@@ -20,6 +20,10 @@
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
++
++/* Get generic FreeBSD definitions. */
++#include <freebsd.h>
++
+ /* This goes away when the math-emulator is fixed */
+ #define TARGET_CPU_DEFAULT 0400 /* TARGET_NO_FANCY_MATH_387 */
+
+@@ -35,7 +39,7 @@
+ #include "i386/perform.h"
+
+ #undef CPP_PREDEFINES
+-#define CPP_PREDEFINES "-Dunix -Di386 -D__FreeBSD__ -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)"
++#define CPP_PREDEFINES "-Di386 -Acpu(i386) -Amachine(i386)" CPP_FBSD_PREDEFINES
+
+ /* Like the default, except no -lg. */
+ #define LIB_SPEC "%{!shared:%{!pg:-lc}%{pg:-lc_p}}"
+@@ -85,14 +89,6 @@
+ necessary when compiling PIC code. */
+
+ #define JUMP_TABLES_IN_TEXT_SECTION 1
+-
+-/* Don't default to pcc-struct-return, because gcc is the only compiler, and
+- we want to retain compatibility with older gcc versions. */
+-#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
+
+ /* i386 freebsd still uses old binutils that don't insert nops by default
+ when the .align directive demands to insert extra space in the text
+@@ -103,19 +99,18 @@
/* Profiling routines, partially copied from i386/osfrose.h. */
@@ -23,7 +58,7 @@
fprintf (FILE, "\tcall mcount\n"); \
} \
}
-@@ -133,6 +132,7 @@
+@@ -133,6 +128,7 @@
#define TYPE_ASM_OP ".type"
#define SIZE_ASM_OP ".size"
@@ -31,7 +66,7 @@
/* The following macro defines the format used to output the second
operand of the .type assembler directive. Different svr4 assemblers
-@@ -142,6 +142,12 @@
+@@ -142,6 +138,12 @@
#define TYPE_OPERAND_FMT "@%s"
@@ -44,12 +79,34 @@
/* Write the extra assembler code needed to declare a function's result.
Most svr4 assemblers don't require any special declaration of the
result value, but there are exceptions. */
-@@ -243,6 +249,8 @@
- #define STARTFILE_SPEC \
+@@ -244,29 +246,4 @@
"%{shared:c++rt0.o%s} \
%{!shared:%{pg:gcrt0.o%s}%{!pg:%{static:scrt0.o%s}%{!static:crt0.o%s}}}"
-+
-+#define MD_STARTFILE_PREFIX "/usr/lib/aout/"
- /* This is defined when gcc is compiled in the BSD-directory-tree, and must
- * make up for the gap to all the stuff done in the GNU-makefiles.
+-/* This is defined when gcc is compiled in the BSD-directory-tree, and must
+- * make up for the gap to all the stuff done in the GNU-makefiles.
+- */
+-
+-#ifdef FREEBSD_NATIVE
+-
+-#define INCLUDE_DEFAULTS { \
+- { "/usr/include", 0, 0, 0 }, \
+- { "/usr/include/g++", "G++", 1, 1 }, \
+- { 0, 0, 0, 0} \
+- }
+-
+-#undef MD_EXEC_PREFIX
+-#define MD_EXEC_PREFIX "/usr/libexec/"
+-
+-#undef STANDARD_STARTFILE_PREFIX
+-#define STANDARD_STARTFILE_PREFIX "/usr/lib"
+-
+-#if 0 /* This is very wrong!!! */
+-#define DEFAULT_TARGET_MACHINE "i386-unknown-freebsd_1.0"
+-#define GPLUSPLUS_INCLUDE_DIR "/usr/local/lib/gcc-lib/i386-unknown-freebsd_1.0/2.5.8/include"
+-#define TOOL_INCLUDE_DIR "/usr/local/i386-unknown-freebsd_1.0/include"
+-#define GCC_INCLUDE_DIR "/usr/local/lib/gcc-lib/i386-unknown-freebsd_1.0/2.5.8/include"
+-#endif
+-
+-#endif /* FREEBSD_NATIVE */
++#define MD_STARTFILE_PREFIX "/usr/lib/aout/"
diff --git a/lang/gcc47/files/patch-af b/lang/gcc47/files/patch-af
index c50ce06c8375..c1f1ba0e855f 100644
--- a/lang/gcc47/files/patch-af
+++ b/lang/gcc47/files/patch-af
@@ -1,6 +1,30 @@
--- gcc/config/i386/freebsd.h.orig Mon Mar 1 14:47:32 1999
-+++ gcc/config/i386/freebsd.h Sat Mar 13 19:25:53 1999
-@@ -113,22 +113,19 @@
++++ gcc/config/i386/freebsd.h Sun Mar 21 16:58:39 1999
+@@ -21,19 +21,13 @@
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
++
++/* Get generic FreeBSD definitions. */
++#include <freebsd.h>
++
+ #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
+-
+ /* This is how to output an element of a case-vector that is relative.
+ This is only used for PIC code. See comments by the `casesi' insn in
+ i386.md for an explanation of the expression this outputs. */
+@@ -113,22 +107,19 @@
: ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \
: (-1))
@@ -27,8 +51,18 @@
} \
}
-@@ -151,20 +148,8 @@
- #define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
+@@ -145,26 +136,16 @@
+ #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)"
++#define CPP_PREDEFINES "-Di386 -D__ELF__ -Acpu(i386) -Amachine(i386)" CPP_FBSD_PREDEFINES
+
+ #undef CPP_SPEC
+-#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
++#define CPP_SPEC \
++ "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE} %{m486:-D__i486__}"
++ /* %{pthread:-D_REENTRANT} */
#undef LIB_SPEC
-#if 1
@@ -36,16 +70,16 @@
- * want to profile or debug the C library, please add
- * -lc_p or -ggdb to LDFLAGS at the link time, respectively.
- */
- #define LIB_SPEC \
+-#define LIB_SPEC \
- "%{!shared: %{mieee-fp:-lieee} %{p:-lgmon} %{pg:-lgmon} \
- %{!ggdb:-lc} %{ggdb:-lg}}"
-#else
--#define LIB_SPEC \
+ #define LIB_SPEC \
- "%{!shared: \
- %{mieee-fp:-lieee} %{p:-lgmon -lc_p} %{pg:-lgmon -lc_p} \
- %{!p:%{!pg:%{!g*:-lc} %{g*:-lg}}}}"
-#endif
-+ "%{!shared: %{p:-lc_p} %{pg:-lc_p} %{!p:%{!pg:-lc}}}"
++ "%{!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
diff --git a/lang/gcc47/files/patch-ak b/lang/gcc47/files/patch-ak
index 19a2994f3f05..2e54beea1a61 100644
--- a/lang/gcc47/files/patch-ak
+++ b/lang/gcc47/files/patch-ak
@@ -1,5 +1,5 @@
---- gcc/configure.orig Mon Mar 8 10:06:10 1999
-+++ gcc/configure Sat Mar 13 19:08:06 1999
+--- gcc/configure.orig Sun Mar 14 02:59:02 1999
++++ gcc/configure Sat Mar 20 00:40:05 1999
@@ -2395,6 +2395,15 @@
thread_file='posix'
fi
@@ -27,18 +27,20 @@
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
- extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
+- tmake_file=i386/t-freebsd
- gas=yes
- gnu_ld=yes
- stabs=yes
++ tmake_file=t-freebsd
;;
i[34567]86-*-freebsd*)
- tm_file=i386/freebsd.h
+ tm_file="i386/i386.h i386/att.h linux.h i386/freebsd.h i386/perform.h"
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
+- tmake_file=i386/t-freebsd
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
++ tmake_file=t-freebsd
+ gas=yes
+ gnu_ld=yes
+ stabs=yes
diff --git a/lang/gcc47/files/patch-al b/lang/gcc47/files/patch-al
index 51e1b8cdee1c..c8a195127ed0 100644
--- a/lang/gcc47/files/patch-al
+++ b/lang/gcc47/files/patch-al
@@ -1,5 +1,5 @@
--- gcc/configure.in.orig Sun Mar 7 16:22:22 1999
-+++ gcc/configure.in Sat Mar 13 19:23:23 1999
++++ gcc/configure.in Sat Mar 20 00:40:58 1999
@@ -416,6 +416,15 @@
thread_file='posix'
fi
@@ -27,18 +27,20 @@
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
- extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
+- tmake_file=i386/t-freebsd
- gas=yes
- gnu_ld=yes
- stabs=yes
++ tmake_file=t-freebsd
;;
i[[34567]]86-*-freebsd*)
- tm_file=i386/freebsd.h
+ tm_file="i386/i386.h i386/att.h linux.h i386/freebsd.h i386/perform.h"
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
+- tmake_file=i386/t-freebsd
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
++ tmake_file=t-freebsd
+ gas=yes
+ gnu_ld=yes
+ stabs=yes
diff --git a/lang/gcc48/Makefile b/lang/gcc48/Makefile
index f9347a47d87e..cd5b039f398a 100644
--- a/lang/gcc48/Makefile
+++ b/lang/gcc48/Makefile
@@ -4,7 +4,7 @@
# Date created: 9 Jan 1998
# Whom: John Polstra <jdp@polstra.com>
#
-# $Id: Makefile,v 1.48 1999/03/08 07:28:27 asami Exp $
+# $Id: Makefile,v 1.50 1999/03/17 00:40:25 obrien Exp $
#
DISTNAME= egcs-1.1.2
@@ -55,21 +55,20 @@ ALL_TARGET= bootstrap
MAN1= cccp.1 g++.1 g77.1 gcc.1
pre-patch:
+ @${MV} ${WRKSRC}/gcc/config/i386/t-freebsd ${WRKSRC}/gcc/config/
@${MV} ${WRKSRC}/gcc/config/i386/freebsd.h ${WRKSRC}/gcc/config/i386/freebsd-aout.h
@${MV} ${WRKSRC}/gcc/config/i386/freebsd-elf.h ${WRKSRC}/gcc/config/i386/freebsd.h
+ @${CP} ${FILESDIR}/alpha-freebsd-elf.h ${WRKSRC}/gcc/config/alpha/freebsd-elf.h
+ @${CP} ${FILESDIR}/alpha-freebsd.h ${WRKSRC}/gcc/config/alpha/freebsd.h
pre-configure:
@# Keep from running `autoconf' and `autoheader' since we modified
@# configure.in by patching it.
@touch ${WRKSRC}/gcc/configure
@touch ${WRKSRC}/gcc/cstamp-h.in
- @(cd ${WRKSRC}/gcc/config/${ARCH}/ ; \
- MAJ=`sysctl -n kern.osreldate | ${SED} -e '/.....$$/s///'` ; \
- ${MV} freebsd-aout.h freebsd-aout.h.in ; \
- ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" freebsd-aout.h.in \
- >freebsd-aout.h ; \
- ${MV} freebsd.h freebsd.h.in ; \
- ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" freebsd.h.in >freebsd.h )
+ @(MAJ=`sysctl -n kern.osreldate | ${SED} -e '/.....$$/s///'` ; \
+ ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" ${FILESDIR}/freebsd.h \
+ >${WRKSRC}/gcc/config/freebsd.h )
.if ${PORTOBJFORMAT} == "elf" && ${MACHINE_ARCH} == "i386"
@${SED} -e 's/^@comment ELF-only://' ${PKGDIR}/PLIST >${PLIST}
.endif
diff --git a/lang/gcc48/files/alpha-freebsd.h b/lang/gcc48/files/alpha-freebsd.h
new file mode 100644
index 000000000000..60a1f07b94ba
--- /dev/null
+++ b/lang/gcc48/files/alpha-freebsd.h
@@ -0,0 +1,443 @@
+/* Definitions of target machine for GNU compiler,
+ for Alpha FreeBSD systems.
+ Copyright (C) 1998 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* This is used on Alpha platforms that use the ELF format.
+ This was taken from the NetBSD configuration, and modified
+ for FreeBSD/alpha by Hidetoshi Shimokawa <simokawa@FreeBSD.ORG> */
+
+
+/* Get generic FreeBSD definitions. */
+#include <freebsd.h>
+
+
+#undef OBJECT_FORMAT_COFF
+#undef EXTENDED_COFF
+#define OBJECT_FORMAT_ELF
+
+/* This is BSD, so it wants DBX format. */
+
+#define DBX_DEBUGGING_INFO
+
+/* This is the char to use for continuation (in case we need to turn
+ continuation back on). */
+
+#define DBX_CONTIN_CHAR '?'
+
+#undef ASM_FINAL_SPEC
+
+/* Names to predefine in the preprocessor for this target machine.
+ XXX FreeBSD, by convention, shouldn't do __alpha, but lots of applications
+ expect it because that's what OSF/1 does. */
+
+#undef TARGET_DEFAULT
+#define TARGET_DEFAULT (MASK_FP | MASK_FPREGS | MASK_GAS)
+
+#undef CPP_PREDEFINES
+#define CPP_PREDEFINES "\
+-D__alpha__ -D__alpha -Acpu(alpha) -Amachine(alpha) " \
+FBSD_CPP_PREDEFINES \
+SUB_CPP_PREDEFINES
+
+/* Make gcc agree with <machine/ansi.h> */
+
+#undef WCHAR_TYPE
+#define WCHAR_TYPE "int"
+
+#undef WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE 32
+
+/* Output assembler code to FILE to increment profiler label # LABELNO
+ for profiling a function entry. Under FreeBSD/Alpha, the assembler does
+ nothing special with -pg. */
+
+#undef FUNCTION_PROFILER
+#define FUNCTION_PROFILER(FILE, LABELNO) \
+ fputs ("\tjsr $28,_mcount\n", (FILE))
+
+/* Show that we need a GP when profiling. */
+#define TARGET_PROFILING_NEEDS_GP
+
+#undef HAS_INIT_SECTION
+
+/* Provide an ASM_SPEC appropriate for a FreeBSD/alpha target. This differs
+ from the generic FreeBSD ASM_SPEC in that no special handling of PIC is
+ necessary on the Alpha. */
+
+#undef ASM_SPEC
+#define ASM_SPEC " %| %{mcpu=*:-m%*}"
+
+/* Output at beginning of assembler file. */
+
+#undef ASM_FILE_START
+#define ASM_FILE_START(FILE) \
+{ \
+ alpha_write_verstamp (FILE); \
+ output_file_directive (FILE, main_input_filename); \
+ fprintf (FILE, "\t.version\t\"01.01\"\n"); \
+ fprintf (FILE, "\t.set noat\n"); \
+}
+
+#define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE) \
+ alpha_output_lineno (STREAM, LINE)
+extern void alpha_output_lineno ();
+
+extern void output_file_directive ();
+
+/* 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. */
+
+#define IDENT_ASM_OP ".ident"
+
+#ifdef IDENTIFY_WITH_IDENT
+#define ASM_IDENTIFY_GCC(FILE) /* nothing */
+#define ASM_IDENTIFY_LANGUAGE(FILE) \
+ fprintf(FILE, "\t%s \"GCC (%s) %s\"\n", IDENT_ASM_OP, \
+ lang_identify(), version_string)
+#else
+#define ASM_FILE_END(FILE) \
+do { \
+ fprintf ((FILE), "\t%s\t\"GCC: (GNU) %s\"\n", \
+ IDENT_ASM_OP, version_string); \
+ } while (0)
+#endif
+
+/* Allow #sccs in preprocessor. */
+
+#define SCCS_DIRECTIVE
+
+/* Output #ident as a .ident. */
+
+#define ASM_OUTPUT_IDENT(FILE, NAME) \
+ fprintf (FILE, "\t%s\t\"%s\"\n", IDENT_ASM_OP, NAME);
+
+/* This is how to allocate empty space in some section. The .zero
+ pseudo-op is used for this on most svr4 assemblers. */
+
+#define SKIP_ASM_OP ".zero"
+
+#undef ASM_OUTPUT_SKIP
+#define ASM_OUTPUT_SKIP(FILE,SIZE) \
+ fprintf (FILE, "\t%s\t%u\n", SKIP_ASM_OP, (SIZE))
+
+/* Output the label which precedes a jumptable. Note that for all svr4
+ systems where we actually generate jumptables (which is to say every
+ svr4 target except i386, where we use casesi instead) we put the jump-
+ tables into the .rodata section and since other stuff could have been
+ put into the .rodata section prior to any given jumptable, we have to
+ make sure that the location counter for the .rodata section gets pro-
+ perly re-aligned prior to the actual beginning of the jump table. */
+
+#define ALIGN_ASM_OP ".align"
+
+#ifndef ASM_OUTPUT_BEFORE_CASE_LABEL
+#define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE,PREFIX,NUM,TABLE) \
+ ASM_OUTPUT_ALIGN ((FILE), 2);
+#endif
+
+#undef ASM_OUTPUT_CASE_LABEL
+#define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,JUMPTABLE) \
+ do { \
+ ASM_OUTPUT_BEFORE_CASE_LABEL (FILE, PREFIX, NUM, JUMPTABLE) \
+ ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); \
+ } while (0)
+
+/* The standard SVR4 assembler seems to require that certain builtin
+ library routines (e.g. .udiv) be explicitly declared as .globl
+ in each assembly file where they are referenced. */
+
+#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
+ ASM_GLOBALIZE_LABEL (FILE, XSTR (FUN, 0))
+
+/* This says how to output assembler code to declare an
+ uninitialized external linkage data object. Under SVR4,
+ the linker seems to want the alignment of data objects
+ to depend on their types. We do exactly that here. */
+
+#define COMMON_ASM_OP ".comm"
+
+#undef ASM_OUTPUT_ALIGNED_COMMON
+#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
+do { \
+ fprintf ((FILE), "\t%s\t", COMMON_ASM_OP); \
+ assemble_name ((FILE), (NAME)); \
+ fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \
+} while (0)
+
+/* This says how to output assembler code to declare an
+ uninitialized internal linkage data object. Under SVR4,
+ the linker seems to want the alignment of data objects
+ to depend on their types. We do exactly that here. */
+
+#define LOCAL_ASM_OP ".local"
+
+#undef ASM_OUTPUT_ALIGNED_LOCAL
+#define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
+do { \
+ fprintf ((FILE), "\t%s\t", LOCAL_ASM_OP); \
+ assemble_name ((FILE), (NAME)); \
+ fprintf ((FILE), "\n"); \
+ ASM_OUTPUT_ALIGNED_COMMON (FILE, NAME, SIZE, ALIGN); \
+} while (0)
+
+/* This is the pseudo-op used to generate a 64-bit word of data with a
+ specific value in some section. */
+
+#define INT_ASM_OP ".quad"
+
+/* This is the pseudo-op used to generate a contiguous sequence of byte
+ values from a double-quoted string WITHOUT HAVING A TERMINATING NUL
+ AUTOMATICALLY APPENDED. This is the same for most svr4 assemblers. */
+
+#undef ASCII_DATA_ASM_OP
+#define ASCII_DATA_ASM_OP ".ascii"
+
+/* Support const sections and the ctors and dtors sections for g++.
+ Note that there appears to be two different ways to support const
+ sections at the moment. You can either #define the symbol
+ READONLY_DATA_SECTION (giving it some code which switches to the
+ readonly data section) or else you can #define the symbols
+ EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, SELECT_SECTION, and
+ SELECT_RTX_SECTION. We do both here just to be on the safe side. */
+
+#define USE_CONST_SECTION 1
+
+#define CONST_SECTION_ASM_OP ".section\t.rodata"
+
+/* Define the pseudo-ops used to switch to the .ctors and .dtors sections.
+
+ Note that we want to give these sections the SHF_WRITE attribute
+ because these sections will actually contain data (i.e. tables of
+ addresses of functions in the current root executable or shared library
+ file) and, in the case of a shared library, the relocatable addresses
+ will have to be properly resolved/relocated (and then written into) by
+ the dynamic linker when it actually attaches the given shared library
+ to the executing process. (Note that on SVR4, you may wish to use the
+ `-z text' option to the ELF linker, when building a shared library, as
+ an additional check that you are doing everything right. But if you do
+ use the `-z text' option when building a shared library, you will get
+ errors unless the .ctors and .dtors sections are marked as writable
+ via the SHF_WRITE attribute.) */
+
+#define CTORS_SECTION_ASM_OP ".section\t.ctors,\"aw\""
+#define DTORS_SECTION_ASM_OP ".section\t.dtors,\"aw\""
+
+/* On svr4, we *do* have support for the .init and .fini sections, and we
+ can put stuff in there to be executed before and after `main'. We let
+ crtstuff.c and other files know this by defining the following symbols.
+ The definitions say how to change sections to the .init and .fini
+ sections. This is the same for all known svr4 assemblers. */
+
+#define INIT_SECTION_ASM_OP ".section\t.init"
+#define FINI_SECTION_ASM_OP ".section\t.fini"
+
+/* A default list of other sections which we might be "in" at any given
+ time. For targets that use additional sections (e.g. .tdesc) you
+ should override this definition in the target-specific file which
+ includes this file. */
+
+#undef EXTRA_SECTIONS
+#define EXTRA_SECTIONS in_const, in_ctors, in_dtors
+
+/* A default list of extra section function definitions. For targets
+ that use additional sections (e.g. .tdesc) you should override this
+ definition in the target-specific file which includes this file. */
+
+#undef EXTRA_SECTION_FUNCTIONS
+#define EXTRA_SECTION_FUNCTIONS \
+ CONST_SECTION_FUNCTION \
+ CTORS_SECTION_FUNCTION \
+ DTORS_SECTION_FUNCTION
+
+#undef READONLY_DATA_SECTION
+#define READONLY_DATA_SECTION() const_section ()
+
+extern void text_section ();
+
+#define CONST_SECTION_FUNCTION \
+void \
+const_section () \
+{ \
+ if (!USE_CONST_SECTION) \
+ text_section(); \
+ else if (in_section != in_const) \
+ { \
+ fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP); \
+ in_section = in_const; \
+ } \
+}
+
+#define CTORS_SECTION_FUNCTION \
+void \
+ctors_section () \
+{ \
+ if (in_section != in_ctors) \
+ { \
+ fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP); \
+ in_section = in_ctors; \
+ } \
+}
+
+#define DTORS_SECTION_FUNCTION \
+void \
+dtors_section () \
+{ \
+ if (in_section != in_dtors) \
+ { \
+ fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP); \
+ in_section = in_dtors; \
+ } \
+}
+
+/* Switch into a generic section.
+ This is currently only used to support section attributes.
+
+ We make the section read-only and executable for a function decl,
+ read-only for a const data decl, and writable for a non-const data decl. */
+#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC) \
+ fprintf (FILE, ".section\t%s,\"%s\",@progbits\n", NAME, \
+ (DECL) && TREE_CODE (DECL) == FUNCTION_DECL ? "ax" : \
+ (DECL) && DECL_READONLY_SECTION (DECL, RELOC) ? "a" : "aw")
+
+
+/* A C statement (sans semicolon) to output an element in the table of
+ global constructors. */
+#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
+ do { \
+ ctors_section (); \
+ fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
+ assemble_name (FILE, NAME); \
+ fprintf (FILE, "\n"); \
+ } while (0)
+
+/* A C statement (sans semicolon) to output an element in the table of
+ global destructors. */
+#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
+ do { \
+ dtors_section (); \
+ fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
+ assemble_name (FILE, NAME); \
+ fprintf (FILE, "\n"); \
+ } while (0)
+
+/* A C statement or statements to switch to the appropriate
+ section for output of DECL. DECL is either a `VAR_DECL' node
+ or a constant of some sort. RELOC indicates whether forming
+ the initial value of DECL requires link-time relocations. */
+
+#define SELECT_SECTION(DECL,RELOC) \
+{ \
+ if (TREE_CODE (DECL) == STRING_CST) \
+ { \
+ if (! flag_writable_strings) \
+ const_section (); \
+ else \
+ data_section (); \
+ } \
+ else if (TREE_CODE (DECL) == VAR_DECL) \
+ { \
+ if ((flag_pic && RELOC) \
+ || !TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL) \
+ || !DECL_INITIAL (DECL) \
+ || (DECL_INITIAL (DECL) != error_mark_node \
+ && !TREE_CONSTANT (DECL_INITIAL (DECL)))) \
+ data_section (); \
+ else \
+ const_section (); \
+ } \
+ else \
+ const_section (); \
+}
+
+/* A C statement or statements to switch to the appropriate
+ section for output of RTX in mode MODE. RTX is some kind
+ of constant in RTL. The argument MODE is redundant except
+ in the case of a `const_int' rtx. Currently, these always
+ go into the const section. */
+
+#undef SELECT_RTX_SECTION
+#define SELECT_RTX_SECTION(MODE,RTX) const_section()
+
+/* Define the strings used for the special svr4 .type and .size directives.
+ These strings generally do not vary from one system running svr4 to
+ another, but if a given system (e.g. m88k running svr) needs to use
+ different pseudo-op names for these, they may be overridden in the
+ file which includes this one. */
+
+#define TYPE_ASM_OP ".type"
+#define SIZE_ASM_OP ".size"
+
+/* This is how we tell the assembler that two symbols have the same value. */
+
+#define ASM_OUTPUT_DEF(FILE,NAME1,NAME2) \
+ do { assemble_name(FILE, NAME1); \
+ fputs(" = ", FILE); \
+ assemble_name(FILE, NAME2); \
+ fputc('\n', FILE); } while (0)
+
+/* A table of bytes codes used by the ASM_OUTPUT_ASCII and
+ ASM_OUTPUT_LIMITED_STRING macros. Each byte in the table
+ corresponds to a particular byte value [0..255]. For any
+ given byte value, if the value in the corresponding table
+ position is zero, the given character can be output directly.
+ If the table value is 1, the byte must be output as a \ooo
+ octal escape. If the tables value is anything else, then the
+ byte value should be output as a \ followed by the value
+ in the table. Note that we can use standard UN*X escape
+ sequences for many control characters, but we don't use
+ \a to represent BEL because some svr4 assemblers (e.g. on
+ the i386) don't know about that. Also, we don't use \v
+ since some versions of gas, such as 2.2 did not accept it. */
+
+#define ESCAPES \
+"\1\1\1\1\1\1\1\1btn\1fr\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\0\0\"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\\\0\0\0\
+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1"
+
+/* Some svr4 assemblers have a limit on the number of characters which
+ can appear in the operand of a .string directive. If your assembler
+ has such a limitation, you should define STRING_LIMIT to reflect that
+ limit. Note that at least some svr4 assemblers have a limit on the
+ actual number of bytes in the double-quoted string, and that they
+ count each character in an escape sequence as one byte. Thus, an
+ escape sequence like \377 would count as four bytes.
+
+ If your target assembler doesn't support the .string directive, you
+ should define this to zero.
+*/
+
+#define STRING_LIMIT ((unsigned) 256)
+
+#define STRING_ASM_OP ".string"
+
+/*
+ * We always use gas here, so we don't worry about ECOFF assembler problems.
+ */
+#undef TARGET_GAS
+#define TARGET_GAS (1)
+
+#undef PREFERRED_DEBUGGING_TYPE
+#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
diff --git a/lang/gcc48/files/patch-ad b/lang/gcc48/files/patch-ad
index f8fb5803acf0..bea070deb344 100644
--- a/lang/gcc48/files/patch-ad
+++ b/lang/gcc48/files/patch-ad
@@ -1,6 +1,41 @@
--- gcc/config/i386/freebsd-aout.h.orig Mon Mar 1 14:47:33 1999
-+++ gcc/config/i386/freebsd-aout.h Sat Mar 13 19:24:50 1999
-@@ -103,19 +103,18 @@
++++ gcc/config/i386/freebsd-aout.h Sat Mar 20 00:27:02 1999
+@@ -20,6 +20,10 @@
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
++
++/* Get generic FreeBSD definitions. */
++#include <freebsd.h>
++
+ /* This goes away when the math-emulator is fixed */
+ #define TARGET_CPU_DEFAULT 0400 /* TARGET_NO_FANCY_MATH_387 */
+
+@@ -35,7 +39,7 @@
+ #include "i386/perform.h"
+
+ #undef CPP_PREDEFINES
+-#define CPP_PREDEFINES "-Dunix -Di386 -D__FreeBSD__ -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)"
++#define CPP_PREDEFINES "-Di386 -Acpu(i386) -Amachine(i386)" CPP_FBSD_PREDEFINES
+
+ /* Like the default, except no -lg. */
+ #define LIB_SPEC "%{!shared:%{!pg:-lc}%{pg:-lc_p}}"
+@@ -85,14 +89,6 @@
+ necessary when compiling PIC code. */
+
+ #define JUMP_TABLES_IN_TEXT_SECTION 1
+-
+-/* Don't default to pcc-struct-return, because gcc is the only compiler, and
+- we want to retain compatibility with older gcc versions. */
+-#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
+
+ /* i386 freebsd still uses old binutils that don't insert nops by default
+ when the .align directive demands to insert extra space in the text
+@@ -103,19 +99,18 @@
/* Profiling routines, partially copied from i386/osfrose.h. */
@@ -23,7 +58,7 @@
fprintf (FILE, "\tcall mcount\n"); \
} \
}
-@@ -133,6 +132,7 @@
+@@ -133,6 +128,7 @@
#define TYPE_ASM_OP ".type"
#define SIZE_ASM_OP ".size"
@@ -31,7 +66,7 @@
/* The following macro defines the format used to output the second
operand of the .type assembler directive. Different svr4 assemblers
-@@ -142,6 +142,12 @@
+@@ -142,6 +138,12 @@
#define TYPE_OPERAND_FMT "@%s"
@@ -44,12 +79,34 @@
/* Write the extra assembler code needed to declare a function's result.
Most svr4 assemblers don't require any special declaration of the
result value, but there are exceptions. */
-@@ -243,6 +249,8 @@
- #define STARTFILE_SPEC \
+@@ -244,29 +246,4 @@
"%{shared:c++rt0.o%s} \
%{!shared:%{pg:gcrt0.o%s}%{!pg:%{static:scrt0.o%s}%{!static:crt0.o%s}}}"
-+
-+#define MD_STARTFILE_PREFIX "/usr/lib/aout/"
- /* This is defined when gcc is compiled in the BSD-directory-tree, and must
- * make up for the gap to all the stuff done in the GNU-makefiles.
+-/* This is defined when gcc is compiled in the BSD-directory-tree, and must
+- * make up for the gap to all the stuff done in the GNU-makefiles.
+- */
+-
+-#ifdef FREEBSD_NATIVE
+-
+-#define INCLUDE_DEFAULTS { \
+- { "/usr/include", 0, 0, 0 }, \
+- { "/usr/include/g++", "G++", 1, 1 }, \
+- { 0, 0, 0, 0} \
+- }
+-
+-#undef MD_EXEC_PREFIX
+-#define MD_EXEC_PREFIX "/usr/libexec/"
+-
+-#undef STANDARD_STARTFILE_PREFIX
+-#define STANDARD_STARTFILE_PREFIX "/usr/lib"
+-
+-#if 0 /* This is very wrong!!! */
+-#define DEFAULT_TARGET_MACHINE "i386-unknown-freebsd_1.0"
+-#define GPLUSPLUS_INCLUDE_DIR "/usr/local/lib/gcc-lib/i386-unknown-freebsd_1.0/2.5.8/include"
+-#define TOOL_INCLUDE_DIR "/usr/local/i386-unknown-freebsd_1.0/include"
+-#define GCC_INCLUDE_DIR "/usr/local/lib/gcc-lib/i386-unknown-freebsd_1.0/2.5.8/include"
+-#endif
+-
+-#endif /* FREEBSD_NATIVE */
++#define MD_STARTFILE_PREFIX "/usr/lib/aout/"
diff --git a/lang/gcc48/files/patch-af b/lang/gcc48/files/patch-af
index c50ce06c8375..c1f1ba0e855f 100644
--- a/lang/gcc48/files/patch-af
+++ b/lang/gcc48/files/patch-af
@@ -1,6 +1,30 @@
--- gcc/config/i386/freebsd.h.orig Mon Mar 1 14:47:32 1999
-+++ gcc/config/i386/freebsd.h Sat Mar 13 19:25:53 1999
-@@ -113,22 +113,19 @@
++++ gcc/config/i386/freebsd.h Sun Mar 21 16:58:39 1999
+@@ -21,19 +21,13 @@
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
++
++/* Get generic FreeBSD definitions. */
++#include <freebsd.h>
++
+ #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
+-
+ /* This is how to output an element of a case-vector that is relative.
+ This is only used for PIC code. See comments by the `casesi' insn in
+ i386.md for an explanation of the expression this outputs. */
+@@ -113,22 +107,19 @@
: ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \
: (-1))
@@ -27,8 +51,18 @@
} \
}
-@@ -151,20 +148,8 @@
- #define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
+@@ -145,26 +136,16 @@
+ #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)"
++#define CPP_PREDEFINES "-Di386 -D__ELF__ -Acpu(i386) -Amachine(i386)" CPP_FBSD_PREDEFINES
+
+ #undef CPP_SPEC
+-#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
++#define CPP_SPEC \
++ "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE} %{m486:-D__i486__}"
++ /* %{pthread:-D_REENTRANT} */
#undef LIB_SPEC
-#if 1
@@ -36,16 +70,16 @@
- * want to profile or debug the C library, please add
- * -lc_p or -ggdb to LDFLAGS at the link time, respectively.
- */
- #define LIB_SPEC \
+-#define LIB_SPEC \
- "%{!shared: %{mieee-fp:-lieee} %{p:-lgmon} %{pg:-lgmon} \
- %{!ggdb:-lc} %{ggdb:-lg}}"
-#else
--#define LIB_SPEC \
+ #define LIB_SPEC \
- "%{!shared: \
- %{mieee-fp:-lieee} %{p:-lgmon -lc_p} %{pg:-lgmon -lc_p} \
- %{!p:%{!pg:%{!g*:-lc} %{g*:-lg}}}}"
-#endif
-+ "%{!shared: %{p:-lc_p} %{pg:-lc_p} %{!p:%{!pg:-lc}}}"
++ "%{!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
diff --git a/lang/gcc48/files/patch-ak b/lang/gcc48/files/patch-ak
index 19a2994f3f05..2e54beea1a61 100644
--- a/lang/gcc48/files/patch-ak
+++ b/lang/gcc48/files/patch-ak
@@ -1,5 +1,5 @@
---- gcc/configure.orig Mon Mar 8 10:06:10 1999
-+++ gcc/configure Sat Mar 13 19:08:06 1999
+--- gcc/configure.orig Sun Mar 14 02:59:02 1999
++++ gcc/configure Sat Mar 20 00:40:05 1999
@@ -2395,6 +2395,15 @@
thread_file='posix'
fi
@@ -27,18 +27,20 @@
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
- extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
+- tmake_file=i386/t-freebsd
- gas=yes
- gnu_ld=yes
- stabs=yes
++ tmake_file=t-freebsd
;;
i[34567]86-*-freebsd*)
- tm_file=i386/freebsd.h
+ tm_file="i386/i386.h i386/att.h linux.h i386/freebsd.h i386/perform.h"
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
+- tmake_file=i386/t-freebsd
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
++ tmake_file=t-freebsd
+ gas=yes
+ gnu_ld=yes
+ stabs=yes
diff --git a/lang/gcc48/files/patch-al b/lang/gcc48/files/patch-al
index 51e1b8cdee1c..c8a195127ed0 100644
--- a/lang/gcc48/files/patch-al
+++ b/lang/gcc48/files/patch-al
@@ -1,5 +1,5 @@
--- gcc/configure.in.orig Sun Mar 7 16:22:22 1999
-+++ gcc/configure.in Sat Mar 13 19:23:23 1999
++++ gcc/configure.in Sat Mar 20 00:40:58 1999
@@ -416,6 +416,15 @@
thread_file='posix'
fi
@@ -27,18 +27,20 @@
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
- extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
+- tmake_file=i386/t-freebsd
- gas=yes
- gnu_ld=yes
- stabs=yes
++ tmake_file=t-freebsd
;;
i[[34567]]86-*-freebsd*)
- tm_file=i386/freebsd.h
+ tm_file="i386/i386.h i386/att.h linux.h i386/freebsd.h i386/perform.h"
# On FreeBSD, the headers are already ok, except for math.h.
fixincludes=fixinc.wrap
+- tmake_file=i386/t-freebsd
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=i386/t-freebsd
++ tmake_file=t-freebsd
+ gas=yes
+ gnu_ld=yes
+ stabs=yes