Source: gcc-13
Followup-For: Bug #1072071

Hello.

The attached suggestions are just ideas, not real commits. They are
hand-written and not tested at all, so probably contain typos.
Morever, they were written in a gcc-14 source tree.

For the context, commit e08cd8a2 disables Ada on sparc (bug #1072328).

If Adrian can check that 0001, 0002 and 0003 fix #1072071,
then I suggest to merge them into a single commit,
else
  if Matthias confirms that := was not deliberate
  then I suggest to apply 0001.
From: Nicolas Boulenguez <nico...@debian.org>
Subject: [PATCH 1/3] probably fix a typo in e08cd8a2

--- a/debian/control
+++ b/debian/control
@@ -15,11 +15,11 @@ Build-Depends: debhelper (>= 11), dpkg-dev (>= 1.17.14), g++-multilib [amd64 i38
   gperf, bison, flex,
   gettext, nvptx-tools [amd64 arm64 ppc64el], amdgcn-tools-18 [amd64],
   texinfo, locales-all, sharutils,
-  procps, gnat-13:native [!sparc !loong64], g++-13:native [!loong64], gnat-14:native [loong64], g++-14:native [loong64], netbase, gdc-13:native [!arc !ia64 !m68k !sh4 !s390 !sparc64 !alpha !hurd-alpha !hurd-amd64 !hurd-i386], python3:any, cargo [!hppa !ia64 !m68k !sh4 !alpha !hurd-alpha],
+  procps, gnat-13:native [!arc !ia64 !sh3 !sh3eb !sh4eb !sparc !loong64], g++-13:native [!loong64], gnat-14:native [loong64], g++-14:native [loong64], netbase, gdc-13:native [!arc !ia64 !m68k !sh4 !s390 !sparc64 !alpha !hurd-alpha !hurd-amd64 !hurd-i386], python3:any, cargo [!hppa !ia64 !m68k !sh4 !alpha !hurd-alpha],
   libisl-dev (>= 0.20), libmpc-dev (>= 1.0), libmpfr-dev (>= 3.0.0-9~), libgmp-dev (>= 2:5.0.1~), lib32z1-dev [amd64], lib64z1-dev [i386], unzip <!nocheck>,
   dejagnu <!nocheck>, coreutils, chrpath, lsb-release, quilt, time,
   pkg-config, libgc-dev,
-  g++-14-for-host <cross>, gobjc-14-for-host [!avr] <cross>, gfortran-14-for-host <cross>, gdc-14-for-host [!arc !ia64 !m68k !sh4 !s390 !sparc64 !alpha !hurd-alpha !hurd-amd64 !hurd-i386] <cross>, gccgo-14-for-host [!arc !avr !hppa !loong64 !m68k !sh4] <cross>, gnat-14-for-host [!sparc] <cross>, gm2-14-for-host [!powerpc !ppc64 !sh4] <cross>,
+  g++-14-for-host <cross>, gobjc-14-for-host [!avr] <cross>, gfortran-14-for-host <cross>, gdc-14-for-host [!arc !ia64 !m68k !sh4 !s390 !sparc64 !alpha !hurd-alpha !hurd-amd64 !hurd-i386] <cross>, gccgo-14-for-host [!arc !avr !hppa !loong64 !m68k !sh4] <cross>, gnat-14-for-host [!arc !ia64 !sh3 !sh3eb !sh4eb !sparc] <cross>, gm2-14-for-host [!powerpc !ppc64 !sh4] <cross>,
 Build-Depends-Indep: doxygen <!nodoc>, graphviz <!nodoc>, ghostscript <!nodoc>, texlive-latex-base <!nodoc>, xsltproc <!nodoc>, libxml2-utils <!nodoc>, docbook-xsl-ns <!nodoc>,
 Homepage: http://gcc.gnu.org/
 Vcs-Browser: https://salsa.debian.org/toolchain-team/gcc
--- a/debian/rules.defs
+++ b/debian/rules.defs
@@ -872,7 +872,7 @@ ifeq (,$(filter $(DEB_STAGE),stage1 stage2))
 # Ada --------------------
 ada_no_cpus	:= arc ia64 sh3 sh3eb sh4eb
 #ada_no_cpus	+= armel # See Debian #1061370
-ada_no_cpus	:= sparc # See Debian #1072328
+ada_no_cpus	+= sparc # See Debian #1072328
 ada_no_systems	:= 
 ada_no_cross	:= no
 ada_no_snap	:= no
From: Nicolas Boulenguez <nico...@debian.org>
Subject: [PATCH 2/3] untested fix for #1072071

--- a/debian/patches/ada-armel-libatomic.diff
+++ b/debian/patches/ada-armel-libatomic.diff
@@ -1,11 +1,14 @@
-Description: link libgnarl with libatomic on armel
+Description: link libgnarl with libatomic on armel and sparc
  On other architectures, the library is ignored thanks to --as-needed.
  .
- Seen with 14-20240429-1:
+ Seen with 14-20240429-1 on armel:
  cd rts; [bla]/./gcc/xgcc [bla] -shared [bla] -o libgnarl-14.so [bla]
  /usr/bin/arm-linux-gnueabi-ld: libgnat-14.so: undefined reference to `__atomic_compare_exchange_8'
  /usr/bin/arm-linux-gnueabi-ld: libgnat-14.so: undefined reference to `__atomic_load_8'
  .
+ Seen with 13.2.0-25 on sparc:
+ checking fp.h usability... /usr/sparc-linux-gnu/bin/ld: libgnat-13.so: undefined reference to `__atomic_compare_exchange_8'
+ .
  Libatomic becomes an artificial dependency for Ada in Makefile.def,
  so a better solution is welcome.
  .
@@ -22,6 +25,7 @@ Description: link libgnarl with libatomic on armel
  (ada-gnattools-cross.diff adds checking options to LDFLAGS,
   then adds LDFLAGS to the command line).
 Bug-Debian: https://bugs.debian.org/861734
+Bug-Debian: https://bugs.debian.org/1072071
 Author: Matthias Klose <d...@debian.org>
 Author: Nicolas Boulenguez <nico...@debian.org>
 
@@ -35,6 +39,14 @@ Author: Nicolas Boulenguez <nico...@debian.org>
    LIBGNAT_TARGET_PAIRS = \
    a-intnam.ads<libgnarl/a-intnam__linux.ads \
    s-inmaop.adb<libgnarl/s-inmaop__posix.adb \
+@@ -2375,6 +2375,7 @@ endif
+ 
+ # SPARC Linux
+ ifeq ($(strip $(filter-out sparc% linux%,$(target_cpu) $(target_os))),)
++  MISCLIB = ../../../$(target_alias)/libatomic/.libs/libatomic.so
+   LIBGNAT_TARGET_PAIRS = \
+   a-intnam.ads<libgnarl/a-intnam__linux.ads \
+   a-nallfl.ads<libgnat/a-nallfl__wraplf.ads \
 --- a/src/Makefile.def
 +++ b/src/Makefile.def
 @@ -417,6 +417,8 @@ dependencies = { module=all-target-libad
From: Nicolas Boulenguez <nico...@debian.org>
Subject: [PATCH 3/3] revert e08cd8a2

--- a/debian/control
+++ b/debian/control
@@ -15,11 +15,11 @@ Build-Depends: debhelper (>= 11), dpkg-dev (>= 1.17.14), g++-multilib [amd64 i38
   gperf, bison, flex,
   gettext, nvptx-tools [amd64 arm64 ppc64el], amdgcn-tools-18 [amd64],
   texinfo, locales-all, sharutils,
-  procps, gnat-13:native [!arc !ia64 !sh3 !sh3eb !sh4eb !sparc !loong64], g++-13:native [!loong64], gnat-14:native [loong64], g++-14:native [loong64], netbase, gdc-13:native [!arc !ia64 !m68k !sh4 !s390 !sparc64 !alpha !hurd-alpha !hurd-amd64 !hurd-i386], python3:any, cargo [!hppa !ia64 !m68k !sh4 !alpha !hurd-alpha],
+  procps, gnat-13:native [!arc !ia64 !sh3 !sh3eb !sh4eb !loong64], g++-13:native [!loong64], gnat-14:native [loong64], g++-14:native [loong64], netbase, gdc-13:native [!arc !ia64 !m68k !sh4 !s390 !sparc64 !alpha !hurd-alpha !hurd-amd64 !hurd-i386], python3:any, cargo [!hppa !ia64 !m68k !sh4 !alpha !hurd-alpha],
   libisl-dev (>= 0.20), libmpc-dev (>= 1.0), libmpfr-dev (>= 3.0.0-9~), libgmp-dev (>= 2:5.0.1~), lib32z1-dev [amd64], lib64z1-dev [i386], unzip <!nocheck>,
   dejagnu <!nocheck>, coreutils, chrpath, lsb-release, quilt, time,
   pkg-config, libgc-dev,
-  g++-14-for-host <cross>, gobjc-14-for-host [!avr] <cross>, gfortran-14-for-host <cross>, gdc-14-for-host [!arc !ia64 !m68k !sh4 !s390 !sparc64 !alpha !hurd-alpha !hurd-amd64 !hurd-i386] <cross>, gccgo-14-for-host [!arc !avr !hppa !loong64 !m68k !sh4] <cross>, gnat-14-for-host [!arc !ia64 !sh3 !sh3eb !sh4eb !sparc] <cross>, gm2-14-for-host [!powerpc !ppc64 !sh4] <cross>,
+  g++-14-for-host <cross>, gobjc-14-for-host [!avr] <cross>, gfortran-14-for-host <cross>, gdc-14-for-host [!arc !ia64 !m68k !sh4 !s390 !sparc64 !alpha !hurd-alpha !hurd-amd64 !hurd-i386] <cross>, gccgo-14-for-host [!arc !avr !hppa !loong64 !m68k !sh4] <cross>, gnat-14-for-host [!arc !ia64 !sh3 !sh3eb !sh4eb] <cross>, gm2-14-for-host [!powerpc !ppc64 !sh4] <cross>,
 Build-Depends-Indep: doxygen <!nodoc>, graphviz <!nodoc>, ghostscript <!nodoc>, texlive-latex-base <!nodoc>, xsltproc <!nodoc>, libxml2-utils <!nodoc>, docbook-xsl-ns <!nodoc>,
 Homepage: http://gcc.gnu.org/
 Vcs-Browser: https://salsa.debian.org/toolchain-team/gcc
--- a/debian/rules.defs
+++ b/debian/rules.defs
@@ -872,7 +872,6 @@ ifeq (,$(filter $(DEB_STAGE),stage1 stage2))
 # Ada --------------------
 ada_no_cpus	:= arc ia64 sh3 sh3eb sh4eb
 #ada_no_cpus	+= armel # See Debian #1061370
-ada_no_cpus	+= sparc # See Debian #1072328
 ada_no_systems	:= 
 ada_no_cross	:= no
 ada_no_snap	:= no

Reply via email to