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

Bug#914031: winegcc-development breaks due to non-standard paths



Package: wine-development
Version: 3.20-2
Tags: patch

Fix two issues specific to the wine-development package:

1) Fix locating libwine.so and hence the correct library path for
   cross-compiling. Using the 64bit -tools package breaks linking
   32bit binaries [0][1] because winegcc fails to find its 32bit
   libraries, and it incorrectly falls back to the native ones.

2) While at it, make winegcc use `winebuild-development` per default,
   so the workaround script /usr/bin/winegcc-development can be removed.
   The envvar WINEBUILD can still be used to override this.

[0] echo 'int main() { return 0; }' | winegcc-development -m32 -x -
[1] ld: relocatable linking with relocations from format elf64-x86-64 (/usr/lib/x86_64-linux-gnu/wine-development/libwinecrt0.a(exe_entry.o)) to format elf32-i386 (a.gjlTmQ.o) is not supported

Attached patch fixes both issues, please consider applying it!

Thanks!
Andre
>From 44ef6582ef3c3628bccac8d9bf10db6609feb439 Mon Sep 17 00:00:00 2001
From: Andre Heider <a.heider@gmail.com>
Date: Fri, 16 Nov 2018 23:14:08 +0100
Subject: [PATCH] winegcc: fixups for wine-development non-standard paths

Fix two issues specific to the wine-development package:

1) Fix locating libwine.so and hence the correct library path for
   cross-compiling. Using the 64bit -tools package breaks linking
   32bit binaries [0][1] because winegcc fails to find its 32bit
   libraries, and it incorrectly falls back to the native ones.

2) While at it, make winegcc use `winebuild-development` per default,
   so the workaround script /usr/bin/winegcc-development can be removed.
   The envvar WINEBUILD can still be used to override this.

[0] echo 'int main() { return 0; }' | winegcc-development -m32 -x -
[1] ld: relocatable linking with relocations from format elf64-x86-64 (/usr/lib/x86_64-linux-gnu/wine-development/libwinecrt0.a(exe_entry.o)) to format elf32-i386 (a.gjlTmQ.o) is not supported

Signed-off-by: Andre Heider <a.heider@gmail.com>
---
 tools/winegcc/winegcc.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c
index 6b3b4b6aab..39bd6b69a2 100644
--- a/tools/winegcc/winegcc.c
+++ b/tools/winegcc/winegcc.c
@@ -456,7 +456,7 @@ static char *get_lib_dir( struct options *opts )
 
     for (i = 0; i < sizeof(stdlibpath)/sizeof(stdlibpath[0]); i++)
     {
-        char *p, *buffer = xmalloc( strlen(stdlibpath[i]) + strlen("/arm-linux-gnueabi") + strlen(libwine) + 1 );
+        char *p, *buffer = xmalloc( strlen(stdlibpath[i]) + strlen("/arm-linux-gnueabi") + strlen("/wine-development") + strlen(libwine) + 1 );
         strcpy( buffer, stdlibpath[i] );
         p = buffer + strlen(buffer);
         while (p > buffer && p[-1] == '/') p--;
@@ -481,6 +481,7 @@ static char *get_lib_dir( struct options *opts )
         default:
             assert(0);
         }
+        strcat( p, "/wine-development" );
         strcat( p, libwine );
         if (check_platform( opts, buffer )) goto found;
 
@@ -711,7 +712,7 @@ static strarray *get_winebuild_args(struct options *opts)
     const char* winebuild = getenv("WINEBUILD");
     strarray *spec_args = strarray_alloc();
 
-    if (!winebuild) winebuild = "winebuild";
+    if (!winebuild) winebuild = "winebuild-development";
     strarray_add( spec_args, winebuild );
     if (verbose) strarray_add( spec_args, "-v" );
     if (keep_generated) strarray_add( spec_args, "--save-temps" );
-- 
2.19.1


Reply to: