<div dir="auto">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</div><div dir="auto"><br></div><div dir="auto">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.</div><div dir="auto"><br></div><div dir="auto">On Thu, Oct 21, 2021 at 1:15 AM Brendan Shanks <<a href="mailto:bshanks@codeweavers.com">bshanks@codeweavers.com</a>> wrote:<br></div><div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)">Something I've been working on lately is cross-compiling Wine for 32-bit<br>
Mac from newer 64-bit-only macOS versions (10.15 and newer). This should<br>
be especially useful for anyone packaging Wine for macOS. <br>
<br>
The first part needed is a toolchain. Apple's last official toolchain to<br>
support targeting i386 is Xcode 9.4.1 and the 10.13 SDK, but this is <br>
unable to run on any OS newer than 10.14.<br>
<br>
To fix this, I've created a hack that allows the Xcode 9.4.1 toolchain to<br>
be used on newer OSes: <<a href="https://github.com/mrpippy/XcodeNueve" rel="noreferrer" target="_blank">https://github.com/mrpippy/XcodeNueve</a>><br>
<br>
<br>
With the toolchain working, building i386 with it is now a cross-compile.<br>
Apple does not prefix the commands with the host triplet though<br>
(i.e. 'i386-apple-darwin'), which Wine seems to expect for cross-compiling.<br>
<br>
Specifically, configure adds "-b <host triplet>" to TARGETFLAGS, causing<br>
winebuild to search for commands like ld and nm prefixed with that host<br>
triplet, which fails.<br>
<br>
This is a patch which only sets that TARGETFLAGS when the host triplet<br>
appears in $CC. I'm open to a different approach to fixing this though.<br>
<br>
<br>
Here's the command I use to configure, assuming the modified Xcode 9.4.1<br>
is at /Applications/Xcode9.app:<br>
<br>
DEVELOPER_DIR="/Applications/Xcode9.app" \<br>
SDKROOT="/Applications/Xcode9.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk" \<br>
../configure --host=i386-apple-darwin \<br>
--with-wine-tools=<path to wine64 build> --with-wine64=<path to wine64 build> \<br>
CC="clang -arch i386" TARGETFLAGS="-m32"<br>
<br>
Make also needs to be run with DEVELOPER_DIR and SDKROOT set.<br>
And this also works on Apple Silicon, just run with 'arch -x86_64'<br>
<br>
Brendan Shanks (1):<br>
  configure: Only set TARGETFLAGS when cross-compiling with<br>
    host-prefixed tools.<br>
<br>
 <a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a> | 6 +++++-<br>
 1 file changed, 5 insertions(+), 1 deletion(-)<br>
<br>
-- <br>
2.30.1 (Apple Git-130)<br>
<br>
</blockquote></div></div>