Sync up to v222
This commit is contained in:
@@ -1,39 +0,0 @@
|
||||
From efbdeeea6ac6ac7e6a33ba9034d0d26a2da2c92e Mon Sep 17 00:00:00 2001
|
||||
From: Danny Baumann <dannybaumann@web.de>
|
||||
Date: Wed, 29 Aug 2018 11:21:52 +0200
|
||||
Subject: [PATCH 1/6] Implement per-process target SDK version override.
|
||||
|
||||
Change-Id: I65bbdbe96541d8aacdd4de125cdb9c1435129413
|
||||
|
||||
This is only partial cherry-pick. Value won't be set via Android.bp
|
||||
---
|
||||
linker/linker.cpp | 13 ++++++++++++-
|
||||
1 file changed, 12 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/linker/linker.cpp b/linker/linker.cpp
|
||||
index b59df7302..ccdb131ca 100644
|
||||
--- a/linker/linker.cpp
|
||||
+++ b/linker/linker.cpp
|
||||
@@ -4217,7 +4217,18 @@ std::vector<android_namespace_t*> init_default_namespaces(const char* executable
|
||||
// somain and ld_preloads are added to these namespaces after LD_PRELOAD libs are linked
|
||||
}
|
||||
|
||||
- set_application_target_sdk_version(config->target_sdk_version());
|
||||
+ uint32_t target_sdk = config->target_sdk_version();
|
||||
+#ifdef SDK_VERSION_OVERRIDES
|
||||
+ for (const auto& entry : android::base::Split(SDK_VERSION_OVERRIDES, " ")) {
|
||||
+ auto splitted = android::base::Split(entry, "=");
|
||||
+ if (splitted.size() == 2 && splitted[0] == executable_path) {
|
||||
+ target_sdk = static_cast<uint32_t>(std::stoul(splitted[1]));
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ DEBUG("Target SDK for %s = %d", executable_path, target_sdk);
|
||||
+#endif
|
||||
+ set_application_target_sdk_version(target_sdk);
|
||||
|
||||
std::vector<android_namespace_t*> created_namespaces;
|
||||
created_namespaces.reserve(namespaces.size());
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
From 13acd597e0dd22c5fa462007b20fe4f2398db297 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Thu, 12 Sep 2019 13:00:55 +0200
|
||||
Subject: [PATCH 6/6] fixup! Actually restore pre-P mutex behavior
|
||||
|
||||
---
|
||||
libc/bionic/pthread_mutex.cpp | 8 +-------
|
||||
1 file changed, 1 insertion(+), 7 deletions(-)
|
||||
|
||||
diff --git a/libc/bionic/pthread_mutex.cpp b/libc/bionic/pthread_mutex.cpp
|
||||
index 969feb43c..bd9fabdb6 100644
|
||||
--- a/libc/bionic/pthread_mutex.cpp
|
||||
+++ b/libc/bionic/pthread_mutex.cpp
|
||||
@@ -528,7 +528,7 @@ int pthread_mutex_init(pthread_mutex_t* mutex_interface, const pthread_mutexattr
|
||||
}
|
||||
|
||||
if (((*attr & MUTEXATTR_PROTOCOL_MASK) >> MUTEXATTR_PROTOCOL_SHIFT) == PTHREAD_PRIO_INHERIT
|
||||
- && bionic_get_application_target_sdk_version() >= __ANDROID_API_P__) {
|
||||
+ && android_get_application_target_sdk_version() >= __ANDROID_API_P__) {
|
||||
#if !defined(__LP64__)
|
||||
if (state & MUTEX_SHARED_MASK) {
|
||||
return EINVAL;
|
||||
@@ -798,12 +798,6 @@ static int __attribute__((noinline)) HandleUsingDestroyedMutex(pthread_mutex_t*
|
||||
return EBUSY;
|
||||
}
|
||||
|
||||
-static int __always_inline HandleUsingDestroyedMutex(pthread_mutex_t* mutex,
|
||||
- const char* function_name) {
|
||||
- __fortify_fatal("%s called on a destroyed mutex (%p)", function_name, mutex);
|
||||
- return EBUSY;
|
||||
-}
|
||||
-
|
||||
int pthread_mutex_lock(pthread_mutex_t* mutex_interface) {
|
||||
#if !defined(__LP64__)
|
||||
// Some apps depend on being able to pass NULL as a mutex and get EINVAL
|
||||
--
|
||||
2.17.1
|
||||
|
||||
Reference in New Issue
Block a user