I did some more exploration, and found that not only are the mingw-w64-{x86_64, i686}-winpthreads packages broken, but any --target=x86_64-w64-mingw32 package:
$ guix build --target=x86_64-w64-mingw32 hello
I have this patch which resolves the problem by simply disabling compressed debug sections, but perhaps it’d also be worthwhile to investigate the root cause...
Toggle snippet (16 lines)
diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm
index 78cbf871ac..397e4d4c1c 100644
--- a/gnu/packages/cross-base.scm
+++ b/gnu/packages/cross-base.scm
@@ -101,7 +101,8 @@ (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
+ binutils "--enable-compressed-debug-sections" "no")
(search-patches "binutils-mingw-w64-timestamp.patch"
"binutils-mingw-w64-deterministic.patch")))
(else binutils))
Toggle quote (20 lines)
> On Jan 21, 2022, at 5:10 PM, Maxime Devos <maximedevos@telenet.be> wrote:
>
> Carl Dong schreef op vr 21-01-2022 om 16:30 [-0500]:
>> I’m wondering what the best course of action is to fix the mingw-w64-
>> {x86_64,i686}-winpthreads packages (e.g. just remove the configure
>> flag for mingw-w64? Add that flag only for linux? Or something else?)
>> and would love some help.
>
> I would assume that it works for Linux, it also works for the Hurd,
> so I would prefer something like
>
> #$@(if (target-mingw?) '() '("--some-configuration..."))
>
> above
>
> #$@(if (target-linux?) '("--some-configuration...") '())
>
> Greetings,
> Maxime.
>