[PATCH, Modula-2 (C/C++/D/F/Go/Jit)] (Register spec fn) (v2)

Gaius Mulley gaius.mulley@southwales.ac.uk
Fri Jun 14 13:10:00 GMT 2019


Hello,

here is version two of the patches which introduce Modula-2 into the
GCC trunk.  The patches include:

  (*)  a patch to allow all front ends to register a lang spec function.
       (included are patches for all front ends to provide an empty
        callback function).
  (*)  patch diffs to allow the Modula-2 front end driver to be
       built using GCC Makefile and friends.

The compressed tarball includes:

  (*)  gcc/m2  (compiler driver and lang-spec stuff for Modula-2).
       Including the need for registering lang spec functions.
  (*)  gcc/testsuite/gm2  (a Modula-2 dejagnu test to ensure that
       the gm2 driver is built and can understands --version).

These patches have been re-written after taking on board the comments
found in this thread:

   https://gcc.gnu.org/ml/gcc-patches/2013-11/msg02620.html

it is a revised patch set from:

   https://gcc.gnu.org/ml/gcc-patches/2019-06/msg00220.html

I've run make bootstrap and run the regression tests on trunk and no
extra failures occur for all languages touched in the ChangeLog.

I'm currently tracking gcc trunk and gcc-9 with gm2 (which works well
with amd64/arm64/i386) - these patches are currently simply for the
driver to minimise the patch size.  There are also > 1800 tests in a
dejagnu testsuite for gm2 which can be included at some future time.

Here are the proposed patches and ChangeLogs and new files (gm2-v2.tar.gz)
(after the patches):

./ChangeLog

14-06-2019  Gaius Mulley   <gaius.mulley@southwales.ac.uk>

        * configure.ac (GM2_FOR_BUILD): Added.
          (GM2_FOR_TARGET): Added.
          Request build driver program gm2.
        * Makefile.def (GM2_FOR_TARGET): Added.
          (GM2FLAGS_FOR_TARGET): Added.  Assign GM2,
          GM2_FOR_BUILD, GM2_FOR_TARGET and GM2FLAGS.
          Pass variables to make.  Add new language Modula-2
          (m2).
        * Makefile.tpl (GM2FLAGS): Added.  (GM2) Added.
          (GM2_FOR_BUILD) Added.

./gcc/ChangeLog

14-06-2019  Gaius Mulley   <gaius.mulley@southwales.ac.uk>

        * gcc.c (allow_linker): Global variable to disable
          linker by the front end.
          (handle_OPT_B): New function to handle the -B option.
          (fe_save_switch): New function to allow front ends to
          add switches.  (fe_B_prefix): New function to allow
          front ends to add their own -B option.
          (fe_remove_infile): Mark a source file
          as compiled.  (maybe_run_linker): Check allow_linker
          before running the linker.  (lookup_spec_function):
          search language specific functions.
          (driver::set_up_specs):  call lang_register_spec_functions.
        * gcc.h (fe_B_prefix): Prototype.  (fe_save_switch): Prototype.
          (allow_linker): Extern.
          (lang_register_spec_functions): Prototype.
          (fe_add_spec_function): Prototype.
        * gcc/brig/brigspec.c (lang_register_spec_functions): Added.
        * c/gccspec.c (lang_register_spec_functions): Added.
        * c-family/cppspec.c (lang_register_spec_functions): Added.
        * cp/g++spec.c (lang_register_spec_functions): Added.
        * d/d-spec.cc (lang_register_spec_functions): Added.
        * fortran/gfortranspec.c(lang_register_spec_functions): Added.
        * gcc/go/gospec.c (lang_register_spec_functions): Added.
        * jit/jit-spec.c (lang_register_spec_functions): Added.


