Hello.

Please consider the attached patch (suggested by Sergei Trofimovich).

Explanation: In a failed build log, we can see this:

for tool in gnatbind gnatchop gnat gnatkr gnatlink gnatls gnatmake gnatname 
gnatprep gnatclean ; do \
  if [ -f $tool ] ; \
  then \
    mv $tool $tool-cross; \
  fi; \
done

and later:

/bin/bash: line 1: ../../gnatbind: No such file or directory
make[6]: *** [../gcc-interface/Makefile:918: b_gnatm.adb] Error 127
make[6]: Leaving directory '/<<PKGBUILDDIR>>/gcc/build/gcc/ada/tools'
make[5]: *** [Makefile:210: gnattools-native] Error 2
make[5]: Leaving directory '/<<PKGBUILDDIR>>/gcc/build/gnattools'
make[4]: *** [Makefile:10700: all-gnattools] Error 2
make[4]: Leaving directory '/<<PKGBUILDDIR>>/gcc/build'
make[3]: *** [Makefile:1064: all] Error 2
make[3]: Leaving directory '/<<PKGBUILDDIR>>/gcc/build'

So, gnatbind does not exist because it has been renamed prematurely.

As pointed out by Helmut Grohne in #924325, there seems to be a missing
dependency somewhere, but as far as such missing dependency is not spotted
and fixed, the attached patch (which just does "cp -p" instead of "mv")
will be a lot better than nothing.

Note: The proposed patch is against gcc-14. I have actually tested the patch
and it works (using the generated "gcc-14-source" package to build 
gcc-14-cross).
The same patch should apply to the other gcc-nn packages.

To reproduce the build failure, please try GRUB_CMDLINE_LINUX="nr_cpus=1".
The failure rate seeems to be 100% that way. Failed build logs
will be like this:

https://people.debian.org/~sanvila/build-logs/gcc-14-cross/

Thanks.
diff -Nru gcc-14-14.2.0/debian/changelog gcc-14-14.2.0/debian/changelog
--- gcc-14-14.2.0/debian/changelog      2024-08-18 17:10:28.000000000 +0000
+++ gcc-14-14.2.0/debian/changelog      2024-08-25 23:31:00.000000000 +0000
@@ -1,3 +1,17 @@
+gcc-14 (14.2.0-3+nmu1) unreleased; urgency=medium
+
+  * Non-maintainer upload.
+  * Add debian/patches/ada-make-lang-fix.diff to fix FTBFS problem
+    in gcc-*-cross packages.
+
+ -- Santiago Vila <sanv...@debian.org>  Mon, 26 Aug 2024 01:31:00 +0200
+
+gcc-14 (14.2.0-3ubuntu1) UNRELEASED; urgency=medium
+
+  * Disable running the tests on alpha and arm64, hanging on the buildds.
+
+ -- Matthias Klose <d...@debian.org>  Wed, 21 Aug 2024 14:54:23 +0200
+
 gcc-14 (14.2.0-3) unstable; urgency=medium
 
   * Update to git 20240817 from the gcc-14 branch.
diff -Nru gcc-14-14.2.0/debian/patches/ada-make-lang-fix.diff 
gcc-14-14.2.0/debian/patches/ada-make-lang-fix.diff
--- gcc-14-14.2.0/debian/patches/ada-make-lang-fix.diff 1970-01-01 
00:00:00.000000000 +0000
+++ gcc-14-14.2.0/debian/patches/ada-make-lang-fix.diff 2024-08-25 
23:29:35.000000000 +0000
@@ -0,0 +1,13 @@
+# DP: Copy (not rename) tools in ADA_TOOLS to fix FTBFS bug in gcc-NN-cross
+
+--- a/src/gcc/ada/gcc-interface/Make-lang.in
++++ b/src/gcc/ada/gcc-interface/Make-lang.in
+@@ -808,7 +808,7 @@ ada.all.cross:
+       for tool in $(ADA_TOOLS) ; do \
+         if [ -f $$tool$(exeext) ] ; \
+         then \
+-          $(MV) $$tool$(exeext) $$tool-cross$(exeext); \
++          $(CP) $$tool$(exeext) $$tool-cross$(exeext); \
+         fi; \
+       done
+ 
diff -Nru gcc-14-14.2.0/debian/rules.patch gcc-14-14.2.0/debian/rules.patch
--- gcc-14-14.2.0/debian/rules.patch    2024-08-17 10:15:13.000000000 +0000
+++ gcc-14-14.2.0/debian/rules.patch    2024-08-25 23:29:35.000000000 +0000
@@ -80,6 +80,7 @@
        hppa64-libgcov-fallback \
        libsanitizer-timebits \
        gcc-vhdl \
+       ada-make-lang-fix \
 
 ifneq (,$(newlib_tarball))
   debian_patches += newlib-amdgcn-locks

Reply via email to