pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/lang/gcc34 Hack it to work on DragonFly.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/1a529992ead8
branches:  trunk
changeset: 391949:1a529992ead8
user:      hasso <hasso%pkgsrc.org@localhost>
date:      Wed Apr 22 18:59:54 2009 +0000

description:
Hack it to work on DragonFly.

diffstat:

 lang/gcc34/Makefile                 |   14 +++-
 lang/gcc34/distinfo                 |    6 +-
 lang/gcc34/files/dragonfly-spec.h   |  128 ++++++++++++++++++++++++++++++++
 lang/gcc34/files/dragonfly.h        |   87 ++++++++++++++++++++++
 lang/gcc34/files/i386-dragonfly.h   |  142 ++++++++++++++++++++++++++++++++++++
 lang/gcc34/files/i386-dragonfly64.h |   45 +++++++++++
 lang/gcc34/patches/patch-aa         |   13 +++
 lang/gcc34/patches/patch-ab         |   51 ++++++++++++
 lang/gcc34/patches/patch-at         |   31 ++++++-
 9 files changed, 507 insertions(+), 10 deletions(-)

diffs (truncated from 601 to 300 lines):

diff -r fc36073a348e -r 1a529992ead8 lang/gcc34/Makefile
--- a/lang/gcc34/Makefile       Wed Apr 22 18:18:04 2009 +0000
+++ b/lang/gcc34/Makefile       Wed Apr 22 18:59:54 2009 +0000
@@ -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 @@
 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 @@
        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 -r fc36073a348e -r 1a529992ead8 lang/gcc34/distinfo
--- a/lang/gcc34/distinfo       Wed Apr 22 18:18:04 2009 +0000
+++ b/lang/gcc34/distinfo       Wed Apr 22 18:59:54 2009 +0000
@@ -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-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 -r fc36073a348e -r 1a529992ead8 lang/gcc34/files/dragonfly-spec.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/gcc34/files/dragonfly-spec.h Wed Apr 22 18:59:54 2009 +0000
@@ -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@localhost>
+   Loren J. Rittle <ljrittle%acm.org@localhost>.  */
+
+
+/* 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 -r fc36073a348e -r 1a529992ead8 lang/gcc34/files/dragonfly.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/gcc34/files/dragonfly.h      Wed Apr 22 18:59:54 2009 +0000
@@ -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@localhost>.  
+   Further work by David O'Brien <obrien%FreeBSD.org@localhost> and
+   Loren J. Rittle <ljrittle%acm.org@localhost>.  */
+
+
+/* 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 -r fc36073a348e -r 1a529992ead8 lang/gcc34/files/i386-dragonfly.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/gcc34/files/i386-dragonfly.h Wed Apr 22 18:59:54 2009 +0000
@@ -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@localhost>
+
+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.
+



Home | Main Index | Thread Index | Old Index