--- gcc-versionno-orig/configure.ac	2019-05-28 22:11:37.993620055 +0100
+++ gcc-versionno/configure.ac	2019-05-28 22:39:16.345133571 +0100
@@ -1270,6 +1270,7 @@
   GFORTRAN_FOR_BUILD=${GFORTRAN_FOR_BUILD-gfortran}
   GOC_FOR_BUILD=${GOC_FOR_BUILD-gccgo}
   GDC_FOR_BUILD=${GDC_FOR_BUILD-gdc}
+  GM2_FOR_BUILD=${GM2_FOR_BUILD-gm2}
   DLLTOOL_FOR_BUILD=${DLLTOOL_FOR_BUILD-dlltool}
   LD_FOR_BUILD=${LD_FOR_BUILD-ld}
   NM_FOR_BUILD=${NM_FOR_BUILD-nm}
@@ -1284,6 +1285,7 @@
   GFORTRAN_FOR_BUILD="\$(GFORTRAN)"
   GOC_FOR_BUILD="\$(GOC)"
   GDC_FOR_BUILD="\$(GDC)"
+  GM2_FOR_BUILD="\$(GM2)"
   DLLTOOL_FOR_BUILD="\$(DLLTOOL)"
   LD_FOR_BUILD="\$(LD)"
   NM_FOR_BUILD="\$(NM)"
@@ -3272,6 +3274,7 @@
 AC_SUBST(GFORTRAN_FOR_BUILD)
 AC_SUBST(GOC_FOR_BUILD)
 AC_SUBST(GDC_FOR_BUILD)
+AC_SUBST(GM2_FOR_BUILD)
 AC_SUBST(LDFLAGS_FOR_BUILD)
 AC_SUBST(LD_FOR_BUILD)
 AC_SUBST(NM_FOR_BUILD)
@@ -3383,6 +3386,7 @@
 NCN_STRICT_CHECK_TARGET_TOOLS(GFORTRAN_FOR_TARGET, gfortran)
 NCN_STRICT_CHECK_TARGET_TOOLS(GOC_FOR_TARGET, gccgo)
 NCN_STRICT_CHECK_TARGET_TOOLS(GDC_FOR_TARGET, gdc)
+NCN_STRICT_CHECK_TARGET_TOOLS(GM2_FOR_TARGET, gm2)
 
 ACX_CHECK_INSTALLED_TARGET_TOOL(AR_FOR_TARGET, ar)
 ACX_CHECK_INSTALLED_TARGET_TOOL(AS_FOR_TARGET, as)
@@ -3419,6 +3423,8 @@
 		[gcc/gccgo -B$$r/$(HOST_SUBDIR)/gcc/], go)
 GCC_TARGET_TOOL(gdc, GDC_FOR_TARGET, GDC,
 		[gcc/gdc -B$$r/$(HOST_SUBDIR)/gcc/], d)
+GCC_TARGET_TOOL(gm2, GM2_FOR_TARGET, GM2,
+		[gcc/xgm2 -B$$r/$(HOST_SUBDIR)/gcc/], gm2)
 GCC_TARGET_TOOL(ld, LD_FOR_TARGET, LD, [ld/ld-new])
 GCC_TARGET_TOOL(lipo, LIPO_FOR_TARGET, LIPO)
 GCC_TARGET_TOOL(nm, NM_FOR_TARGET, NM, [binutils/nm-new])
--- gcc-versionno-orig/gcc/gcc.c	2019-05-28 22:15:19.368276992 +0100
+++ gcc-versionno/gcc/gcc.c	2019-06-05 18:14:52.702739525 +0100
@@ -305,6 +305,9 @@
 static const char *cross_compile = "0";
 #endif
 
+/* The lang specs might wish to override the default linker.  */
+int allow_linker = 1;
+
 /* Greatest exit code of sub-processes that has been encountered up to
    now.  */
 static int greatest_status = 1;
@@ -410,6 +413,7 @@
 static const char *debug_level_greater_than_spec_func (int, const char **);
 static const char *find_fortran_preinclude_file (int, const char **);
 static char *convert_white_space (char *);
