1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-04-07 13:40:36 +02:00
Files
guix/gnu/packages/patches/binutils-cross-windres.patch
Dariqq 71dc089411 gnu: cross-binutils: make windres find gcc for mingw.
* gnu/packages/cross-base.scm (cross-binutils*): Add patch for mingw targets.
* gnu/packages/patches/binutils-cross-windres.patch: New patch.
* gnu/local.mk (dis_patch_DATA): Register patch.

Change-Id: I5e7a53a02dccc9eadef539b0e4566c05791872cd
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Merges: #6642
2026-03-04 17:27:52 +01:00

32 lines
960 B
Diff

windres currently looks for gcc in this order:
* target-prefixed gcc in same directory as windres
* gcc in same directory as windres
* gcc in PATH
In case of cross compiling the unprefixed gcc is a native compiler
and probably the wrong choice.
This adds another option to look for a target-prefixed gcc in PATH
in case binutils and gcc are installed in different prefixes.
Index: binutils-2.44/binutils/resrc.c
===================================================================
--- binutils-2.44.orig/binutils/resrc.c
+++ binutils-2.44/binutils/resrc.c
@@ -535,6 +535,14 @@ read_rc_file (const char *filename, cons
preprocargs, filename);
}
+ if (slash && dash && (dash > slash) && ! cpp_pipe)
+ {
+ /* Try prefixed gcc with the same prefix as windres */
+
+ cpp_pipe = look_for_default (cmd, slash + 1, dash - (slash + 1) + 1,
+ preprocargs, filename);
+ }
+
if (! cpp_pipe)
{
/* Sigh, try the default */