kanjitalk755 / macemu

Basilisk II and SheepShaver Macintosh emulators
349 stars 53 forks source link

Problems with building under Ventura on M1/M2 Mac #163

Closed emendelson closed 1 year ago

emendelson commented 1 year ago

A few problems building under latest version of Ventura and Xcode on an Apple Silicon Mac:

  1. There is nothing you can do about this one: Both gmp and mpfr produce multiple failures (segementation faults) on make check. I don't know if this has any effect on the actual builds of BII and SS.

  2. BII build fails with a message about minimum versions. The fix is to open the project in Xcode, and replace one instance of 10.11 with 10.13.3 and two instances of 10.7 with 10.13.3.

  3. SS fails with a similar message. The fix is to open the project in Xcode and replace three instances of 10.7 with 10.13.3.

Probably 10.13.0 would work also, but I didn't try it.

RonaldPR commented 1 year ago

For my more recent SheepShaver and BasiliskII builds, also before Ventura, I always changed the value 10.7 for "Minimum Deployments" to the earliest macOS version presented as alternative choice in the menu in Xcode, and in Info I then changed "Minimum system version" accordingly (in BasiliskII I added that in Info). For my latest builds that is 10.13 and 10.13.0 respectively.

(I do not see "10.11" anywhere.)

emendelson commented 1 year ago

(I do not see "10.11" anywhere.)

Screenshot 2023-04-03 at 7 47 14 AM
RonaldPR commented 1 year ago

I do not know where you see that "uae_cpu_2021", I can only find a "macOS Deployment Target", which is set to "Default". I never changed that.

emendelson commented 1 year ago

Latest code, just downloaded. Open Basiliskii.xcodeproj in Xcode. Use the magnifying glass icon at the top left to search for 10.11.

Screenshot 2023-04-03 at 11 56 47 AM

Click on "10.11"; in the editing window, scroll down to Deployment Target, then macOS Deployment Target.

EDIT: or you can open use_cpu_2021.xcodeproj in Xcode and make the same change there. Both methods seem to work.

RonaldPR commented 1 year ago

Well, without "Find", I would never have encountered it. I never make any changes in Build settings, leave Architectures alone. I just set MinimumDeployments to 10.13 in the General tab, which automatically also changes macOS Deployment Target to macOS 10.13 in Build settings > Deployment.

emendelson commented 1 year ago

Your method is much easier. I'll use it in the future. Thank you!

kanjitalk755 commented 1 year ago
  1. There is nothing you can do about this one: Both gmp and mpfr produce multiple failures (segementation faults) on make check. I don't know if this has any effect on the actual builds of BII and SS.

See below for a bug report.

https://gmplib.org https://www.mpfr.org

  1. BII build fails with a message about minimum versions. The fix is to open the project in Xcode, and replace one instance of 10.11 with 10.13.3 and two instances of 10.7 with 10.13.3.
  2. SS fails with a similar message. The fix is to open the project in Xcode and replace three instances of 10.7 with 10.13.3.

This is a difficult issue to deal with. For example, people using El Capitan on older machines won't be able to build and run.

emendelson commented 1 year ago

I've filled a bug report for GMP. It's possible that the problems with MPFR may be an effect of the problems in GMP, so I'll file a bug report for MPFR after the GMP issue gets fixed.

I don't how to deal with this problem. Maybe create two project files for each app, one with "Xcode14" in its name?

EDIT: after filing a bug report, I found this patch:

https://gmplib.org/repo/gmp/raw-rev/5f32dbc41afc

referenced on this page:

https://stackoverflow.com/questions/74374104/gmp-unit-tests-failing-on-ventura-mac-m1

I applied the patch by copying the file into the gmp folder and running

patch -s -p1 <patchfile.txt

I don't know if that's the correct command, but the errors then disappeared from GMP.

MPFR then built successfully.

For convenience, here is a zip archive of the GMP source code with the patch already applied:

gmp-6.2.1.zip

kanjitalk755 commented 1 year ago

I don't know if that's the correct command, but the errors then disappeared from GMP. MPFR then built successfully.

Great!

Changed Deployment Target to 10.13 and added a description of it to README.md.