+static void handle_OPT_B (const char *arg);
 
 /* The Specs Language
 
@@ -1655,6 +1659,10 @@
   { 0, 0 }
 };
 
+/* front end registered spec functions */
+static struct spec_function *lang_spec_functions = NULL;
+static unsigned int lang_spec_functions_length = 0;
+
 static int processing_spec_function;
 
 /* Add appropriate libgcc specs to OBSTACK, taking into account
@@ -3725,6 +3733,70 @@
   setenv ("SOURCE_DATE_EPOCH", source_date_epoch, 0);
 }
 
+/* Save an option OPT with N_ARGS arguments in array ARGS, marking it
+   as validated if VALIDATED.  */
+
+void
+fe_save_switch (const char *opt, size_t n_args, const char *const *args,
+		bool validated, bool known)
+{
+  save_switch (opt, n_args, args, validated, known);
+}
+
+/* fe_B_prefix allow the front end to add its own -B option.  */
+
+void
+fe_B_prefix (const char *arg)
+{
+  handle_OPT_B (arg);
+}
+
+/* Handle the -B option by adding the prefix to exec, startfile and
+   include search paths.  */
+
+static
+void handle_OPT_B (const char *arg)
+{
+  size_t len = strlen (arg);
+
+  /* Catch the case where the user has forgotten to append a
+     directory separator to the path.  Note, they may be using
+     -B to add an executable name prefix, eg "i386-elf-", in
+     order to distinguish between multiple installations of
+     GCC in the same directory.  Hence we must check to see
+     if appending a directory separator actually makes a
+     valid directory name.  */
+  if (!IS_DIR_SEPARATOR (arg[len - 1])
+      && is_directory (arg, false))
+    {
+      char *tmp = XNEWVEC (char, len + 2);
+      strcpy (tmp, arg);
+      tmp[len] = DIR_SEPARATOR;
+      tmp[++len] = 0;
+      arg = tmp;
+    }
+
+  add_prefix (&exec_prefixes, arg, NULL,
+	      PREFIX_PRIORITY_B_OPT, 0, 0);
+  add_prefix (&startfile_prefixes, arg, NULL,
+	      PREFIX_PRIORITY_B_OPT, 0, 0);
+  add_prefix (&include_prefixes, arg, NULL,
+	      PREFIX_PRIORITY_B_OPT, 0, 0);
+}
+
+/* Mark a source file as compiled.  */
+
+void
+fe_remove_infile (const char *name)
+{
+  int max = n_infiles + lang_specific_extra_outfiles;
+  int i;
+
+  for (i = 0; i < max; i++)
+    if (filename_cmp (name, infiles[i].name) == 0)
+      infiles[i].compiled = true;
+}
+
 /* Handle an option DECODED that is unknown to the option-processing
    machinery.  */
 
@@ -4204,33 +4276,7 @@
       break;
 
     case OPT_B:
-      {
-	size_t len = strlen (arg);
-
-	/* Catch the case where the user has forgotten to append a
-	   directory separator to the path.  Note, they may be using
-	   -B to add an executable name prefix, eg "i386-elf-", in
-	   order to distinguish between multiple installations of
-	   GCC in the same directory.  Hence we must check to see
-	   if appending a directory separator actually makes a
-	   valid directory name.  */
-	if (!IS_DIR_SEPARATOR (arg[len - 1])
-	    && is_directory (arg, false))
-	  {
-	    char *tmp = XNEWVEC (char, len + 2);
-	    strcpy (tmp, arg);
-	    tmp[len] = DIR_SEPARATOR;
-	    tmp[++len] = 0;
-	    arg = tmp;
-	  }
-
-	add_prefix (&exec_prefixes, arg, NULL,
-		    PREFIX_PRIORITY_B_OPT, 0, 0);
-	add_prefix (&startfile_prefixes, arg, NULL,
-		    PREFIX_PRIORITY_B_OPT, 0, 0);
-	add_prefix (&include_prefixes, arg, NULL,
-		    PREFIX_PRIORITY_B_OPT, 0, 0);
-      }
+      handle_OPT_B (arg);
       validated = true;
       break;
 
@@ -6069,6 +6115,34 @@
   return 0;
 }
 
+/* Allow the front end to register a spec function.  */
+
+void
+fe_add_spec_function (const char *name, const char *(*func) (int, const char **))
+{
+  const struct spec_function *f = lookup_spec_function (name);
+  struct spec_function *fl;
+  unsigned int i;
+
+  if (f != NULL)
+    fatal_error (input_location, "spec function (%s) already registered", name);
+
+  if (lang_spec_functions == NULL)
+    lang_spec_functions_length = 1;
+
+  lang_spec_functions_length++;
+  fl = (struct spec_function *) xmalloc (sizeof (const struct spec_function)*lang_spec_functions_length);
+  for (i=0; i<lang_spec_functions_length-2; i++)
+    fl[i] = lang_spec_functions[i];
+  free (lang_spec_functions);
+  lang_spec_functions = fl;
+
+  lang_spec_functions[lang_spec_functions_length-2].name = name;
+  lang_spec_functions[lang_spec_functions_length-2].func = func;
+  lang_spec_functions[lang_spec_functions_length-1].name = NULL;
+  lang_spec_functions[lang_spec_functions_length-1].func = NULL;
+}
+
 /* Look up a spec function.  */
 
 static const struct spec_function *
@@ -6080,6 +6154,11 @@
     if (strcmp (sf->name, name) == 0)
       return sf;
 
+  if (lang_spec_functions != NULL)
+    for (sf = lang_spec_functions; sf->name != NULL; sf++)
+      if (strcmp (sf->name, name) == 0)
+	return sf;
+
   return NULL;
 }
 
@@ -7563,6 +7642,8 @@
 			   accel_dir_suffix, dir_separator_str, NULL);
   just_machine_suffix = concat (spec_machine, dir_separator_str, NULL);
 
+  lang_register_spec_functions ();
+
   specs_file = find_a_file (&startfile_prefixes, "specs", R_OK, true);
   /* Read the specs file unless it is a default one.  */
   if (specs_file != 0 && strcmp (specs_file, "specs"))
@@ -8259,7 +8340,8 @@
 
   /* Run ld to link all the compiler output files.  */
 
-  if (num_linker_inputs > 0 && !seen_error () && print_subprocess_help < 2)
+  if (num_linker_inputs > 0 && !seen_error () && print_subprocess_help < 2
+      && allow_linker)
     {
       int tmp = execution_count;
 
@@ -8326,7 +8408,7 @@
   /* If options said don't run linker,
      complain about input files to be given to the linker.  */
 
-  if (! linker_was_run && !seen_error ())
+  if (! linker_was_run && !seen_error () && allow_linker)
     for (i = 0; (int) i < n_infiles; i++)
       if (explicit_link_files[i]
 	  && !(infiles[i].language && infiles[i].language[0] == '*'))
--- gcc-versionno-orig/gcc/gcc.h	2019-05-28 22:15:19.368276992 +0100
+++ gcc-versionno/gcc/gcc.h	2019-06-05 21:56:07.100326079 +0100
@@ -72,9 +72,14 @@
 extern int do_spec (const char *);
 extern void record_temp_file (const char *, int, int);
 extern void set_input (const char *);
+extern void fe_save_switch (const char *opt, size_t n_args,
+			    const char *const *args, bool validated);
+extern void fe_B_prefix (const char *arg);
 
 /* Spec files linked with gcc.c must provide definitions for these.  */
 
+extern void lang_register_spec_functions (void);
+
 /* Called before processing to change/add/remove arguments.  */
 extern void lang_specific_driver (struct cl_decoded_option **,
 				  unsigned int *, int *);
@@ -96,4 +101,12 @@
 					      void *user_data),
 				   void *user_data);
 
