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

SFII won't compile on a mac with Apple silicon M1 CPU. #131

Closed
Grrrolf opened this issue May 8, 2021 · 3 comments · Fixed by #132
Closed

SFII won't compile on a mac with Apple silicon M1 CPU. #131

Grrrolf opened this issue May 8, 2021 · 3 comments · Fixed by #132
Assignees
Labels
bug Something isn't working
Milestone

Comments

@Grrrolf
Copy link

Grrrolf commented May 8, 2021

Describe the bug
SFII won't compile on a mac with Apple silicon M1 CPU due to you distributing an incompatible version of SDL2.framework.

To Reproduce
Steps to reproduce the behavior:

  1. git clone https://github.com/Chordian/sidfactory2.git
  2. cd sidfactory2/macos
  3. make
  4. ld: warning: ignoring file ./App/Contents/Frameworks/SDL2.framework/SDL2, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
    [...]
    ld: symbol(s) not found for architecture arm64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    make: *** [artifacts/SIDFactoryII] Error 1

Expected behavior
a successful build

Desktop (please complete the following information):

  • macOS Big Sur - mac mini with M1 CPU (arm64)
  • the source from the 'master' branche.

Additional information
Replacing the currently distributed SDL2.framework with the latest stable (currently version 2.0.14) – downloadable from libsdl.org – will solve this issue and leads to a successful build.
An alternative might be looking for the framework in /Library/Frameworks and see if it is installed there, if so, then use this one instead of the one in sidfactory2/macos/App/Contents/Frameworks.

@Grrrolf Grrrolf added the bug Something isn't working label May 8, 2021
@micheldebree micheldebree added this to the next_release milestone May 8, 2021
@micheldebree micheldebree self-assigned this May 8, 2021
@micheldebree
Copy link
Collaborator

Hi @Grrrolf can you try building from the sdl_upgrade branch? I don't have an M1 machine myself...

@Grrrolf
Copy link
Author

Grrrolf commented May 9, 2021

So far so good!
It now ends without any errors.

It gives a nice clean and working binary:
bash-3.2$ file artifacts/SIDFactoryII
artifacts/SIDFactoryII: Mach-O 64-bit executable arm64

There are still some (for me minor) issues (likely better to address when you have an Apple Silicon mac yourself), but so far so good!! Also, I don't hink the idea is to run the binary itself instead of using an .app, I guess ;-) Good enough for me to start learning this editor anyway!

Thank you very much!

@micheldebree
Copy link
Collaborator

micheldebree commented May 10, 2021

Great :)
The executable from the macos is not meant to be run by itself, because it needs to find its resources (config.ini, colorschemes, default driver to load etc.), which are in different locations inside an App bundle.

You can do make app to build the App bundle, or make raw to build a raw version of the DMG that is distributed.

You should also be able to build and run the linux version from the Makefile in the root of the project. This standalone executable expects the resources to be present in the same folder as the executable.
Better run make clean before compiling when switching macOS and linux builds by the way.

P.S. the linux style build needs sdl2 to be installed "linux style" to build and run (brew install sdl2)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants