libretro / Dinothawr

Dinothawr is a block pushing puzzle game on slippery surfaces. Our hero is a dinosaur whose friends are trapped in ice. Through puzzles it is your task to free the dinos from their ice prison.
Other
11 stars 13 forks source link

Builds on iOS9, but not iOS10/11 (arm64) #16

Closed jet082 closed 5 years ago

jet082 commented 5 years ago

See title.

Error is:

cc -arch arm64 -marm -miphoneos-version-min=8.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.4.sdk -O2 -DNDEBUG -DHAVE_ZLIB -ffast-math -fPIC -I./deps -I./audio -I./deps/pugixml -I./deps/vorbis -I./deps/ogg -I./libretro-common/include -c -o libretro-common/audio/conversion/s16_to_float_neon.o libretro-common/audio/conversion/s16_to_float_neon.c
clang: warning: argument unused during compilation: '-mno-thumb' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-mno-thumb' [-Wunused-command-line-argument]
<inline asm>:3:3: error: unknown directive
  .arm
  ^
<inline asm>:7:3: error: unknown directive
  .arm
  ^
<inline asm>:12:18: error: unexpected floating point literal
   vmov.f32 q8, #16.0
                 ^
<inline asm>:13:18: error: unexpected floating point literal
   vmov.f32 q9, #0.5
                 ^
<inline asm>:14:4: error: unrecognized instruction mnemonic, did you mean: fmul, mul, pmul?
   vmul.f32 q8, q8, q8
   ^
<inline asm>:15:4: error: unrecognized instruction mnemonic, did you mean: fmul, mul, pmul?
   vmul.f32 q8, q8, q8
   ^
<inline asm>:16:4: error: unrecognized instruction mnemonic, did you mean: fmul, mul, pmul?
   vmul.f32 q8, q8, q9
   ^
<inline asm>:20:14: error: vector register expected
   vld1.f32 {q0-q1}, [r1]!
             ^
<inline asm>:22:4: error: unrecognized instruction mnemonic, did you mean: fmul, mul, pmul?
   vmul.f32 q0, q0, q8
   ^
<inline asm>:23:4: error: unrecognized instruction mnemonic, did you mean: fmul, mul, pmul?
   vmul.f32 q1, q1, q8
   ^
<inline asm>:25:4: error: unrecognized instruction mnemonic, did you mean: fcvt?
   vcvt.s32.f32 q0, q0
   ^
<inline asm>:26:4: error: unrecognized instruction mnemonic, did you mean: fcvt?
   vcvt.s32.f32 q1, q1
   ^
<inline asm>:28:4: error: unrecognized instruction mnemonic, did you mean: movn?
   vqmovn.s32 d4, q0
   ^
<inline asm>:29:4: error: unrecognized instruction mnemonic, did you mean: movn?
   vqmovn.s32 d5, q1
   ^
<inline asm>:31:14: error: vector register expected
   vst1.f32 {d4-d5}, [r0]!
             ^
<inline asm>:34:9: error: invalid operand for instruction
   subs r2, r2, #8
        ^
<inline asm>:37:4: error: unrecognized instruction mnemonic, did you mean: b, bl, br, tbx?
   bx lr
   ^
<inline asm>:3:3: error: unknown directive
  .arm
  ^
<inline asm>:717 errors generated.
:3: error: unknown directive
  .arm
  ^
<inline asm>:13:18: error: unexpected floating point literal
   vmov.f32 q8, #0.25
                 ^
<inline asm>:14:4: error: unrecognized instruction mnemonic, did you mean: fmul, mul, pmul?
   vmul.f32 q8, q8, q8
   ^
<inline asm>:15:4: error: unrecognized instruction mnemonic, did you mean: fmul, mul, pmul?
   vmul.f32 q8, q8, q8
   ^
<inline asm>:16:4: error: unrecognized instruction mnemonic, did you mean: fmul, mul, pmul?
   vmul.f32 q8, q8, q8
   ^
