[PATCH 0/1] Cross-compiling 32-bit macOS from 64-bit-only macOS.

Dean Greer gcenx83 at gmail.com
Thu Oct 21 09:52:49 CDT 2021


Did Xcode13 now break i386 targets?, as Xcode12 on my M1 Mac Mini had
compiled i386 target wine for me when using MacOSX10.13.SDK

The proposed patch reminds me of a change to meson a while back that
removed this as it caused issues on Linux when cross-compiling for other
distros/archs.

On Thu, Oct 21, 2021 at 1:15 AM Brendan Shanks <bshanks at codeweavers.com>
wrote:

> Something I've been working on lately is cross-compiling Wine for 32-bit
> Mac from newer 64-bit-only macOS versions (10.15 and newer). This should
> be especially useful for anyone packaging Wine for macOS.
>
> The first part needed is a toolchain. Apple's last official toolchain to
> support targeting i386 is Xcode 9.4.1 and the 10.13 SDK, but this is
> unable to run on any OS newer than 10.14.
>
> To fix this, I've created a hack that allows the Xcode 9.4.1 toolchain to
> be used on newer OSes: <https://github.com/mrpippy/XcodeNueve>
>
>
> With the toolchain working, building i386 with it is now a cross-compile.
> Apple does not prefix the commands with the host triplet though
> (i.e. 'i386-apple-darwin'), which Wine seems to expect for cross-compiling.
>
> Specifically, configure adds "-b <host triplet>" to TARGETFLAGS, causing
> winebuild to search for commands like ld and nm prefixed with that host
> triplet, which fails.
>
> This is a patch which only sets that TARGETFLAGS when the host triplet
> appears in $CC. I'm open to a different approach to fixing this though.
>
>
> Here's the command I use to configure, assuming the modified Xcode 9.4.1
> is at /Applications/Xcode9.app:
>
> DEVELOPER_DIR="/Applications/Xcode9.app" \
> SDKROOT="/Applications/Xcode9.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk"
> \
> ../configure --host=i386-apple-darwin \
> --with-wine-tools=<path to wine64 build> --with-wine64=<path to wine64
> build> \
> CC="clang -arch i386" TARGETFLAGS="-m32"
>
> Make also needs to be run with DEVELOPER_DIR and SDKROOT set.
> And this also works on Apple Silicon, just run with 'arch -x86_64'
>
> Brendan Shanks (1):
>   configure: Only set TARGETFLAGS when cross-compiling with
>     host-prefixed tools.
>
>  configure.ac | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> --
> 2.30.1 (Apple Git-130)
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20211021/42686cf3/attachment.htm>


More information about the wine-devel mailing list