public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "iains at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug ada/108983] New: [13 Regression] Ada build is broken for Native (and Canadian) crosses after r13-6351-ge6d39f68d03c46
Date: Wed, 01 Mar 2023 09:18:31 +0000	[thread overview]
Message-ID: <bug-108983-4@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108983

            Bug ID: 108983
           Summary: [13 Regression] Ada build is broken for Native (and
                    Canadian) crosses after r13-6351-ge6d39f68d03c46
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
          Assignee: unassigned at gcc dot gnu.org
          Reporter: iains at gcc dot gnu.org
                CC: dkm at gcc dot gnu.org
  Target Milestone: ---

r13-6351-ge6d39f68d03c46 modifies

            * Make-generated.in: Use GNATMAKE.
            * gcc-interface/Makefile.in: Ditto.

but $(GNATMAKE) is for $host and some tools are being built for $build.

Up to now we have relied on the install quirk of Ada that the native gnatxxxxx
are not qualified (so that 'gnatmake' is correct for $build and any other
gnatmake needs to be qualified.

for my 0.02 GBP - we should probably add GNATxxxx_FOR_BUILD to disambiguate
this.

here's a hack patch that allows build for a native cross ($build != $host ==
$target) to complete.

(I think the GNATxxx_FOR_BUILD needs to be at the top level, so I am not
posting this for review)

diff --git a/gcc/ada/Make-generated.in b/gcc/ada/Make-generated.in
index 34c86b2cd63..80a573d3ce5 100644
--- a/gcc/ada/Make-generated.in
+++ b/gcc/ada/Make-generated.in
@@ -18,7 +18,7 @@ GEN_IL_FLAGS = -gnata -gnat2012 -gnatw.g -gnatyg -gnatU
$(GEN_IL_INCLUDES)
 ada/seinfo_tables.ads ada/seinfo_tables.adb ada/sinfo.h ada/einfo.h
ada/nmake.ads ada/nmake.adb ada/seinfo.ads ada/sinfo-nodes.ads
ada/sinfo-nodes.adb ada/einfo-entities.ads ada/einfo-entities.adb:
ada/stamp-gen_il ; @true
 ada/stamp-gen_il: $(fsrcdir)/ada/gen_il*
        $(MKDIR) ada/gen_il
-       cd ada/gen_il; $(GNATMAKE) -q -g $(GEN_IL_FLAGS) gen_il-main
+       cd ada/gen_il; $(GNATMAKE_FOR_BUILD) -q -g $(GEN_IL_FLAGS) gen_il-main
        # Ignore errors to work around finalization issues in older compilers
        - cd ada/gen_il; ./gen_il-main
        $(fsrcdir)/../move-if-change ada/gen_il/seinfo_tables.ads
ada/seinfo_tables.ads
@@ -39,14 +39,14 @@ ada/stamp-gen_il: $(fsrcdir)/ada/gen_il*
 # would cause bootstrapping with older compilers to fail. You can call it by
 # hand, as a sanity check that these files are legal.
 ada/seinfo_tables.o: ada/seinfo_tables.ads ada/seinfo_tables.adb
-       cd ada ; $(GNATMAKE) $(GEN_IL_INCLUDES) seinfo_tables.adb -gnatU -gnatX
+       cd ada ; $(GNATMAKE_FOR_BUILD) $(GEN_IL_INCLUDES) seinfo_tables.adb
-gnatU -gnatX

 ada/snames.h ada/snames.ads ada/snames.adb : ada/stamp-snames ; @true
 ada/stamp-snames : ada/snames.ads-tmpl ada/snames.adb-tmpl ada/snames.h-tmpl
ada/xsnamest.adb ada/xutil.ads ada/xutil.adb
        -$(MKDIR) ada/bldtools/snamest
        $(RM) $(addprefix ada/bldtools/snamest/,$(notdir $^))
        $(CP) $^ ada/bldtools/snamest
-       cd ada/bldtools/snamest; $(GNATMAKE) -q xsnamest ; ./xsnamest
+       cd ada/bldtools/snamest; $(GNATMAKE_FOR_BUILD) -q xsnamest ; ./xsnamest
        $(fsrcdir)/../move-if-change ada/bldtools/snamest/snames.ns
ada/snames.ads
        $(fsrcdir)/../move-if-change ada/bldtools/snamest/snames.nb
ada/snames.adb
        $(fsrcdir)/../move-if-change ada/bldtools/snamest/snames.nh
ada/snames.h
diff --git a/gcc/ada/gcc-interface/Make-lang.in
b/gcc/ada/gcc-interface/Make-lang.in
index 9507f2f0920..b1afdad5e4c 100644
--- a/gcc/ada/gcc-interface/Make-lang.in
+++ b/gcc/ada/gcc-interface/Make-lang.in
@@ -186,6 +186,9 @@ ada.serial = gnat1$(exeext)

 # There are too many Ada sources to check against here.  Let's
 # always force the recursive make.