<inline asm>:17:4: error: unrecognized instruction mnemonic, did you mean: add, addp, adds, addv, fadd, madd?
   vadd.f32 q8, q8, q8
   ^
<inline asm>:20:14: error: vector register expected
   vld1.f32 {d6[0]}, [r3]
             ^
<inline asm>:21:23: error: unexpected token in argument list
   vmul.f32 q8, q8, d6[0]
                      ^
<inline asm>:25:14: error: vector register expected
   vld1.s16 {q0}, [r1]!
             ^
<inline asm>:28:4: error: unrecognized instruction mnemonic, did you mean: mov?
   vmovl.s16 q1, d0
   ^
<inline asm>:29:4: error: unrecognized instruction mnemonic, did you mean: mov?
   vmovl.s16 q2, d1
   ^
<inline asm>:32:4: error: unrecognized instruction mnemonic, did you mean: fcvt?
   vcvt.f32.s32 q1, q1
   ^
<inline asm>:33:4: error: unrecognized instruction mnemonic, did you mean: fcvt?
   vcvt.f32.s32 q2, q2
   ^
<inline asm>:35:4: error: unrecognized instruction mnemonic, did you mean: fmul, mul, pmul?
   vmul.f32 q1, q1, q8
   ^
make: *** [libretro-common/audio/conversion/float_to_s16_neon.o] Error 1
make: *** Waiting for unfinished jobs....
<inline asm>:36:4: error: unrecognized instruction mnemonic, did you mean: fmul, mul, pmul?
   vmul.f32 q2, q2, q8
   ^
<inline asm>:38:14: error: vector register expected
   vst1.f32 {q1-q2}, [r0]!
             ^
<inline asm>:41:9: error: invalid operand for instruction
   subs r2, r2, #8
        ^
<inline asm>:44:4: error: unrecognized instruction mnemonic, did you mean: b, bl, br, tbx?
   bx lr
   ^
19 errors generated.
jet082 commented 5 years ago

This is fixed by doing the following:

Add this to the Makefile

else ifeq ($(platform), ios-arm64)
        TARGET := $(TARGET_NAME)_libretro_ios.dylib
        APPLE := 1
        SHARED := -dynamiclib
        fpic := -fPIC
        ifeq ($(IOSSDK),)
                IOSSDK := $(shell xcodebuild -version -sdk iphoneos Path)
        endif
        CC = clang -arch arm64 -isysroot $(IOSSDK)
        CXX = clang++ -arch arm64 -isysroot $(IOSSDK)
        CC_AS = perl ./tools/gas-preprocessor.pl $(CC)
        CFLAGS += -DIOS

        CC     += -miphoneos-version-min=8.0
        CXX    += -miphoneos-version-min=8.0
        CC_AS  += -miphoneos-version-min=8.0
        CFLAGS += -miphoneos-version-min=8.0
        ARCH := arm64
        HAVE_NEON = 0
        use_cyclone = 0
        use_fame = 1
        use_drz80 = 0
        use_cz80 = 1
        use_sh2drc = 0
        use_svpdrc = 0

Replace all instances of #if defined(__ARM_NEON__) with #if defined(__ARM_NEON__) && false in libretro-common/audio/conversion/float_to_s16.c and libretro-dinothawr/libretro-common/audio/conversion/s16_to_float.c

RobLoach commented 5 years ago

Replace all instances of #if defined(ARM_NEON) with #if defined(ARM_NEON) && false

The && false seems questionable. Unsure what float_to_s16 is doing in this content, but it seems like the functionality may be needed for the audio.

jet082 commented 5 years ago

I have tested this on my iPad Pro and the game runs properly and sound works well.

jet082 commented 5 years ago

Fixed by https://github.com/libretro/Dinothawr/commit/022527e6e2889b98ef644f490c696514389ac00b