+/* Default setting is true, but can be overridden by the language
+   front end to prohibit the linker from being invoked.  */
+extern int allow_linker;
+
+extern void
+fe_add_spec_function (const char *name,
+		      const char *(*func) (int, const char **));
+
 #endif /* ! GCC_GCC_H */
--- gcc-versionno-orig/Makefile.def	2019-05-28 22:33:03.786431313 +0100
+++ gcc-versionno/Makefile.def	2019-06-06 20:05:25.389064754 +0100
@@ -284,6 +284,8 @@
 flags_to_pass = { flag= GOCFLAGS_FOR_TARGET ; };
 flags_to_pass = { flag= GDC_FOR_TARGET ; };
 flags_to_pass = { flag= GDCFLAGS_FOR_TARGET ; };
+flags_to_pass = { flag= GM2_FOR_TARGET ; };
+flags_to_pass = { flag= GM2FLAGS_FOR_TARGET ; };
 flags_to_pass = { flag= LD_FOR_TARGET ; };
 flags_to_pass = { flag= LIPO_FOR_TARGET ; };
 flags_to_pass = { flag= LDFLAGS_FOR_TARGET ; };
@@ -612,6 +614,7 @@
 				lib-check-target=check-target-libhsail-rt; };
 languages = { language=d;	gcc-check-target=check-d;
 				lib-check-target=check-target-libphobos; };
+languages = { language=m2;	gcc-check-target=check-m2; };
 
 // Toplevel bootstrap
 bootstrap_stage = { id=1 ; };
--- gcc-versionno-orig/Makefile.tpl	2019-05-28 22:33:04.658406768 +0100
+++ gcc-versionno/Makefile.tpl	2019-06-11 14:53:03.033696961 +0100
@@ -161,6 +161,8 @@
 	GOCFLAGS="$(GOCFLAGS_FOR_BUILD)"; export GOCFLAGS; \
 	GDC="$(GDC_FOR_BUILD)"; export GDC; \
 	GDCFLAGS="$(GDCFLAGS_FOR_BUILD)"; export GDCFLAGS; \
+	GM2FLAGS="$(GM2FLAGS_FOR_BUILD)"; export GM2FLAGS; \
+	GM2="$(GM2_FOR_BUILD)"; export GM2; \
 	DLLTOOL="$(DLLTOOL_FOR_BUILD)"; export DLLTOOL; \
 	LD="$(LD_FOR_BUILD)"; export LD; \
 	LDFLAGS="$(LDFLAGS_FOR_BUILD)"; export LDFLAGS; \
@@ -198,6 +200,7 @@
 	GFORTRAN="$(GFORTRAN)"; export GFORTRAN; \
 	GOC="$(GOC)"; export GOC; \
 	GDC="$(GDC)"; export GDC; \
+	GM2="$(GM2)"; export GM2; \
 	AR="$(AR)"; export AR; \
 	AS="$(AS)"; export AS; \
 	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
