Skip to content

Commit 8ef7a6e

Browse files
authored
Bump NDK to r26 (#8213)
Changes: https://github.com/android/ndk/wiki/Changelog-r26#announcements NDK r26 has the following changes which are interesting to us: * libc++ has been updated. The NDK's libc++ now comes directly from our LLVM toolchain, so every future LLVM update is also a libc++ update. * Updated LLVM to clang-r487747c, based on LLVM 17 development The `libc++` update brings internal implementation changes, and as a result we no longer need to partially instantiate a couple of classes previously underlying the `vector<T>` and `basic_string<T>` implementations.
1 parent eb6397d commit 8ef7a6e

File tree

6 files changed

+13
-24
lines changed

6 files changed

+13
-24
lines changed

build-tools/xaprepare/xaprepare/ConfigAndData/BuildAndroidPlatforms.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ namespace Xamarin.Android.Prepare
55
{
66
class BuildAndroidPlatforms
77
{
8-
public const string AndroidNdkVersion = "25c";
9-
public const string AndroidNdkPkgRevision = "25.2.9519653";
8+
public const string AndroidNdkVersion = "26";
9+
public const string AndroidNdkPkgRevision = "26.0.10792818";
1010
public const int NdkMinimumAPI = 21;
11-
public const int NdkMinimumAPILegacy32 = 19;
11+
public const int NdkMinimumAPILegacy32 = 21;
1212

1313
public static readonly List<AndroidPlatform> AllPlatforms = new List<AndroidPlatform> {
1414
new AndroidPlatform (apiName: "", apiLevel: 1, platformID: "1"),

src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Tasks/NdkUtilTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public void TestNdkUtil ()
4141
Assert.IsTrue (ndk.ValidateNdkPlatform (arch, enableLLVM: false));
4242
Assert.AreEqual (0, errors.Count, "NdkTools.ValidateNdkPlatform should not have returned false.");
4343
int level = ndk.GetMinimumApiLevelFor (arch);
44-
int expected = 19;
44+
int expected = 21;
4545
Assert.AreEqual (expected, level, $"Min Api Level for {arch} should be {expected}.");
4646
var compilerNoQuotes = ndk.GetToolPath (NdkToolKind.CompilerC, arch, level);
4747
Assert.AreEqual (0, errors.Count, "NdkTools.GetToolPath should not have errored.");

src/monodroid/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,6 @@ if(ANDROID)
505505
${BIONIC_SOURCES_DIR}/cxa_guard.cc
506506
${SOURCES_DIR}/cxx-abi/string.cc
507507
${SOURCES_DIR}/cxx-abi/terminate.cc
508-
${SOURCES_DIR}/cxx-abi/vector.cc
509508
)
510509
endif()
511510
else()

src/monodroid/jni/cxx-abi/string.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
_LIBCPP_BEGIN_NAMESPACE_STD
99

10-
template class __attribute__ ((__visibility__("hidden"))) __basic_string_common<true>;
1110
template class __attribute__ ((__visibility__("hidden"))) basic_string<char>;
1211

1312
_LIBCPP_END_NAMESPACE_STD

src/monodroid/jni/cxx-abi/vector.cc

Lines changed: 0 additions & 12 deletions
This file was deleted.

tests/Mono.Android-Tests/jni/reuse-threads.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
#include <errno.h>
7676
#include <stdio.h>
7777
#include <stdlib.h>
78+
#include <string.h>
7879
#include <unistd.h>
7980
#include <pthread.h>
8081
#include <semaphore.h>
@@ -206,15 +207,17 @@ rt_invoke_callback_on_new_thread (CB cb)
206207
return 0;
207208
}
208209

210+
static int _register_retval = 0;
211+
209212
/* We return -2 for errors, because -1 is reserved for the pthreads PTHREAD_CANCELED special value, indicating that the
210213
* thread was canceled. */
211-
static int
214+
static void*
212215
_register_type_from_new_thread (void *data)
213216
{
214217
RegisterFromThreadContext *context = (RegisterFromThreadContext*)data;
215218

216219
if (context == NULL) {
217-
return -100;
220+
return (void*)(intptr_t)-100;
218221
}
219222

220223
JNIEnv *env = _get_env ("_register_type_from_new_thread");
@@ -227,7 +230,7 @@ _register_type_from_new_thread (void *data)
227230
(*env)->ExceptionClear (env);
228231
}
229232

230-
return -101;
233+
return (void*)(intptr_t)-101;
231234
}
232235

233236
int ret = 0;
@@ -286,7 +289,7 @@ _register_type_from_new_thread (void *data)
286289
cleanup:
287290
(*env)->PopLocalFrame (env, NULL);
288291

289-
return ret;
292+
return (void*)(intptr_t)ret;
290293
}
291294

292295
JNIEXPORT int JNICALL
@@ -312,10 +315,10 @@ rt_register_type_on_new_thread (const char *java_type_name, jobject class_loader
312315
return -201;
313316
}
314317

315-
if ((int)tr == -1 /* PTHREAD_CANCELED - not defined in bionic */) {
318+
if ((int)(intptr_t)tr == -1 /* PTHREAD_CANCELED - not defined in bionic */) {
316319
__android_log_print (ANDROID_LOG_INFO, "XA/RuntimeTest", "RegisterOnNewThread: worker thread was canceled");
317320
return -202;
318321
}
319322

320-
return (int)tr;
323+
return (int)(intptr_t)tr;
321324
}

0 commit comments

Comments
 (0)