-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
CMake C compiler ABI detection fails with GCC #6960
Comments
Until we have a proper fix you can edit
with
(change |
Not sure if I understand the cmake modules. Reading the errors, I started with the first error, first file mentioned,
The thing is, I don't understand yet why This calls ( Also looked in Hard coded value might work-around, but it bugs me not understanding how Clang works, seemingly bypassing the search for arch abi. Maybe the GNU script is called in error or something? Seems like it shouldn't be called unless cross-compiling... Hmm, but There's a lot of extra NDK related code in the Clang module vs the GNU module. Not sure yet what it all does. Edit: Basically, I just copy/pasted |
The solution is very simple, Android-Clang.cmake currently does nothing in Termux. I didn't bother adding that for Android-GNU as neither Termux or the NDK use gcc, feel free to add it yourself and submit a patch. |
@buttaface
Exit early, and so no include any Platform/Android/abi--.cmake files, is that the idea? Will submit a patch soon. |
This comment has been minimized.
This comment has been minimized.
In Android-Clang.cmake
so in Android-GNU.cmake
|
Yep, that's all that's needed, feel free to submit a pull. |
Problem description
Trying to get cmake to use
gcc
rather thanclang
fails withPlatform/Android/abi--GNU can't be found
, due to empty${CMAKE_ANDROID_ARCH_ABI}
.Steps to reproduce
usr/bin/gcc
to link togcc-10
rather thanclang-12
.setup-parchforgcc
script from its-pontless.hello-world
project dir, withsrc/hello-world.c
andsrc/CMakeLists.txt
files.CC=gcc ...
or... -DCMAKE_C_COMPILER=/full/path/to/gcc
, same fail result.Android-GNU.cmake
sayingPlatform/Android/abi--GNU
can't be found.${CMAKE_ANDROID_ARCH_ABI}
empty when trying to specifygcc
.clang
with either method builds the build system.Not sure of root cause at this point. Seeking clarification.
Expected behavior
Expect to be able to freely switch between gcc, clang, or any other compiler.
Additional information
Create project:
Build:
Output:
The text was updated successfully, but these errors were encountered: