-
Notifications
You must be signed in to change notification settings - Fork 257
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
Update linkage_arm64.S #831
base: master
Are you sure you want to change the base?
Conversation
Add support for underscores in symbol names. This is based off of my work on OpenEmu/Mupen64Plus-Core@decfb5d and OpenEmu/Mupen64Plus-Core@7c5a3eb This is needed for Darwin/macOS and, I believe, Windows. (To get it to compile on Mac, you will need to use gas-preprocessor, but the current version doesn't like the adrp/add used by this file.)
Thanks, I suspect we need to update the |
I have Apple systems, but no M1 or anything with an ARM CPU. |
Even with these patches, I can't get Mupen64 running on M1 under OpenEmu. |
So I was pointed to this PR by @Jj0YzL5nvJ and I can say that it helps proceed further along the compilation process, however it's far from a finished PR based what I've tried to do. So on my m1 mac, I ran make -C ./projects/unix NEW_DYNAREC=1 ARCH_DETECTED=64BITS CPU=ARM OS=OSX PLUGINDIR= SHAREDIR= BINDIR= MANDIR= LIBDIR= APPSDIR= ICONSDIR=icons all Now I know this is rather behind current git head, but the ouput I got was this https://gist.github.com/ZachBacon/5c4d4997eb665ec840e080da6d829ce9 |
Try with:
And build with And post your P.S: What assembler compiler are you using for ARM64? |
I'm using the default of whatever comes with the commandline tools within macOS for assembly |
OSX + ARM64 is out of the scope... the current Makefile is useless for OSX on ARM64. Replace: Erase:
And add:
|
still no dice. Same error as I posted above for this branch and same error for git master that I posted in the issue's repo which was this.
|
Are you running the assembly file through gas-preprocessor? |
by gas, you mean as? Then yes. |
gas-preprocessor, as in https://github.com/libav/gas-preprocessor/blob/master/gas-preprocessor.pl |
so basically you want me to adapt a step that's not in the makefile to bypass the issue... in order to get it linked with asm support. |
Yep. |
https://wiki.libav.org/Tools/gas-preprocessor
|
so at this point /if/ it's known to work with this pr, shouldn't it be integrated specifically for the MacOS m1 silicon chips? To have the makefile do the work instead of manual intervention? |
It will first be necessary to know the changes that lead to a successful compilation that works without errors... |
took me a little bit to get back to this due to work, and perhaps I am not understanding what is expected of me, and I do apologize for that. But I'm still being brought back to square one with this. So what I did first was this make OS=OSX ARCH=arm64 ARCH_DETECTED=64BITS AS="./gas-preprocessor.pl -arch aarch64 -as-type clang -- clang -arch arm64" all which got me back to hitting my original issue of
but then I thought of trying to build the file outside of the makefile by using that perl script that I was linked to. And I still got nothing but errors. https://gist.github.com/ZachBacon/a8db9d70f8fdb1263aea99ed92731346 |
Without a developer who implements the platform support, this will never be fixed. Something like:
Obviously you would have to add the script to tools folder for my example. Try with:
|
well, it's we are trying to figure this out, so that it can be implemented on this m1 platform, I'll give it a go and hope for the best. |
I have opened #908 which as-is works but with |
Tried getting these changes up to date with master and messing with gas-preprocessor and the Makefile, but I'm still getting a an unknown-directive error. If anybody wants to take a look at my changes, I have them in https://github.com/keegandent/mupen64plus-core/tree/apple-silicon-asm I have access to an M1 via MacInCloud if anyone without access to a testbed would like to schedule some collaboration time. |
I, too, got unknown-directive errors. I just ended up manually fixing the end-result. I think it's a limitation of |
What do you mean by “manually fixing”? Is there a way we can ship this manual adjustment or produce it programmatically? We could add that to the relevant section of the makefile if so. |
I can't remember what I did to make gas-preprocessor to output the preprocessed assembly, but the closest I've got to a proper command line is |
Ah, now I remember: the environment variable "GASPP_DEBUG", which writes the preprocessed source to |
This is what I get out of that
Let me know if there's anything else I should try. I'm beginning to wonder if we shouldn't benchmark performance with |
Try with: Libav variant is old... |
Tried this, same issue. I'm editing my previous with a more verbose output. |
If we examine the libretro implementation, |
Tried with a ton of different compiler arguments from that libretro example, but no dice. Even for their iOS-64 implementation, it seems they go with NO_ASM. I think that's a pretty good indication this has a slim hope of working. I'll leave what I have in https://github.com/keegandent/mupen64plus-core/tree/apple-silicon-asm in case somebody else wants to take a crack at it. |
I got everything to compile fine (using the new dynarec) on an Apple M2 machine but it failed to run properly, generating continuous SIGILLs. One thought I had was the memory page size, I've seen this cause other emulator projects using mmap / dynamic recompiling to have issues. The default page size on Apple Silicon machines seems to be 16KB rather than the normal 4KB on most platforms. It also is 16KB on the default Raspbian Linux distro recommended for the Raspeberry Pi 5. I noticed hard coded |
No, I think this is just a coincidence. The new dynarec code uses 4k memory buffers in many places because the r4300 CPU which is being emulated uses 4k pages. But this has nothing to do with the page size of the underlying CPU running the emulator. |
Add support for underscores in symbol names.
This is based off of my work on OpenEmu/Mupen64Plus-Core@decfb5d and OpenEmu/Mupen64Plus-Core@7c5a3eb
This is needed for Darwin/macOS and, I believe, Windows. (To get it to compile on Mac, you will need to use gas-preprocessor, but the current version doesn't like the adrp/add used by this file.)
To enable, pass
-DLEADING_UNDERSCORE
to the compiler/preprocessor/assembler.