SDL icon indicating copy to clipboard operation
SDL copied to clipboard

there a error compile android arm in mac

Open JXChuangLab opened this issue 1 year ago • 7 comments

jiaxing@jiaxingdeMacBook-Pro build-scripts % sudo ./androidbuildlibs.sh Password: [armeabi-v7a] Compile thumb : SDL2 <= SDL.c In file included from ./src/SDL.c:46: In file included from ./include/SDL.h:38: In file included from ./include/SDL_cpuinfo.h:111: In file included from /Users/jiaxing/Library/Android/sdk/ndk/16.1.4479499/toolchains/llvm/prebuilt/darwin-x86_64/lib64/clang/5.0.300080/include/immintrin.h:28: /Users/jiaxing/Library/Android/sdk/ndk/16.1.4479499/toolchains/llvm/prebuilt/darwin-x86_64/lib64/clang/5.0.300080/include/mmintrin.h:64:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size return (__m64)__builtin_ia32_vec_init_v2si(__i, 0); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

JXChuangLab avatar Jun 02 '23 05:06 JXChuangLab

i can succed compile android with sdl2.0.6 in my mac

JXChuangLab avatar Jun 02 '23 05:06 JXChuangLab

This looks like it tried to include an x86 header when compiling for ARM. I'll see if I can reproduce this today.

icculus avatar Jun 02 '23 12:06 icculus

i can succed compile android with sdl2.0.6 in my mac

Is this a typo or are you really building SDL 2.0.6?

If it isn't, please upgrade to a more recent version (2.26.5 is the latest released version).

madebr avatar Jun 02 '23 21:06 madebr

I think he was saying it definitely works with an older version, so it isn't that his ndk install is simply broken.

icculus avatar Jun 02 '23 21:06 icculus

I have to apply the patch below to get src/hidapi/android/hid.cpp to build with ndk 16.1.4479499. It uses bools, nullptr and in-class initialization of non-static data members.

But alas I can't reproduce OP's error. More recent ndk releases require a more recent APP_PLATFORM to avoid an error about log2.

--- a/Android.mk
+++ b/Android.mk
@@ -78,6 +78,8 @@ LOCAL_CFLAGS += \
 # Warnings we haven't fixed (yet)
 LOCAL_CFLAGS += -Wno-unused-parameter -Wno-sign-compare
 
+LOCAL_CXXFLAGS += -std=gnu++11
+
 LOCAL_LDLIBS := -ldl -lGLESv1_CM -lGLESv2 -lOpenSLES -llog -landroid
 
 LOCAL_LDFLAGS := -Wl,--no-undefined

madebr avatar Jun 02 '23 21:06 madebr

Oh, I wonder if he's using SDL headers configured for his development machine, and then trying to build android libraries after that, so it ends up in a bad state...?

icculus avatar Jun 02 '23 22:06 icculus

I'm moving this out of the 2.28 milestone. I was able to build with @madebr's patch as well, with a fresh download of the 16b toolchain, so I think this is a local configuration issue.

@madebr, I went ahead and pushed your patch, thanks!

slouken avatar Jun 04 '23 07:06 slouken

SDL 2.0 is now in maintenance mode, and all inactive issues are being closed. If this issue is impacting you, please feel free to reopen it with additional information.

slouken avatar Nov 08 '23 05:11 slouken