@@ -295,6 +298,7 @@
 	GFORTRAN="$(GFORTRAN_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GFORTRAN; \
 	GOC="$(GOC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GOC; \
 	GDC="$(GDC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GDC; \
+	GM2="$(GM2_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GM2; \
 	DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
 	LD="$(COMPILER_LD_FOR_TARGET)"; export LD; \
 	LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
@@ -361,6 +365,7 @@
 GFORTRAN_FOR_BUILD = @GFORTRAN_FOR_BUILD@
 GOC_FOR_BUILD = @GOC_FOR_BUILD@
 GDC_FOR_BUILD = @GDC_FOR_BUILD@
+GM2_FOR_BUILD = @GM2_FOR_BUILD@
 LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@
 LD_FOR_BUILD = @LD_FOR_BUILD@
 NM_FOR_BUILD = @NM_FOR_BUILD@
@@ -430,6 +435,7 @@
 LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
 GOCFLAGS = $(CFLAGS)
 GDCFLAGS = $(CFLAGS)
+GM2FLAGS = $(CFLAGS)
 
 CREATE_GCOV = create_gcov
 
@@ -517,6 +523,7 @@
 GFORTRAN_FOR_TARGET=$(STAGE_CC_WRAPPER) @GFORTRAN_FOR_TARGET@
 GOC_FOR_TARGET=$(STAGE_CC_WRAPPER) @GOC_FOR_TARGET@
 GDC_FOR_TARGET=$(STAGE_CC_WRAPPER) @GDC_FOR_TARGET@
+GM2_FOR_TARGET=$(STAGE_CC_WRAPPER) @GM2_FOR_TARGET@
 DLLTOOL_FOR_TARGET=@DLLTOOL_FOR_TARGET@
 LD_FOR_TARGET=@LD_FOR_TARGET@
 
@@ -543,6 +550,7 @@
 LDFLAGS_FOR_TARGET = @LDFLAGS_FOR_TARGET@
 GOCFLAGS_FOR_TARGET = -O2 -g
 GDCFLAGS_FOR_TARGET = -O2 -g
+GM2FLAGS_FOR_TARGET = -O2 -g
 
 FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@
 SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
@@ -646,6 +654,7 @@
 	'GFORTRAN=$(GFORTRAN)' \
 	'GOC=$(GOC)' \
 	'GDC=$(GDC)' \
+	'GM2=$(GM2)' \
 	'LD=$(LD)' \
 	'LIPO=$(LIPO)' \
 	'NM=$(NM)' \
@@ -672,6 +681,7 @@
 	CC="$${CC}" CC_FOR_BUILD="$${CC_FOR_BUILD}" \
 	CXX="$${CXX}" CXX_FOR_BUILD="$${CXX_FOR_BUILD}" \
 	GDC="$${GDC}" GDC_FOR_BUILD="$${GDC_FOR_BUILD}" \
+	GM2="$${GM2}" GM2_FOR_BUILD="$${GM2_FOR_BUILD}" \
 	GNATBIND="$${GNATBIND}" \
 	LDFLAGS="$${LDFLAGS}" \
 	HOST_LIBS="$${HOST_LIBS}" \
@@ -706,6 +716,8 @@
 	'GOCFLAGS=$$(GOCFLAGS_FOR_TARGET)' \
 	'GDC=$$(GDC_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
 	'GDCFLAGS=$$(GDCFLAGS_FOR_TARGET)' \
+	'GM2=$$(GM2_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
+	'GM2FLAGS=$$(GM2FLAGS_FOR_TARGET)' \
 	'LD=$(COMPILER_LD_FOR_TARGET)' \
 	'LDFLAGS=$$(LDFLAGS_FOR_TARGET)' \
 	'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \
--- gcc-versionno-orig/gcc/brig/brigspec.c	2019-05-28 22:13:58.673160856 +0100
+++ gcc-versionno/gcc/brig/brigspec.c	2019-05-29 13:26:01.912054593 +0100
@@ -134,3 +134,9 @@
 /* Number of extra output files that lang_specific_pre_link may generate.  */
 
 int lang_specific_extra_outfiles = 0; /* Not used for Brig.  */
+
+/* lang_register_spec_functions.  Not used for Brig.  */
+void
+lang_register_spec_functions (void)
+{
+}
--- gcc-versionno-orig/gcc/c/gccspec.c	2019-05-28 22:14:41.268431069 +0100
+++ gcc-versionno/gcc/c/gccspec.c	2019-05-28 22:39:16.345133571 +0100
@@ -105,3 +105,9 @@
 
 /* Number of extra output files that lang_specific_pre_link may generate.  */
 int lang_specific_extra_outfiles = 0;  /* Not used for C.  */
+
+/* lang_register_spec_functions.  Not used for C.  */
+void
+lang_register_spec_functions (void)
+{
+}
--- gcc-versionno-orig/gcc/c-family/cppspec.c	2019-05-28 22:14:31.693053075 +0100
+++ gcc-versionno/gcc/c-family/cppspec.c	2019-05-28 22:39:16.349133480 +0100
@@ -198,3 +198,9 @@
 
 /* Number of extra output files that lang_specific_pre_link may generate.  */
 int lang_specific_extra_outfiles = 0;  /* Not used for cpp.  */
+
+/* lang_register_spec_functions.  Not used for cpp.  */
+void
+lang_register_spec_functions (void)
+{
+}
--- gcc-versionno-orig/gcc/cp/g++spec.c	2019-05-28 22:25:26.294430659 +0100
+++ gcc-versionno/gcc/cp/g++spec.c	2019-05-28 22:39:16.349133480 +0100
@@ -403,3 +403,9 @@
 
 /* Number of extra output files that lang_specific_pre_link may generate.  */
 int lang_specific_extra_outfiles = 0;  /* Not used for C++.  */
+
+/* lang_register_spec_functions.  Not used for C++.  */
+void
+lang_register_spec_functions (void)
+{
+}
--- gcc-versionno-orig/gcc/d/d-spec.cc	2019-05-28 22:14:48.807588205 +0100
+++ gcc-versionno/gcc/d/d-spec.cc	2019-05-29 13:22:28.178083707 +0100
@@ -514,3 +514,8 @@
 
 int lang_specific_extra_outfiles = 0;  /* Not used for D.  */
 
+/* lang_register_spec_functions.  Not used for D.  */
+void
+lang_register_spec_functions (void)
+{
+}
--- gcc-versionno-orig/gcc/fortran/gfortranspec.c	2019-05-28 22:27:32.773238257 +0100
+++ gcc-versionno/gcc/fortran/gfortranspec.c	2019-05-29 12:10:01.323261736 +0100
@@ -448,3 +448,9 @@
 
 /* Number of extra output files that lang_specific_pre_link may generate.  */
 int lang_specific_extra_outfiles = 0;	/* Not used for F77.  */
+
+/* lang_register_spec_functions.  Not used for F77.  */
+void
+lang_register_spec_functions (void)
+{
+}
--- gcc-versionno-orig/gcc/go/gospec.c	2019-05-28 22:25:46.061568405 +0100
+++ gcc-versionno/gcc/go/gospec.c	2019-05-29 12:08:38.862984663 +0100
@@ -440,3 +440,9 @@
 
 /* Number of extra output files that lang_specific_pre_link may generate.  */
 int lang_specific_extra_outfiles = 0;  /* Not used for Go.  */
+
+/* lang_register_spec_functions.  Not used for Go.  */
+void
+lang_register_spec_functions (void)
+{
+}
--- gcc-versionno-orig/gcc/jit/jit-spec.c	2019-05-28 22:15:27.567416541 +0100
+++ gcc-versionno/gcc/jit/jit-spec.c	2019-05-29 17:36:49.773426782 +0100
@@ -39,3 +39,9 @@
 
 /* Number of extra output files that lang_specific_pre_link may generate.  */
 int lang_specific_extra_outfiles = 0;  /* Not used for jit.  */
+
+/* lang_register_spec_functions.  Not used for jit.  */
+void
+lang_register_spec_functions (void)
+{
+}

-------------- next part --------------
A non-text attachment was scrubbed...
Name: gm2-v2.tar.gz
Type: application/gzip
Size: 218914 bytes
Desc: gm2-v2.tar.gz
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20190614/3071e6ef/attachment.gz>
-------------- next part --------------

hope the patches are useful,


regards,
Gaius


More information about the Gcc-patches mailing list