Your message dated Thu, 08 Feb 2024 18:50:44 +0000
with message-id <e1ry9tw-009vjb...@fasolo.debian.org>
and subject line Bug#1063359: fixed in gdb-mingw-w64 13.1
has caused the Debian Bug report #1063359,
regarding gdb-mingw-w64: FTBFS on arm64 due to arch-specific build flag: 
-mbranch-protection=standard
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
1063359: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1063359
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Source: gdb-mingw-w64
Version: 13
Severity: serious
Justification: fails to build from source (but built successfully in the past)
Tags: sid trixie ftbfs patch
User: debian-...@lists.debian.org
Usertags: arm64

Hi,

arm64 now has an architecture-specific flag among the default build
flags: -mbranch-protection=standard.

gdb-mingw-w64 calls dpkg-buildflags on the build system, which on arm64
looks like this:

$ dpkg-buildflags --get CFLAGS
-g -O2 -ffile-prefix-map=/tmp/gdb-mingw-w64-13=. -fstack-protector-strong 
-fstack-clash-protection -Wformat -Werror=format-security 
-mbranch-protection=standard

The output of the above command is then passed to the configure script
of the various targets (i686-w64-mingw32 and x86_64-w64-mingw32),
resulting in the following FTBFS on arm64:

 checking for i686-w64-mingw32-gcc... i686-w64-mingw32-gcc-posix
 checking whether the C compiler works... no
 configure: error: in 
`/tmp/gdb-mingw-w64-13/build-gdbserver/i686-w64-mingw32/gnulib':
 configure: error: C compiler cannot create executables
 See `config.log' for more details

And indeed config.log points out the issue:

 i686-w64-mingw32-gcc-posix: error: unrecognized command-line option 
'-mbranch-protection=standard'

I propose in the attached patch to use DEB_HOST_ARCH and ensure that
i686-specific flags are used when building for i686, ditto for amd64.

  Emanuele
