Blame SOURCES/gcc12-hack.patch

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