Gcenx / macports-wine

Updated wine Portfiles for macports
89 stars 11 forks source link

Wine won't build on M1 Ventura #45

Closed gasinvein closed 1 year ago

gasinvein commented 1 year ago

Trying to build wine-devel (or wine-stable, which rans into the same problem) on a M1 mac gives the following error at the end of the configure stage:

config.status: executing tools/makedep commands
In file included from tools/makedep.c:28:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/stdlib.h:66:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/wait.h:186:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/machine/endian.h:35:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/i386/endian.h:101:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_endian.h:130:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/libkern/_OSByteOrder.h:80:
/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/libkern/arm/OSByteOrder.h:15:1: error: redefinition of '_OSSwapInt16'
_OSSwapInt16(
^
/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/libkern/i386/_OSByteOrder.h:46:1: note: previous definition is here
_OSSwapInt16(
^

It looks similar to this macports ticket, but that issue was resolved by adding muniversal 1.0 PortGroup, which is already present here. This is the first time I'm using the repo, so sorry in advance if I'm missing something.

Gcenx commented 1 year ago

There’s no need to add muniversal 1.0 as there already using muniversal 1.1

I’ve built these on my own m1 mini running macOS Ventura 13.0.1 (not updated to 13.1 yet), I only test building under Rosetta2 as an arm64 build of wine wouldn’t be very useful anyway.

Gcenx commented 1 year ago

Please attach the main.log so I can see exactly what’s happening

gasinvein commented 1 year ago

I’ve built these on my own m1 mini running macOS Ventura 13.0.1 (not updated to 13.1 yet)

I have 13.1, yes. FWIW, tried adding different configure.sdk_versions to the portfile, to no effect.

I only test building under Rosetta2 as an arm64 build of wine wouldn’t be very useful anyway.

Sorry, I'm a bit new to this. What do you mean by "building under Rosetta2"? Is that different from running port install as usual?

Please attach the main.log so I can see exactly what’s happening

Here it is

gasinvein commented 1 year ago

I only test building under Rosetta2 as an arm64 build of wine wouldn’t be very useful anyway.

Sorry, I'm a bit new to this. What do you mean by "building under Rosetta2"? Is that different from running port install as usual?

Ok, so I've googled it a bit and did arch -x86_64 port install and Wine did build successfully. Many thanks for the hint!

Still, shouldn't it be buildable without running macports itself under rosetta?

Gcenx commented 1 year ago

Still, shouldn't it be buildable without running macports itself under rosetta?

It should be possible to build for arm64 but I’ve not tested this nor would it be useful currently as there few Windows arm64 applications/games.


Not sure why Macports had allowed this to even get that far as I’ve not even set arm64 as a supported arch for the wine ports….


Might need to add another block to all the wine ports to quickly bailout.

gasinvein commented 1 year ago

Still, shouldn't it be buildable without running macports itself under rosetta?

It should be possible to build for arm64 but I’ve not tested this nor would it be useful currently as there few Windows arm64 applications/games.

Right, I didn't mean to build it for native arm64 target. Just seeing i386 x86_64 in supported_archs, I expected it to produce x86_64-only binaries (cross-compile them on the arm64 host? not sure how those universal binaries work).

Gcenx commented 1 year ago

There’s a separate command to force Macports to build for a specific target just can’t remember what it was currently.

I only run Macports under Terminal that’s running under Rosetta2, but it’s possible something in macports-base is swapping x86_64 for arm64.

Guess the only way to ensure this doesn’t continue to happen is adding a pre-fetch block that forces it to die on an arm64 platform.

Gcenx commented 1 year ago

After my m1 has done installing updates I’ll try directly install out outside of Rosetta2 and figure out a fix.

Gcenx commented 1 year ago

This should be resolved with https://github.com/Gcenx/macports-wine/commit/317d84a03826ee15464c3821cc85fccfab3c12a4

gasinvein commented 1 year ago

Yep, it builds now without forcing rosetta. Thanks!