/usr/src/gcc-8/debian/patches/gdc-8.diff is in gcc-8-source 8-20180414-1ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 | # DP: This implements D language support in the GCC back end, and adds
# DP: relevant documentation about the GDC front end (code part).
Index: b/src/gcc/config/powerpcspe/powerpcspe.c
===================================================================
--- a/src/gcc/config/powerpcspe/powerpcspe.c
+++ b/src/gcc/config/powerpcspe/powerpcspe.c
@@ -32034,11 +32034,12 @@ rs6000_output_function_epilogue (FILE *f
use language_string.
C is 0. Fortran is 1. Pascal is 2. Ada is 3. C++ is 9.
Java is 13. Objective-C is 14. Objective-C++ isn't assigned
- a number, so for now use 9. LTO, Go and JIT aren't assigned numbers
- either, so for now use 0. */
+ a number, so for now use 9. LTO, Go, D and JIT aren't assigned
+ numbers either, so for now use 0. */
if (lang_GNU_C ()
|| ! strcmp (language_string, "GNU GIMPLE")
|| ! strcmp (language_string, "GNU Go")
+ || ! strcmp (language_string, "GNU D")
|| ! strcmp (language_string, "libgccjit"))
i = 0;
else if (! strcmp (language_string, "GNU F77")
Index: b/src/gcc/config/rs6000/rs6000.c
===================================================================
--- a/src/gcc/config/rs6000/rs6000.c
+++ b/src/gcc/config/rs6000/rs6000.c
@@ -29194,11 +29194,12 @@ rs6000_output_function_epilogue (FILE *f
use language_string.
C is 0. Fortran is 1. Pascal is 2. Ada is 3. C++ is 9.
Java is 13. Objective-C is 14. Objective-C++ isn't assigned
- a number, so for now use 9. LTO, Go and JIT aren't assigned numbers
- either, so for now use 0. */
+ a number, so for now use 9. LTO, Go, D, and JIT aren't assigned
+ numbers either, so for now use 0. */
if (lang_GNU_C ()
|| ! strcmp (language_string, "GNU GIMPLE")
|| ! strcmp (language_string, "GNU Go")
+ || ! strcmp (language_string, "GNU D")
|| ! strcmp (language_string, "libgccjit"))
i = 0;
else if (! strcmp (language_string, "GNU F77")
Index: b/src/gcc/dwarf2out.c
===================================================================
--- a/src/gcc/dwarf2out.c
+++ b/src/gcc/dwarf2out.c
@@ -5464,6 +5464,16 @@ is_ada (void)
return lang == DW_LANG_Ada95 || lang == DW_LANG_Ada83;
}
+/* Return TRUE if the language is D. */
+
+static inline bool
+is_dlang (void)
+{
+ unsigned int lang = get_AT_unsigned (comp_unit_die (), DW_AT_language);
+
+ return lang == DW_LANG_D;
+}
+
/* Remove the specified attribute if present. Return TRUE if removal
was successful. */
@@ -24396,6 +24406,8 @@ gen_compile_unit_die (const char *filena
language = DW_LANG_ObjC;
else if (strcmp (language_string, "GNU Objective-C++") == 0)
language = DW_LANG_ObjC_plus_plus;
+ else if (strcmp (language_string, "GNU D") == 0)
+ language = DW_LANG_D;
else if (dwarf_version >= 5 || !dwarf_strict)
{
if (strcmp (language_string, "GNU Go") == 0)
@@ -25999,7 +26011,7 @@ declare_in_namespace (tree thing, dw_die
if (ns_context != context_die)
{
- if (is_fortran ())
+ if (is_fortran () || is_dlang ())
return ns_context;
if (DECL_P (thing))
gen_decl_die (thing, NULL, NULL, ns_context);
@@ -26022,7 +26034,7 @@ gen_namespace_die (tree decl, dw_die_ref
{
/* Output a real namespace or module. */
context_die = setup_namespace_context (decl, comp_unit_die ());
- namespace_die = new_die (is_fortran ()
+ namespace_die = new_die (is_fortran () || is_dlang ()
? DW_TAG_module : DW_TAG_namespace,
context_die, decl);
/* For Fortran modules defined in different CU don't add src coords. */
@@ -26094,7 +26106,7 @@ gen_decl_die (tree decl, tree origin, st
break;
case CONST_DECL:
- if (!is_fortran () && !is_ada ())
+ if (!is_fortran () && !is_ada () && !is_dlang ())
{
/* The individual enumerators of an enum type get output when we output
the Dwarf representation of the relevant enum type itself. */
@@ -26691,7 +26703,7 @@ dwarf2out_decl (tree decl)
case CONST_DECL:
if (debug_info_level <= DINFO_LEVEL_TERSE)
return;
- if (!is_fortran () && !is_ada ())
+ if (!is_fortran () && !is_ada () && !is_dlang ())
return;
if (TREE_STATIC (decl) && decl_function_context (decl))
context_die = lookup_decl_die (DECL_CONTEXT (decl));
Index: b/src/gcc/gcc.c
===================================================================
--- a/src/gcc/gcc.c
+++ b/src/gcc/gcc.c
@@ -1305,6 +1305,7 @@ static const struct compiler default_com
{".f08", "#Fortran", 0, 0, 0}, {".F08", "#Fortran", 0, 0, 0},
{".r", "#Ratfor", 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",
Index: b/src/gcc/po/EXCLUDES
===================================================================
--- a/src/gcc/po/EXCLUDES
+++ b/src/gcc/po/EXCLUDES
@@ -53,3 +53,43 @@ genrecog.c
gensupport.c
gensupport.h
read-md.c
+
+# These files are part of the front end to D, and have no i18n support.
+d/dfrontend/arrayop.c
+d/dfrontend/attrib.c
+d/dfrontend/canthrow.c
+d/dfrontend/cond.c
+d/dfrontend/constfold.c
+d/dfrontend/cppmangle.c
+d/dfrontend/ctfeexpr.c
+d/dfrontend/dcast.c
+d/dfrontend/dclass.c
+d/dfrontend/declaration.c
+d/dfrontend/denum.c
+d/dfrontend/dimport.c
+d/dfrontend/dinterpret.c
+d/dfrontend/dmangle.c
+d/dfrontend/dmodule.c
+d/dfrontend/doc.c
+d/dfrontend/dscope.c
+d/dfrontend/dstruct.c
+d/dfrontend/dsymbol.c
+d/dfrontend/dtemplate.c
+d/dfrontend/dversion.c
+d/dfrontend/expression.c
+d/dfrontend/func.c
+d/dfrontend/init.c
+d/dfrontend/inline.c
+d/dfrontend/lexer.c
+d/dfrontend/mtype.c
+d/dfrontend/nogc.c
+d/dfrontend/nspace.c
+d/dfrontend/objc.c
+d/dfrontend/opover.c
+d/dfrontend/optimize.c
+d/dfrontend/parse.c
+d/dfrontend/sideeffect.c
+d/dfrontend/statement.c
+d/dfrontend/statementsem.c
+d/dfrontend/staticassert.c
+d/dfrontend/traits.c
|