Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flatpak release 1.6.19 #96

Closed
wants to merge 24 commits into from
Closed

Conversation

SegHaxx
Copy link

@SegHaxx SegHaxx commented Jun 20, 2021

Hi its me, the flatpak guy. :) I just released this on flathub. I rebased all my work on this repo. The summary of what I have done:

  1. Remove a lot of legacy platforms/APIs.
  2. Centralized all macintosh memory allocation in Basilisk II, such that that the macintosh memory is allocated all at once, and only once. This fixes a major source of random crashes on 64bit Linux, when using JIT and when switching video modes.
  3. Made non-JIT Basilisk II fully "64bit clean". This makes it much more portable and secure. Making x86_64 JIT 64bit clean still needs to be done.
  4. Added CI for every working build I know of :)

I notice there's work on JIT going on here. For stable JIT on linux you need this patch. Notably I moved the memory allocation to basilisk_glue.cpp, so that it is shared by all platforms, because that's where the RAM pointers were already. This may not be ideal and can certainly be revised.

If there's work on JIT happening I would like to be kept in the loop on that. :)

People can play with builds out of my CI if they would like. JIT works on all of them. :) However windows builds will need DLLs from MSYS2, and the macOS SheepShaver build is a "unix" build that needs sdl2/gtk+ from brew. If someone can give me an updated SheepShaver xcode project I can switch to that. :)

https://ci.appveyor.com/project/SegHaxx/macemu-flatpak

@kanjitalk755
Copy link
Owner

Both BII and SS for macOS couldn't be built.
Make sure you can build and run on macOS.

@SegHaxx
Copy link
Author

SegHaxx commented Jun 20, 2021

BII build with xcodebuild works for me? If you're using "uae_cpu_2021" yeah I need to revise my patch for that. I'll look in to it.

@kanjitalk755
Copy link
Owner

BII build with xcodebuild works for me?

Yes, as follows.

$ cd BasiliskII/src/MacOSX
$ xcodebuild build -project BasiliskII.xcodeproj -configuration Release

$ cd SheepShaver/src/MacOSX
$ xcodebuild build -project SheepShaver_Xcode8.xcodeproj -configuration Release

If you're using "uae_cpu_2021" yeah I need to revise my patch for that.

uae_cpu_2021 is for Apple Silicon Mac.
In that environment, fpu_ieee is inaccurate because sizeof long double is 8.
uae_cpu_2021 has fpu_mpfr using GMP/MPFR and resolves the issue.

BTW, uae_cpu_2021 has problems with JIT, so x86_64 build uses uae_cpu.

@SegHaxx
Copy link
Author

SegHaxx commented Jun 20, 2021

Okay I managed to get a universal binary built on intel, the trick is to build gmp/mpfr with CFLAGS="-arch arm64" CXXFLAGS="$CFLAGS" ./configure -host=aarch64-apple-darwin --disable-shared but I do not have an ARM mac to test it on.

SheepShaver seemed to be failing because SDL1 was removed. I fixed that, however the build still fails for me because it can't find GTK+? I have it installed via brew.

@kanjitalk755
Copy link
Owner

SheepShaver seemed to be failing because SDL1 was removed. I fixed that, however the build still fails for me because it can't find GTK+? I have it installed via brew.

GTK+ is not used when building with xcodebuild.
SS of your latest source can be built but crashes.

I do not have an ARM mac to test it on.

If you can't debug with Apple Silicon, I can't merge this PR.
Can you modify your PR so that it doesn't affect Mac Platform?

@SegHaxx
Copy link
Author

SegHaxx commented Jun 20, 2021

Okay turns out my SheepShaver build was being messed up by having a lingering Unix/config.h from a unix build. I deleted it and I have a working SheepShaver build here.

Anyone else out there with apple silicon want to help out with this?

@emendelson
Copy link

I now have a borrowed Apple Silicon machine, and I am happy to help out. On my Intel Mac, under Big Sur, I tried to build gmp with the configure command shown above:

CFLAGS="-arch arm64" CXXFLAGS="$CFLAGS" ./configure -host=aarch64-apple-darwin --disable-shared

and got no error messages from configure or make. But make check showed this failure:

