android-tools: update patch

This commit is contained in:
Leonid Pliushch 2021-05-03 18:01:40 +00:00
parent 46c77e5ab6
commit 29d6f0e06a
No known key found for this signature in database
GPG Key ID: 45F2964132545795
1 changed files with 214 additions and 289 deletions

View File

@ -1,8 +1,7 @@
diff --git a/vendor/CMakeLists.adb.txt b/vendor/CMakeLists.adb.txt
index 5206a80..3fe9b70 100644
--- a/vendor/CMakeLists.adb.txt
+++ b/vendor/CMakeLists.adb.txt
@@ -192,7 +192,6 @@ target_link_libraries(adb
diff -uNr android-tools-31.0.0p1/vendor/CMakeLists.adb.txt android-tools-31.0.0p1.mod/vendor/CMakeLists.adb.txt
--- android-tools-31.0.0p1/vendor/CMakeLists.adb.txt 2021-03-22 17:48:01.000000000 +0000
+++ android-tools-31.0.0p1.mod/vendor/CMakeLists.adb.txt 2021-05-03 17:56:53.036722882 +0000
@@ -192,7 +192,6 @@
brotlidec
brotlienc
lz4
@ -10,21 +9,19 @@ index 5206a80..3fe9b70 100644
usb-1.0
z
zstd)
diff --git a/vendor/CMakeLists.fastboot.txt b/vendor/CMakeLists.fastboot.txt
index 66cbd61..34d5e7f 100644
--- a/vendor/CMakeLists.fastboot.txt
+++ b/vendor/CMakeLists.fastboot.txt
@@ -133,4 +133,4 @@ target_compile_definitions(fastboot PRIVATE
diff -uNr android-tools-31.0.0p1/vendor/CMakeLists.fastboot.txt android-tools-31.0.0p1.mod/vendor/CMakeLists.fastboot.txt
--- android-tools-31.0.0p1/vendor/CMakeLists.fastboot.txt 2021-03-22 17:48:01.000000000 +0000
+++ android-tools-31.0.0p1.mod/vendor/CMakeLists.fastboot.txt 2021-05-03 17:56:53.036722882 +0000
@@ -133,4 +133,4 @@
target_link_libraries(fastboot
libsparse libzip libcutils liblog libfsmgr libutil
libbase libext4 libselinux libsepol libdiagnoseusb crypto
- z pcre2-8 pthread dl)
+ z pcre2-8 dl)
diff --git a/vendor/CMakeLists.mke2fs.txt b/vendor/CMakeLists.mke2fs.txt
index a8f89fd..d1cae40 100644
--- a/vendor/CMakeLists.mke2fs.txt
+++ b/vendor/CMakeLists.mke2fs.txt
@@ -112,6 +112,6 @@ add_executable("${ANDROID_MKE2FS_NAME}"
diff -uNr android-tools-31.0.0p1/vendor/CMakeLists.mke2fs.txt android-tools-31.0.0p1.mod/vendor/CMakeLists.mke2fs.txt
--- android-tools-31.0.0p1/vendor/CMakeLists.mke2fs.txt 2020-03-06 13:43:50.000000000 +0000
+++ android-tools-31.0.0p1.mod/vendor/CMakeLists.mke2fs.txt 2021-05-03 17:56:53.036722882 +0000
@@ -112,6 +112,6 @@
e2fsprogs/misc/util.c)
target_link_libraries("${ANDROID_MKE2FS_NAME}"
@ -32,36 +29,9 @@ index a8f89fd..d1cae40 100644
+ libext2fs libsparse libbase libzip liblog libutil z)
target_include_directories("${ANDROID_MKE2FS_NAME}" PRIVATE
e2fsprogs/lib)
diff --git a/vendor/base/libs/androidfw/ResourceTypes.cpp b/vendor/base/libs/androidfw/ResourceTypes.cpp
index dfb4009..e2a3862 100644
--- a/vendor/base/libs/androidfw/ResourceTypes.cpp
+++ b/vendor/base/libs/androidfw/ResourceTypes.cpp
@@ -41,7 +41,7 @@
#include <utils/String16.h>
#include <utils/String8.h>
-#ifdef __ANDROID__
+#if 0
#include <binder/TextOutput.h>
#endif
diff --git a/vendor/boringssl/crypto/CMakeLists.txt b/vendor/boringssl/crypto/CMakeLists.txt
index c6073d2..3552f42 100644
--- a/vendor/boringssl/crypto/CMakeLists.txt
+++ b/vendor/boringssl/crypto/CMakeLists.txt
@@ -161,7 +161,7 @@ perlasm(test/trampoline-x86_64.${ASM_EXT} test/asm/trampoline-x86_64.pl)
add_custom_command(
OUTPUT err_data.c
- COMMAND ${GO_EXECUTABLE} run err_data_generate.go > ${CMAKE_CURRENT_BINARY_DIR}/err_data.c
+ COMMAND GOOS=linux GOARCH=amd64 ${GO_EXECUTABLE} run err_data_generate.go > ${CMAKE_CURRENT_BINARY_DIR}/err_data.c
DEPENDS
err/err_data_generate.go
err/asn1.errordata
diff --git a/vendor/core/adb/pairing_auth/include/adb/pairing/pairing_auth.h b/vendor/core/adb/pairing_auth/include/adb/pairing/pairing_auth.h
index f6b7b2a..68116c0 100644
--- a/vendor/core/adb/pairing_auth/include/adb/pairing/pairing_auth.h
+++ b/vendor/core/adb/pairing_auth/include/adb/pairing/pairing_auth.h
diff -uNr android-tools-31.0.0p1/vendor/adb/pairing_auth/include/adb/pairing/pairing_auth.h android-tools-31.0.0p1.mod/vendor/adb/pairing_auth/include/adb/pairing/pairing_auth.h
--- android-tools-31.0.0p1/vendor/adb/pairing_auth/include/adb/pairing/pairing_auth.h 2021-04-14 15:24:51.000000000 +0000
+++ android-tools-31.0.0p1.mod/vendor/adb/pairing_auth/include/adb/pairing/pairing_auth.h 2021-05-03 17:56:53.036722882 +0000
@@ -26,7 +26,7 @@
#ifdef __cplusplus
extern "C" {
@ -71,10 +41,9 @@ index f6b7b2a..68116c0 100644
/**
* PairingAuthCtx is a wrapper around the SPAKE2 protocol + cipher initialization
diff --git a/vendor/core/adb/pairing_connection/include/adb/pairing/pairing_connection.h b/vendor/core/adb/pairing_connection/include/adb/pairing/pairing_connection.h
index ad34dc4..01dad0f 100644
--- a/vendor/core/adb/pairing_connection/include/adb/pairing/pairing_connection.h
+++ b/vendor/core/adb/pairing_connection/include/adb/pairing/pairing_connection.h
diff -uNr android-tools-31.0.0p1/vendor/adb/pairing_connection/include/adb/pairing/pairing_connection.h android-tools-31.0.0p1.mod/vendor/adb/pairing_connection/include/adb/pairing/pairing_connection.h
--- android-tools-31.0.0p1/vendor/adb/pairing_connection/include/adb/pairing/pairing_connection.h 2021-04-14 15:24:51.000000000 +0000
+++ android-tools-31.0.0p1.mod/vendor/adb/pairing_connection/include/adb/pairing/pairing_connection.h 2021-05-03 17:56:53.036722882 +0000
@@ -37,7 +37,7 @@
#ifdef __cplusplus
extern "C" {
@ -84,10 +53,9 @@ index ad34dc4..01dad0f 100644
const uint32_t kMaxPeerInfoSize = 8192;
struct PeerInfo {
diff --git a/vendor/core/adb/pairing_connection/include/adb/pairing/pairing_server.h b/vendor/core/adb/pairing_connection/include/adb/pairing/pairing_server.h
index 0a8d676..454a214 100644
--- a/vendor/core/adb/pairing_connection/include/adb/pairing/pairing_server.h
+++ b/vendor/core/adb/pairing_connection/include/adb/pairing/pairing_server.h
diff -uNr android-tools-31.0.0p1/vendor/adb/pairing_connection/include/adb/pairing/pairing_server.h android-tools-31.0.0p1.mod/vendor/adb/pairing_connection/include/adb/pairing/pairing_server.h
--- android-tools-31.0.0p1/vendor/adb/pairing_connection/include/adb/pairing/pairing_server.h 2021-04-14 15:24:51.000000000 +0000
+++ android-tools-31.0.0p1.mod/vendor/adb/pairing_connection/include/adb/pairing/pairing_server.h 2021-05-03 17:56:53.036722882 +0000
@@ -33,7 +33,7 @@
#ifdef __cplusplus
extern "C" {
@ -97,11 +65,10 @@ index 0a8d676..454a214 100644
// PairingServerCtx is a wrapper around the #PairingConnectionCtx APIs,
// which handles multiple client connections.
diff --git a/vendor/core/adb/sysdeps.h b/vendor/core/adb/sysdeps.h
index 298c06a..7d822f4 100644
--- a/vendor/core/adb/sysdeps.h
+++ b/vendor/core/adb/sysdeps.h
@@ -482,7 +482,11 @@ static inline int adb_gethostname(char* name, size_t len) {
diff -uNr android-tools-31.0.0p1/vendor/adb/sysdeps.h android-tools-31.0.0p1.mod/vendor/adb/sysdeps.h
--- android-tools-31.0.0p1/vendor/adb/sysdeps.h 2021-04-14 15:24:51.000000000 +0000
+++ android-tools-31.0.0p1.mod/vendor/adb/sysdeps.h 2021-05-03 17:56:53.036722882 +0000
@@ -482,7 +482,11 @@
}
static inline int adb_getlogin_r(char* buf, size_t bufsize) {
@ -114,10 +81,33 @@ index 298c06a..7d822f4 100644
}
static inline int adb_read(borrowed_fd fd, void* buf, size_t len) {
diff --git a/vendor/core/fs_mgr/liblp/utility.cpp b/vendor/core/fs_mgr/liblp/utility.cpp
index d8e171b..31b34a5 100644
--- a/vendor/core/fs_mgr/liblp/utility.cpp
+++ b/vendor/core/fs_mgr/liblp/utility.cpp
diff -uNr android-tools-31.0.0p1/vendor/base/libs/androidfw/ResourceTypes.cpp android-tools-31.0.0p1.mod/vendor/base/libs/androidfw/ResourceTypes.cpp
--- android-tools-31.0.0p1/vendor/base/libs/androidfw/ResourceTypes.cpp 2020-11-12 18:02:26.000000000 +0000
+++ android-tools-31.0.0p1.mod/vendor/base/libs/androidfw/ResourceTypes.cpp 2021-05-03 17:56:53.036722882 +0000
@@ -41,7 +41,7 @@
#include <utils/String16.h>
#include <utils/String8.h>
-#ifdef __ANDROID__
+#if 0
#include <binder/TextOutput.h>
#endif
diff -uNr android-tools-31.0.0p1/vendor/boringssl/crypto/CMakeLists.txt android-tools-31.0.0p1.mod/vendor/boringssl/crypto/CMakeLists.txt
--- android-tools-31.0.0p1/vendor/boringssl/crypto/CMakeLists.txt 2021-03-22 17:48:14.000000000 +0000
+++ android-tools-31.0.0p1.mod/vendor/boringssl/crypto/CMakeLists.txt 2021-05-03 17:56:53.036722882 +0000
@@ -167,7 +167,7 @@
add_custom_command(
OUTPUT err_data.c
- COMMAND ${GO_EXECUTABLE} run err_data_generate.go > ${CMAKE_CURRENT_BINARY_DIR}/err_data.c
+ COMMAND GOOS=linux GOARCH=amd64 ${GO_EXECUTABLE} run err_data_generate.go > ${CMAKE_CURRENT_BINARY_DIR}/err_data.c
DEPENDS
err/err_data_generate.go
err/asn1.errordata
diff -uNr android-tools-31.0.0p1/vendor/core/fs_mgr/liblp/utility.cpp android-tools-31.0.0p1.mod/vendor/core/fs_mgr/liblp/utility.cpp
--- android-tools-31.0.0p1/vendor/core/fs_mgr/liblp/utility.cpp 2020-12-20 20:06:59.000000000 +0000
+++ android-tools-31.0.0p1.mod/vendor/core/fs_mgr/liblp/utility.cpp 2021-05-03 17:56:53.040722882 +0000
@@ -34,7 +34,7 @@
#include <ext4_utils/ext4_utils.h>
#include <openssl/sha.h>
@ -127,7 +117,7 @@ index d8e171b..31b34a5 100644
#include <cutils/android_get_control_file.h>
#endif
@@ -208,7 +208,7 @@ bool SetBlockReadonly(int fd, bool readonly) {
@@ -208,7 +208,7 @@
}
base::unique_fd GetControlFileOrOpen(std::string_view path, int flags) {
@ -136,11 +126,10 @@ index d8e171b..31b34a5 100644
int fd = android_get_control_file(path.data());
if (fd >= 0) {
int newfd = TEMP_FAILURE_RETRY(dup(fd));
diff --git a/vendor/core/init/reboot.cpp b/vendor/core/init/reboot.cpp
index 1a7275f..85e0859 100644
--- a/vendor/core/init/reboot.cpp
+++ b/vendor/core/init/reboot.cpp
@@ -247,7 +247,7 @@ static bool FindPartitionsToUmount(std::vector<MountEntry>* block_dev_partitions
diff -uNr android-tools-31.0.0p1/vendor/core/init/reboot.cpp android-tools-31.0.0p1.mod/vendor/core/init/reboot.cpp
--- android-tools-31.0.0p1/vendor/core/init/reboot.cpp 2021-04-14 15:24:51.000000000 +0000
+++ android-tools-31.0.0p1.mod/vendor/core/init/reboot.cpp 2021-05-03 17:56:53.040722882 +0000
@@ -247,7 +247,7 @@
if (dump) {
LOG(INFO) << "mount entry " << mentry->mnt_fsname << ":" << mentry->mnt_dir << " opts "
<< mentry->mnt_opts << " type " << mentry->mnt_type;
@ -149,11 +138,10 @@ index 1a7275f..85e0859 100644
std::string mount_dir(mentry->mnt_dir);
// These are R/O partitions changed to R/W after adb remount.
// Do not umount them as shutdown critical services may rely on them.
diff --git a/vendor/core/libcutils/properties.cpp b/vendor/core/libcutils/properties.cpp
index 03f0496..11c4786 100644
--- a/vendor/core/libcutils/properties.cpp
+++ b/vendor/core/libcutils/properties.cpp
@@ -91,7 +91,7 @@ int property_get(const char* key, char* value, const char* default_value) {
diff -uNr android-tools-31.0.0p1/vendor/core/libcutils/properties.cpp android-tools-31.0.0p1.mod/vendor/core/libcutils/properties.cpp
--- android-tools-31.0.0p1/vendor/core/libcutils/properties.cpp 2020-12-20 20:06:59.000000000 +0000
+++ android-tools-31.0.0p1.mod/vendor/core/libcutils/properties.cpp 2021-05-03 17:56:53.040722882 +0000
@@ -91,7 +91,7 @@
return len;
}
@ -162,52 +150,165 @@ index 03f0496..11c4786 100644
#define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_
#include <sys/_system_properties.h>
diff --git a/vendor/core/libcutils/threads.cpp b/vendor/core/libcutils/threads.cpp
index d3c9af4..da28145 100644
--- a/vendor/core/libcutils/threads.cpp
+++ b/vendor/core/libcutils/threads.cpp
@@ -24,15 +24,13 @@
#include <sys/syscall.h>
#include <sys/time.h>
#include <unistd.h>
-#elif defined(__linux__) && !defined(__ANDROID__)
+#elif defined(__linux__)
#include <syscall.h>
#include <unistd.h>
diff -uNr android-tools-31.0.0p1/vendor/e2fsprogs/lib/ext2fs/ismounted.c android-tools-31.0.0p1.mod/vendor/e2fsprogs/lib/ext2fs/ismounted.c
--- android-tools-31.0.0p1/vendor/e2fsprogs/lib/ext2fs/ismounted.c 2019-08-21 17:14:14.000000000 +0000
+++ android-tools-31.0.0p1.mod/vendor/e2fsprogs/lib/ext2fs/ismounted.c 2021-05-03 17:56:53.044722882 +0000
@@ -196,7 +196,7 @@
#endif /* __GNU__ */
*mount_flags = EXT2_MF_MOUNTED;
-#ifdef MNTOPT_RO
+#if 0
/* Check to see if the ro option is set */
if (hasmntopt(mnt, MNTOPT_RO))
*mount_flags |= EXT2_MF_READONLY;
diff -uNr android-tools-31.0.0p1/vendor/f2fs-tools/lib/libf2fs.c android-tools-31.0.0p1.mod/vendor/f2fs-tools/lib/libf2fs.c
--- android-tools-31.0.0p1/vendor/f2fs-tools/lib/libf2fs.c 2020-12-20 12:53:55.000000000 +0000
+++ android-tools-31.0.0p1.mod/vendor/f2fs-tools/lib/libf2fs.c 2021-05-03 17:56:53.044722882 +0000
@@ -714,7 +714,7 @@
while ((mnt = getmntent(file)) != NULL) {
if (!strcmp(device, mnt->mnt_fsname)) {
-#ifdef MNTOPT_RO
+#if 0
if (hasmntopt(mnt, MNTOPT_RO))
c.ro = 1;
#endif
diff -uNr android-tools-31.0.0p1/vendor/libbase/include/android-base/unique_fd.h android-tools-31.0.0p1.mod/vendor/libbase/include/android-base/unique_fd.h
--- android-tools-31.0.0p1/vendor/libbase/include/android-base/unique_fd.h 2020-11-12 18:02:33.000000000 +0000
+++ android-tools-31.0.0p1.mod/vendor/libbase/include/android-base/unique_fd.h 2021-05-03 17:56:53.044722882 +0000
@@ -46,7 +46,7 @@
// unique_fd is also known as ScopedFd/ScopedFD/scoped_fd; mentioned here to help
// you find this class if you're searching for one of those names.
-#if defined(__BIONIC__)
+#if 0
#include <android/fdsan.h>
#endif
@@ -54,7 +54,7 @@
namespace base {
struct DefaultCloser {
-#if defined(__BIONIC__)
+#if 0
static void Tag(int fd, void* old_addr, void* new_addr) {
if (android_fdsan_exchange_owner_tag) {
uint64_t old_tag = android_fdsan_create_owner_tag(ANDROID_FDSAN_OWNER_TYPE_UNIQUE_FD,
diff -uNr android-tools-31.0.0p1/vendor/libbase/logging.cpp android-tools-31.0.0p1.mod/vendor/libbase/logging.cpp
--- android-tools-31.0.0p1/vendor/libbase/logging.cpp 2021-04-14 15:24:51.000000000 +0000
+++ android-tools-31.0.0p1.mod/vendor/libbase/logging.cpp 2021-05-03 17:56:53.044722882 +0000
@@ -65,11 +65,17 @@
namespace android {
namespace base {
+#if defined(__linux__)
+extern "C" {
+extern char* __progname;
+}
+#endif
+
// BSD-based systems like Android/macOS have getprogname(). Others need us to provide one.
#if defined(__linux__) || defined(_WIN32)
static const char* getprogname() {
#if defined(__linux__)
- return program_invocation_short_name;
+ return __progname;
#elif defined(_WIN32)
#include <windows.h>
#endif
static bool first = true;
static char progname[MAX_PATH] = {};
diff -uNr android-tools-31.0.0p1/vendor/libbase/properties.cpp android-tools-31.0.0p1.mod/vendor/libbase/properties.cpp
--- android-tools-31.0.0p1/vendor/libbase/properties.cpp 2020-11-12 18:02:33.000000000 +0000
+++ android-tools-31.0.0p1.mod/vendor/libbase/properties.cpp 2021-05-03 17:56:53.044722882 +0000
@@ -16,7 +16,7 @@
-// No definition needed for Android because we'll just pick up bionic's copy.
-#if !defined(__ANDROID__) || !defined(__GLIBC__) || __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 30)
pid_t gettid() {
#if defined(__APPLE__)
uint64_t tid;
@@ -44,7 +42,6 @@ pid_t gettid() {
return GetCurrentThreadId();
#endif
#include "android-base/properties.h"
-#if defined(__BIONIC__)
+#if 0
#define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_
#include <sys/system_properties.h>
#include <sys/_system_properties.h>
@@ -32,8 +32,6 @@
#include <android-base/parseint.h>
#include <android-base/strings.h>
-#if !defined(__BIONIC__)
-
#define PROP_VALUE_MAX 92
static std::map<std::string, std::string>& g_properties = *new std::map<std::string, std::string>;
@@ -63,8 +61,6 @@
return strlen(value);
}
-#endif // __ANDROID__
#if !defined(_WIN32)
-#endif
-
namespace android {
namespace base {
diff --git a/vendor/core/liblog/include/android/log.h b/vendor/core/liblog/include/android/log.h
index e80432e..b52be34 100644
--- a/vendor/core/liblog/include/android/log.h
+++ b/vendor/core/liblog/include/android/log.h
@@ -216,7 +216,7 @@ typedef void (*__android_logger_function)(const struct __android_log_message* lo
@@ -108,7 +104,7 @@
std::string GetProperty(const std::string& key, const std::string& default_value) {
std::string property_value;
-#if defined(__BIONIC__)
+#if 0
const prop_info* pi = __system_property_find(key.c_str());
if (pi == nullptr) return default_value;
@@ -134,7 +130,7 @@
return (__system_property_set(key.c_str(), value.c_str()) == 0);
}
-#if defined(__BIONIC__)
+#if 0
struct WaitForPropertyData {
bool done;
diff -uNr android-tools-31.0.0p1/vendor/libziparchive/zip_archive.cc android-tools-31.0.0p1.mod/vendor/libziparchive/zip_archive.cc
--- android-tools-31.0.0p1/vendor/libziparchive/zip_archive.cc 2020-11-12 18:02:33.000000000 +0000
+++ android-tools-31.0.0p1.mod/vendor/libziparchive/zip_archive.cc 2021-05-03 17:56:53.044722882 +0000
@@ -39,7 +39,9 @@
#define lseek64 lseek
#endif
-#if defined(__BIONIC__)
+#undef __ANDROID__
+
+#if 0
#include <android/fdsan.h>
#endif
@@ -88,7 +90,7 @@
* of the string length into the hash table entry.
*/
typedef void (*__android_aborter_function)(const char* abort_message);
-#if !defined(__ANDROID__) || __ANDROID_API__ >= 30
+#if 1
/**
* Writes the log message specified by log_message. log_message includes additional file name and
* line number information that a logger may use. log_message is versioned for backwards
diff --git a/vendor/core/liblog/logger_write.cpp b/vendor/core/liblog/logger_write.cpp
index 09802ff..93e1b91 100644
--- a/vendor/core/liblog/logger_write.cpp
+++ b/vendor/core/liblog/logger_write.cpp
-#if defined(__BIONIC__)
+#if 0
uint64_t GetOwnerTag(const ZipArchive* archive) {
return android_fdsan_create_owner_tag(ANDROID_FDSAN_OWNER_TYPE_ZIPARCHIVE,
reinterpret_cast<uint64_t>(archive));
@@ -102,7 +104,7 @@
central_directory(),
directory_map(),
num_entries(0) {
-#if defined(__BIONIC__)
+#if 0
if (assume_ownership) {
CHECK(mapped_zip.HasFd());
android_fdsan_exchange_owner_tag(mapped_zip.GetFileDescriptor(), 0, GetOwnerTag(this));
@@ -120,7 +122,7 @@
ZipArchive::~ZipArchive() {
if (close_file && mapped_zip.GetFileDescriptor() >= 0) {
-#if defined(__BIONIC__)
+#if 0
android_fdsan_close_with_tag(mapped_zip.GetFileDescriptor(), GetOwnerTag(this));
#else
close(mapped_zip.GetFileDescriptor());
diff -uNr android-tools-31.0.0p1/vendor/logging/liblog/logger_write.cpp android-tools-31.0.0p1.mod/vendor/logging/liblog/logger_write.cpp
--- android-tools-31.0.0p1/vendor/logging/liblog/logger_write.cpp 2021-04-14 15:24:52.000000000 +0000
+++ android-tools-31.0.0p1.mod/vendor/logging/liblog/logger_write.cpp 2021-05-03 17:56:53.044722882 +0000
@@ -39,6 +39,8 @@
#include "logger.h"
#include "uio.h"
@ -217,7 +318,7 @@ index 09802ff..93e1b91 100644
#ifdef __ANDROID__
#include "logd_writer.h"
#include "pmsg_writer.h"
@@ -108,31 +110,6 @@ void __android_log_close() {
@@ -108,31 +110,6 @@
#endif
}
@ -249,179 +350,3 @@ index 09802ff..93e1b91 100644
// It's possible for logging to happen during static initialization before our globals are
// initialized, so we place this std::string in a function such that it is initialized on the first
// call.
diff --git a/vendor/e2fsprogs/lib/ext2fs/ismounted.c b/vendor/e2fsprogs/lib/ext2fs/ismounted.c
index 6cd497d..dcdd4fd 100644
--- a/vendor/e2fsprogs/lib/ext2fs/ismounted.c
+++ b/vendor/e2fsprogs/lib/ext2fs/ismounted.c
@@ -196,7 +196,7 @@ static errcode_t check_mntent_file(const char *mtab_file, const char *file,
#endif /* __GNU__ */
*mount_flags = EXT2_MF_MOUNTED;
-#ifdef MNTOPT_RO
+#if 0
/* Check to see if the ro option is set */
if (hasmntopt(mnt, MNTOPT_RO))
*mount_flags |= EXT2_MF_READONLY;
diff --git a/vendor/f2fs-tools/lib/libf2fs.c b/vendor/f2fs-tools/lib/libf2fs.c
index 55fa391..cf2716c 100644
--- a/vendor/f2fs-tools/lib/libf2fs.c
+++ b/vendor/f2fs-tools/lib/libf2fs.c
@@ -714,7 +714,7 @@ static int is_mounted(const char *mpt, const char *device)
while ((mnt = getmntent(file)) != NULL) {
if (!strcmp(device, mnt->mnt_fsname)) {
-#ifdef MNTOPT_RO
+#if 0
if (hasmntopt(mnt, MNTOPT_RO))
c.ro = 1;
#endif
diff --git a/vendor/libbase/include/android-base/unique_fd.h b/vendor/libbase/include/android-base/unique_fd.h
index 9ceb5db..bf6f5cc 100644
--- a/vendor/libbase/include/android-base/unique_fd.h
+++ b/vendor/libbase/include/android-base/unique_fd.h
@@ -46,7 +46,7 @@
// unique_fd is also known as ScopedFd/ScopedFD/scoped_fd; mentioned here to help
// you find this class if you're searching for one of those names.
-#if defined(__BIONIC__)
+#if 0
#include <android/fdsan.h>
#endif
@@ -54,7 +54,7 @@ namespace android {
namespace base {
struct DefaultCloser {
-#if defined(__BIONIC__)
+#if 0
static void Tag(int fd, void* old_addr, void* new_addr) {
if (android_fdsan_exchange_owner_tag) {
uint64_t old_tag = android_fdsan_create_owner_tag(ANDROID_FDSAN_OWNER_TYPE_UNIQUE_FD,
diff --git a/vendor/libbase/liblog_symbols.cpp b/vendor/libbase/liblog_symbols.cpp
index 1f4b69b..0a1c1de 100644
--- a/vendor/libbase/liblog_symbols.cpp
+++ b/vendor/libbase/liblog_symbols.cpp
@@ -16,9 +16,7 @@
#include "liblog_symbols.h"
-#if defined(__ANDROID_SDK_VERSION__) && (__ANDROID_SDK_VERSION__ <= 29)
#define USE_DLSYM
-#endif
#ifdef USE_DLSYM
#include <dlfcn.h>
diff --git a/vendor/libbase/logging.cpp b/vendor/libbase/logging.cpp
index 88c05b5..5f993e2 100644
--- a/vendor/libbase/logging.cpp
+++ b/vendor/libbase/logging.cpp
@@ -66,11 +66,17 @@
namespace android {
namespace base {
+#if defined(__linux__)
+extern "C" {
+extern char* __progname;
+}
+#endif
+
// BSD-based systems like Android/macOS have getprogname(). Others need us to provide one.
#if defined(__linux__) || defined(_WIN32)
static const char* getprogname() {
#if defined(__linux__)
- return program_invocation_short_name;
+ return __progname;
#elif defined(_WIN32)
static bool first = true;
static char progname[MAX_PATH] = {};
diff --git a/vendor/libbase/properties.cpp b/vendor/libbase/properties.cpp
index 8190987..a61ac05 100644
--- a/vendor/libbase/properties.cpp
+++ b/vendor/libbase/properties.cpp
@@ -16,7 +16,7 @@
#include "android-base/properties.h"
-#if defined(__BIONIC__)
+#if 0
#define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_
#include <sys/system_properties.h>
#include <sys/_system_properties.h>
@@ -32,8 +32,6 @@
#include <android-base/parseint.h>
#include <android-base/strings.h>
-#if !defined(__BIONIC__)
-
#define PROP_VALUE_MAX 92
static std::map<std::string, std::string>& g_properties = *new std::map<std::string, std::string>;
@@ -63,8 +61,6 @@ int __system_property_get(const char* key, char* value) {
return strlen(value);
}
-#endif
-
namespace android {
namespace base {
@@ -108,7 +104,7 @@ template uint64_t GetUintProperty(const std::string&, uint64_t, uint64_t);
std::string GetProperty(const std::string& key, const std::string& default_value) {
std::string property_value;
-#if defined(__BIONIC__)
+#if 0
const prop_info* pi = __system_property_find(key.c_str());
if (pi == nullptr) return default_value;
@@ -134,7 +130,7 @@ bool SetProperty(const std::string& key, const std::string& value) {
return (__system_property_set(key.c_str(), value.c_str()) == 0);
}
-#if defined(__BIONIC__)
+#if 0
struct WaitForPropertyData {
bool done;
diff --git a/vendor/libziparchive/zip_archive.cc b/vendor/libziparchive/zip_archive.cc
index 9e6091c..933c865 100644
--- a/vendor/libziparchive/zip_archive.cc
+++ b/vendor/libziparchive/zip_archive.cc
@@ -39,7 +39,9 @@
#define lseek64 lseek
#endif
-#if defined(__BIONIC__)
+#undef __ANDROID__
+
+#if 0
#include <android/fdsan.h>
#endif
@@ -88,7 +90,7 @@ static constexpr uint64_t kMaxFileLength = 256 * static_cast<uint64_t>(1u << 30u
* of the string length into the hash table entry.
*/
-#if defined(__BIONIC__)
+#if 0
uint64_t GetOwnerTag(const ZipArchive* archive) {
return android_fdsan_create_owner_tag(ANDROID_FDSAN_OWNER_TYPE_ZIPARCHIVE,
reinterpret_cast<uint64_t>(archive));
@@ -102,7 +104,7 @@ ZipArchive::ZipArchive(MappedZipFile&& map, bool assume_ownership)
central_directory(),
directory_map(),
num_entries(0) {
-#if defined(__BIONIC__)
+#if 0
if (assume_ownership) {
CHECK(mapped_zip.HasFd());
android_fdsan_exchange_owner_tag(mapped_zip.GetFileDescriptor(), 0, GetOwnerTag(this));
@@ -120,7 +122,7 @@ ZipArchive::ZipArchive(const void* address, size_t length)
ZipArchive::~ZipArchive() {
if (close_file && mapped_zip.GetFileDescriptor() >= 0) {
-#if defined(__BIONIC__)
+#if 0
android_fdsan_close_with_tag(mapped_zip.GetFileDescriptor(), GetOwnerTag(this));
#else
close(mapped_zip.GetFileDescriptor());