Can't run cocos2d-x on M1 Chip

I am aware that X86_64 should work but I don’t know if it’s full proof at this point. @R101 what do you think?

The x86_64 runs fine on the M1 Mac via Rosetta, and my main concern was regarding enabling Rosetta; I don’t know if it can be enabled automatically on installation, or the end-user needs to turn it on manually for the specific binary (I don’t think it can be enabled system-wide, but I could be wrong).

In terms of performance, running x86_64 on the ARM hardware seems to be equivalent to running on the native x86_64 hardware, but I can’t give you specific numbers.

Ideally there should be arm64 native binaries though……to avoid Rosetta entirely.

@pinky2012 Hi! i was working on this issue today (m1 build) compiling the libraries but i cant seem to find glsl_optimizer anywhere, any ideas?

Sorry, can’t help you there. My project does not use that library ( I guess you are at Cocos 4.0?). Seems the sources are available though, so you could try to compile it for ARM yourself.

https://github.com/cocos2d/glsl-optimizer

thanks a lot guys!

Hi all, I got in the same issues when trying to build cocos for Mac. I compiled most dependencies for M1. I can build cocos2dx with or without Lua using directly cmake, and it is available on my GitHub.

https://github.com/papatr0x/cocos2d-x/tree/v4-with-m1-deps

Just to be sure, for iOS, this arm64 libs I did build for Mac are not compatible and I need to rebuild a new set of libs for iOS even when Mac and iOS are both arm64. is that correct?

1 Like

@papalma your repo can run cocos native Apple M1 without Rosetta right?

yes it does

made this a year ago. you can check it out.

I was just looking for this. Thanks @bilalmirza!

Hi @bilalmirza,

In order to build “my” cocos2dx (= 3.15.1) silicon versions of the following libraries are needed:
tiff
chipmunk
curl
which you have not ported to silicon in your repository.

“Your” version is 3.17.1. Does it mean that this version does not need tiff, chipmunk and curl anymore? I am asking to understand if I need to migrate to 3.17.1 or if you maybe do not use those libraries at all…

i dont think 3.15.1 should change anything. You also might be able to find these libraries in cocos creator repo.