Blame SOURCES/gcc9-hack.patch

840d93
--- libada/Makefile.in.jj	2019-01-09 13:01:18.015608205 +0100
840d93
+++ libada/Makefile.in	2019-01-11 18:16:23.441726931 +0100
840d93
@@ -71,18 +71,40 @@ version := $(shell @get_gcc_base_ver@ $(
840d93
 libsubdir := $(libdir)/gcc/$(target_noncanonical)/$(version)$(MULTISUBDIR)
840d93
 ADA_RTS_DIR=$(GCC_DIR)/ada/rts$(subst /,_,$(MULTISUBDIR))
840d93
 
840d93
+DEFAULTMULTIFLAGS :=
840d93
+ifeq ($(MULTISUBDIR),)
840d93
+targ:=$(subst -, ,$(target))
840d93
+arch:=$(word 1,$(targ))
840d93
+ifeq ($(words $(targ)),2)
840d93
+osys:=$(word 2,$(targ))
840d93
+else
840d93
+osys:=$(word 3,$(targ))
840d93
+endif
840d93
+ifeq ($(strip $(filter-out i%86 x86_64 powerpc% ppc% s390% sparc% linux%, $(arch) $(osys))),)
840d93
+ifeq ($(shell $(CC) $(CFLAGS) -print-multi-os-directory),../lib64)
840d93
+DEFAULTMULTIFLAGS := -m64
840d93
+else
840d93
+ifeq ($(strip $(filter-out s390%, $(arch))),)
840d93
+DEFAULTMULTIFLAGS := -m31
840d93
+else
840d93
+DEFAULTMULTIFLAGS := -m32
840d93
+endif
840d93
+endif
840d93
+endif
840d93
+endif
840d93
+
840d93
 # exeext should not be used because it's the *host* exeext.  We're building
840d93
 # a *target* library, aren't we?!?  Likewise for CC.  Still, provide bogus
840d93
 # definitions just in case something slips through the safety net provided
840d93
 # by recursive make invocations in gcc/ada/Makefile.in
840d93
 LIBADA_FLAGS_TO_PASS = \
840d93
         "MAKEOVERRIDES=" \
840d93
-        "LDFLAGS=$(LDFLAGS)" \
840d93
+        "LDFLAGS=$(LDFLAGS) $(DEFAULTMULTIFLAGS)" \
840d93
         "LN_S=$(LN_S)" \
840d93
         "SHELL=$(SHELL)" \
840d93
-        "GNATLIBFLAGS=$(GNATLIBFLAGS) $(MULTIFLAGS)" \
840d93
-        "GNATLIBCFLAGS=$(GNATLIBCFLAGS) $(MULTIFLAGS)" \
840d93
-        "GNATLIBCFLAGS_FOR_C=$(GNATLIBCFLAGS_FOR_C) $(MULTIFLAGS)" \
840d93
+        "GNATLIBFLAGS=$(GNATLIBFLAGS) $(MULTIFLAGS) $(DEFAULTMULTIFLAGS)" \
840d93
+        "GNATLIBCFLAGS=$(GNATLIBCFLAGS) $(MULTIFLAGS) $(DEFAULTMULTIFLAGS)" \
840d93
+        "GNATLIBCFLAGS_FOR_C=$(GNATLIBCFLAGS_FOR_C) $(MULTIFLAGS) $(DEFAULTMULTIFLAGS)" \
840d93
         "PICFLAG_FOR_TARGET=$(PICFLAG)" \
840d93
         "THREAD_KIND=$(THREAD_KIND)" \
840d93
         "TRACE=$(TRACE)" \
840d93
@@ -93,7 +115,7 @@ LIBADA_FLAGS_TO_PASS = \
840d93
         "exeext=.exeext.should.not.be.used " \
840d93
 	'CC=the.host.compiler.should.not.be.needed' \
840d93
 	"GCC_FOR_TARGET=$(CC)" \
840d93
-        "CFLAGS=$(CFLAGS)"
840d93
+        "CFLAGS=$(CFLAGS) $(DEFAULTMULTIFLAGS)"
840d93
 
840d93
 .PHONY: libada gnatlib gnatlib-shared gnatlib-sjlj gnatlib-zcx osconstool
840d93
 
840d93
--- config-ml.in.jj	2019-01-09 12:50:16.646501448 +0100
840d93
+++ config-ml.in	2019-01-11 18:16:23.442726914 +0100
840d93
@@ -511,6 +511,8 @@ multi-do:
840d93
 				ADAFLAGS="$(ADAFLAGS) $${flags}" \
840d93
 				prefix="$(prefix)" \
840d93
 				exec_prefix="$(exec_prefix)" \
840d93
+				mandir="$(mandir)" \
840d93
+				infodir="$(infodir)" \
840d93
 				GOCFLAGS="$(GOCFLAGS) $${flags}" \
840d93
 				GDCFLAGS="$(GDCFLAGS) $${flags}" \
840d93
 				CXXFLAGS="$(CXXFLAGS) $${flags}" \
840d93
--- libcpp/macro.c.jj	2019-01-09 13:01:21.420552123 +0100
840d93
+++ libcpp/macro.c	2019-01-11 18:18:17.736876285 +0100
840d93
@@ -3256,8 +3256,6 @@ static cpp_macro *
840d93
 create_iso_definition (cpp_reader *pfile)
840d93
 {
840d93
   bool following_paste_op = false;
840d93
-  const char *paste_op_error_msg =
840d93
-    N_("'##' cannot appear at either end of a macro expansion");
840d93
   unsigned int num_extra_tokens = 0;
840d93
   unsigned nparms = 0;
840d93
   cpp_hashnode **params = NULL;
840d93
@@ -3382,7 +3380,9 @@ create_iso_definition (cpp_reader *pfile
840d93
 	     function-like macros, but not at the end.  */
840d93
 	  if (following_paste_op)
840d93
 	    {
840d93
-	      cpp_error (pfile, CPP_DL_ERROR, paste_op_error_msg);
840d93
+	      cpp_error (pfile, CPP_DL_ERROR,
840d93
+			 "'##' cannot appear at either end of a macro "
840d93
+			 "expansion");
840d93
 	      goto out;
840d93
 	    }
840d93
 	  if (!vaopt_tracker.completed ())
840d93
@@ -3397,7 +3397,9 @@ create_iso_definition (cpp_reader *pfile
840d93
 	     function-like macros, but not at the beginning.  */
840d93
 	  if (macro->count == 1)
840d93
 	    {
840d93
-	      cpp_error (pfile, CPP_DL_ERROR, paste_op_error_msg);
840d93
+	      cpp_error (pfile, CPP_DL_ERROR,
840d93
+			 "'##' cannot appear at either end of a macro "
840d93
+			 "expansion");
840d93
 	      goto out;
840d93
 	    }
840d93
 
840d93
--- libcpp/expr.c.jj	2019-01-09 13:01:22.415535734 +0100
840d93
+++ libcpp/expr.c	2019-01-11 18:16:23.444726882 +0100
840d93
@@ -788,16 +788,17 @@ cpp_classify_number (cpp_reader *pfile,
840d93
       if ((result & CPP_N_WIDTH) == CPP_N_LARGE
840d93
 	  && CPP_OPTION (pfile, cpp_warn_long_long))
840d93
         {
840d93
-          const char *message = CPP_OPTION (pfile, cplusplus) 
840d93
-				? N_("use of C++11 long long integer constant")
840d93
-		                : N_("use of C99 long long integer constant");
840d93
-
840d93
 	  if (CPP_OPTION (pfile, c99))
840d93
             cpp_warning_with_line (pfile, CPP_W_LONG_LONG, virtual_location,
840d93
-				   0, message);
840d93
+				   0, CPP_OPTION (pfile, cplusplus)
840d93
+				      ? N_("use of C++11 long long integer constant")
840d93
+				      : N_("use of C99 long long integer constant"));
840d93
           else
840d93
             cpp_pedwarning_with_line (pfile, CPP_W_LONG_LONG,
840d93
-				      virtual_location, 0, message);
840d93
+				      virtual_location, 0,
840d93
+				      CPP_OPTION (pfile, cplusplus)
840d93
+				      ? N_("use of C++11 long long integer constant")
840d93
+				      : N_("use of C99 long long integer constant"));
840d93
         }
840d93
 
840d93
       result |= CPP_N_INTEGER;