[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#989916: unblock: gcc-mingw-w64/24.2



Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: unblock

Dear release team,

This is a pre-upload unblock request for gcc-mingw-w64, to fix a
regression affecting gcov support and profile-guided optimisation,
both of which are completely broken.

The proposed debdiff is attached.

unblock gcc-mingw-w64/24.2

Regards,

Stephen


-- System Information:
Debian Release: 10.9
  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-12-amd64 (SMP w/8 CPU cores)
Kernel taint flags: TAINT_WARN, 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 332aa0b9869ab48e4a4d80710d89c58c60b33c07
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: #989682
    LP: #1883933, #1920988

diff --git a/debian/changelog b/debian/changelog
index ace01f8..348b62a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+gcc-mingw-w64 (24.2) unstable; 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: #989682. LP: #1883933, #1920988.
+
+ -- Stephen Kitt <skitt@debian.org>  Sat, 12 Jun 2021 18:54:10 +0200
+
 gcc-mingw-w64 (24.1) unstable; urgency=medium
 
   * Update gcc-mingw-w64-base’s README.Debian with the switch to Dwarf2.
diff --git a/debian/patches/gcov.patch b/debian/patches/gcov.patch
index 4e9e610..5113282 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
 @@ -31,6 +31,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 eca45ad..89c05d4 100644
--- a/debian/patches/series1
+++ b/debian/patches/series1
@@ -1,2 +1,3 @@
 disable-multilib.patch
 reproducible-sort.patch
+gcov.patch
diff --git a/debian/patches/series2 b/debian/patches/series2
index 479f603..8c7122b 100644
--- a/debian/patches/series2
+++ b/debian/patches/series2
@@ -1,3 +1,2 @@
 reproducible-s-oscons.patch
-gcov.patch
 vmov-alignment.patch
diff --git a/debian/rules b/debian/rules
index fd0b6d7..b71f935 100755
--- a/debian/rules
+++ b/debian/rules
@@ -217,9 +217,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: