Bug#990315: buster-pu: package gcc-mingw-w64/21.3~deb10u1
Package: release.debian.org
Severity: normal
Tags: buster
User: release.debian.org@packages.debian.org
Usertags: pu
Dear release team,
Would it be possible to upload the backported fix for gcc-mingw-w64’s
#989862 to Buster? The debdiff is attached; it’s a minimal, targeted
fix for gcov support.
Regards,
Stephen
-- System Information:
Debian Release: 10.10
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable-debug'), (500, 'stable'), (100, 'unstable-debug'), (100, 'testing-debug'), (100, 'unstable'), (100, 'testing'), (1, 'experimental-debug'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386, arm64
Kernel: Linux 4.19.0-17-amd64 (SMP w/8 CPU cores)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
commit f319345c3caf1dedbfc87654e1853762af3b6d77
Author: Stephen Kitt <steve@sk2.org>
Date: Tue Jun 15 22:18:31 2021 +0200
Fix gcov handling
When gcov is supported in a cross-compiler setup, GCC assumes that
either the headers are present and shared with the host, or present
and set up in a sysroot, or absent. We have headers which aren’t
shared and aren’t in a sysroot, so we need to tell GCC where they are
*without* specifying them as an argument to --with-headers (the latter
must only be enabled).
Closes: #989862
LP: #1883933, #1920988
(cherry picked from commit 2ee26ff4f275384aa6173ada884929db4d2f1bbf)
diff --git a/debian/changelog b/debian/changelog
index 66834dc..7d18a47 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+gcc-mingw-w64 (21.3~deb10u2) buster; urgency=medium
+
+ * Fix gcov handling: we need to tell GCC that we have headers, without
+ telling it where, and then we need to correct its default assumption
+ about where they are. Closes: #989862. LP: #1883933, #1920988.
+
+ -- Stephen Kitt <skitt@debian.org> Sat, 12 Jun 2021 18:54:10 +0200
+
gcc-mingw-w64 (21.3~deb10u1) buster; urgency=medium
* Upload to Buster.
diff --git a/debian/patches/gcov.patch b/debian/patches/gcov.patch
index 4400d53..4e6a83e 100644
--- a/debian/patches/gcov.patch
+++ b/debian/patches/gcov.patch
@@ -1,10 +1,17 @@
-Description: Add __gcov_exit for gcov fallback
+Description: Fix gcov build issues
Author: Stephen Kitt <skitt@debian.org>
When gcov is not supported on the target, gcc uses a fallback
do-nothing implementation. That’s missing a __gcov_exit()
implementation, causing linking errors.
+When gcov is supported in a cross-compiler setup, GCC assumes that
+either the headers are present and shared with the host, or present
+and set up in a sysroot, or absent. We have headers which aren’t
+shared and aren’t in a sysroot, so we need to tell GCC where they are
+*without* specifying them as an argument to --with-headers (the latter
+must only be enabled).
+
--- a/src/libgcc/libgcov-driver.c
+++ b/src/libgcc/libgcov-driver.c
@@ -30,6 +30,7 @@
@@ -15,3 +22,14 @@ implementation, causing linking errors.
#endif
#else /* inhibit_libc */
+--- a/src/gcc/configure.ac
++++ b/src/gcc/configure.ac
+@@ -2268,7 +2268,7 @@
+ if test "x$with_build_sysroot" != "x"; then
+ target_header_dir="${with_build_sysroot}${native_system_header_dir}"
+ elif test "x$with_sysroot" = x; then
+- target_header_dir="${test_exec_prefix}/${target_noncanonical}/sys-include"
++ target_header_dir="${test_exec_prefix}/${target_noncanonical}/include"
+ elif test "x$with_sysroot" = xyes; then
+ target_header_dir="${test_exec_prefix}/${target_noncanonical}/sys-root${native_system_header_dir}"
+ else
diff --git a/debian/patches/series1 b/debian/patches/series1
index 048c6bf..7a28c31 100644
--- a/debian/patches/series1
+++ b/debian/patches/series1
@@ -1,3 +1,4 @@
disable-multilib.patch
reproducible-sort.patch
bug-55930.patch
+gcov.patch
diff --git a/debian/patches/series2 b/debian/patches/series2
index 53bd6d3..4cce23c 100644
--- a/debian/patches/series2
+++ b/debian/patches/series2
@@ -1,5 +1,4 @@
reproducible-s-oscons.patch
-gcov.patch
wc-file-streams.patch
refactor-path-construction.patch
win-std-filesystem.patch
diff --git a/debian/rules b/debian/rules
index e9e4416..4bbb4d1 100755
--- a/debian/rules
+++ b/debian/rules
@@ -187,9 +187,9 @@ CONFFLAGS = \
--libdir=/$(PF)/$(libdir) \
--enable-libstdcxx-time=yes \
--with-tune=generic
-# Tell GCC where the headers are (this enables gcov)
+# Tell GCC we have headers (this enables gcov)
CONFFLAGS += \
- --with-headers=/usr/$$target/include
+ --with-headers
# MinGW-w64 flags
# version-specific-runtime-libs puts target-specific libraries in
# /usr/lib/gcc rather than /usr/$(target)
Reply to: