[PATCH] gnu: Disable compressed debug sections for mingw-w64

  • Done
  • quality assurance status badge
Details
3 participants
  • Carl Dong
  • Leo Famulari
  • Maxim Cournoyer
Owner
unassigned
Submitted by
Carl Dong
Severity
normal
C
C
Carl Dong wrote on 1 Feb 2022 19:22
(address . guix-patches@gnu.org)(name . Carl Dong)(address . contact@carldong.me)
20220201182202.2300335-1-contact@carldong.me
The newly introduced --enable-compressed-debug-section=all configure
flag in the base binutils package makes the mingw-w64 build system
unusable. For example:

$ guix build --target=x86_64-w64-mingw32 hello

and

$ guix build mingw-w64-x86_64-winpthreads

Will fail to build with an error:

"x86_64-w64-mingw32-ld: final link failed: bad value"

Turning off this flag seems to fix the problem, but perhaps it'd also be
worthwhile to investigate the root cause.

* gnu/packages/cross-base.scm (cross-binutils): When building for mingw
targets, append "--enable-compressed-debug-section=no" to configure
flags.
---
gnu/packages/cross-base.scm | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)

Toggle diff (24 lines)
diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm
index 78cbf871ac..529144d127 100644
--- a/gnu/packages/cross-base.scm
+++ b/gnu/packages/cross-base.scm
@@ -101,7 +101,16 @@ (define* (cross-binutils target #:optional (binutils binutils))
"ath9k-htc-firmware-binutils.patch")))
((target-mingw? target)
(package-with-extra-patches
- binutils
+ (package-with-extra-configure-variable
+ ;; mingw binutils does not work correctly when configured
+ ;; with `--enable-compressed-debug-sections`. An error
+ ;; like the following will occur whenever you try to link:
+ ;;
+ ;; x86_64-w64-mingw32-ld: final link failed: bad value
+ ;;
+ ;; TODO: This seems like a deeper problem that warrants
+ ;; deeper investigation.
+ binutils "--enable-compressed-debug-sections" "no")
(search-patches "binutils-mingw-w64-timestamp.patch"
"binutils-mingw-w64-deterministic.patch")))
(else binutils))
--
2.34.1
L
L
Leo Famulari wrote on 3 Feb 2022 19:39
(no subject)
(name . GNU bug tracker automated control server)(address . control@debbugs.gnu.org)
YfwhW7myCtO8IyKu@jasmine.lan
block 53214 with 53706
C
C
Carl Dong wrote on 3 Feb 2022 19:51
re: [PATCH] gnu: Disable compressed debug sections for mingw-w64
AACE2E6B-F4E9-4C0C-AB54-3A2689D566E1@carldong.me
Just for some extra context, this commit should not trigger mass rebuilds. I’m happy to commit it myself, but would someone to give me a quick sanity check before doing so!

Related: https://issues.guix.gnu.org/53426 https://issues.guix.gnu.org/53426

Cheers,
Carl Dong
Attachment: file
Attachment: signature.asc
M
M
Maxim Cournoyer wrote on 6 Feb 2022 05:59
Re: [PATCH] gnu: Disable compressed debug sections for mingw-w64
(name . Carl Dong)(address . contact@carldong.me)
87wni81tfw.fsf@gmail.com
Hi Carl,

Carl Dong <contact@carldong.me> writes:

Toggle quote (6 lines)
> Just for some extra context, this commit should not trigger mass
> rebuilds. I’m happy to commit it myself, but would someone to give me
> a quick sanity check before doing so!
>
> Related: https://issues.guix.gnu.org/53426 <https://issues.guix.gnu.org/53426>

I just had a quick look, and it LGTM.

Thanks,

Maxim
C
C
Carl Dong wrote on 7 Feb 2022 22:40
Closing
(address . 53706-done@debbugs.gnu.org)
0363027B-C192-4556-931B-6748BD8FBE30@carldong.me
In master as of 2d78b27711d44f39fabf170d044b45247af7babe
Closed
?