-
Notifications
You must be signed in to change notification settings - Fork 440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error: unknown target CPU 'armv7-a' #1
Comments
I have clang selected by default: /Users/User/android-ndk-r8e/toolchains/llvm-3.1/prebuilt/darwin-x86/bin/clang -fexceptions -Wno-psabi --sysroot=/Users/User/android-ndk-r8e/platforms/android-8/arch-arm -fpic -funwind-tables -finline-limit=64 -fsigned-char -no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -fdata-sections -ffunction-sections -Wa,--noexecstack -isystem /Users/User/android-ndk-r8e/platforms/android-8/arch-arm/usr/include -isystem /Users/User/android-ndk-r8e/sources/cxx-stl/gnu-libstdc++/4.6/include -isystem /Users/User/android-ndk-r8e/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi-v7a/include -o CMakeFiles/libzip.dir/lib/mkstemp.c.o -c mkstemp.c |
@shaders, thanks for the report! At the moment toolchain requires |
Hi! I've got the same error with clang 3.3 and your toolchain :( |
The compiler needs a triplet, and there is code in there to set the triplet to get the proper CPU. Take a look at android.toolchain.cmake and look for the section where it talks about the ANDROID_ABI variable. You need to set this when you are running cmake. For example: "cmake -DCMAKE_TOOLCHAIN_FILE=$ANDTOOLCHAIN -DANDROID_TOOLCHAIN_NAME=$ANDROID_TOOLCHAIN_NAME -DANDROID_ABI=armeabi-v7a .." Here is a link: https://github.com/taka-no-me/android-cmake/blob/5db45cfb87fec180b74963d3680dd60d4d8d8c3a/android.toolchain.cmake#l74-91 |
Or as taka suggested, add -DCMAKE_BUILD_TYPE=Release|Debug and this will set the triplet as well |
Thanks, but I already tried that... here's the complete list of relevant cmake options:
I ended up compiling a standalone toolchain which worked (yay!) with this cmake toolchain (using That's the clang instance being called: |
This worked for me: cmake -DCMAKE_TOOLCHAIN_FILE=$ANDTOOLCHAIN -DANDROID_TOOLCHAIN_NAME=$ANDROID_TOOLCHAIN_NAME -DANDROID_ABI="armeabi-v7a with NEON" -DCMAKE_BUILD_TYPE=Release .. |
Thanks! That's weird, it looks exactly the same.. Do you have the same clang instance being called? ( |
Make sure to specify -target armv7-none-linux-androideabi |
Calling clang from this folder I feel that something is really wrong.. |
This is getting a bit off topic. But you would learn a lot by running ndk-build V=1 on one of the sample projects. You will see all of the options that need to be passed in. Of particular importance are compiling with -fPIC and using the proper gcc toolchain. Pretty much just look at the output of ndk-build and see what it's doing then adapt to your files. |
Ok, I'll take a look at that, thanks a lot! |
This problem should be gone with the latest update. |
Add support for libc++, the LLVM C++ Standard Library.
Hi,
I have a very simple script:
export ANDROID_NDK=
/android-ndk-r8e/android-cmake/android.toolchain.cmakecmake -DCMAKE_TOOLCHAIN_FILE=
everything works fine at this point but trying to run make I always receive the same error:
error: unknown target CPU 'armv7-a'
I have tried different toolchains using ANDROID_TOOLCHAIN_NAME, but the error is always the same.
Any ideas what could be wrong?
Thanks!
The text was updated successfully, but these errors were encountered: