summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordoko <doko@6ca36cf4-e1d1-0310-8c6f-e303bb2178ca>2013-04-11 17:27:43 +0000
committerdoko <doko@6ca36cf4-e1d1-0310-8c6f-e303bb2178ca>2013-04-11 17:27:43 +0000
commita7848e1aac7bae75a6cbdc7db38f4ebb17084f36 (patch)
tree5ac5bbe6c810c4f128f4ebf9580ac828e8f3c1a0
parenta8ef91a67534472479eef0918970021dbbf6575d (diff)
downloadgcc-48-a7848e1aac7bae75a6cbdc7db38f4ebb17084f36.tar.gz
[ Iain Buclaw ]
* Port GDC to GCC 4.8.0 release. git-svn-id: svn://svn.debian.org/svn/gcccvs/branches/sid/gcc-4.8@6671 6ca36cf4-e1d1-0310-8c6f-e303bb2178ca
-rw-r--r--debian/changelog3
-rw-r--r--debian/control.m46
-rw-r--r--debian/patches/gdc-4.6.diff349
-rw-r--r--debian/patches/gdc-4.8.diff36
-rw-r--r--debian/patches/gdc-doc.diff360
-rw-r--r--debian/patches/gdc-driver-nophobos.diff29
-rw-r--r--debian/patches/gdc-driver-zlib.diff60
-rw-r--r--debian/patches/gdc-libphobos-build.diff112
-rw-r--r--debian/patches/gdc-libphobos-math.diff28
-rw-r--r--debian/patches/gdc-versym-cpu.diff316
-rw-r--r--debian/patches/gdc-versym-os.diff346
-rwxr-xr-xdebian/rules2
-rw-r--r--debian/rules.conf9
-rw-r--r--debian/rules.d/binary-d.mk26
-rw-r--r--debian/rules.defs35
-rw-r--r--debian/rules.patch9
-rw-r--r--debian/rules.source2
-rw-r--r--debian/rules.unpack32
18 files changed, 1183 insertions, 577 deletions
diff --git a/debian/changelog b/debian/changelog
index 0df8976..316f132 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,9 @@ gcc-4.8 (4.8.0-3) UNRELEASED; urgency=low
* Update to SVN 20130411 (r197813) from the gcc-4_8-branch.
+ [ Iain Buclaw ]
+ * Port GDC to GCC 4.8.0 release.
+
-- Matthias Klose <doko@debian.org> Thu, 11 Apr 2013 19:18:24 +0200
gcc-4.8 (4.8.0-2) experimental; urgency=low
diff --git a/debian/control.m4 b/debian/control.m4
index b7b2616..45de495 100644
--- a/debian/control.m4
+++ b/debian/control.m4
@@ -77,7 +77,7 @@ Build-Conflicts: binutils-gold
ifelse(regexp(SRCNAME, `gnat'),0,`dnl
Homepage: http://gcc.gnu.org/
', regexp(SRCNAME, `gdc'),0,`dnl
-Homepage: http://bitbucket.org/goshawk/gdc/
+Homepage: http://gdcproject.org/
', `dnl
Homepage: http://gcc.gnu.org/
')dnl SRCNAME
@@ -4077,7 +4077,7 @@ BUILT_USING`'dnl
Description: Phobos D standard library
This is the Phobos standard library that comes with the D2 compiler.
.
- For more information check http://www.d-programming-language.org/phobos/
+ For more information check http://www.dlang.org/phobos/
Package: libphobos`'PHOBOS_V`'PV`'TS-dbg
Section: debug
@@ -4089,7 +4089,7 @@ BUILT_USING`'dnl
Description: The Phobos D standard library (debug symbols)
This is the Phobos standard library that comes with the D2 compiler.
.
- For more information check http://www.d-programming-language.org/phobos/
+ For more information check http://www.dlang.org/phobos/
')`'dnl libphobos
')`'dnl d
diff --git a/debian/patches/gdc-4.6.diff b/debian/patches/gdc-4.6.diff
deleted file mode 100644
index b0ff565..0000000
--- a/debian/patches/gdc-4.6.diff
+++ /dev/null
@@ -1,349 +0,0 @@
-# DP: Patches the GCC Directory for D.
-
---- a/src/gcc/cgraph.c 2011-03-04 18:49:23.000000000 +0000
-+++ b/src/gcc/cgraph.c 2011-07-09 20:25:16.517533109 +0100
-@@ -491,6 +491,7 @@ struct cgraph_node *
- cgraph_node (tree decl)
- {
- struct cgraph_node key, *node, **slot;
-+ tree context;
-
- gcc_assert (TREE_CODE (decl) == FUNCTION_DECL);
-
-@@ -512,11 +513,15 @@ cgraph_node (tree decl)
- node = cgraph_create_node ();
- node->decl = decl;
- *slot = node;
-- if (DECL_CONTEXT (decl) && TREE_CODE (DECL_CONTEXT (decl)) == FUNCTION_DECL)
-+ if (DECL_STATIC_CHAIN (decl))
- {
-- node->origin = cgraph_node (DECL_CONTEXT (decl));
-- node->next_nested = node->origin->nested;
-- node->origin->nested = node;
-+ context = decl_function_context (decl);
-+ if (context)
-+ {
-+ node->origin = cgraph_node (context);
-+ node->next_nested = node->origin->nested;
-+ node->origin->nested = node;
-+ }
- }
- if (assembler_name_hash)
- {
---- a/src/gcc/config/i386/i386.c 2011-03-04 17:56:39.000000000 +0000
-+++ b/src/gcc/config/i386/i386.c 2011-07-24 12:47:54.466177239 +0100
-@@ -5358,6 +5358,10 @@ ix86_handle_cconv_attribute (tree *node,
- {
- error ("fastcall and thiscall attributes are not compatible");
- }
-+ if (lookup_attribute ("optlink", TYPE_ATTRIBUTES (*node)))
-+ {
-+ error ("fastcall and optlink attributes are not compatible");
-+ }
- }
-
- /* Can combine stdcall with fastcall (redundant), regparm and
-@@ -5376,6 +5380,10 @@ ix86_handle_cconv_attribute (tree *node,
- {
- error ("stdcall and thiscall attributes are not compatible");
- }
-+ if (lookup_attribute ("optlink", TYPE_ATTRIBUTES (*node)))
-+ {
-+ error ("stdcall and optlink attributes are not compatible");
-+ }
- }
-
- /* Can combine cdecl with regparm and sseregparm. */
-@@ -5393,6 +5401,10 @@ ix86_handle_cconv_attribute (tree *node,
- {
- error ("cdecl and thiscall attributes are not compatible");
- }
-+ if (lookup_attribute ("optlink", TYPE_ATTRIBUTES (*node)))
-+ {
-+ error ("cdecl and optlink attributes are not compatible");
-+ }
- }
- else if (is_attribute_p ("thiscall", name))
- {
-@@ -5411,6 +5423,31 @@ ix86_handle_cconv_attribute (tree *node,
- {
- error ("cdecl and thiscall attributes are not compatible");
- }
-+ if (lookup_attribute ("optlink", TYPE_ATTRIBUTES (*node)))
-+ {
-+ error ("optlink and thiscall attributes are not compatible");
-+ }
-+ }
-+
-+ /* Can combine optlink with regparm and sseregparm. */
-+ else if (is_attribute_p ("optlink", name))
-+ {
-+ if (lookup_attribute ("cdecl", TYPE_ATTRIBUTES (*node)))
-+ {
-+ error ("optlink and cdecl attributes are not compatible");
-+ }
-+ if (lookup_attribute ("fastcall", TYPE_ATTRIBUTES (*node)))
-+ {
-+ error ("optlink and fastcall attributes are not compatible");
-+ }
-+ if (lookup_attribute ("stdcall", TYPE_ATTRIBUTES (*node)))
-+ {
-+ error ("optlink and stdcall attributes are not compatible");
-+ }
-+ if (lookup_attribute ("thiscall", TYPE_ATTRIBUTES (*node)))
-+ {
-+ error ("optlink and thiscall attributes are not compatible");
-+ }
- }
-
- /* Can combine sseregparm with all attributes. */
-@@ -5644,6 +5681,12 @@ ix86_return_pops_args (tree fundecl, tre
- || lookup_attribute ("thiscall", TYPE_ATTRIBUTES (funtype)))
- rtd = 1;
-
-+ /* Optlink functions will pop the stack if floating-point return
-+ and if not variable args. */
-+ if (lookup_attribute ("optlink", TYPE_ATTRIBUTES (funtype))
-+ && FLOAT_MODE_P (TYPE_MODE (TREE_TYPE (funtype))))
-+ rtd = 1;
-+
- if (rtd && ! stdarg_p (funtype))
- return size;
- }
-@@ -5991,6 +6034,11 @@ init_cumulative_args (CUMULATIVE_ARGS *c
- }
- else
- cum->nregs = ix86_function_regparm (fntype, fndecl);
-+
-+ /* For optlink, last parameter is passed in eax rather than
-+ being pushed on the stack. */
-+ if (lookup_attribute ("optlink", TYPE_ATTRIBUTES (fntype)))
-+ cum->optlink = 1;
- }
-
- /* Set up the number of SSE registers used for passing SFmode
-@@ -8721,6 +8769,10 @@ ix86_frame_pointer_required (void)
- if (crtl->profile && !flag_fentry)
- return true;
-
-+ /* Optlink mandates the setting up of ebp, unless 'naked' is used. */
-+ if (crtl->args.info.optlink && !cfun->naked)
-+ return true;
-+
- return false;
- }
-
-@@ -9366,6 +9418,10 @@ ix86_compute_frame_layout (struct ix86_f
- frame->red_zone_size = 0;
- frame->stack_pointer_offset -= frame->red_zone_size;
-
-+ if (cfun->naked)
-+ /* As above, skip return address. */
-+ frame->stack_pointer_offset = UNITS_PER_WORD;
-+
- /* The SEH frame pointer location is near the bottom of the frame.
- This is enforced by the fact that the difference between the
- stack pointer and the frame pointer is limited to 240 bytes in
-@@ -29731,7 +29787,7 @@ x86_output_mi_thunk (FILE *file,
- output_set_got (tmp, NULL_RTX);
-
- xops[1] = tmp;
-- output_asm_insn ("mov{l}\t{%0@GOT(%1), %1|%1, %0@GOT[%1]}", xops);
-+ output_asm_insn ("mov{l}\t{%a0@GOT(%1), %1|%1, %a0@GOT[%1]}", xops);
- output_asm_insn ("jmp\t{*}%1", xops);
- }
- }
-@@ -32553,6 +32609,8 @@ static const struct attribute_spec ix86_
- /* Sseregparm attribute says we are using x86_64 calling conventions
- for FP arguments. */
- { "sseregparm", 0, 0, false, true, true, ix86_handle_cconv_attribute },
-+ /* Optlink attribute says we are using D calling convention */
-+ { "optlink", 0, 0, false, true, true, ix86_handle_cconv_attribute },
- /* force_align_arg_pointer says this function realigns the stack at entry. */
- { (const char *)&ix86_force_align_arg_pointer_string, 0, 0,
- false, true, true, ix86_handle_cconv_attribute },
---- a/src/gcc/config/i386/i386.h 2011-01-14 21:03:22.000000000 +0000
-+++ b/src/gcc/config/i386/i386.h 2011-07-09 20:25:16.661533818 +0100
-@@ -1498,6 +1498,7 @@ typedef struct ix86_args {
- int regno; /* next available register number */
- int fastcall; /* fastcall or thiscall calling convention
- is used */
-+ int optlink; /* optlink calling convention is used */
- int sse_words; /* # sse words passed so far */
- int sse_nregs; /* # sse registers available for passing */
- int warn_avx; /* True when we want to warn about AVX ABI. */
---- a/src/gcc/config/rs6000/rs6000.c 2011-03-15 12:57:37.000000000 +0000
-+++ b/src/gcc/config/rs6000/rs6000.c 2011-07-09 20:25:16.721534120 +0100
-@@ -22039,6 +22039,7 @@ rs6000_output_function_epilogue (FILE *f
- a number, so for now use 9. LTO isn't assigned a number either,
- so for now use 0. */
- if (! strcmp (language_string, "GNU C")
-+ || ! strcmp (language_string, "GNU D")
- || ! strcmp (language_string, "GNU GIMPLE")
- || ! strcmp (language_string, "GNU Go"))
- i = 0;
---- a/src/gcc/dojump.c 2010-05-19 21:09:57.000000000 +0100
-+++ b/src/gcc/dojump.c 2011-07-12 23:03:55.909624421 +0100
-@@ -80,7 +80,8 @@ void
- clear_pending_stack_adjust (void)
- {
- if (optimize > 0
-- && (! flag_omit_frame_pointer || cfun->calls_alloca)
-+ && ((! flag_omit_frame_pointer && ! cfun->naked)
-+ || cfun->calls_alloca)
- && EXIT_IGNORE_STACK)
- discard_pending_stack_adjust ();
- }
---- a/src/gcc/dwarf2out.c 2011-03-18 16:22:01.000000000 +0000
-+++ b/src/gcc/dwarf2out.c 2011-07-09 20:25:16.781534412 +0100
-@@ -20069,6 +20069,8 @@ gen_compile_unit_die (const char *filena
- language = DW_LANG_C89;
- if (strcmp (language_string, "GNU C++") == 0)
- language = DW_LANG_C_plus_plus;
-+ else if (strcmp (language_string, "GNU D") == 0)
-+ language = DW_LANG_D;
- else if (strcmp (language_string, "GNU F77") == 0)
- language = DW_LANG_Fortran77;
- else if (strcmp (language_string, "GNU Pascal") == 0)
-@@ -21464,7 +21466,7 @@ dwarf2out_decl (tree decl)
-
- /* For local statics lookup proper context die. */
- if (TREE_STATIC (decl) && decl_function_context (decl))
-- context_die = lookup_decl_die (DECL_CONTEXT (decl));
-+ context_die = lookup_decl_die (decl_function_context (decl));
-
- /* If we are in terse mode, don't generate any DIEs to represent any
- variable declarations or definitions. */
---- a/src/gcc/function.c 2011-03-09 20:49:00.000000000 +0000
-+++ b/src/gcc/function.c 2011-07-10 18:54:33.562977424 +0100
-@@ -3409,7 +3409,8 @@ assign_parms (tree fndecl)
- targetm.calls.function_arg_advance (&all.args_so_far, data.promoted_mode,
- data.passed_type, data.named_arg);
-
-- assign_parm_adjust_stack_rtl (&data);
-+ if (!cfun->naked)
-+ assign_parm_adjust_stack_rtl (&data);
-
- if (assign_parm_setup_block_p (&data))
- assign_parm_setup_block (&all, parm, &data);
-@@ -3426,7 +3427,8 @@ assign_parms (tree fndecl)
-
- /* Output all parameter conversion instructions (possibly including calls)
- now that all parameters have been copied out of hard registers. */
-- emit_insn (all.first_conversion_insn);
-+ if (!cfun->naked)
-+ emit_insn (all.first_conversion_insn);
-
- /* Estimate reload stack alignment from scalar return mode. */
- if (SUPPORTS_STACK_ALIGNMENT)
-@@ -3590,6 +3592,9 @@ gimplify_parameters (void)
- VEC(tree, heap) *fnargs;
- unsigned i;
-
-+ if (cfun->naked)
-+ return NULL;
-+
- assign_parms_initialize_all (&all);
- fnargs = assign_parms_augmented_arg_list (&all);
-
-@@ -5287,6 +5292,9 @@ thread_prologue_and_epilogue_insns (void
- edge e;
- edge_iterator ei;
-
-+ if (cfun->naked)
-+ return;
-+
- rtl_profile_for_bb (ENTRY_BLOCK_PTR);
-
- inserted = false;
---- a/src/gcc/function.h 2011-01-03 20:52:22.000000000 +0000
-+++ b/src/gcc/function.h 2011-07-12 23:04:20.197744890 +0100
-@@ -636,6 +636,10 @@ struct GTY(()) function {
- adjusts one of its arguments and forwards to another
- function. */
- unsigned int is_thunk : 1;
-+
-+ /* Nonzero if no code should be generated for prologues, copying
-+ parameters, etc. */
-+ unsigned int naked : 1;
- };
-
- /* Add the decl D to the local_decls list of FUN. */
---- a/src/gcc/gcc.c 2011-02-23 02:04:43.000000000 +0000
-+++ b/src/gcc/gcc.c 2011-07-12 21:55:05.805144355 +0100
-@@ -83,6 +83,9 @@ int is_cpp_driver;
- /* Flag set to nonzero if an @file argument has been supplied to gcc. */
- static bool at_file_supplied;
-
-+/* Flag set by drivers needing Pthreads. */
-+int need_pthreads;
-+
- /* Definition of string containing the arguments given to configure. */
- #include "configargs.h"
-
-@@ -373,6 +376,7 @@ or with constant text in a single argume
- assembler has done its job.
- %D Dump out a -L option for each directory in startfile_prefixes.
- If multilib_dir is set, extra entries are generated with it affixed.
-+ %N Output the currently selected multilib directory name.
- %l process LINK_SPEC as a spec.
- %L process LIB_SPEC as a spec.
- %G process LIBGCC_SPEC as a spec.
-@@ -3925,6 +3929,17 @@ process_command (unsigned int decoded_op
- add_infile ("help-dummy", "c");
- }
-
-+ if (need_pthreads)
-+ {
-+ switches[n_switches].part1 = "pthread";
-+ switches[n_switches].args = 0;
-+ switches[n_switches].live_cond = 0;
-+ /* Do not print an error if there is not expansion for -pthread. */
-+ switches[n_switches].validated = 1;
-+ switches[n_switches].ordering = 0;
-+ n_switches++;
-+ }
-+
- alloc_switch ();
- switches[n_switches].part1 = 0;
- alloc_infile ();
-@@ -5095,6 +5110,17 @@ do_spec_1 (const char *spec, int inswitc
- return value;
- break;
-
-+ case 'N':
-+ if (multilib_dir)
-+ {
-+ arg_going = 1;
-+ obstack_grow (&obstack, "-fmultilib-dir=",
-+ strlen ("-fmultilib-dir="));
-+ obstack_grow (&obstack, multilib_dir,
-+ strlen (multilib_dir));
-+ }
-+ break;
-+
- /* Here we define characters other than letters and digits. */
-
- case '{':
---- a/src/gcc/ira.c 2011-03-08 15:51:12.000000000 +0000
-+++ b/src/gcc/ira.c 2011-07-12 23:04:12.433706377 +0100
-@@ -1341,7 +1341,7 @@ ira_setup_eliminable_regset (void)
- case. At some point, we should improve this by emitting the
- sp-adjusting insns for this case. */
- int need_fp
-- = (! flag_omit_frame_pointer
-+ = ((! flag_omit_frame_pointer && ! cfun->naked)
- || (cfun->calls_alloca && EXIT_IGNORE_STACK)
- /* We need the frame pointer to catch stack overflow exceptions
- if the stack pointer is moving. */
---- a/src/gcc/tree-sra.c 2011-02-17 16:18:24.000000000 +0000
-+++ b/src/gcc/tree-sra.c 2011-07-09 20:25:16.941535211 +0100
-@@ -1533,6 +1533,8 @@ is_va_list_type (tree type)
- /* The very first phase of intraprocedural SRA. It marks in candidate_bitmap
- those with type which is suitable for scalarization. */
-
-+/* FIXME: Should we do something here for GDC? */
-+
- static bool
- find_var_candidates (void)
- {
diff --git a/debian/patches/gdc-4.8.diff b/debian/patches/gdc-4.8.diff
new file mode 100644
index 0000000..b4bc21d
--- /dev/null
+++ b/debian/patches/gdc-4.8.diff
@@ -0,0 +1,36 @@
+# DP: This implements D language support in the GCC back end, and adds
+# DP: relevant documentation about the GDC front end.
+
+--- a/src/gcc/config/rs6000/rs6000.c 2013-02-08 19:36:04.000000000 +0000
++++ b/src/gcc/config/rs6000/rs6000.c 2013-03-20 16:26:18.566235720 +0000
+@@ -21578,7 +21578,8 @@ rs6000_output_function_epilogue (FILE *f
+ either, so for now use 0. */
+ if (! strcmp (language_string, "GNU C")
+ || ! strcmp (language_string, "GNU GIMPLE")
+- || ! strcmp (language_string, "GNU Go"))
++ || ! strcmp (language_string, "GNU Go")
++ || ! strcmp (language_string, "GNU D"))
+ i = 0;
+ else if (! strcmp (language_string, "GNU F77")
+ || ! strcmp (language_string, "GNU Fortran"))
+--- a/src/gcc/dwarf2out.c 2013-03-05 23:08:45.000000000 +0000
++++ b/src/gcc/dwarf2out.c 2013-03-20 16:26:18.690235723 +0000
+@@ -18907,6 +18907,8 @@ gen_compile_unit_die (const char *filena
+ language = DW_LANG_C89;
+ if (strcmp (language_string, "GNU C++") == 0)
+ language = DW_LANG_C_plus_plus;
++ else if (strcmp (language_string, "GNU D") == 0)
++ language = DW_LANG_D;
+ else if (strcmp (language_string, "GNU F77") == 0)
+ language = DW_LANG_Fortran77;
+ else if (strcmp (language_string, "GNU Pascal") == 0)
+--- a/src/gcc/gcc.c 2013-03-06 06:32:03.000000000 +0000
++++ b/src/gcc/gcc.c 2013-03-20 16:26:18.706235722 +0000
+@@ -1002,6 +1002,7 @@ static const struct compiler default_com
+ {".java", "#Java", 0, 0, 0}, {".class", "#Java", 0, 0, 0},
+ {".zip", "#Java", 0, 0, 0}, {".jar", "#Java", 0, 0, 0},
+ {".go", "#Go", 0, 1, 0},
++ {".d", "#D", 0, 1, 0}, {".dd", "#D", 0, 1, 0}, {".di", "#D", 0, 1, 0},
+ /* Next come the entries for C. */
+ {".c", "@c", 0, 0, 1},
+ {"@c",
diff --git a/debian/patches/gdc-doc.diff b/debian/patches/gdc-doc.diff
new file mode 100644
index 0000000..66b6041
--- /dev/null
+++ b/debian/patches/gdc-doc.diff
@@ -0,0 +1,360 @@
+# DP: Replace documentation with stub.
+
+--- a/src/gcc/d/gdc.texi 2013-04-08 11:21:37.000000000 +0100
++++ b/src/gcc/d/gdc.texi 2013-04-10 16:09:21.497798648 +0100
+@@ -1,7 +1,10 @@
+-\input texinfo @c -*-texinfo-*-
+-@setfilename gdc.info
+-@settitle The GNU D Compiler
++\input texinfo @c -*-texinfo-*-
++@c %**start of header
+
++@settitle The GNU Compiler Collection (GCC)
++
++@c Create a separate index for command line options.
++@defcodeindex op
+ @c Merge the standard indexes into a single one.
+ @syncodeindex fn cp
+ @syncodeindex vr cp
+@@ -9,327 +12,30 @@
+ @syncodeindex pg cp
+ @syncodeindex tp cp
+
+-@include gcc-common.texi
++@paragraphindent 1
+
+-@c Copyright years for this manual.
+-@set copyrights-d 2011, 2012
++@c %**end of header
+
+ @copying
+-@c man begin COPYRIGHT
+-Copyright @copyright{} @value{copyrights-d} Free Software Foundation, Inc.
+-
+-Permission is granted to copy, distribute and/or modify this document
+-under the terms of the GNU Free Documentation License, Version 1.3 or
+-any later version published by the Free Software Foundation; with no
+-Invariant Sections, the Front-Cover Texts being (a) (see below), and
+-with the Back-Cover Texts being (b) (see below).
+-A copy of the license is included in the
+-@c man end
+-section entitled ``GNU Free Documentation License''.
+-@ignore
+-@c man begin COPYRIGHT
+-man page gfdl(7).
+-@c man end
+-@end ignore
+-
+-@c man begin COPYRIGHT
+-
+-(a) The FSF's Front-Cover Text is:
+-
+- A GNU Manual
+-
+-(b) The FSF's Back-Cover Text is:
+-
+- You have freedom to copy and modify this GNU Manual, like GNU
+- software. Copies published by the Free Software Foundation raise
+- funds for GNU development.
+-@c man end
++The current documentation is licensed under the same terms as the Debian packaging.
+ @end copying
+-
+-@ifinfo
+-@format
+-@dircategory Software development
++@ifnottex
++@dircategory Programming
+ @direntry
+-* gdc - A GCC-based compiler for the D language
++* gdc: (gdc). The GNU Compiler Collection (gdc).
+ @end direntry
+-@end format
+-
+-@insertcopying
+-@end ifinfo
+-
+-@titlepage
+-@title The GNU D Compiler
+-@versionsubtitle
+-@author David Friedman, Iain Buclaw
+-
+-@page
+-@vskip 0pt plus 1filll
+-Published by the Free Software Foundation @*
+-51 Franklin Street, Fifth Floor@*
+-Boston, MA 02110-1301, USA@*
+ @sp 1
+-@insertcopying
+-@end titlepage
++@end ifnottex
++
++@summarycontents
+ @contents
+ @page
+
+ @node Top
+ @top Introduction
+-
+-This manual describes how to use @command{gdc}, the GNU compiler for
+-the o programming language. This manual is specifically about
+-@command{gdc}. For more information about the D programming
+-language in general, including language specifications and standard
+-package documentation, see @uref{http://dlang.org/}.
+-
+-@menu
+-* Copying:: The GNU General Public License.
+-* GNU Free Documentation License::
+- How you can share and copy this manual.
+-* Invoking gdc:: How to run gdc.
+-* Index:: Index.
+-@end menu
+-
+-
+-@include gpl_v3.texi
+-
+-@include fdl.texi
+-
+-
+-@node Invoking gdc
+-@chapter Invoking gdc
+-
+-@c man title gdc A GCC-based compiler for the D language
+-
+-@ignore
+-@c man begin SYNOPSIS gdc
+-gdc [@option{-c}]
+- [@option{-g}] [@option{-pg}] [@option{-O}@var{level}]
+- [@option{-I}@var{dir}@dots{}] [@option{-L}@var{dir}@dots{}]
+- [@option{-o} @var{outfile}] @var{infile}@dots{}
+-
+-For any given input file, the file name suffix determines what kind of
+-compilation is done:
+-
+-@table @gcctabopt
+-@item @var{file}.d
+-D source files.
+-
+-@item @var{file}.di
+-D interface files.
+-
+-@item @var{file}.o
+-Object files to link in.
+-
+-@item @var{file}.a
+-Library files to link in
+-@end table
+-
+-@c man end
+-@c man begin SEEALSO
+-gpl(7), gfdl(7), fsf-funding(7), gcc(1)
+-and the Info entries for @file{gdc} and @file{gcc}.
+-@c man end
+-@end ignore
+-
+-@c man begin DESCRIPTION gdc
+-
+-The @command{gdc} command is a frontend to @command{gcc} and
+-supports many of the same options. @xref{Option Summary, , Option
+-Summary, gcc, Using the GNU Compiler Collection (GCC)}. This manual
+-only documents the options specific to @command{gdc}.
+-Most of these have both positive and negative forms; the negative
+-form of -ffoo would be -fno-foo.
+-This manual documents only one of these two forms, whichever one is
+-not the default.
+-
+-The @command{gdc} command may be used to compile D source code into
+-an object file, link a collection of object files together, or do both
+-in sequence.
+-
+-Only the most useful options are listed here; see below for the
+-remainder.
+-
+-@c man end
+-
+-@c man begin OPTIONS gdc
+-
+-@table @gcctabopt
+-@item -frelease
+-@cindex @option{-frelease}
+-Compile release version.
+-
+-@item -funittest
+-@cindex @option{-funittest}
+-Compile in unittest code.
+-
+-@item -fno-assert
+-@cindex @option{-fno-assert}
+-Turn off code generation for runtime assert()'s.
+-
+-@item -fno-invariants
+-@cindex @option{-fno-invariants}
+-Turn off code generation for runtime invariant()'s.
+-
+-@item -fno-in
+-@cindex @option{-fno-in}
+-Turn off code generation for runtime in() contracts.
+-
+-@item -fno-out
+-@cindex @option{-fno-out}
+-Turn off code generation for runtime out() contracts.
+-
+-@item -fno-bounds-check
+-@cindex @option{-fno-bounds-check}
+-Turns off array bounds checking for all functions.
+-
+-@item -fno-builtin
+-@cindex @option{-fno-builtin}
+-Don't recognize built-in functions that do not begin with
+-@samp{__builtin_} as prefix.
+-
+-@item -fno-emit-moduleinfo
+-@cindex @option{-fno-emit-moduleinfo}
+-Turns off generation of module information and related functions.
+-
+-@item -fd-verbose
+-@cindex @option{-fd-verbose}
+-Print information about D language processing to stdout.
+-
+-@item -fproperty
+-@cindex @option{-fproperty}
+-For D2, enforce @@property syntax.
+-
+-@item -fd-vtls
+-@cindex @option{-fd-vtls}
+-List all variables going into thread local storage.
+-
+-@item -fignore-unknown-pragmas
+-@cindex @option{-fignore-unknown-pragmas}
+-Ignore unsupported pragmas.
+-
+-@item -fsplit-dynamic-arrays
+-@cindex @option{-fsplit-dynamic-arrays}
+-Split dynamic arrays into length and pointer when passing to functions.
+-
+-@item -femit-templates
+-@cindex @option{-femit-templates}
+-Control template emission behaviour.
+-
+-Turning on this option will emit all templates, but make them private
+-to the translation unit. The executable will have multiple copies
+-of code and data.
+-
+-Turning off this option will tell the compiler to not emit templates
+-at all.
+-
+-The default behaviour is to emit templates, but only if the compiler
+-determines that it needs to.
+-
+-@item -fdebug=@var{opt}
+-@cindex @option{-fdebug}
+-Compile in debug code into the program.
+-
+-These are supported options:
+-
+-@table @samp
+-@item level
+-Compile in debug code <= level.
+-
+-@item ident
+-Compile in debug code identified by ident.
+-@end table
+-
+-@item -fdeps=@var{filename}
+-@cindex @option{-fdeps}
+-Write module dependencies to filename.
+-
+-@item -fmake-deps=@var{filename}
+-@cindex @option{-fmake-deps}
+-Write makefile dependency output to the given file.
+-
+-@item -fmake-mdeps=@var{filename}
+-@cindex @option{-fmake-mdeps}
+-Like -fmake-deps=@var{filename} but ignore system header files.
+-
+-@item -fonly=@var{filename}
+-@cindex @option{-fonly}
+-Process all modules specified on the command line,
+-but only generate code for the module specified by the argument.
+-
+-@item -fversion=@var{opt}
+-@cindex @option{-fversion}
+-Compile in version code into the program.
+-
+-These are the supported options:
+-
+-@table @samp
+-@item level
+-Compile in version code >= level.
+-
+-@item ident
+-Compile in debug code identified by ident.
+-@end table
+-
+-@item -fintfc
+-@cindex @option{-fintfc}
+-Generate D interface files.
+-
+-@item -fintfc-dir=@var{directory}
+-@cindex @option{-fintfc-dir}
+-Write D interface files to @var{directory}.
+-
+-@item -fintfc-file=@var{filename}
+-@cindex @option{-fintfc-file}
+-Write D interface file to @var{filename}.
+-
+-@item -fdoc
+-@cindex @option{-fdoc}
+-Generate documentation.
+-
+-@item -fdoc-dir=@var{directory}
+-@cindex @option{-fdoc-dir}
+-Write documentation file in @var{directory}.
+-
+-@item -fdoc-file=@var{filename}
+-@cindex @option{-fdoc-file}
+-Write documentation file to @var{filename}.
+-
+-@item -fdoc-inc=@var{filename}
+-@cindex @option{-fdoc-inc}
+-Include a Ddoc macro file.
+-
+-@item -fXf=@var{filename}
+-@cindex @option{-fXf}
+-Write JSON file to filename.
+-
+-@item -fdump-source
+-@cindex @option{fdump-source}
+-Dump decoded UTF-8 text from source.
+-
+-@item -Wcast-result
+-@cindex @option{Wcast-result}
+-Warn about casts that will produce a null or nil result.
+-
+-@item -Werror
+-@cindex @option{Werror}
+-Make all warnings into errors.
+-
+-@item -Wno-deprecated
+-@cindex @option{Wno-deprecated}
+-Do not warn about usage of deprecated features.
+-
+-@item -Wunknown-pragmas
+-@cindex @option{Wunknown-pragmas}
+-Warn when a pragma is encountered that is not understood by GDC.
+-@end table
+-
+-@c man end
+-
+-@node Index
+-@unnumbered Index
+-
+-@printindex cp
+-
++@cindex introduction
++The official GNU compilers' documentation is released under the terms
++of the GNU Free Documentation License with cover texts. This has been
++considered non free by the Debian Project. Thus you will find it in the
++non-free section of the Debian archive.
+ @bye
+-
diff --git a/debian/patches/gdc-driver-nophobos.diff b/debian/patches/gdc-driver-nophobos.diff
index a21f019..7ec5414 100644
--- a/debian/patches/gdc-driver-nophobos.diff
+++ b/debian/patches/gdc-driver-nophobos.diff
@@ -2,7 +2,7 @@
--- a/src/gcc/d/d-lang.cc 2011-07-24 15:48:55.796035654 +0100
+++ b/src/gcc/d/d-lang.cc 2011-07-24 18:19:45.108908785 +0100
-@@ -184,7 +184,7 @@
+@@ -148,7 +148,7 @@
d_init_options_struct (struct gcc_options *opts)
{
// GCC options
@@ -11,34 +11,9 @@
// Avoid range issues for complex multiply and divide.
opts->x_flag_complex_method = 2;
---- a/src/gcc/d/dmain.d 1970-01-01 01:00:00.000000000 +0100
-+++ b/src/gcc/d/dmain.d 2011-02-20 23:45:24.799761560 +0000
-@@ -0,0 +1,22 @@
-+extern (C) size_t strlen(const char* s);
-+extern (C) void* malloc(size_t s);
-+
-+int main(char[][] args); // U _Dmain
-+
-+extern (C) int main(int argc, char** argv) {
-+ char[][] args;
-+ char[] *am;
-+ int i;
-+
-+ am = cast(char[] *) malloc(argc * (char[]).sizeof);
-+
-+ for(i = 0; i < argc; i++) {
-+ am[i] = argv[i][0 .. strlen(argv[i])];
-+ }
-+
-+ args = am[0 .. argc];
-+
-+ return main(args);
-+}
-+
-+
--- a/src/gcc/d/d-spec.c 2011-07-24 15:48:55.820035782 +0100
+++ b/src/gcc/d/d-spec.c 2011-07-24 18:20:43.841200023 +0100
-@@ -114,7 +114,7 @@
+@@ -84,7 +84,7 @@
/* If nonzero, use the standard D runtime library when linking with
standard libraries. */
diff --git a/debian/patches/gdc-driver-zlib.diff b/debian/patches/gdc-driver-zlib.diff
deleted file mode 100644
index 78fca67..0000000
--- a/debian/patches/gdc-driver-zlib.diff
+++ /dev/null
@@ -1,60 +0,0 @@
-# DP: Update the gdc driver to use the up-to-date system zlib
-
---- a/src/gcc/d/d-spec.c 2011-07-24 15:48:55.820035782 +0100
-+++ b/src/gcc/d/d-spec.c 2011-07-24 18:12:57.750888801 +0100
-@@ -119,7 +119,7 @@
- /* The number of arguments being added to what's in argv, other than
- libraries. We use this to track the number of times we've inserted
- -xd/-xnone. */
-- int added = 0;
-+ int added = 1; /* -lz */
-
- /* The new argument list will be contained in this. */
- struct cl_decoded_option *new_decoded_options;
-@@ -505,6 +505,11 @@
- {
- /* Handled in gcc.c */
- need_pthreads = 1;
-+ /* Use the up-to-date system zlib with libphobos */
-+ generate_option (OPT_l, "z", 1, CL_DRIVER,
-+ &new_decoded_options[j]);
-+ added_libraries++;
-+ j++;
- }
-
- if (saw_librt)
---- a/src/gcc/d/phobos2/etc/c/zlib.d 2011-07-24 15:48:57.068041974 +0100
-+++ b/src/gcc/d/phobos2/etc/c/zlib.d 2011-07-24 18:14:18.775290585 +0100
-@@ -35,8 +35,8 @@
-
- extern (C):
-
--const char[] ZLIB_VERSION = "1.2.3";
--const ZLIB_VERNUM = 0x1230;
-+const char[] ZLIB_VERSION = "1.2.3.4";
-+const ZLIB_VERNUM = 0x1234;
-
- /*
- The 'zlib' compression library provides in-memory compression and
---- a/src/gcc/d/phobos2/Makefile.am 2011-07-24 15:48:57.004041665 +0100
-+++ b/src/gcc/d/phobos2/Makefile.am 2011-07-24 18:16:01.115798057 +0100
-@@ -288,7 +288,7 @@
- std/stream.t.o: std/stream.d $(D_PREREQ_SRCS)
- $(GDC) -o $@ $(ALL_DFLAGS) -fdeprecated -c $<
-
--ALL_PHOBOS_OBJS = $(D_EXTRA_OBJS) $(MAIN_OBJS) $(ZLIB_OBJS)
-+ALL_PHOBOS_OBJS = $(D_EXTRA_OBJS) $(MAIN_OBJS)
-
-
- libgphobos2.a : libgdruntime.a $(ALL_PHOBOS_OBJS)
---- a/src/gcc/d/phobos2/Makefile.in 2011-07-24 15:48:57.016041704 +0100
-+++ b/src/gcc/d/phobos2/Makefile.in 2011-07-24 18:16:08.787836103 +0100
-@@ -379,7 +379,7 @@
- std/windows/charset.o std/windows/iunknown.o std/windows/registry.o \
- std/windows/syserror.o std/__fileinit.o
-
--ALL_PHOBOS_OBJS = $(D_EXTRA_OBJS) $(MAIN_OBJS) $(ZLIB_OBJS)
-+ALL_PHOBOS_OBJS = $(D_EXTRA_OBJS) $(MAIN_OBJS)
-
- # Work around what appears to be a GNU make bug handling MAKEFLAGS
- # values defined in terms of make variables, as is the case for CC and
diff --git a/debian/patches/gdc-libphobos-build.diff b/debian/patches/gdc-libphobos-build.diff
index 04e0a0b..5429fdd 100644
--- a/debian/patches/gdc-libphobos-build.diff
+++ b/debian/patches/gdc-libphobos-build.diff
@@ -1,8 +1,8 @@
-# DP: Setup gcc build system for libphobos.
+# DP: This implements building of libphobos library in GCC.
---- a/src/configure 2011-03-16 18:27:36.000000000 +0000
-+++ b/src/configure 2011-05-28 21:37:07.919690215 +0100
-@@ -2720,7 +2720,8 @@
+--- a/src/configure 2013-02-15 17:45:54.000000000 +0000
++++ b/src/configure 2013-03-20 16:26:18.442235719 +0000
+@@ -2781,7 +2781,8 @@ target_libraries="target-libgcc \
${libgcj} \
target-libobjc \
target-libada \
@@ -12,9 +12,9 @@
# these tools are built using the target libraries, and are intended to
# run only in the target environment
---- a/src/configure.ac 2011-03-16 18:27:36.000000000 +0000
-+++ b/src/configure.ac 2011-05-28 21:37:07.923690230 +0100
-@@ -201,7 +201,8 @@
+--- a/src/configure.ac 2013-02-15 17:45:54.000000000 +0000
++++ b/src/configure.ac 2013-03-20 16:26:18.462235720 +0000
+@@ -168,7 +168,8 @@ target_libraries="target-libgcc \
${libgcj} \
target-libobjc \
target-libada \
@@ -24,9 +24,9 @@
# these tools are built using the target libraries, and are intended to
# run only in the target environment
---- a/src/Makefile.def 2011-02-12 12:02:24.000000000 +0000
-+++ b/src/Makefile.def 2011-05-28 21:37:07.947690350 +0100
-@@ -160,6 +160,7 @@
+--- a/src/Makefile.def 2013-01-14 16:15:21.000000000 +0000
++++ b/src/Makefile.def 2013-03-20 16:26:18.466235720 +0000
+@@ -131,6 +131,7 @@ target_modules = { module= libquadmath;
target_modules = { module= libgfortran; };
target_modules = { module= libobjc; };
target_modules = { module= libgo; };
@@ -34,9 +34,27 @@
target_modules = { module= libtermcap; no_check=true;
missing=mostlyclean;
missing=clean;
---- a/src/Makefile.in 2011-02-12 12:02:24.000000000 +0000
-+++ b/src/Makefile.in 2011-05-28 21:37:08.047690846 +0100
-@@ -963,6 +963,7 @@
+@@ -505,6 +506,8 @@ dependencies = { module=configure-target
+ dependencies = { module=all-target-libgo; on=all-target-libbacktrace; };
+ dependencies = { module=all-target-libgo; on=all-target-libffi; };
+ dependencies = { module=all-target-libgo; on=all-target-libatomic; };
++dependencies = { module=configure-target-libphobos; on=configure-target-zlib; };
++dependencies = { module=all-target-libphobos; on=all-target-zlib; };
+ dependencies = { module=configure-target-libjava; on=configure-target-zlib; };
+ dependencies = { module=configure-target-libjava; on=configure-target-boehm-gc; };
+ dependencies = { module=configure-target-libjava; on=configure-target-libffi; };
+@@ -560,6 +563,8 @@ languages = { language=objc; gcc-check-t
+ languages = { language=obj-c++; gcc-check-target=check-obj-c++; };
+ languages = { language=go; gcc-check-target=check-go;
+ lib-check-target=check-target-libgo; };
++languages = { language=d; gcc-check-target=check-d;
++ lib-check-target=check-target-libphobos; };
+
+ // Toplevel bootstrap
+ bootstrap_stage = { id=1 ; };
+--- a/src/Makefile.in 2013-01-14 16:15:21.000000000 +0000
++++ b/src/Makefile.in 2013-03-20 16:26:18.514235720 +0000
+@@ -933,6 +933,7 @@ configure-target: \
maybe-configure-target-libgfortran \
maybe-configure-target-libobjc \
maybe-configure-target-libgo \
@@ -44,7 +62,7 @@
maybe-configure-target-libtermcap \
maybe-configure-target-winsup \
maybe-configure-target-libgloss \
-@@ -1147,6 +1148,7 @@
+@@ -1086,6 +1087,7 @@ all-target: maybe-all-target-libquadmath
all-target: maybe-all-target-libgfortran
all-target: maybe-all-target-libobjc
all-target: maybe-all-target-libgo
@@ -52,7 +70,7 @@
all-target: maybe-all-target-libtermcap
all-target: maybe-all-target-winsup
all-target: maybe-all-target-libgloss
-@@ -1270,6 +1272,7 @@
+@@ -1175,6 +1177,7 @@ info-target: maybe-info-target-libquadma
info-target: maybe-info-target-libgfortran
info-target: maybe-info-target-libobjc
info-target: maybe-info-target-libgo
@@ -60,7 +78,7 @@
info-target: maybe-info-target-libtermcap
info-target: maybe-info-target-winsup
info-target: maybe-info-target-libgloss
-@@ -1386,6 +1389,7 @@
+@@ -1257,6 +1260,7 @@ dvi-target: maybe-dvi-target-libquadmath
dvi-target: maybe-dvi-target-libgfortran
dvi-target: maybe-dvi-target-libobjc
dvi-target: maybe-dvi-target-libgo
@@ -68,7 +86,7 @@
dvi-target: maybe-dvi-target-libtermcap
dvi-target: maybe-dvi-target-winsup
dvi-target: maybe-dvi-target-libgloss
-@@ -1502,6 +1506,7 @@
+@@ -1339,6 +1343,7 @@ pdf-target: maybe-pdf-target-libquadmath
pdf-target: maybe-pdf-target-libgfortran
pdf-target: maybe-pdf-target-libobjc
pdf-target: maybe-pdf-target-libgo
@@ -76,7 +94,7 @@
pdf-target: maybe-pdf-target-libtermcap
pdf-target: maybe-pdf-target-winsup
pdf-target: maybe-pdf-target-libgloss
-@@ -1618,6 +1623,7 @@
+@@ -1421,6 +1426,7 @@ html-target: maybe-html-target-libquadma
html-target: maybe-html-target-libgfortran
html-target: maybe-html-target-libobjc
html-target: maybe-html-target-libgo
@@ -84,7 +102,7 @@
html-target: maybe-html-target-libtermcap
html-target: maybe-html-target-winsup
html-target: maybe-html-target-libgloss
-@@ -1734,6 +1740,7 @@
+@@ -1503,6 +1509,7 @@ TAGS-target: maybe-TAGS-target-libquadma
TAGS-target: maybe-TAGS-target-libgfortran
TAGS-target: maybe-TAGS-target-libobjc
TAGS-target: maybe-TAGS-target-libgo
@@ -92,7 +110,7 @@
TAGS-target: maybe-TAGS-target-libtermcap
TAGS-target: maybe-TAGS-target-winsup
TAGS-target: maybe-TAGS-target-libgloss
-@@ -1850,6 +1857,7 @@
+@@ -1585,6 +1592,7 @@ install-info-target: maybe-install-info-
install-info-target: maybe-install-info-target-libgfortran
install-info-target: maybe-install-info-target-libobjc
install-info-target: maybe-install-info-target-libgo
@@ -100,7 +118,7 @@
install-info-target: maybe-install-info-target-libtermcap
install-info-target: maybe-install-info-target-winsup
install-info-target: maybe-install-info-target-libgloss
-@@ -1966,6 +1974,7 @@
+@@ -1667,6 +1675,7 @@ install-pdf-target: maybe-install-pdf-ta
install-pdf-target: maybe-install-pdf-target-libgfortran
install-pdf-target: maybe-install-pdf-target-libobjc
install-pdf-target: maybe-install-pdf-target-libgo
@@ -108,7 +126,7 @@
install-pdf-target: maybe-install-pdf-target-libtermcap
install-pdf-target: maybe-install-pdf-target-winsup
install-pdf-target: maybe-install-pdf-target-libgloss
-@@ -2082,6 +2091,7 @@
+@@ -1749,6 +1758,7 @@ install-html-target: maybe-install-html-
install-html-target: maybe-install-html-target-libgfortran
install-html-target: maybe-install-html-target-libobjc
install-html-target: maybe-install-html-target-libgo
@@ -116,7 +134,7 @@
install-html-target: maybe-install-html-target-libtermcap
install-html-target: maybe-install-html-target-winsup
install-html-target: maybe-install-html-target-libgloss
-@@ -2198,6 +2208,7 @@
+@@ -1831,6 +1841,7 @@ installcheck-target: maybe-installcheck-
installcheck-target: maybe-installcheck-target-libgfortran
installcheck-target: maybe-installcheck-target-libobjc
installcheck-target: maybe-installcheck-target-libgo
@@ -124,7 +142,7 @@
installcheck-target: maybe-installcheck-target-libtermcap
installcheck-target: maybe-installcheck-target-winsup
installcheck-target: maybe-installcheck-target-libgloss
-@@ -2314,6 +2325,7 @@
+@@ -1913,6 +1924,7 @@ mostlyclean-target: maybe-mostlyclean-ta
mostlyclean-target: maybe-mostlyclean-target-libgfortran
mostlyclean-target: maybe-mostlyclean-target-libobjc
mostlyclean-target: maybe-mostlyclean-target-libgo
@@ -132,7 +150,7 @@
mostlyclean-target: maybe-mostlyclean-target-libtermcap
mostlyclean-target: maybe-mostlyclean-target-winsup
mostlyclean-target: maybe-mostlyclean-target-libgloss
-@@ -2430,6 +2442,7 @@
+@@ -1995,6 +2007,7 @@ clean-target: maybe-clean-target-libquad
clean-target: maybe-clean-target-libgfortran
clean-target: maybe-clean-target-libobjc
clean-target: maybe-clean-target-libgo
@@ -140,7 +158,7 @@
clean-target: maybe-clean-target-libtermcap
clean-target: maybe-clean-target-winsup
clean-target: maybe-clean-target-libgloss
-@@ -2546,6 +2559,7 @@
+@@ -2077,6 +2090,7 @@ distclean-target: maybe-distclean-target
distclean-target: maybe-distclean-target-libgfortran
distclean-target: maybe-distclean-target-libobjc
distclean-target: maybe-distclean-target-libgo
@@ -148,7 +166,7 @@
distclean-target: maybe-distclean-target-libtermcap
distclean-target: maybe-distclean-target-winsup
distclean-target: maybe-distclean-target-libgloss
-@@ -2662,6 +2676,7 @@
+@@ -2159,6 +2173,7 @@ maintainer-clean-target: maybe-maintaine
maintainer-clean-target: maybe-maintainer-clean-target-libgfortran
maintainer-clean-target: maybe-maintainer-clean-target-libobjc
maintainer-clean-target: maybe-maintainer-clean-target-libgo
@@ -156,7 +174,7 @@
maintainer-clean-target: maybe-maintainer-clean-target-libtermcap
maintainer-clean-target: maybe-maintainer-clean-target-winsup
maintainer-clean-target: maybe-maintainer-clean-target-libgloss
-@@ -2833,6 +2848,7 @@
+@@ -2296,6 +2311,7 @@ check-target: \
maybe-check-target-libgfortran \
maybe-check-target-libobjc \
maybe-check-target-libgo \
@@ -164,7 +182,7 @@
maybe-check-target-libtermcap \
maybe-check-target-winsup \
maybe-check-target-libgloss \
-@@ -3056,6 +3072,7 @@
+@@ -2451,6 +2467,7 @@ install-target: \
maybe-install-target-libgfortran \
maybe-install-target-libobjc \
maybe-install-target-libgo \
@@ -172,7 +190,7 @@
maybe-install-target-libtermcap \
maybe-install-target-winsup \
maybe-install-target-libgloss \
-@@ -3191,6 +3208,7 @@
+@@ -2553,6 +2570,7 @@ install-strip-target: \
maybe-install-strip-target-libgfortran \
maybe-install-strip-target-libobjc \
maybe-install-strip-target-libgo \
@@ -180,7 +198,7 @@
maybe-install-strip-target-libtermcap \
maybe-install-strip-target-winsup \
maybe-install-strip-target-libgloss \
-@@ -51278,6 +51296,463 @@
+@@ -37320,6 +37338,463 @@ maintainer-clean-target-libgo:
@@ -644,7 +662,22 @@
.PHONY: configure-target-libtermcap maybe-configure-target-libtermcap
maybe-configure-target-libtermcap:
@if gcc-bootstrap
-@@ -60184,6 +60659,7 @@
+@@ -43354,6 +43829,14 @@ check-gcc-go:
+ (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) check-go);
+ check-go: check-gcc-go check-target-libgo
+
++.PHONY: check-gcc-d check-d
++check-gcc-d:
++ r=`${PWD_COMMAND}`; export r; \
++ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
++ $(HOST_EXPORTS) \
++ (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) check-d);
++check-d: check-gcc-d check-target-libphobos
++
+
+ # The gcc part of install-no-fixedincludes, which relies on an intimate
+ # knowledge of how a number of gcc internal targets (inter)operate. Delegate.
+@@ -45407,6 +45890,7 @@ configure-target-libquadmath: stage_last
configure-target-libgfortran: stage_last
configure-target-libobjc: stage_last
configure-target-libgo: stage_last
@@ -652,7 +685,7 @@
configure-target-libtermcap: stage_last
configure-target-winsup: stage_last
configure-target-libgloss: stage_last
-@@ -60215,6 +60691,7 @@
+@@ -45438,6 +45922,7 @@ configure-target-libquadmath: maybe-all-
configure-target-libgfortran: maybe-all-gcc
configure-target-libobjc: maybe-all-gcc
configure-target-libgo: maybe-all-gcc
@@ -660,7 +693,16 @@
configure-target-libtermcap: maybe-all-gcc
configure-target-winsup: maybe-all-gcc
configure-target-libgloss: maybe-all-gcc
-@@ -61059,6 +61536,7 @@
+@@ -46180,6 +46665,8 @@ configure-target-libgo: maybe-all-target
+ all-target-libgo: maybe-all-target-libbacktrace
+ all-target-libgo: maybe-all-target-libffi
+ all-target-libgo: maybe-all-target-libatomic
++configure-target-libphobos: maybe-configure-target-zlib
++all-target-libphobos: maybe-all-target-zlib
+ configure-target-libjava: maybe-configure-target-zlib
+ configure-target-libjava: maybe-configure-target-boehm-gc
+ configure-target-libjava: maybe-configure-target-libffi
+@@ -46266,6 +46753,7 @@ configure-target-libquadmath: maybe-all-
configure-target-libgfortran: maybe-all-target-libgcc
configure-target-libobjc: maybe-all-target-libgcc
configure-target-libgo: maybe-all-target-libgcc
@@ -668,7 +710,7 @@
configure-target-libtermcap: maybe-all-target-libgcc
configure-target-winsup: maybe-all-target-libgcc
configure-target-libgloss: maybe-all-target-libgcc
-@@ -61092,6 +61570,8 @@
+@@ -46301,6 +46789,8 @@ configure-target-libobjc: maybe-all-targ
configure-target-libgo: maybe-all-target-newlib maybe-all-target-libgloss
diff --git a/debian/patches/gdc-libphobos-math.diff b/debian/patches/gdc-libphobos-math.diff
deleted file mode 100644
index 5656924..0000000
--- a/debian/patches/gdc-libphobos-math.diff
+++ /dev/null
@@ -1,28 +0,0 @@
-# DP: Define fpclassify and signbit for systems that need it.
-
---- a/src/gcc/d/phobos2/gcc/cbridge_math.c 2010-04-21 13:08:40.000000000 +0100
-+++ b/src/gcc/d/phobos2/gcc/cbridge_math.c 2010-08-23 11:01:05.022792451 +0100
-@@ -21,6 +21,23 @@
- #include <math.h>
- #include "config.h"
-
-+/* If undefined, define fpclassify and signbit here */
-+#ifndef fpclassify
-+# define fpclassify(x) \
-+ (sizeof (x) == sizeof (float) \
-+ ? __fpclassifyf (x) \
-+ : sizeof (x) == sizeof (double) \
-+ ? __fpclassify (x) : __fpclassifyl (x))
-+#endif
-+
-+#ifndef signbit
-+# define signbit(x) \
-+ (sizeof (x) == sizeof (float) \
-+ ? __signbitf (x) \
-+ : sizeof (x) == sizeof (double) \
-+ ? __signbit (x) : __signbitl (x))
-+#endif
-+
- /*
- #if HAVE_DISTINCT_LONG_DOUBLE
- typedef long double my_long_double;
diff --git a/debian/patches/gdc-versym-cpu.diff b/debian/patches/gdc-versym-cpu.diff
new file mode 100644
index 0000000..48c0d84
--- /dev/null
+++ b/debian/patches/gdc-versym-cpu.diff
@@ -0,0 +1,316 @@
+# DP: Implements D CPU version conditions.
+
+--- a/src/gcc/config/aarch64/aarch64.h 2013-01-10 20:38:27.000000000 +0000
++++ b/src/gcc/config/aarch64/aarch64.h 2013-03-20 16:26:18.726235723 +0000
+@@ -51,6 +51,14 @@
+ \
+ } while (0)
+
++/* Target CPU builtins for D. */
++#define TARGET_CPU_D_BUILTINS() \
++ do \
++ { \
++ builtin_define ("AArch64"); \
++ builtin_define ("D_HardFloat"); \
++ } while (0)
++
+
+
+ /* Target machine storage layout. */
+--- a/src/gcc/config/alpha/alpha.h 2013-01-10 20:38:27.000000000 +0000
++++ b/src/gcc/config/alpha/alpha.h 2013-03-20 16:26:18.734235722 +0000
+@@ -72,6 +72,23 @@ along with GCC; see the file COPYING3.
+ SUBTARGET_LANGUAGE_CPP_BUILTINS(); \
+ } while (0)
+
++/* Target CPU builtins for D. */
++#define TARGET_CPU_D_BUILTINS() \
++ do \
++ { \
++ builtin_define ("Alpha"); \
++ if (TARGET_SOFT_FP) \
++ { \
++ builtin_define ("D_SoftFloat"); \
++ builtin_define ("Alpha_SoftFloat"); \
++ } \
++ else \
++ { \
++ builtin_define ("D_HardFloat"); \
++ builtin_define ("Alpha_HardFloat"); \
++ } \
++} while (0)
++
+ #ifndef SUBTARGET_LANGUAGE_CPP_BUILTINS
+ #define SUBTARGET_LANGUAGE_CPP_BUILTINS() \
+ do \
+--- a/src/gcc/config/arm/arm.h 2013-01-15 16:17:28.000000000 +0000
++++ b/src/gcc/config/arm/arm.h 2013-03-20 16:26:18.746235724 +0000
+@@ -158,6 +158,31 @@ extern char arm_arch_name[];
+ builtin_define ("__ARM_ARCH_EXT_IDIV__"); \
+ } while (0)
+
++/* Target CPU builtins for D. */
++#define TARGET_CPU_D_BUILTINS() \
++ do \
++ { \
++ builtin_define ("ARM"); \
++ \
++ if (TARGET_THUMB || TARGET_THUMB2) \
++ builtin_define ("ARM_Thumb"); \
++ \
++ if (TARGET_HARD_FLOAT_ABI) \
++ builtin_define ("ARM_HardFloat"); \
++ else \
++ { \
++ if(TARGET_SOFT_FLOAT) \
++ builtin_define ("ARM_SoftFloat"); \
++ else if(TARGET_HARD_FLOAT) \
++ builtin_define ("ARM_SoftFP"); \
++ } \
++ \
++ if(TARGET_SOFT_FLOAT) \
++ builtin_define ("D_SoftFloat"); \
++ else if(TARGET_HARD_FLOAT) \
++ builtin_define ("D_HardFloat"); \
++ } while (0)
++
+ #include "config/arm/arm-opts.h"
+
+ enum target_cpus
+--- a/src/gcc/config/i386/i386.h 2013-01-28 20:42:55.000000000 +0000
++++ b/src/gcc/config/i386/i386.h 2013-03-20 16:26:18.754235724 +0000
+@@ -588,6 +588,24 @@ extern const char *host_detect_local_cpu
+ /* Target CPU builtins. */
+ #define TARGET_CPU_CPP_BUILTINS() ix86_target_macros ()
+
++/* Target CPU builtins for D. */
++#define TARGET_CPU_D_BUILTINS() \
++ do { \
++ if (TARGET_64BIT) \
++ { \
++ builtin_define("X86_64"); \
++ if (TARGET_X32) \
++ builtin_define("D_X32"); \
++ } \
++ else \
++ builtin_define("X86"); \
++ \
++ if (TARGET_80387) \
++ builtin_define("D_HardFloat"); \
++ else \
++ builtin_define("D_SoftFloat"); \
++ } while (0)
++
+ /* Target Pragmas. */
+ #define REGISTER_TARGET_PRAGMAS() ix86_register_pragmas ()
+
+--- a/src/gcc/config/ia64/ia64.h 2013-01-10 20:38:27.000000000 +0000
++++ b/src/gcc/config/ia64/ia64.h 2013-03-20 16:26:18.766235724 +0000
+@@ -40,6 +40,13 @@ do { \
+ builtin_define("__BIG_ENDIAN__"); \
+ } while (0)
+
++/* Target CPU builtins for D. */
++#define TARGET_CPU_D_BUILTINS() \
++do { \
++ builtin_define ("IA64"); \
++ builtin_define ("D_HardFloat"); \
++} while (0)
++
+ #ifndef SUBTARGET_EXTRA_SPECS
+ #define SUBTARGET_EXTRA_SPECS
+ #endif
+--- a/src/gcc/config/mips/mips.h 2013-02-25 13:53:16.000000000 +0000
++++ b/src/gcc/config/mips/mips.h 2013-03-20 16:26:18.778235723 +0000
+@@ -551,6 +551,54 @@ struct mips_cpu_info {
+ } \
+ while (0)
+
++/* Target CPU builtins for D. */
++#define TARGET_CPU_D_BUILTINS() \
++ do \
++ { \
++ if (TARGET_64BIT) \
++ builtin_define("MIPS64"); \
++ else \
++ builtin_define("MIPS32"); \
++ \
++ switch (mips_abi) \
++ { \
++ case ABI_32: \
++ builtin_define("MIPS_O32"); \
++ break; \
++ \
++ case ABI_O64: \
++ builtin_define("MIPS_O64"); \
++ break; \
++ \
++ case ABI_N32: \
++ builtin_define("MIPS_N32"); \
++ break; \
++ \
++ case ABI_64: \
++ builtin_define("MIPS_N64"); \
++ break; \
++ \
++ case ABI_EABI: \
++ builtin_define("MIPS_EABI"); \
++ break; \
++ \
++ default: \
++ gcc_unreachable(); \
++ } \
++ \
++ if (TARGET_HARD_FLOAT_ABI) \
++ { \
++ builtin_define("MIPS_HardFloat"); \
++ builtin_define("D_HardFloat"); \
++ } \
++ else if (TARGET_SOFT_FLOAT_ABI) \
++ { \
++ builtin_define("MIPS_SoftFloat"); \
++ builtin_define("D_SoftFloat"); \
++ } \
++ } \
++ while (0)
++
+ /* Default target_flags if no switches are specified */
+
+ #ifndef TARGET_DEFAULT
+--- a/src/gcc/config/pa/pa.h 2013-02-03 19:52:37.000000000 +0000
++++ b/src/gcc/config/pa/pa.h 2013-03-20 16:26:18.870235724 +0000
+@@ -185,6 +185,20 @@ do { \
+ builtin_define("_PA_RISC1_0"); \
+ } while (0)
+
++/* Target CPU builtins for D. */
++#define TARGET_CPU_D_BUILTINS() \
++do { \
++ if(TARGET_64BIT) \
++ builtin_define("HPPA64"); \
++ else \
++ builtin_define("HPPA"); \
++ \
++ if(TARGET_SOFT_FLOAT) \
++ builtin_define ("D_SoftFloat"); \
++ else \
++ builtin_define ("D_HardFloat"); \
++} while (0)
++
+ /* An old set of OS defines for various BSD-like systems. */
+ #define TARGET_OS_CPP_BUILTINS() \
+ do \
+--- a/src/gcc/config/rs6000/rs6000.h 2013-02-09 09:30:45.000000000 +0000
++++ b/src/gcc/config/rs6000/rs6000.h 2013-03-20 16:26:19.058235728 +0000
+@@ -613,6 +613,28 @@ extern unsigned char rs6000_recip_bits[]
+ #define TARGET_CPU_CPP_BUILTINS() \
+ rs6000_cpu_cpp_builtins (pfile)
+
++/* Target CPU builtins for D. */
++#define TARGET_CPU_D_BUILTINS() \
++ do \
++ { \
++ if (TARGET_64BIT) \
++ builtin_define ("PPC64"); \
++ else \
++ builtin_define ("PPC"); \
++ \
++ if (TARGET_HARD_FLOAT) \
++ { \
++ builtin_define ("PPC_HardFloat"); \
++ builtin_define ("D_HardFloat"); \
++ } \
++ else if (TARGET_SOFT_FLOAT) \
++ { \
++ builtin_define ("PPC_SoftFloat"); \
++ builtin_define ("D_SoftFloat"); \
++ } \
++ } \
++ while (0)
++
+ /* This is used by rs6000_cpu_cpp_builtins to indicate the byte order
+ we're compiling for. Some configurations may need to override it. */
+ #define RS6000_CPU_CPP_ENDIAN_BUILTINS() \
+--- a/src/gcc/config/s390/s390.h 2013-03-05 12:02:06.000000000 +0000
++++ b/src/gcc/config/s390/s390.h 2013-03-20 16:26:19.094235727 +0000
+@@ -108,6 +108,21 @@ enum processor_flags
+ } \
+ while (0)
+
++/* Target CPU builtins for D. */
++#define TARGET_CPU_D_BUILTINS() \
++ do \
++ { \
++ if (TARGET_64BIT) \
++ builtin_define ("S390X"); \
++ else \
++ builtin_define ("S390"); \
++ \
++ if(TARGET_SOFT_FLOAT) \
++ builtin_define ("D_SoftFloat"); \
++ else if(TARGET_HARD_FLOAT) \
++ builtin_define ("D_HardFloat"); \
++ while (0)
++
+ #ifdef DEFAULT_TARGET_64BIT
+ #define TARGET_DEFAULT (MASK_64BIT | MASK_ZARCH | MASK_HARD_DFP)
+ #else
+--- a/src/gcc/config/sh/sh.h 2013-03-13 18:09:10.000000000 +0000
++++ b/src/gcc/config/sh/sh.h 2013-03-20 16:26:19.102235728 +0000
+@@ -31,6 +31,22 @@ extern int code_for_indirect_jump_scratc
+
+ #define TARGET_CPU_CPP_BUILTINS() sh_cpu_cpp_builtins (pfile)
+
++/* Target CPU builtins for D. */
++#define TARGET_CPU_D_BUILTINS() \
++ do \
++ { \
++ if (TARGET_SHMEDIA64) \
++ builtin_define ("SH64"); \
++ else \
++ builtin_define ("SH"); \
++ \
++ if (TARGET_FPU_ANY) \
++ builtin_define ("D_HardFloat"); \
++ else \
++ builtin_define ("D_SoftFloat"); \
++ } \
++ while (0)
++
+ /* Value should be nonzero if functions must have frame pointers.
+ Zero means the frame pointer need not be set up (and parms may be accessed
+ via the stack pointer) in functions that seem suitable. */
+--- a/src/gcc/config/sparc/sparc.h 2013-01-10 20:38:27.000000000 +0000
++++ b/src/gcc/config/sparc/sparc.h 2013-03-20 16:26:19.110235727 +0000
+@@ -27,6 +27,31 @@ along with GCC; see the file COPYING3.
+
+ #define TARGET_CPU_CPP_BUILTINS() sparc_target_macros ()
+
++/* Target CPU builtins for D. */
++#define TARGET_CPU_D_BUILTINS() \
++do \
++ { \
++ if (TARGET_64BIT) \
++ builtin_define ("SPARC64"); \
++ else \
++ builtin_define ("SPARC"); \
++ \
++ if(TARGET_V8PLUS) \
++ builtin_define ("SPARC_V8Plus"); \
++ \
++ if(TARGET_FPU) \
++ { \
++ builtin_define ("D_HardFloat"); \
++ builtin_define ("SPARC_HardFloat"); \
++ } \
++ else \
++ { \
++ builtin_define ("D_SoftFloat"); \
++ builtin_define ("SPARC_SoftFloat"); \
++ } \
++ } \
++ while (0)
++
+ /* Specify this in a cover file to provide bi-architecture (32/64) support. */
+ /* #define SPARC_BI_ARCH */
+
diff --git a/debian/patches/gdc-versym-os.diff b/debian/patches/gdc-versym-os.diff
new file mode 100644
index 0000000..94e9bce
--- /dev/null
+++ b/debian/patches/gdc-versym-os.diff
@@ -0,0 +1,346 @@
+# DP: Implements D OS version conditions.
+
+--- a/src/gcc/config/arm/linux-eabi.h 2013-01-10 20:38:27.000000000 +0000
++++ b/src/gcc/config/arm/linux-eabi.h 2013-03-20 16:26:19.134235729 +0000
+@@ -30,6 +30,15 @@
+ } \
+ while (false)
+
++#undef TARGET_OS_D_BUILTINS
++#define TARGET_OS_D_BUILTINS() \
++ do \
++ { \
++ TARGET_GENERIC_LINUX_OS_D_BUILTINS(); \
++ ANDROID_TARGET_OS_D_BUILTINS(); \
++ } \
++ while (false)
++
+ /* We default to a soft-float ABI so that binaries can run on all
+ target hardware. If you override this to use the hard-float ABI then
+ change the setting of GLIBC_DYNAMIC_LINKER_DEFAULT as well. */
+--- a/src/gcc/config/darwin.h 2013-02-11 23:30:10.000000000 +0000
++++ b/src/gcc/config/darwin.h 2013-03-20 16:26:19.162235729 +0000
+@@ -921,4 +921,10 @@ extern void darwin_driver_init (unsigned
+ providing an osx-version-min of this unless overridden by the User. */
+ #define DEF_MIN_OSX_VERSION "10.4"
+
++#define TARGET_OS_D_BUILTINS() \
++ do { \
++ builtin_define ("OSX"); \
++ builtin_define ("Posix"); \
++ } while (0)
++
+ #endif /* CONFIG_DARWIN_H */
+--- a/src/gcc/config/freebsd.h 2013-01-10 20:38:27.000000000 +0000
++++ b/src/gcc/config/freebsd.h 2013-03-20 16:26:19.178235729 +0000
+@@ -32,6 +32,13 @@ along with GCC; see the file COPYING3.
+ #undef TARGET_OS_CPP_BUILTINS
+ #define TARGET_OS_CPP_BUILTINS() FBSD_TARGET_OS_CPP_BUILTINS()
+
++#undef TARGET_OS_D_BUILTINS
++#define TARGET_OS_D_BUILTINS() \
++ do { \
++ builtin_define ("FreeBSD"); \
++ builtin_define ("Posix"); \
++ } while (0)
++
+ #undef CPP_SPEC
+ #define CPP_SPEC FBSD_CPP_SPEC
+
+--- a/src/gcc/config/gnu.h 2013-02-06 23:12:03.000000000 +0000
++++ b/src/gcc/config/gnu.h 2013-03-20 16:26:19.182235728 +0000
+@@ -39,3 +39,11 @@ along with GCC. If not, see <http://www
+ builtin_assert ("system=unix"); \
+ builtin_assert ("system=posix"); \
+ } while (0)
++
++#undef TARGET_OS_D_BUILTINS
++#define TARGET_OS_D_BUILTINS() \
++ do { \
++ \
++ builtin_define ("Hurd"); \
++ builtin_define ("Posix"); \
++ } while (0)
+--- a/src/gcc/config/i386/cygwin.h 2013-03-13 15:17:54.000000000 +0000
++++ b/src/gcc/config/i386/cygwin.h 2013-03-20 16:26:19.190235729 +0000
+@@ -20,6 +20,13 @@ along with GCC; see the file COPYING3.
+
+ #define EXTRA_OS_CPP_BUILTINS() /* Nothing. */
+
++#define TARGET_OS_D_BUILTINS() \
++ do { \
++ builtin_define ("Windows"); \
++ builtin_define ("Cygwin"); \
++ builtin_define ("Posix"); \
++ } while (0)
++
+ #undef CPP_SPEC
+ #define CPP_SPEC "%(cpp_cpu) %{posix:-D_POSIX_SOURCE} \
+ -D__CYGWIN32__ -D__CYGWIN__ %{!ansi:-Dunix} -D__unix__ -D__unix \
+--- a/src/gcc/config/i386/linux-common.h 2013-01-10 20:38:27.000000000 +0000
++++ b/src/gcc/config/i386/linux-common.h 2013-03-20 16:26:19.202235730 +0000
+@@ -27,6 +27,15 @@ along with GCC; see the file COPYING3.
+ } \
+ while (0)
+
++#undef TARGET_OS_D_BUILTINS
++#define TARGET_OS_D_BUILTINS() \
++ do \
++ { \
++ TARGET_GENERIC_LINUX_OS_D_BUILTINS(); \
++ ANDROID_TARGET_OS_D_BUILTINS(); \
++ } \
++ while (0)
++
+ #undef CC1_SPEC
+ #define CC1_SPEC \
+ LINUX_OR_ANDROID_CC (GNU_USER_TARGET_CC1_SPEC, \
+--- a/src/gcc/config/i386/mingw32.h 2013-01-10 20:38:27.000000000 +0000
++++ b/src/gcc/config/i386/mingw32.h 2013-03-20 16:26:19.206235730 +0000
+@@ -53,6 +53,18 @@ along with GCC; see the file COPYING3.
+ } \
+ while (0)
+
++#define TARGET_OS_D_BUILTINS() TARGET_GENERIC_MINGW_OS_D_BUILTINS()
++#define TARGET_GENERIC_MINGW_OS_D_BUILTINS() \
++ do { \
++ builtin_define ("Windows"); \
++ builtin_define ("MinGW"); \
++ \
++ if (TARGET_64BIT && ix86_abi == MS_ABI) \
++ builtin_define ("Win64"); \
++ else if (!TARGET_64BIT) \
++ builtin_define ("Win32"); \
++ } while (0)
++
+ #ifndef TARGET_USE_PTHREAD_BY_DEFAULT
+ #define SPEC_PTHREAD1 "pthread"
+ #define SPEC_PTHREAD2 "!no-pthread"
+--- a/src/gcc/config/i386/mingw-w64.h 2013-01-10 20:38:27.000000000 +0000
++++ b/src/gcc/config/i386/mingw-w64.h 2013-03-20 16:26:19.206235730 +0000
+@@ -84,3 +84,10 @@ along with GCC; see the file COPYING3.
+ %{static:-Bstatic} %{!static:-Bdynamic} \
+ %{shared|mdll: " SUB_LINK_ENTRY " --enable-auto-image-base} \
+ %(shared_libgcc_undefs)"
++
++#undef TARGET_OS_D_BUILTINS
++#define TARGET_OS_D_BUILTINS() \
++ do { \
++ TARGET_GENERIC_MINGW_OS_D_BUILTINS(); \
++ builtin_define ("GNU_MinGW64"); \
++ } while (0)
+--- a/src/gcc/config/i386/sysv4.h 2013-01-10 20:38:27.000000000 +0000
++++ b/src/gcc/config/i386/sysv4.h 2013-03-20 16:26:19.210235730 +0000
+@@ -70,3 +70,10 @@ along with GCC; see the file COPYING3.
+ "|%0,_GLOBAL_OFFSET_TABLE_+(.-.LPR%=)}" \
+ : "=d"(BASE))
+ #endif
++
++#define TARGET_OS_D_BUILTINS() \
++ do { \
++ \
++ builtin_define ("SysV4"); \
++ builtin_define ("Posix"); \
++ } while (0)
+--- a/src/gcc/config/ia64/sysv4.h 2013-01-10 20:38:27.000000000 +0000
++++ b/src/gcc/config/ia64/sysv4.h 2013-03-20 16:26:19.210235730 +0000
+@@ -142,3 +142,10 @@ do { \
+
+ #define SDATA_SECTION_ASM_OP "\t.sdata"
+ #define SBSS_SECTION_ASM_OP "\t.sbss"
++
++#define TARGET_OS_D_BUILTINS() \
++ do { \
++ \
++ builtin_define ("SysV4"); \
++ builtin_define ("Posix"); \
++ } while (0)
+--- a/src/gcc/config/kfreebsd-gnu.h 2013-01-10 20:38:27.000000000 +0000
++++ b/src/gcc/config/kfreebsd-gnu.h 2013-03-20 16:26:19.210235730 +0000
+@@ -29,6 +29,14 @@ along with GCC; see the file COPYING3.
+ } \
+ while (0)
+
++#undef TARGET_OS_D_BUILTINS
++#define TARGET_OS_D_BUILTINS() \
++ do { \
++ builtin_define ("FreeBSD"); \
++ builtin_define ("Posix"); \
++ builtin_define ("GNU_GLibc"); \
++ } while (0)
++
+ #define GNU_USER_DYNAMIC_LINKER GLIBC_DYNAMIC_LINKER
+ #define GNU_USER_DYNAMIC_LINKER32 GLIBC_DYNAMIC_LINKER32
+ #define GNU_USER_DYNAMIC_LINKER64 GLIBC_DYNAMIC_LINKER64
+--- a/src/gcc/config/knetbsd-gnu.h 2013-01-10 20:38:27.000000000 +0000
++++ b/src/gcc/config/knetbsd-gnu.h 2013-03-20 16:26:19.218235730 +0000
+@@ -30,6 +30,16 @@ along with GCC; see the file COPYING3.
+ } \
+ while (0)
+
++#undef TARGET_OS_D_BUILTINS
++#define TARGET_OS_D_BUILTINS() \
++ do \
++ { \
++ builtin_define ("NetBSD"); \
++ builtin_define ("Posix"); \
++ builtin_define ("GNU_GLibc"); \
++ } \
++ while (0)
++
+
+ #undef GNU_USER_DYNAMIC_LINKER
+ #define GNU_USER_DYNAMIC_LINKER "/lib/ld.so.1"
+--- a/src/gcc/config/kopensolaris-gnu.h 2013-01-10 20:38:27.000000000 +0000
++++ b/src/gcc/config/kopensolaris-gnu.h 2013-03-20 16:26:19.218235730 +0000
+@@ -30,5 +30,15 @@ along with GCC; see the file COPYING3.
+ } \
+ while (0)
+
++#define TARGET_OS_D_BUILTINS() \
++ do \
++ { \
++ builtin_define ("Solaris"); \
++ builtin_define ("Posix"); \
++ builtin_define ("GNU_OpenSolaris"); \
++ builtin_define ("GNU_GLibc"); \
++ } \
++ while (0)
++
+ #undef GNU_USER_DYNAMIC_LINKER
+ #define GNU_USER_DYNAMIC_LINKER "/lib/ld.so.1"
+--- a/src/gcc/config/linux-android.h 2013-01-10 20:38:27.000000000 +0000
++++ b/src/gcc/config/linux-android.h 2013-03-20 16:26:19.218235730 +0000
+@@ -25,6 +25,12 @@
+ builtin_define ("__ANDROID__"); \
+ } while (0)
+
++#define ANDROID_TARGET_OS_D_BUILTINS() \
++ do { \
++ if (TARGET_ANDROID) \
++ builtin_define ("Android"); \
++ } while (0)
++
+ #if ANDROID_DEFAULT
+ # define NOANDROID "mno-android"
+ #else
+--- a/src/gcc/config/linux.h 2013-01-10 20:38:27.000000000 +0000
++++ b/src/gcc/config/linux.h 2013-03-20 16:26:19.226235729 +0000
+@@ -49,6 +49,20 @@ see the files COPYING3 and COPYING.RUNTI
+ builtin_assert ("system=posix"); \
+ } while (0)
+
++#define TARGET_OS_D_BUILTINS() TARGET_GENERIC_LINUX_OS_D_BUILTINS()
++#define TARGET_GENERIC_LINUX_OS_D_BUILTINS() \
++ do { \
++ if (OPTION_GLIBC) \
++ builtin_define ("GNU_GLibc"); \
++ else if (OPTION_UCLIBC) \
++ builtin_define ("GNU_UCLibc"); \
++ else if (OPTION_BIONIC) \
++ builtin_define ("GNU_Bionic"); \
++ \
++ builtin_define ("linux"); \
++ builtin_define ("Posix"); \
++ } while (0)
++
+ /* Determine which dynamic linker to use depending on whether GLIBC or
+ uClibc or Bionic is the default C library and whether
+ -muclibc or -mglibc or -mbionic has been passed to change the default. */
+--- a/src/gcc/config/mips/linux-common.h 2013-01-10 20:38:27.000000000 +0000
++++ b/src/gcc/config/mips/linux-common.h 2013-03-20 16:26:19.230235729 +0000
+@@ -27,6 +27,15 @@ along with GCC; see the file COPYING3.
+ ANDROID_TARGET_OS_CPP_BUILTINS(); \
+ } while (0)
+
++#undef TARGET_OS_D_BUILTINS
++#define TARGET_OS_D_BUILTINS() \
++ do \
++ { \
++ TARGET_GENERIC_LINUX_OS_D_BUILTINS(); \
++ ANDROID_TARGET_OS_D_BUILTINS(); \
++ } \
++ while (0)
++
+ #undef LINK_SPEC
+ #define LINK_SPEC \
+ LINUX_OR_ANDROID_LD (GNU_USER_TARGET_LINK_SPEC, \
+--- a/src/gcc/config/netbsd.h 2013-01-10 20:38:27.000000000 +0000
++++ b/src/gcc/config/netbsd.h 2013-03-20 16:26:19.230235729 +0000
+@@ -29,6 +29,14 @@ along with GCC; see the file COPYING3.
+ } \
+ while (0)
+
++#define TARGET_OS_D_BUILTINS() \
++ do \
++ { \
++ builtin_define ("NetBSD"); \
++ builtin_define ("Posix"); \
++ } \
++ while (0)
++
+ /* CPP_SPEC parts common to all NetBSD targets. */
+ #define NETBSD_CPP_SPEC \
+ "%{posix:-D_POSIX_SOURCE} \
+--- a/src/gcc/config/openbsd.h 2013-01-10 20:38:27.000000000 +0000
++++ b/src/gcc/config/openbsd.h 2013-03-20 16:26:19.230235729 +0000
+@@ -84,6 +84,14 @@ along with GCC; see the file COPYING3.
+ } \
+ while (0)
+
++#define TARGET_OS_D_BUILTINS() \
++ do \
++ { \
++ builtin_define ("OpenBSD"); \
++ builtin_define ("Posix"); \
++ } \
++ while (0)
++
+ /* TARGET_OS_CPP_BUILTINS() common to all OpenBSD ELF targets. */
+ #define OPENBSD_OS_CPP_BUILTINS_ELF() \
+ do \
+--- a/src/gcc/config/rs6000/aix.h 2013-01-10 20:38:27.000000000 +0000
++++ b/src/gcc/config/rs6000/aix.h 2013-03-20 16:26:19.230235729 +0000
+@@ -110,6 +110,13 @@
+ } \
+ while (0)
+
++#define TARGET_OS_D_BUILTINS() \
++ do { \
++ \
++ builtin_define ("AIX"); \
++ builtin_define ("Posix"); \
++ } while (0)
++
+ /* Define appropriate architecture macros for preprocessor depending on
+ target switches. */
+
+--- a/src/gcc/config/rs6000/sysv4.h 2013-01-10 20:38:27.000000000 +0000
++++ b/src/gcc/config/rs6000/sysv4.h 2013-03-20 16:26:19.238235730 +0000
+@@ -523,6 +523,13 @@ extern int fixuplabelno;
+ while (0)
+ #endif
+
++#define TARGET_OS_D_BUILTINS() \
++ do { \
++ \
++ builtin_define ("SysV4"); \
++ builtin_define ("Posix"); \
++ } while (0)
++
+ #undef ASM_SPEC
+ #define ASM_SPEC "%(asm_cpu) \
+ %{,assembler|,assembler-with-cpp: %{mregnames} %{mno-regnames}} \
+--- a/src/gcc/config/sparc/sysv4.h 2013-01-10 20:38:27.000000000 +0000
++++ b/src/gcc/config/sparc/sysv4.h 2013-03-20 16:26:19.242235729 +0000
+@@ -117,3 +117,10 @@ do { ASM_OUTPUT_ALIGN ((FILE), Pmode ==
+
+ #undef MCOUNT_FUNCTION
+ #define MCOUNT_FUNCTION "*_mcount"
++
++#define TARGET_OS_D_BUILTINS() \
++ do { \
++ \
++ builtin_define ("SysV4"); \
++ builtin_define ("Posix"); \
++ } while (0)
diff --git a/debian/rules b/debian/rules
index 3a46070..93204a2 100755
--- a/debian/rules
+++ b/debian/rules
@@ -68,7 +68,7 @@ $(check_stamp): $(build_stamp)
clean:
rm -rf $(stampdir)
# remove temporary dirs used for unpacking
- rm -rf $(gcc_srcdir) $(gdc_srcdir) d
+ rm -rf $(gcc_srcdir) $(gdc_srcdir)
-$(MAKE) -f debian/rules2 $@
rm -rf $(srcdir)* $(builddir)* debian/tmp* html
rm -f bootstrap-* first-move-stamp
diff --git a/debian/rules.conf b/debian/rules.conf
index 45b7206..6cc6641 100644
--- a/debian/rules.conf
+++ b/debian/rules.conf
@@ -142,10 +142,6 @@ NEXT_GCC_RELEASE_VERSION := $(shell expr $(echo $(GCC_MAJOR_VERSION)) + 1)
ifeq ($(single_package),yes)
BASE_VERSION := $(shell echo $(GCC_VERSION) | sed -e 's/\([1-9]\.[0-9]\).*/\1/')
endif
-ifneq (,$(findstring gdc,$(PKGSOURCE)))
- GDC_BASE_VERSION := $(word 1, $(subst -, ,$(DEB_VERSION)))
- DEB_VERSION := $(subst $(GDC_BASE_VERSION)-,,$(DEB_VERSION))
-endif
GCC_SOURCE_VERSION := $(shell echo $(DEB_VERSION) | sed 's/-.*//')
NEXT_GCC_SOURCE_VERSION := $(shell echo $(GCC_SOURCE_VERSION) | \
@@ -500,7 +496,8 @@ DEB_GCC_SOFT_VERSION := 4.8
DEB_GCJ_SOFT_VERSION := 4.8
ifeq ($(with_d),yes)
- DEB_GDC_VERSION := $(GDC_BASE_VERSION)-$(DEB_VERSION)
+ GDC_VERSION := $(BASE_VERSION)
+ DEB_GDC_VERSION := $(DEB_VERSION)
endif
# semiautomatic ...
@@ -1054,7 +1051,6 @@ parameters-file:
echo 'SOURCE_VERSION := $(SOURCE_VERSION)'; \
echo 'DEB_VERSION := $(DEB_VERSION)'; \
echo 'DEB_EVERSION := $(DEB_EVERSION)'; \
- echo 'GDC_BASE_VERSION := $(GDC_BASE_VERSION)'; \
echo 'DEB_GDC_VERSION := $(DEB_GDC_VERSION)'; \
echo 'DEB_SOVERSION := $(DEB_SOVERSION)'; \
echo 'DEB_SOEVERSION := $(DEB_SOEVERSION)'; \
@@ -1071,6 +1067,7 @@ parameters-file:
echo 'FORTRAN_SONAME := $(FORTRAN_SONAME)'; \
echo 'OBJC_SONAME := $(OBJC_SONAME)'; \
echo 'GCJ_SONAME := $(GCJ_SONAME)'; \
+ echo 'GDC_VERSION := $(GDC_VERSION)'; \
echo 'GNAT_VERSION := $(GNAT_VERSION)'; \
echo 'GNAT_SONAME := $(GNAT_SONAME)'; \
echo 'FFI_SONAME := $(FFI_SONAME)'; \
diff --git a/debian/rules.d/binary-d.mk b/debian/rules.d/binary-d.mk
index 847a743..7e902d2 100644
--- a/debian/rules.d/binary-d.mk
+++ b/debian/rules.d/binary-d.mk
@@ -5,12 +5,12 @@ ifeq ($(with_libphobos),yes)
endif
p_gdc = gdc$(pkg_ver)
-p_libphobos = libphobos$(libphobos_version)$(pkg_ver)-dev
+p_libphobos = libphobos$(pkg_ver)-dev
d_gdc = debian/$(p_gdc)
d_libphobos = debian/$(p_libphobos)
-gdc_include_dir := $(PF)/include/d$(libphobos_version)
+gdc_include_dir := $(PF)/include/d
dirs_gdc = \
$(PF)/bin \
@@ -20,9 +20,7 @@ dirs_gdc = \
files_gdc = \
$(PF)/bin/$(cmd_prefix)gdc$(pkg_ver) \
- $(PF)/bin/$(cmd_prefix)gdmd$(pkg_ver) \
$(PF)/share/man/man1/gdc$(pkg_ver).1 \
- $(PF)/share/man/man1/gdmd$(pkg_ver).1 \
$(gcc_lexec_dir)/cc1d
@@ -32,7 +30,7 @@ dirs_libphobos = \
$(gcc_lib_dir)
files_libphobos = \
- $(PF)/$(libdir)/libgphobos$(libphobos_version).a \
+ $(PF)/$(libdir)/libgphobos2.a \
$(gdc_include_dir)/$(BASE_VERSION)
links_gdc = \
@@ -50,8 +48,7 @@ $(binary_stamp)-gdc: $(install_stamp)
rm -rf $(d_gdc)
dh_installdirs -p$(p_gdc) $(dirs_gdc)
- dh_installdocs -p$(p_gdc) \
- src/gcc/d/{README,GDC.html,History}
+ dh_installdocs -p$(p_gdc) src/gcc/d/README
dh_installchangelogs -p$(p_gdc) src/gcc/d/ChangeLog
DH_COMPAT=2 dh_movefiles -p$(p_gdc) -X/zlib/ $(files_gdc)
@@ -65,19 +62,10 @@ ifneq ($(DEB_CROSS),yes)
$(d_gdc)/$(PF)/share/man/man1/$(DEB_TARGET_GNU_TYPE)-gdc$(pkg_ver).1
ln -sf gdc$(pkg_ver).1 \
$(d_gdc)/$(PF)/share/man/man1/$(TARGET_ALIAS)-gdc$(pkg_ver).1
-
- ln -sf gdmd$(pkg_ver) \
- $(d_gdc)/$(PF)/bin/$(DEB_TARGET_GNU_TYPE)-gdmd$(pkg_ver)
- ln -sf gdmd$(pkg_ver) \
- $(d_gdc)/$(PF)/bin/$(TARGET_ALIAS)-gdmd$(pkg_ver)
- ln -sf gdmd$(pkg_ver).1 \
- $(d_gdc)/$(PF)/share/man/man1/$(DEB_TARGET_GNU_TYPE)-gdmd$(pkg_ver).1
- ln -sf gdmd$(pkg_ver).1 \
- $(d_gdc)/$(PF)/share/man/man1/$(TARGET_ALIAS)-gdmd$(pkg_ver).1
endif
# Always needed by gdc.
- cp $(srcdir)/gcc/d/druntime/object.di \
+ cp $(srcdir)/libphobos/libdruntime/object.di \
$(d_gdc)/$(gdc_include_dir)/$(BASE_VERSION)/
dh_link -p$(p_gdc) $(links_gdc)
@@ -103,10 +91,10 @@ $(binary_stamp)-libphobos: $(install_stamp)
rm -rf $(d_libphobos)
dh_installdirs -p$(p_libphobos) $(dirs_libphobos)
- DH_COMPAT=2 dh_movefiles -p$(p_libphobos) -X/zlib/ $(files_libphobos)
+ DH_COMPAT=2 dh_movefiles -p$(p_libphobos) $(files_libphobos)
# better to have it there, avoid conflicts
- mv $(d_libphobos)/$(PF)/$(libdir)/libgphobos$(libphobos_version).a \
+ mv $(d_libphobos)/$(PF)/$(libdir)/libgphobos2.a \
$(d_libphobos)/$(gcc_lib_dir)
# included in gdc package
diff --git a/debian/rules.defs b/debian/rules.defs
index 4c3bfac..5918ae4 100644
--- a/debian/rules.defs
+++ b/debian/rules.defs
@@ -53,10 +53,6 @@ EPOCH := 1
DEB_EVERSION := $(EPOCH):$(DEB_VERSION)
BASE_VERSION := $(shell echo $(DEB_VERSION) | sed -e 's/\([1-9]\.[0-9]\).*-.*/\1/')
-ifneq (,$(findstring gdc,$(PKGSOURCE)))
- BASE_VERSION := $(shell echo $(DEB_VERSION) | sed -e 's/.*-\([1-9]\.[0-9]\).*-.*/\1/')
-endif
-
# push glibc stack traces into stderr
export LIBC_FATAL_STDERR_=1
@@ -709,11 +705,13 @@ endif
with_go := $(call envfilt, go, , , $(with_go))
# Build all packages needed for Go development
-ifeq ($(with_go),yes)
- ifeq ($(with_common_libs),yes)
- with_libgo := yes
+ifneq (,$(findstring gcc, $(PKGSOURCE)))
+ ifeq ($(with_go),yes)
+ ifeq ($(with_common_libs),yes)
+ with_libgo := yes
+ endif
+ enabled_languages += go
endif
- enabled_languages += go
endif
ifeq ($(with_go)-$(with_separate_libgo),yes-yes)
@@ -742,27 +740,24 @@ ifeq ($(d_no_snap)-$(single_package),yes-yes)
with_d := disabled for snapshot build
endif
+ifeq ($(with_base_only),yes)
+ with_d := no
+endif
+
ifeq ($(with_d)-$(with_separate_gdc),yes-yes)
ifneq (,$(findstring gdc,$(PKGSOURCE)))
languages := c c++
separate_lang := yes
+
+ # FIXME: language selection needs improvement.
+ with_go := disabled for d
else
- # FIXME: not ready for 4.8
- #debian_extra_langs += d
+ debian_extra_langs += d
with_d := built from separate source
endif
endif
-ifeq ($(with_base_only),yes)
- with_d := no
-endif
-
ifeq ($(with_d),yes)
- # no suffix for D 1.0
- #libphobos_version :=
- # still experimental
- libphobos_version := 2
-
with_libphobos := yes
libphobos_no_cpus := alpha avr arm hppa ia64 m68k mips mipsel powerpc powerpcspe ppc64 s390 s390x sh4 sparc sparc64
@@ -1532,7 +1527,7 @@ ifneq (,$(findstring $(DEB_TARGET_GNU_SYSTEM),$(locale_no_systems)))
force_gnu_locales := disabled for system $(DEB_TARGET_GNU_SYSTEM)
endif
-gcc_tarpath := $(firstword $(wildcard gcc-*.tar.* /usr/src/gcc-$(BASE_VERSION)/gcc-*.tar.*))
+gcc_tarpath := $(firstword $(wildcard gcc-*.tar.* /usr/src/gcc-4.8/gcc-*.tar.*))
gcc_tarball := $(notdir $(gcc_tarpath))
gcc_srcdir := $(subst -dfsg,,$(patsubst %.tar.xz,%,$(patsubst %.tar.lzma,%,$(patsubst %.tar.gz,%,$(gcc_tarball:.tar.bz2=)))))
diff --git a/debian/rules.patch b/debian/rules.patch
index 0189873..bc918a4 100644
--- a/debian/rules.patch
+++ b/debian/rules.patch
@@ -145,12 +145,12 @@ ifeq ($(with_ada),yes)
endif
-ifeq (0,1)
ifeq ($(with_d),yes)
debian_patches += \
- gdc-4.6 \
- gdc-libphobos-math \
- gdc-driver-zlib
+ gdc-4.8 \
+ gdc-doc \
+ gdc-versym-cpu \
+ gdc-versym-os
ifeq ($(with_libphobos),yes)
debian_patches += gdc-libphobos-build
@@ -161,7 +161,6 @@ ifeq ($(with_d),yes)
else
debian_patches += gcc-d-lang
endif
-endif # D
ifeq ($(DEB_TARGET_ARCH),alpha)
debian_patches += alpha-ieee mudflap-nocheck
diff --git a/debian/rules.source b/debian/rules.source
index 15aa53e..a11b595 100644
--- a/debian/rules.source
+++ b/debian/rules.source
@@ -9,7 +9,7 @@ patch-source: $(patch_stamp)
clean-source:
rm -rf $(stampdir)
- rm -rf $(gcc_srcdir) $(gdc_srcdir) d
+ rm -rf $(gcc_srcdir) $(gdc_srcdir)
rm -rf bin
rm -rf $(srcdir)
diff --git a/debian/rules.unpack b/debian/rules.unpack
index cc99850..260ce19 100644
--- a/debian/rules.unpack
+++ b/debian/rules.unpack
@@ -213,7 +213,7 @@ endif
# ---------------------------------------------------------------------------
ifneq (,$(gdc_tarball))
-$(unpack_stamp)-$(gdc_tarball): $(gdc_tarpath)
+$(unpack_stamp)-$(gdc_tarball): $(gdc_tarpath) $(unpack_stamp)-$(gcc_tarball)
ifneq ($(with_libphobos),yes)
echo >&2 "libphobos v2 needs porting: $(with_libphobos)"
false
@@ -225,7 +225,11 @@ $(unpack_stamp)-$(gdc_tarball): $(gdc_tarpath)
false; \
fi
#rm -rf $(gdc_srcdir)
- rm -rf d
+ rm -rf $(srcdir)/gcc/d
+ rm -rf $(srcdir)/gcc/testsuite/gdc.test
+ rm -f $(srcdir)/gcc/testsuite/lib/gdc*.exp
+ rm -rf $(srcdir)/libphobos
+
case $(gdc_tarball) in \
*.bz2) tar -x --bzip2 -f $(gdc_tarpath);; \
*.gz) tar -x --gzip -f $(gdc_tarpath);; \
@@ -233,27 +237,9 @@ $(unpack_stamp)-$(gdc_tarball): $(gdc_tarpath)
*.xz) xzcat $(gdc_tarpath) | tar -x -f -;; \
*) false; \
esac
- if [ -d d ]; then \
- mv d $(srcdir)/gcc/. ; \
- else \
- mv $(gdc_srcdir)/d $(srcdir)/gcc/. ; \
- rm -rf $(gdc_srcdir)/CVS; \
- rmdir $(gdc_srcdir); \
- fi
- ifeq ($(with_libphobos),yes)
- [ -d $(srcdir)/libphobos ] && rm -rf $(srcdir)/libphobos || true
- mkdir $(srcdir)/libphobos && \
- cd $(srcdir)/libphobos && \
- ../symlink-tree ../gcc/d/phobos$(libphobos_version) 2>&1 && \
- cd $(srcdir)
- endif
- ifeq ($(libphobos_version),2)
- cd $(srcdir)/libphobos && \
- ../symlink-tree ../gcc/d/druntime 2>&1 && \
- cd $(srcdir)
- echo "D_LANGUAGE_VERSION=2" > $(srcdir)/gcc/d/d-make-include
- else
- echo "D_LANGUAGE_VERSION=1" > $(srcdir)/gcc/d/d-make-include
+
+ ifneq ($(with_libphobos),yes)
+ rm -rf $(srcdir)/libphobos
endif
echo "$(gdc_tarball) unpacked." > $@
endif