diff -Nru gdb-mingw-w64-13/debian/changelog gdb-mingw-w64-13+nmu1/debian/changelog
--- gdb-mingw-w64-13/debian/changelog	2023-09-29 17:54:37.000000000 +0200
+++ gdb-mingw-w64-13+nmu1/debian/changelog	2024-02-06 20:23:38.000000000 +0100
@@ -1,3 +1,11 @@
+gdb-mingw-w64 (13+nmu1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Use DEB_HOST_ARCH to avoid setting potentially arch-specific build flags.
+    Closes: -1.
+
+ -- Emanuele Rocca <e...@debian.org>  Tue, 06 Feb 2024 20:23:38 +0100
+
 gdb-mingw-w64 (13) unstable; urgency=medium
 
   * Switch from the obsolete libncurses5-dev build-dependency to
diff -Nru gdb-mingw-w64-13/debian/rules gdb-mingw-w64-13+nmu1/debian/rules
--- gdb-mingw-w64-13/debian/rules	2023-09-29 13:47:46.000000000 +0200
+++ gdb-mingw-w64-13+nmu1/debian/rules	2024-02-06 20:23:38.000000000 +0100
@@ -69,6 +69,7 @@
 override_dh_auto_configure-arch: unpack-stamp
 	set -e; \
 	for target in $(targets); do \
+		host_arch=$(shell echo $target | grep -q ^i686 && echo i686 || echo amd64); \
 		mkdir -p $(build_gdb_dir)/$$target; \
 		cd $(build_gdb_dir)/$$target; \
 		$(upstream_dir)/configure \
@@ -77,7 +78,7 @@
 			--with-system-readline --with-system-zlib \
 			--enable-tui --with-expat --with-python=python3 \
 			--target=$$target --disable-werror \
-			$(shell $(dpkg_buildflags_arch) --export=cmdline); \
+			$(shell DEB_HOST_ARCH=$host_arch $(dpkg_buildflags_arch) --export=cmdline); \
 	done
 
 # We're only interested in gdbserver; that also requires gnulib, libiberty, and gdbsupport
@@ -85,6 +86,7 @@
 override_dh_auto_configure-indep: unpack-stamp
 	set -e; \
 	for target in $(targets); do \
+		host_arch=$(shell echo $target | grep -q ^i686 && echo i686 || echo amd64); \
 		for project in $(gdbserver_projects); do \
 			mkdir -p $(build_gdbserver_dir)/$$target/$$project; \
 			cd $(build_gdbserver_dir)/$$target/$$project; \
@@ -93,22 +95,24 @@
 				--host=$$target --target=$$target \
 				CC=$$target-gcc-posix CXX=$$target-g++-posix \
 				--disable-werror \
-				$(shell $(dpkg_buildflags_indep) --export=cmdline); \
+				$(shell DEB_HOST_ARCH=$host_arch $(dpkg_buildflags_indep) --export=cmdline); \
 		done; \
 	done
 
 override_dh_auto_build-arch:
 	set -e; \
 	for target in $(targets); do \
-		$(shell $(dpkg_buildflags_arch) --export=sh); \
+		host_arch=$(shell echo $target | grep -q ^i686 && echo i686 || echo amd64); \
+		$(shell DEB_HOST_ARCH=$host_arch $(dpkg_buildflags_arch) --export=sh); \
 		dh_auto_build --parallel -B$(build_gdb_dir)/$$target -- V=1; \
 	done
 
 override_dh_auto_build-indep:
 	set -e; \
 	for target in $(targets); do \
+		host_arch=$(shell echo $target | grep -q ^i686 && echo i686 || echo amd64); \
 		for project in $(gdbserver_projects); do \
-			$(shell $(dpkg_buildflags_indep) --export=sh); \
+			$(shell DEB_HOST_ARCH=$host_arch $(dpkg_buildflags_indep) --export=sh); \
 			dh_auto_build --parallel -B$(build_gdbserver_dir)/$$target/$$project -- V=1; \
 		done; \
 	done

--- End Message ---
--- Begin Message ---
Source: gdb-mingw-w64
Source-Version: 13.1
Done: Stephen Kitt <sk...@debian.org>

We believe that the bug you reported is fixed in the latest version of
gdb-mingw-w64, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1063...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Stephen Kitt <sk...@debian.org> (supplier of updated gdb-mingw-w64 package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmas...@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Thu, 08 Feb 2024 19:15:03 +0100
Source: gdb-mingw-w64
Architecture: source
Version: 13.1
Distribution: unstable
Urgency: medium
Maintainer: Stephen Kitt <sk...@debian.org>
Changed-By: Stephen Kitt <sk...@debian.org>
Closes: 1063359
Changes:
 gdb-mingw-w64 (13.1) unstable; urgency=medium
 .
   * Specify the target architecture when calculating build flags.
     Closes: #1063359.
Checksums-Sha1:
 729c884145448a18a902f78fff962d7c12cc83f1 2012 gdb-mingw-w64_13.1.dsc
 700efb584ad5edefd88b0d9fb818c164ae25e0b8 9628 gdb-mingw-w64_13.1.tar.xz
 84f401fd7916ced84bfdf884f090dfc1eaa060e3 8107 
gdb-mingw-w64_13.1_source.buildinfo
Checksums-Sha256:
 865a1f4f5f7c530ad89825687e43c0865ec9e14957b373833e2fec6964a4ac26 2012 
gdb-mingw-w64_13.1.dsc
 56b9f6cbd31df2cab49ac11ec522298110007326d34be7bba365eac1232c5e2d 9628 
gdb-mingw-w64_13.1.tar.xz
 bf144a6a58f90fc405ee481b7d89ebbbd5567e37eb16a39493df3e8277d3df77 8107 
gdb-mingw-w64_13.1_source.buildinfo
Files:
 8611d035c518bcf1e970c56b73f79651 2012 devel optional gdb-mingw-w64_13.1.dsc
 fd303c5f91b8cb67d0b8222be7590d63 9628 devel optional gdb-mingw-w64_13.1.tar.xz
 6ce663438510cac6130feab152f3bbb3 8107 devel optional 
gdb-mingw-w64_13.1_source.buildinfo

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEnPVX/hPLkMoq7x0ggNMC9Yhtg5wFAmXFG3QACgkQgNMC9Yht
g5yBiw//c53WbpII8Z70V3FLLTPdEoCzs2jZo5KwXeDLBbirq7S7qgQcLBdsvpZx
tDLabDd10JVcri1676LOP770eNxlwSY0eyUoLELp8uRyZWwG9PLFEPjP2X4J2MgC
gmPn5bdCpnzn5EP59B0olxeoqc3mfabLjxHjPgsW7/VBApevRNjyLJAwI/6KMiWz
JHUNcmhS2d1I1h0kewiSf0CHrg5ywdlg35yswmnXyMppD5Kgy71Y+tn2Bo6XxBHR
WVnKssS8PpOVlynnp7w+5lJEGyPd/5/AaLBRPDUDUIE04zu5/NVEphUj0LQN0M9Z
2raX7qgSpuPrQLysjAmOPR+LNeZliI3zODPKmIF5jx7mT+Es45OZ/bR+hEOQp3jM
ZOqCMUzU3gWXiy7f6pa7j3MVgGNDQdx1Z4CIzM3UpV5f196zMOiQFb7MRbsa1JvK
OFtG8AbLX+LT4SdG0Du2r0KZmFu5hQ72NQbquAHlITQcQt3HUYKJeDo94ew3YVJH
JyJW+Sh7hzfPzZeEh/zCZBSy7eTMCLf2ereK8MJ32yTK/FPt5rEFDXwVPtJWg/w4
smHDdmTjJnVrDHXGBXuSwNpZD77P3x5AZpHibMN0ioJRasMzUilBeX1OXjg7CjA2
dPTzJJ0V4CEQQ0rF4wBdYJcTjQsVOfkNoh0tg0y4VhBmeSVfNdg=
=J/ue
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to