-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
[Android] Building fails with Android NDK r22 on OSX? #55412
Comments
Tagging subscribers to this area: @Anipik, @safern, @ViktorHofer Issue Details
Expected: Build succeeds Actual:
Build fails while linking Note that it's Xcode's linker that is complaining. So something about the toolchain detection is not picking up the linker from the NDK and falling back to whatever it finds on the PATH. Possibly see #51876 which attempted to support r22 apparently did not get everything. I have this in
Have not tried the latest r22b 22.1.7171670 at this time.
|
Tagging subscribers to this area: @directhex Issue Details
Expected: Build succeeds Actual:
Build fails while linking Note that it's Xcode's linker that is complaining. So something about the toolchain detection is not picking up the linker from the NDK and falling back to whatever it finds on the PATH. Possibly see #51876 which attempted to support r22 apparently did not get everything. I have this in
Have not tried the latest r22b 22.1.7171670 at this time.
|
I tried it on BigSur 11.2.3 using the
|
@grendello Do you happen to know how to address this issue? |
@MaximLipnin r22 moved stuff around. Also, if the build uses generated toolchains, they won't work. Build must use the toolchain found in |
@grendello The weird thing is that the build of libmono works, but System.Native ends up using Xcode's ranlib. And they both use the android.toolchain.cmake file - here's System.Native, I think -
|
huh, that IS weird |
In some cases, CMAKE_CXX_COMPILER_ID might not be populated, which causes the toolchaine prefix checks to be ignored, which causes the build to look for `ranlib` not `llvm-ranlib`, which causes it to use XCode ranlib instead of Android NDK ranlib for builds, which doesn't work. Hopefully (we'll see what CI says) this doesn't regress other builds. Closes: dotnet#55412
PR to fix this is linked above. r23 patch (tested on Linux and macOS):
|
* Check for CMAKE_C_COMPILER_ID not CXX In some cases, CMAKE_CXX_COMPILER_ID might not be populated, which causes the toolchaine prefix checks to be ignored, which causes the build to look for `ranlib` not `llvm-ranlib`, which causes it to use XCode ranlib instead of Android NDK ranlib for builds, which doesn't work. Hopefully (we'll see what CI says) this doesn't regress other builds. Closes: #55412 * Update eng/native/configuretools.cmake Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com> * Use llvm-objcopy, not GNU, on Android It's available in r21 (which we use today) and works for r23 (which has no GNU objcopy any more and breaks without this change) Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
export ANDROID_NDK_ROOT=/path/to/android-ndk-r22 ./build.sh --os android --arch x64 -c Release
Expected:
Build succeeds
Actual:
Build fails while linking
libSystem.Native.a
with:Note that it's Xcode's linker that is complaining. So something about the toolchain detection is not picking up the linker from the NDK and falling back to whatever it finds on the PATH.
Possibly see #51876 which attempted to support r22 apparently did not get everything.
I have this in
ndk/source.properties
Have not tried the latest r22b 22.1.7171670 at this time.
The text was updated successfully, but these errors were encountered: