11

I'm using cocos2d-iphone (develop-v2) and xcode 5 and have this error when trying to archive my app: (and not when I compile it)

libs/kazmath/src/neon_matrix_impl.c:64:15:

error: unknown register name 'q0' in asm
         : "memory", "q0", "q1", "q2", "q3", "q8", "q9", "q10", "q11", "q12", "q13", "q14", "q15" //clobber
                     ^
libs/kazmath/src/neon_matrix_impl.c:93:15: error: unknown register name 'q0' in asm
         : "memory", "q0", "q1", "q8", "q9", "q10", "q11" //clobber
                     ^
2 errors generated.

How to fix that?

franck
  • 2,995
  • 3
  • 17
  • 28
  • Show the code you use to create the archive. – CodeSmile Oct 28 '13 at 12:54
  • I opened an issue here: http://code.google.com/p/cocos2d-iphone/issues/detail?id=1507&can=1&q=franck4321&colspec=ID%20Type%20Status%20Priority%20Milestone%20Component%20Owner%20Summary – franck Oct 31 '13 at 07:08

3 Answers3

36

I had to replace:

#if defined(__ARM_NEON__)

by:

#if defined(_ARM_ARCH_7)

in the file neon_matrix_impl.c.

the
  • 21,007
  • 11
  • 68
  • 101
franck
  • 2,995
  • 3
  • 17
  • 28
  • update: maybe it's less clumsy to fix it in mat4.c and simply remove the ifdef and code that triggers the call to NEON_Matrix4Mul. in the kmMat4Multiply function – franck Apr 04 '14 at 12:44
  • This saved me! I was looking for a solution for this for almost a month now! – Mihai Fratu Apr 11 '14 at 10:47
  • 8
    You have to change ARM_NEON to ARMARCH_7 in two files , neon_matrix_impl.c and mat4.c . 64-bit should work fine after that. – suku Oct 17 '14 at 10:23
9

This is the error in kazmath if you just change in neon_matrix_impl.c only

Undefined symbols for architecture arm64:  
  "_NEON_Matrix4Mul", referenced from:  
      _kmMat4Multiply in libcocos2d-library.a(mat4.o)  
ld: symbol(s) not found for architecture arm64  
clang: error: linker command failed with exit code 1 (use -v to see invocation)

You have to change ARM_NEON to ARMARCH_7 in two files:

  1. neon_matrix_impl.c
  2. mat4.c

In both files search for the #if and replace it.

#if defined(__ARM_NEON__)

With

#if defined(_ARM_ARCH_7)

64-bit should work fine after that.

Paul Solt
  • 8,375
  • 5
  • 41
  • 46
suku
  • 217
  • 3
  • 13
3

#if defined(_ARM_ARCH_7) compiles with cocos2D v2.1, but does link errors (on iPad Air).

I've upgraded my karmath library with cocos2D v3 kazmath lib (https://github.com/cocos2d/cocos2d-iphone/tree/develop-v3/external/kazmath).

It works for me.

David DUTOUR
  • 151
  • 1
  • 3
  • 7