Question

An error occurs when compiling cocos2d-iphone v2.x and including arm64 architecture. The error is in the assembly code for kazmath. Is there a fix for this? (other than removing arm64)

libs/kazmath/src/neon_matrix_impl.c:

Unknown register name 'q0' in asm

Well, maybe no big deal... would be nice to support iPhone 5s etc fully with existing code. I guess this is fixed or will be fixed in the cocos2d 3.x line. https://github.com/cocos2d/cocos2d-iphone/issues/534

Was it helpful?

Solution 3

Cocos2D 2.2 now has 64 bit support!

You can download version 2.2 form here.

OTHER TIPS

Correct, cocos2d-iphone v3 does build successfully for the arm64 architecture, v2.x does not.

Even though the compiler warnings/errors are relatively easy to fix, there are a number of 64-bit compatibility issues that remain in v2.x (like CGFloat vs float mismatches and others) which means it's not recommended to enable arm64 builds for v2.x unless you're prepared to debug and fix these issues yourself. More so if you use 3rd party extensions which haven't been tested with arm64 either, for example anything in the cocos2d-iphone-extensions project.

Since currently no one is assigned to work on the v2.x branch and I don't expect v2.x to receive any future updates at all it's probably best to not include arm64 code (not much to gain anyway). Then start your next project with cocos2d-iphone v3.

I also had this problem in my one of old projects with Cocos2d.

I've downloaded Cocos2d v3, and copied the "kazmath" folder only to my older project, and replaced them.

If you don't want to change all the files, change :

#if defined(__ARM_NEON__)

into

#if defined(_ARM_ARCH_7)

By the way, I'm trying to update fully to the Cocos2d v3, and I think that is the right solution for this. even though my problem is handled, it is still problematic in general.

Upgrade your karmath library with cocos2D v3 kazmath lib (https://github.com/cocos2d/cocos2d-iphone/tree/develop-v3/external/kazmath).

It works for me (on iPad Air)

I solved in this way:

  1. Downloading Cocos2D 2.2 here as suggested by @appzYourLife
  2. Replaced folders cocos2d and CocosDenshion inside xcode project folder with folders of version 2.2
  3. In folder kazmath/src edit mad4.c and neon_matrix_impl.c and replace line:
#if defined(__ARM_NEON__)

with

#if defined(_ARM_ARCH_7)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top