+GNATMAKE_FOR_BUILD=gnatmake
+GNATBIND_FOR_BUILD=gnatbind
+GNATLINK_FOR_BUILD=gnatlink
 ifeq ($(build), $(host))
   ifeq ($(host), $(target))
     # This is a regular native. So use the compiler from our current build
@@ -197,7 +200,10 @@ ifeq ($(build), $(host))
         ADA_INCLUDES="-I- -I../generated -I../rts" \
         GNATMAKE="../../gnatmake" \
         GNATLINK="../../gnatlink" \
-        GNATBIND="../../gnatbind"
+        GNATBIND="../../gnatbind" \
+        GNATMAKE_FOR_BUILD=$(GNATMAKE_FOR_BUILD) \
+        GNATBIND_FOR_BUILD=$(GNATBIND_FOR_BUILD) \
+        GNATLINK_FOR_BUILD=$(GNATLINK_FOR_BUILD)
   else
     # This is a regular cross compiler. Use the native compiler to compile
     # the tools.
@@ -216,6 +222,9 @@ ifeq ($(build), $(host))
         GNATMAKE="gnatmake" \
         GNATBIND="gnatbind" \
         GNATLINK="gnatlink" \
+        GNATMAKE_FOR_BUILD=$(GNATMAKE_FOR_BUILD) \
+        GNATBIND_FOR_BUILD=$(GNATBIND_FOR_BUILD) \
+        GNATLINK_FOR_BUILD=$(GNATLINK_FOR_BUILD) \
         LIBGNAT=""
   endif
 else
@@ -227,6 +236,9 @@ else
   GNATBIND_FOR_HOST=$(host_noncanonical)-gnatbind
   GNATLINK_FOR_HOST=$(host_noncanonical)-gnatlink
   GNATLS_FOR_HOST=$(host_noncanonical)-gnatls
+  GNATMAKE_FOR_BUILD=gnatmake
+  GNATBIND_FOR_BUILD=gnatbind
+  GNATLINK_FOR_BUILD=gnatlink

   ifeq ($(host), $(target))
     # This is a cross native. All the sources are taken from the currently
@@ -239,6 +251,9 @@ else
         GNATMAKE="$(GNATMAKE_FOR_HOST)"      \
         GNATBIND="$(GNATBIND_FOR_HOST)"      \
         GNATLINK="$(GNATLINK_FOR_HOST)"      \
+        GNATMAKE_FOR_BUILD=$(GNATMAKE_FOR_BUILD) \
+        GNATBIND_FOR_BUILD=$(GNATBIND_FOR_BUILD) \
+        GNATLINK_FOR_BUILD=$(GNATLINK_FOR_BUILD) \
         LIBGNAT=""
   else
     # This is a canadian cross. We should use a toolchain running on the
@@ -254,6 +269,9 @@ else
         GNATMAKE="$(GNATMAKE_FOR_HOST)"      \
         GNATBIND="$(GNATBIND_FOR_HOST)"      \
         GNATLINK="$(GNATLINK_FOR_HOST)"      \
+        GNATMAKE_FOR_BUILD=$(GNATMAKE_FOR_BUILD) \
+        GNATBIND_FOR_BUILD=$(GNATBIND_FOR_BUILD) \
+        GNATLINK_FOR_BUILD=$(GNATLINK_FOR_BUILD) \
         LIBGNAT=""
   endif
 endif
diff --git a/gcc/ada/gcc-interface/Makefile.in
b/gcc/ada/gcc-interface/Makefile.in
index c8c38acf447..da6a56fcec8 100644
--- a/gcc/ada/gcc-interface/Makefile.in
+++ b/gcc/ada/gcc-interface/Makefile.in
@@ -616,7 +616,7 @@ OSCONS_EXTRACT=$(GCC_FOR_ADA_RTS) $(GNATLIBCFLAGS_FOR_C) -S
s-oscons-tmplt.i
        -$(MKDIR) ./bldtools/oscons
        $(RM) $(addprefix ./bldtools/oscons/,$(notdir $^))
        $(CP) $^ ./bldtools/oscons
-       (cd ./bldtools/oscons ; $(GNATMAKE) -q xoscons)
+       (cd ./bldtools/oscons ; gnatmake -q xoscons)

 $(RTSDIR)/s-oscons.ads: ../stamp-gnatlib1-$(RTSDIR) s-oscons-tmplt.c gsocket.h
./bldtools/oscons/xoscons
        $(RM) $(RTSDIR)/s-oscons-tmplt.i $(RTSDIR)/s-oscons-tmplt.s

             reply	other threads:[~2023-03-01  9:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-01  9:18 iains at gcc dot gnu.org [this message]
2023-03-01  9:20 ` [Bug ada/108983] " rguenth at gcc dot gnu.org
2023-03-06 10:36 ` ebotcazou at gcc dot gnu.org
2023-03-06 10:40 ` cvs-commit at gcc dot gnu.org
2023-03-06 10:40 ` ebotcazou at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-108983-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).