/Applications/Xcode.app/Contents/Developer/usr/bin/make  check-TESTS
FAIL: t-bswap
FAIL: t-constants
FAIL: t-count_zeros
FAIL: t-hightomask
FAIL: t-modlinv
FAIL: t-popc
FAIL: t-parity
FAIL: t-sub

Am I doing something wrong? Is it possible that something I installed with brew is causing the problem? This is the list of my brew installs:

edward@MacBook-Pro-Big-Sur gmp-6.2.1 % brew list
==> Formulae
boost		glib		libodfgen	libwps		pcre		writerperfect
doxygen		icu4c		librevenge	libxml2		python@3.9	xz
gdbm		libffi		libwpd		mpdecimal	readline
gettext		libgsf		libwpg		openssl@1.1	sqlite

Again, I'll be glad to test this on Apple Silicon, but obviously I need to sort out this gmp problem first.

@kanjitalk755
Copy link
Owner

You built arm64 binaries, so make check should fail on Intel.
If you want to check GMP/MPFR, build them on Apple Silicon.

@emendelson
Copy link

Thank you for that explanation. I've now followed the instructions and built a universal Basilisk II on an Intel Mac by building both GMP and MPFR with the ./configure command shown here, followed by make and sudo make install and then building with: xcodebuild build -project BasiliskII.xcodeproj -configuration Release. The resulting executable runs on Apple Silicon. Thank you!

May I suggest that the instructions on the main page should be clarified slightly? Instead of On an Intel Mac, change the configure command as follows: maybe say something like On an Intel Mac, change the configure command for both GMP and MPFR as follows, and ignore the make check command:

Also, should the instructions say to edit the schemes of the two use_cpu schemes to change Debug to Release? I've been doing this, but I don't know if it's useful

Thank you again for all your work on this project!

@kanjitalk755
Copy link
Owner

Also, should the instructions say to edit the schemes of the two use_cpu schemes to change Debug to Release? I've been doing this, but I don't know if it's useful

The subproject configuration is same as the main project regardless of individual settings, so there is no need to set it.

I changed README.md description to build with xcodebuild for clarity.

@emendelson
Copy link

I was also able to build with the full Xcode, but I didn't check the resulting build on an Apple Silicon Mac. If I do, I'll report back. Thank you again.

@iDevPro
Copy link

iDevPro commented Sep 2, 2021

I now have a borrowed Apple Silicon machine, and I am happy to help out. On my Intel Mac, under Big Sur, I tried to build gmp with the configure command shown above:

CFLAGS="-arch arm64" CXXFLAGS="$CFLAGS" ./configure -host=aarch64-apple-darwin --disable-shared

and got no error messages from configure or make. But make check showed this failure:

/Applications/Xcode.app/Contents/Developer/usr/bin/make  check-TESTS
FAIL: t-bswap
FAIL: t-constants
FAIL: t-count_zeros
FAIL: t-hightomask
FAIL: t-modlinv
FAIL: t-popc
FAIL: t-parity
FAIL: t-sub

Am I doing something wrong? Is it possible that something I installed with brew is causing the problem? This is the list of my brew installs:

edward@MacBook-Pro-Big-Sur gmp-6.2.1 % brew list
==> Formulae
boost		glib		libodfgen	libwps		pcre		writerperfect
doxygen		icu4c		librevenge	libxml2		python@3.9	xz
gdbm		libffi		libwpd		mpdecimal	readline
gettext		libgsf		libwpg		openssl@1.1	sqlite

Again, I'll be glad to test this on Apple Silicon, but obviously I need to sort out this gmp problem first.

I have M1, and have the same problem when build gmp on it :)

============================================================================
Testsuite summary for GNU MP 6.2.1
============================================================================
# TOTAL: 50
# PASS:  17
# SKIP:  0
# XFAIL: 0
# FAIL:  33
# XPASS: 0
# ERROR: 0

@kanjitalk755
Copy link
Owner

Try uname -m in the terminal where you built GMP.
If the result is not arm64, turn Rosetta off and start over.

@SegHaxx
Copy link
Author

SegHaxx commented Aug 2, 2022

Closing this, I have a new release in the works with significant patch reworking which obsoletes all this.

@SegHaxx SegHaxx closed this Aug 2, 2022
@SegHaxx SegHaxx deleted the kanjitalk-merge branch August 2, 2022 04:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants