summaryrefslogtreecommitdiff
path: root/lang
diff options
context:
space:
mode:
authorhasso <hasso>2009-04-22 18:59:54 +0000
committerhasso <hasso>2009-04-22 18:59:54 +0000
commitcbe920a120d82b211c1ebf4a6708d52e36a71aec (patch)
treeed7a67c19b7008c77bb1dcece3c53d25297c1364 /lang
parent1eb7428a5de265d92010ac53b895da606accbf17 (diff)
downloadpkgsrc-cbe920a120d82b211c1ebf4a6708d52e36a71aec.tar.gz
Hack it to work on DragonFly.
Diffstat (limited to 'lang')
-rw-r--r--lang/gcc34/Makefile14
-rw-r--r--lang/gcc34/distinfo6
-rw-r--r--lang/gcc34/files/dragonfly-spec.h128
-rw-r--r--lang/gcc34/files/dragonfly.h87
-rw-r--r--lang/gcc34/files/i386-dragonfly.h142
-rw-r--r--lang/gcc34/files/i386-dragonfly64.h45
-rw-r--r--lang/gcc34/patches/patch-aa13
-rw-r--r--lang/gcc34/patches/patch-ab51
-rw-r--r--lang/gcc34/patches/patch-at31
9 files changed, 507 insertions, 10 deletions
diff --git a/lang/gcc34/Makefile b/lang/gcc34/Makefile
index 5a9a3f559dd..4a6553e0add 100644
--- a/lang/gcc34/Makefile
+++ b/lang/gcc34/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.40 2007/10/25 21:04:22 jlam Exp $
+# $NetBSD: Makefile,v 1.41 2009/04/22 18:59:54 hasso Exp $
#
DISTNAME= gcc-${GCC_VERSION}
@@ -90,6 +90,12 @@ CONFIGURE_ARGS+= --with-libiconv-prefix=${BUILDLINK_PREFIX.iconv}
MAKE_ENV+= ICONVPREFIX=${BUILDLINK_PREFIX.iconv}
MAKE_ENV+= SHELL=${CONFIG_SHELL}
+# FIXME Because gcc ignores rpath for some reason, it breaks on DragonFly -
+# binaries are linked against libintl. Disabling NLS for now.
+.if ${OPSYS} == "DragonFly"
+CONFIGURE_ARGS+= --disable-nls
+.endif
+
UNLIMIT_RESOURCES+= datasize
.if !empty(BUILD_F77:M[Yy][Ee][Ss])
@@ -195,6 +201,12 @@ pre-configure:
done )
. endif
.endif
+.if ${OPSYS} == "DragonFly"
+ ${CP} ${FILESDIR}/dragonfly.h ${WRKSRC}/gcc/config/dragonfly.h
+ ${CP} ${FILESDIR}/dragonfly-spec.h ${WRKSRC}/gcc/config/dragonfly-spec.h
+ ${CP} ${FILESDIR}/i386-dragonfly.h ${WRKSRC}/gcc/config/i386/dragonfly.h
+ ${CP} ${FILESDIR}/i386-dragonfly64.h ${WRKSRC}/gcc/config/i386/dragonfly64.h
+.endif
do-configure:
${MKDIR} ${WRKDIR}/obj
diff --git a/lang/gcc34/distinfo b/lang/gcc34/distinfo
index 6080d7cc5e4..3662b2967ce 100644
--- a/lang/gcc34/distinfo
+++ b/lang/gcc34/distinfo
@@ -1,8 +1,10 @@
-$NetBSD: distinfo,v 1.18 2009/03/30 10:57:02 markd Exp $
+$NetBSD: distinfo,v 1.19 2009/04/22 18:59:54 hasso Exp $
SHA1 (gcc-3.4.6.tar.bz2) = 97b290fdc572c8e490b3b39f243e69bacad23c2b
RMD160 (gcc-3.4.6.tar.bz2) = b15003368cedc7964f6ceaee0c39ddc43a46c442
Size (gcc-3.4.6.tar.bz2) = 28193401 bytes
+SHA1 (patch-aa) = 40ba26c4af81ecc0effce3b7ac3c74bdfe4b56a6
+SHA1 (patch-ab) = 50345471e99264104e136acd7c09da0a5275cb62
SHA1 (patch-ae) = 928fa6155e614ca85b02359cf893d6c62231b192
SHA1 (patch-af) = cdd6b0d13c557996cb6582d7fa5dc651d37ee0ee
SHA1 (patch-ag) = beee5294d387faafa640ab048823499da629e715
@@ -12,7 +14,7 @@ SHA1 (patch-aj) = ea0bef88be9e823ed2acfa54a59f29016de8cc5e
SHA1 (patch-ak) = 1188e98e65fce3b968f9a2c211ffe315644d87d5
SHA1 (patch-al) = 3368a43981499dd46b2caa111eae19a0549d7499
SHA1 (patch-am) = 5a27d8f6a289f9b110a4bdc640547e43b799f08c
-SHA1 (patch-at) = a8a310b85e661bbf2cb832027b84b72c1db27a0c
+SHA1 (patch-at) = f74c2cd4919c59c0591e5aac7fdf8bb20fb87b96
SHA1 (patch-ba) = 6fc03fc155f630329f7dc831eece6b6464b453a6
SHA1 (patch-bb) = aa088194fb073fcde8d2f558ed55ec36106d60d0
SHA1 (patch-ca) = e04ff912406505abd015789f288ef09a7e1ae386
diff --git a/lang/gcc34/files/dragonfly-spec.h b/lang/gcc34/files/dragonfly-spec.h
new file mode 100644
index 00000000000..2e94e24b66e
--- /dev/null
+++ b/lang/gcc34/files/dragonfly-spec.h
@@ -0,0 +1,128 @@
+/* Base configuration file for all FreeBSD targets.
+ Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC 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.
+
+GCC 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 GCC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+/* Common DragonFly configuration.
+ All DragonFly architectures should include this file, which will specify
+ their commonalities.
+ Adapted from gcc/config/freebsd.h by
+ David O'Brien <obrien@FreeBSD.org>
+ Loren J. Rittle <ljrittle@acm.org>. */
+
+
+/* In case we need to know. */
+#define USING_CONFIG_DRAGONFLY_SPEC 1
+
+/* This defines which switch letters take arguments. On DragonFly, most of
+ the normal cases (defined in gcc.c) apply, and we also have -h* and
+ -z* options (for the linker) (coming from SVR4).
+ We also have -R (alias --rpath), no -z, --soname (-h), --assert etc. */
+
+#define DFBSD_SWITCH_TAKES_ARG(CHAR) \
+ (DEFAULT_SWITCH_TAKES_ARG (CHAR) \
+ || (CHAR) == 'h' \
+ || (CHAR) == 'z' /* ignored by ld */ \
+ || (CHAR) == 'R')
+
+/* This defines which multi-letter switches take arguments. */
+
+#define DFBSD_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 DFBSD_TARGET_OS_CPP_BUILTINS() \
+ do \
+ { \
+ if (DFBSD_MAJOR == 4) \
+ builtin_define ("__DragonFly__=4"); \
+ else if (DFBSD_MAJOR == 3) \
+ builtin_define ("__DragonFly__=3"); \
+ if (DFBSD_MAJOR == 2) \
+ builtin_define ("__DragonFly__=2"); \
+ else if (DFBSD_MAJOR == 1) \
+ builtin_define ("__DragonFly__=1"); \
+ else \
+ builtin_define ("__DragonFly__"); \
+ builtin_define_std ("unix"); \
+ builtin_define ("__KPRINTF_ATTRIBUTE__"); \
+ builtin_assert ("system=unix"); \
+ builtin_assert ("system=bsd"); \
+ builtin_assert ("system=DragonFly"); \
+ DFBSD_TARGET_CPU_CPP_BUILTINS(); \
+ } \
+ while (0)
+
+/* Define the default DragonFly-specific per-CPU hook code. */
+#define DFBSD_TARGET_CPU_CPP_BUILTINS() do {} while (0)
+
+/* Provide a CPP_SPEC appropriate for DragonFly. We just deal with the GCC
+ option `-posix', and PIC issues. */
+
+#define DFBSD_CPP_SPEC " \
+ %(cpp_cpu) \
+ %{fPIC|fpic|fPIE|fpie:-D__PIC__ -D__pic__} \
+ %{posix:-D_POSIX_SOURCE}"
+
+/* Provide a STARTFILE_SPEC appropriate for DragonFly. Here we add
+ the magical crtbegin.o file (see crtstuff.c) which provides part
+ of the support for getting C++ file-scope static object constructed
+ before entering `main'. */
+
+#define DFBSD_STARTFILE_SPEC \
+ "%{!shared: \
+ %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
+ %{!p:%{profile:gcrt1.o%s} \
+ %{!profile:crt1.o%s}}}} \
+ crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
+
+/* Provide a ENDFILE_SPEC appropriate for DragonFly. Here we tack on
+ the magical crtend.o file (see crtstuff.c) which provides part of
+ the support for getting C++ file-scope static object constructed
+ before entering `main', followed by a normal "finalizer" file,
+ `crtn.o'. */
+
+#define DFBSD_ENDFILE_SPEC \
+ "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
+
+/* Provide a LIB_SPEC appropriate for DragonFly as configured and as
+ required by the user-land thread model. */
+
+/* Provide a LIB_SPEC appropriate for DragonFly. Just select the appropriate
+ libc, depending on whether we're doing profiling or need threads support.
+ (similar to the default, except no -lg, and no -p). */
+
+#ifdef DFBSD_NO_THREADS
+#define DFBSD_LIB_SPEC " \
+ %{pthread: %eThe -pthread option is only supported on DragonFly when gcc \
+is built with the --enable-threads configure-time option.} \
+ %{!shared: \
+ %{!pg: -lc} \
+ %{pg: -lc_p} \
+ }"
+#else
+#define DFBSD_LIB_SPEC " \
+ %{!shared: \
+ %{!pg: %{pthread:-lpthread} -lc} \
+ %{pg: %{pthread:-lpthread_p} -lc_p} \
+ }"
+#endif
+
+#define DFBSD_DYNAMIC_LINKER "/usr/libexec/ld-elf.so.2"
diff --git a/lang/gcc34/files/dragonfly.h b/lang/gcc34/files/dragonfly.h
new file mode 100644
index 00000000000..6853757b621
--- /dev/null
+++ b/lang/gcc34/files/dragonfly.h
@@ -0,0 +1,87 @@
+/* Base configuration file for all FreeBSD targets.
+ Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC 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.
+
+GCC 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 GCC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+/* Common DragonFly configuration.
+ All DragonFly architectures should include this file, which will specify
+ their commonalities.
+ Adapted from gcc/config/i386/freebsd-elf.h by
+ David O'Brien <obrien@FreeBSD.org>.
+ Further work by David O'Brien <obrien@FreeBSD.org> and
+ Loren J. Rittle <ljrittle@acm.org>. */
+
+
+/* In case we need to know. */
+#define USING_CONFIG_DRAGONFLY 1
+
+/* This defines which switch letters take arguments. On DragonFly, most of
+ the normal cases (defined in gcc.c) apply, and we also have -h* and
+ -z* options (for the linker) (coming from SVR4).
+ We also have -R (alias --rpath), no -z, --soname (-h), --assert etc. */
+
+#undef SWITCH_TAKES_ARG
+#define SWITCH_TAKES_ARG(CHAR) (DFBSD_SWITCH_TAKES_ARG(CHAR))
+
+#undef WORD_SWITCH_TAKES_ARG
+#define WORD_SWITCH_TAKES_ARG(STR) (DFBSD_WORD_SWITCH_TAKES_ARG(STR))
+
+#undef TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS() DFBSD_TARGET_OS_CPP_BUILTINS()
+
+#undef CPP_SPEC
+#define CPP_SPEC DFBSD_CPP_SPEC
+
+#undef STARTFILE_SPEC
+#define STARTFILE_SPEC DFBSD_STARTFILE_SPEC
+
+#undef ENDFILE_SPEC
+#define ENDFILE_SPEC DFBSD_ENDFILE_SPEC
+
+#undef LIB_SPEC
+#define LIB_SPEC DFBSD_LIB_SPEC
+
+
+/************************[ Target stuff ]***********************************/
+
+/* All DragonFly Architectures support the ELF object file format. */
+#undef OBJECT_FORMAT_ELF
+#define OBJECT_FORMAT_ELF
+
+/* Don't assume anything about the header files. */
+#undef NO_IMPLICIT_EXTERN_C
+#define NO_IMPLICIT_EXTERN_C 1
+
+/* Make gcc agree with FreeBSD's standard headers (<machine/ansi.h>, etc...) */
+
+#undef WCHAR_TYPE
+#define WCHAR_TYPE "int"
+
+#define MATH_LIBRARY_PROFILE "-lm_p"
+
+/* Code generation parameters. */
+
+/* Use periods rather than dollar signs in special g++ assembler names.
+ This ensures the configuration knows our system correctly so we can link
+ with libraries compiled with the native cc. */
+#undef NO_DOLLAR_IN_LABEL
+
+/* Used by libgcc2.c. We support file locking with fcntl / F_SETLKW.
+ This enables the test coverage code to use file locking when exiting a
+ program, which avoids race conditions if the program has forked. */
+#define TARGET_HAS_F_SETLKW
diff --git a/lang/gcc34/files/i386-dragonfly.h b/lang/gcc34/files/i386-dragonfly.h
new file mode 100644
index 00000000000..3617570b5bd
--- /dev/null
+++ b/lang/gcc34/files/i386-dragonfly.h
@@ -0,0 +1,142 @@
+/* Definitions for Intel 386 running DragonFly
+ Copyright (C) 1996, 2000, 2002 Free Software Foundation, Inc.
+ Contributed by Eric Youngdale.
+ Modified for stabs-in-ELF by H.J. Lu.
+ Adapted from GNU/Linux version by John Polstra.
+ Continued development by David O'Brien <obrien@freebsd.org>
+
+This file is part of GCC.
+
+GCC 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.
+
+GCC 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 GCC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+
+#define TARGET_VERSION fprintf (stderr, " (i386 DragonFly)");
+
+/* Override the default comment-starter of "/". */
+#undef ASM_COMMENT_START
+#define ASM_COMMENT_START "#"
+
+#undef ASM_APP_ON
+#define ASM_APP_ON "#APP\n"
+
+#undef ASM_APP_OFF
+#define ASM_APP_OFF "#NO_APP\n"
+
+#undef DBX_REGISTER_NUMBER
+#define DBX_REGISTER_NUMBER(n) \
+ (TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n])
+
+#undef NO_PROFILE_COUNTERS
+#define NO_PROFILE_COUNTERS 1
+
+/* Tell final.c that we don't need a label passed to mcount. */
+
+#undef MCOUNT_NAME
+#define MCOUNT_NAME ".mcount"
+
+/* Make gcc agree with <machine/ansi.h>. */
+
+#undef SIZE_TYPE
+#define SIZE_TYPE (TARGET_64BIT ? "long unsigned int" : "unsigned int")
+
+#undef PTRDIFF_TYPE
+#define PTRDIFF_TYPE (TARGET_64BIT ? "long int" : "int")
+
+#undef WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE (TARGET_64BIT ? 32 : BITS_PER_WORD)
+
+#undef SUBTARGET_EXTRA_SPECS /* i386.h bogusly defines it. */
+#define SUBTARGET_EXTRA_SPECS \
+ { "dfbsd_dynamic_linker", DFBSD_DYNAMIC_LINKER }
+
+/* Provide a STARTFILE_SPEC appropriate for DragonFly. Here we add
+ the magical crtbegin.o file (see crtstuff.c) which provides part
+ of the support for getting C++ file-scope static object constructed
+ before entering `main'. */
+
+#undef STARTFILE_SPEC
+#define STARTFILE_SPEC \
+ "%{!shared: \
+ %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
+ %{!p:%{profile:gcrt1.o%s} \
+ %{!profile:crt1.o%s}}}} \
+ crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
+
+/* Provide a ENDFILE_SPEC appropriate for DragonFly. Here we tack on
+ the magical crtend.o file (see crtstuff.c) which provides part of
+ the support for getting C++ file-scope static object constructed
+ before entering `main', followed by a normal "finalizer" file,
+ `crtn.o'. */
+
+#undef ENDFILE_SPEC
+#define ENDFILE_SPEC \
+ "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
+
+/* Provide a LINK_SPEC appropriate for DragonFly. Here we provide support
+ for the special GCC options -static and -shared, which allow us to
+ link things in one of these three modes by applying the appropriate
+ combinations of options at link-time. We like to support here for
+ as many of the other GNU linker options as possible. But I don't
+ have the time to search for those flags. I am sure how to add
+ support for -soname shared_object_name. H.J.
+
+ I took out %{v:%{!V:-V}}. It is too much :-(. They can use
+ -Wl,-V.
+
+ When the -shared link option is used a final link is not being
+ done. */
+
+#undef LINK_SPEC
+#define LINK_SPEC "\
+ %{p:%nconsider using `-pg' instead of `-p' with gprof(1)} \
+ %{Wl,*:%*} \
+ %{v:-V} \
+ %{assert*} %{R*} %{rpath*} %{defsym*} \
+ %{shared:-Bshareable %{h*} %{soname*}} \
+ %{!shared: \
+ %{!static: \
+ %{rdynamic:-export-dynamic} \
+ %{!dynamic-linker:-dynamic-linker %(dfbsd_dynamic_linker) }} \
+ %{static:-Bstatic}} \
+ %{symbolic:-Bsymbolic}"
+
+/* A C statement to output to the stdio stream FILE an assembler
+ command to advance the location counter to a multiple of 1<<LOG
+ bytes if it is within MAX_SKIP bytes.
+
+ This is used to align code labels according to Intel recommendations. */
+
+#ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
+#undef ASM_OUTPUT_MAX_SKIP_ALIGN
+#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE, LOG, MAX_SKIP) \
+ if ((LOG) != 0) { \
+ if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \
+ else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \
+ }
+#endif
+
+/* Don't default to pcc-struct-return, we want to retain compatibility with
+ older gcc versions AND pcc-struct-return is nonreentrant.
+ (even though the SVR4 ABI for the i386 says that records and unions are
+ returned in memory). */
+
+#undef DEFAULT_PCC_STRUCT_RETURN
+#define DEFAULT_PCC_STRUCT_RETURN 0
+
+/* DragonFly sets the rounding precision of the FPU to 53 bits. Let the
+ compiler get the contents of <float.h> and std::numeric_limits correct. */
+#undef TARGET_96_ROUND_53_LONG_DOUBLE
+#define TARGET_96_ROUND_53_LONG_DOUBLE (!TARGET_64BIT)
diff --git a/lang/gcc34/files/i386-dragonfly64.h b/lang/gcc34/files/i386-dragonfly64.h
new file mode 100644
index 00000000000..1e4530f1dc8
--- /dev/null
+++ b/lang/gcc34/files/i386-dragonfly64.h
@@ -0,0 +1,45 @@
+/* Definitions for AMD x86-64 running DragonFly with ELF format
+ Copyright (C) 2002 Free Software Foundation, Inc.
+ Contributed by David O'Brien <obrien@FreeBSD.org>
+
+This file is part of GCC.
+
+GCC 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.
+
+GCC 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 GCC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+
+#undef TARGET_VERSION
+#define TARGET_VERSION fprintf (stderr, " (DragonFly/x86-64)");
+
+#define SUBTARGET_EXTRA_SPECS \
+ { "dfbsd_dynamic_linker", DFBSD_DYNAMIC_LINKER }
+
+/* Provide a LINK_SPEC appropriate for the DragonFly/x86-64 target.
+ This is a copy of LINK_SPEC from <i386/dragonfly.h> tweaked for
+ the x86-64 target. */
+
+#undef LINK_SPEC
+#define LINK_SPEC "\
+ %{m32:-m elf_i386_dfbsd} \
+ %{Wl,*:%*} \
+ %{v:-V} \
+ %{assert*} %{R*} %{rpath*} %{defsym*} \
+ %{shared:-Bshareable %{h*} %{soname*}} \
+ %{!shared: \
+ %{!static: \
+ %{rdynamic:-export-dynamic} \
+ %{!dynamic-linker:-dynamic-linker %(dfbsd_dynamic_linker) }} \
+ %{static:-Bstatic}} \
+ %{symbolic:-Bsymbolic}"
diff --git a/lang/gcc34/patches/patch-aa b/lang/gcc34/patches/patch-aa
new file mode 100644
index 00000000000..6109ff74572
--- /dev/null
+++ b/lang/gcc34/patches/patch-aa
@@ -0,0 +1,13 @@
+$NetBSD: patch-aa,v 1.1 2009/04/22 18:59:54 hasso Exp $
+
+--- boehm-gc/include/private/gcconfig.h.orig 2009-04-08 14:54:58 +0300
++++ boehm-gc/include/private/gcconfig.h 2009-04-08 14:55:38 +0300
+@@ -55,7 +55,7 @@
+ # endif
+
+ /* And one for FreeBSD: */
+-# if defined(__FreeBSD__)
++# if defined(__FreeBSD__) || defined(__DragonFly__)
+ # define FREEBSD
+ # endif
+
diff --git a/lang/gcc34/patches/patch-ab b/lang/gcc34/patches/patch-ab
new file mode 100644
index 00000000000..41dbe0517ed
--- /dev/null
+++ b/lang/gcc34/patches/patch-ab
@@ -0,0 +1,51 @@
+$NetBSD: patch-ab,v 1.1 2009/04/22 18:59:54 hasso Exp $
+
+--- ../gcc-3.4.6/gcc/config.gcc 2005-07-20 00:08:48 +0300
++++ gcc/config.gcc 2009-04-09 09:26:24 +0300
+@@ -451,6 +451,33 @@ case ${target} in
+ "" | yes | posix) thread_file='posix' ;;
+ esac
+ ;;
++*-*-dragonfly*)
++ gas=yes
++ gnu_ld=yes
++ extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
++ case ${target} in
++ *-*-dragonfly1 | *-*-dragonfly[1].*)
++ tm_defines="${tm_defines} DFBSD_MAJOR=1" ;;
++ *-*-dragonfly2 | *-*-dragonfly[2].*)
++ tm_defines="${tm_defines} DFBSD_MAJOR=2" ;;
++ *-*-dragonfly3 | *-*-dragonfly[3].*)
++ tm_defines="${tm_defines} DFBSD_MAJOR=3" ;;
++ *-*-dragonfly4 | *-*-dragonfly[4].*)
++ tm_defines="${tm_defines} DFBSD_MAJOR=4" ;;
++ *)
++ echo 'Please update *-*-dragonfly* in gcc/config.gcc'
++ exit 1
++ ;;
++ esac
++ tmake_file="t-slibgcc-elf-ver t-dragonfly"
++ case ${enable_threads} in
++ "" | yes | posix)
++ thread_file='posix'
++ tmake_file="${tmake_file} t-dragonfly-thread"
++ ;;
++ esac
++ dfbsd_tm_file="${dfbsd_tm_file} dragonfly-spec.h dragonfly.h"
++ ;;
+ *-*-linux*libc1* | *-*-linux*aout*)
+ # Avoid the generic linux case.
+ ;;
+@@ -964,6 +991,12 @@ i[34567]86-*-freebsd*)
+ x86_64-*-freebsd*)
+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/x86-64.h i386/freebsd.h i386/freebsd64.h"
+ ;;
++i[34567]86-*-dragonfly*)
++ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${dfbsd_tm_file} i386/dragonfly.h"
++ ;;
++x86_64-*-dragonfly*)
++ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${dfbsd_tm_file} i386/x86-64.h i386/dragonfly.h i386/dragonfly64.h"
++ ;;
+ i[34567]86-*-netbsdelf*)
+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/netbsd-elf.h"
+ ;;
diff --git a/lang/gcc34/patches/patch-at b/lang/gcc34/patches/patch-at
index f4d72aec34c..1808688e19b 100644
--- a/lang/gcc34/patches/patch-at
+++ b/lang/gcc34/patches/patch-at
@@ -1,24 +1,41 @@
-$NetBSD: patch-at,v 1.1 2009/03/30 10:57:02 markd Exp $
+$NetBSD: patch-at,v 1.2 2009/04/22 18:59:54 hasso Exp $
Alternative fix for http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38182
---- gcc/ginclude/stddef.h.orig 2009-02-28 18:57:06.000000000 +0100
-+++ gcc/ginclude/stddef.h
-@@ -64,7 +64,7 @@ Boston, MA 02111-1307, USA. */
+--- gcc/ginclude/stddef.h.orig 2004-08-12 03:34:33 +0300
++++ gcc/ginclude/stddef.h 2009-04-09 12:05:04 +0300
+@@ -61,10 +61,15 @@ Boston, MA 02111-1307, USA. */
+ #include <sys/_types.h>
+ #endif
+
++#if defined (__DragonFly__)
++#include <machine/stdint.h>
++#include <sys/types.h>
++#endif
++
/* In 4.3bsd-net2, machine/ansi.h defines these symbols, which are
defined if the corresponding type is *not* defined.
FreeBSD-2.1 defines _MACHINE_ANSI_H_ instead of _ANSI_H_ */
-#if defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_)
-+#if defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_) || defined(__NetBSD__)
++#if defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_) || defined(__NetBSD__) || defined(__DragonFly__)
#if !defined(_SIZE_T_) && !defined(_BSD_SIZE_T_)
#define _SIZE_T
#endif
-@@ -359,7 +359,7 @@ typedef __WINT_TYPE__ wint_t;
+@@ -201,7 +205,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t;
+ #define ___int_size_t_h
+ #define _GCC_SIZE_T
+ #define _SIZET_
+-#if defined (__FreeBSD__) && (__FreeBSD__ >= 5)
++#if (defined (__FreeBSD__) && (__FreeBSD__ >= 5)) || defined(__DragonFly__)
+ /* __size_t is a typedef on FreeBSD 5!, must not trash it. */
+ #else
+ #define __size_t
+@@ -359,7 +363,7 @@ typedef __WINT_TYPE__ wint_t;
/* In 4.3bsd-net2, leave these undefined to indicate that size_t, etc.
are already defined. */
/* BSD/OS 3.1 and FreeBSD [23].x require the MACHINE_ANSI_H check here. */
-#if defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_)
-+#if defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_) || defined(__NetBSD__)
++#if defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_) || defined(__NetBSD__) || defined(__DragonFly__)
/* The references to _GCC_PTRDIFF_T_, _GCC_SIZE_T_, and _GCC_WCHAR_T_
are probably typos and should be removed before 2.8 is released. */
#ifdef _GCC_PTRDIFF_T_