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

            Bug ID: 104861
           Summary: s-oscons.ads should use target_noncanonical
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rguenth at gcc dot gnu.org
  Target Milestone: ---

It seems that gprbuild uses Target_Name to construct paths to find files of the
installed gnat but when you configure GCC with a non-canonical target name
like --target=x86_64-suse-linux (omitting -gnu) then make install will use
@target_noncanonical@ for the directory.  That causes the gprbuild tools to
fail to build.

A solution might be to do the following and base Target_Name on
@target_noncanonical@ instead.

diff --git a/gcc/ada/gcc-interface/Makefile.in
b/gcc/ada/gcc-interface/Makefile.in
index b8a24708280..1e9801a8b96 100644
--- a/gcc/ada/gcc-interface/Makefile.in
+++ b/gcc/ada/gcc-interface/Makefile.in
@@ -138,6 +138,7 @@ objdir = .

 target_alias=@target_alias@
 target=@target@
+target_noncanonical=@target_noncanonical@
 target_cpu=@target_cpu@
 target_vendor=@target_vendor@
 target_os=@target_os@
@@ -598,7 +599,7 @@ OSCONS_CC=$(subst ./xgcc,../../xgcc,$(subst -B./,
-B../../,$(GCC_FOR_TARGET)))
 # has a <types.h> header).

 OSCONS_CPP=$(OSCONS_CC) $(GNATLIBCFLAGS_FOR_C) -E -C \
-  -DTARGET=\"$(target)\" -iquote $(fsrcpfx)ada $(fsrcpfx)ada/s-oscons-tmplt.c
> s-oscons-tmplt.i
+  -DTARGET=\"$(target_noncanonical)\" -iquote $(fsrcpfx)ada
$(fsrcpfx)ada/s-oscons-tmplt.c > s-oscons-tmplt.i
 OSCONS_EXTRACT=$(OSCONS_CC) $(GNATLIBCFLAGS_FOR_C) -S s-oscons-tmplt.i

 # Note: if you need to build with a non-GNU compiler, you could adapt the

Reply via email to