Advertisement

M1 Apple Progress

Started by November 01, 2022 05:30 PM
10 comments, last by WitchLord 1 year, 10 months ago

It looks like there has been some progress supporting M1 processors on apple. See this commit:

https://github.com/codecat/angelscript-mirror/commit/c933a516cecf688fbec0df92c176616ace6dd327

However, the file referenced in that commit, ‘as_callfunc_arm64_xcode.S’ has not been added to the source tree.

I made a GitHub issue report, but it was suggested I post here instead.

Thanks,

Rob

That's my mistake. David Carlier sent me the patch that changed the cmake project to refer to that file and I didn't notice that he changed to refer to this non-existing file.

I've reached out to David to check if he can send me the file. When he does I'll have it checked in. In the meantime I'll probably need to revert his patch.

Regards,
Andreas

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Advertisement

No worries, I figured it was a simple slipup like this.

It is only in WIP – for an architecture that isn't supported yet. David will probably come through soon. I wouldn't worry about reverting it unless you're ready to roll another release. Since you just did one, I think you're fine.

Thanks for everything.

Rob

David sent the file, which I've now checked in under revision 2806.

It's probably not fully working, but should at least compile on Apple M1.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

@WitchLord Thanks for the heads up. I'll give it a try and cross my fingers.

Sorry this has taken forever for me to get back to.

I just pulled down Version 2.36.1 WIP - 2023/01/15 and tried building the tests.

The new assembly *.S file appears to build and link fine. However, it seems to me that there should be a bunch of accompanying as_config.h changes to not set AS_MAX_PORTABILITY for the M1 platform.

From what I can tell, the only things that have from David is a change to the CMake file to build the *.S and now the *.S file itself.

Do you know if David has a more extensive set of changes – or perhaps he is expecting this to still be a DIY contribution.

Advertisement

I think David didn't do much on getting it to actually work, only to make it compile. Now comes the part where the code needs to be adjusted to actually work on M1.

If you wish to give it a try, the test_feature project has several tests designed to incrementally test the native calling convention, starting from simple functions without arguments, then adding primitive arguments, then finally building up to virtual class methods with complex objects as arguments. Look in the main.cpp file, the tests designed for the native calling conventions are grouped at the end of the main function. If you can get just the first test working, to call a native C function without arguments, it would be a step in the right direction.

Unfortunately I do not have access to an M1 environment to test on, otherwise I would gladly do this myself (well, if I could find the time for it).

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Thanks for the clarification on David's progress – I had assumed he had some local application working to some level.

Unfortunately, I'm afraid going down this rabbit hole is beyond my skills – and beyond my current scope of work. Everything works so great with Rosetta, getting AngelScript to run natively (so my program can be fully native) is just a personal project – which is why it took three months for me to actually try the last code drop.

Would you be interested in a refurbed M1 MacBook Air?

It's not really that difficult, but I understand that you don't have the time for it.

If you're donating the MacBook I would definitely be interested. Can you send it to Brazil? ?

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

I'm not sure. My plan was to go to apple.com, enter your address and my credit card number and have it sent directly to you. I don't know if there are reasons that would not work.

This topic is closed to new replies.

Advertisement