From owner-freebsd-ports-bugs@FreeBSD.ORG Sat Aug 22 22:05:50 2009 Return-Path: Delivered-To: freebsd-ports-bugs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9730106568B for ; Sat, 22 Aug 2009 22:05:50 +0000 (UTC) (envelope-from gerald@pfeifer.com) Received: from vexpert.dbai.tuwien.ac.at (vexpert.dbai.tuwien.ac.at [128.131.111.2]) by mx1.freebsd.org (Postfix) with ESMTP id 983DF8FC0A for ; Sat, 22 Aug 2009 22:05:50 +0000 (UTC) Received: from acrux.dbai.tuwien.ac.at (acrux.dbai.tuwien.ac.at [128.131.111.60]) by vexpert.dbai.tuwien.ac.at (Postfix) with ESMTP id 812D81E091; Sat, 22 Aug 2009 23:49:42 +0200 (CEST) Received: by acrux.dbai.tuwien.ac.at (Postfix, from userid 1203) id D09D41005D; Sat, 22 Aug 2009 23:49:47 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by acrux.dbai.tuwien.ac.at (Postfix) with ESMTP id C1B8D10059; Sat, 22 Aug 2009 23:49:47 +0200 (CEST) Date: Sat, 22 Aug 2009 23:49:47 +0200 (CEST) From: Gerald Pfeifer To: bug-followup@FreeBSD.org, Edward Tomasz Napierala In-Reply-To: <200908201950.n7KJoB8e046008@freefall.freebsd.org> Message-ID: References: <200908201950.n7KJoB8e046008@freefall.freebsd.org> User-Agent: Alpine 1.99 (LSU 1142 2008-08-13) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: freebsd-ports-bugs@FreeBSD.org Subject: Re: ports/137999: [PATCH] emulators/wine: fix winebuild X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Aug 2009 22:05:50 -0000 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 ); }