Date: Sat, 22 Aug 2009 23:49:47 +0200 (CEST) From: Gerald Pfeifer <gerald@pfeifer.com> To: bug-followup@FreeBSD.org, Edward Tomasz Napierala <trasz@FreeBSD.org> Cc: freebsd-ports-bugs@FreeBSD.org Subject: Re: ports/137999: [PATCH] emulators/wine: fix winebuild Message-ID: <alpine.LSU.1.99.0908222336390.16166@acrux.dbai.tuwien.ac.at> In-Reply-To: <200908201950.n7KJoB8e046008@freefall.freebsd.org> References: <200908201950.n7KJoB8e046008@freefall.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Thanks for the report and suggested patch. I'm afraid this is a bit hackish and not acceptable upstream, and I think it's important to resolve this properly together with upstream, both for the sake of users building outside of the realm of the ports tree and for longer term maintainability. So, given that your proposed patch already highlighted the issue very nicely and suggested a fix for FreeBSD, I gave it a try to generalize this in a way that hopefully will be acceptable upstream. Would you mind giving the patch below a try and let me know the outcome? Thanks, Gerald diff --git a/tools/winebuild/build.h b/tools/winebuild/build.h index 7ca10c1..96d7493 100644 --- a/tools/winebuild/build.h +++ b/tools/winebuild/build.h @@ -124,7 +124,11 @@ enum target_cpu enum target_platform { - PLATFORM_UNSPECIFIED, PLATFORM_APPLE, PLATFORM_SOLARIS, PLATFORM_WINDOWS + PLATFORM_UNSPECIFIED, + PLATFORM_APPLE, + PLATFORM_FREEBSD, + PLATFORM_SOLARIS, + PLATFORM_WINDOWS }; extern char *target_alias; diff --git a/tools/winebuild/main.c b/tools/winebuild/main.c index bebb37b..3c80ea3 100644 --- a/tools/winebuild/main.c +++ b/tools/winebuild/main.c @@ -64,6 +64,8 @@ enum target_cpu target_cpu = CPU_POWERPC; #ifdef __APPLE__ enum target_platform target_platform = PLATFORM_APPLE; +#elif defined(__FreeBSD__) +enum target_platform target_platform = PLATFORM_FREEBSD; #elif defined(__sun) enum target_platform target_platform = PLATFORM_SOLARIS; #elif defined(_WINDOWS) diff --git a/tools/winebuild/utils.c b/tools/winebuild/utils.c index d11bd32..bf414fb 100644 --- a/tools/winebuild/utils.c +++ b/tools/winebuild/utils.c @@ -296,9 +296,18 @@ const char *get_ld_command(void) if (force_pointer_size) { - const char *args = (target_platform == PLATFORM_APPLE) ? - ((force_pointer_size == 8) ? " -arch x86_64" : " -arch i386") : - ((force_pointer_size == 8) ? " -m elf_x86_64" : " -m elf_i386"); + const char *args; + + if (target_platform == PLATFORM_APPLE) + args = (force_pointer_size == 8) ? " -arch x86_64" + : " -arch i386"; + else if (target_platform == PLATFORM_FREEBSD) + args = (force_pointer_size == 8) ? " -m elf_x86_64" + : " -m elf_i386_fbsd"; + else + args = (force_pointer_size == 8) ? " -m elf_x86_64" + : " -m elf_i386"; + ld_command = xrealloc( ld_command, strlen(ld_command) + strlen(args) + 1 ); strcat( ld_command, args ); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.LSU.1.99.0908222336390.16166>