[Bug 1196861] gcc-ada built with incorrect target
10 Mar
2022
10 Mar
'22
07:33
https://bugzilla.suse.com/show_bug.cgi?id=1196861 https://bugzilla.suse.com/show_bug.cgi?id=1196861#c4 --- Comment #4 from Richard Biener--- Note gcc -v also prints Target: x86_64-suse-linux a more reliable way to construct the path is to use sth like gcc -print-file-name=cc1 which results in /usr/lib64/gcc/x86_64-suse-linux/7/cc1 and which can be used as base to derive whatever actual path gprbuild tools want to figure out. Btw, s-oscons.ads is built by the ./bldtools/oscons/xoscons: xoscons.adb xutil.ads xutil.adb -$(MKDIR) ./bldtools/oscons $(RM) $(addprefix ./bldtools/oscons/,$(notdir $^)) $(CP) $^ ./bldtools/oscons (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 (cd $(RTSDIR) ; \ $(OSCONS_CPP) ; \ $(OSCONS_EXTRACT) ; \ ../bldtools/oscons/xoscons s-oscons) tools. It seems the actual name is passed via OSCONS_CPP=$(OSCONS_CC) $(GNATLIBCFLAGS_FOR_C) -E -C \ -DTARGET=\"$(target)\" -iquote $(fsrcpfx)ada $(fsrcpfx)ada/s-oscons-tmplt.c > s-oscons-tmplt.i but the paths on the filesystem will end up using target_noncanonical (which isn't available in this makefile). The following should eventually fix that but then I don't know whether that has consequences downstream on how gnat functions. Maybe you can manually edit s-oscons.adb in your install and see whether it breaks anything since you seem to be set up to do some actual testing on whether gnat functions? It seems we do not provide packages for gprbuild (googling finds it on github), but there are attempts to do so in some home:$USER:devel:languages:Ada projects. 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 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 -- You are receiving this mail because: You are on the CC list for the bug.
800
Age (days ago)
800
Last active (days ago)
0 comments
1 participants
participants (1)
-
bugzilla_noreply@suse.com