summaryrefslogtreecommitdiffstats
path: root/development/android-tools/fix_build_core.patch
diff options
context:
space:
mode:
Diffstat (limited to 'development/android-tools/fix_build_core.patch')
-rw-r--r--development/android-tools/fix_build_core.patch155
1 files changed, 89 insertions, 66 deletions
diff --git a/development/android-tools/fix_build_core.patch b/development/android-tools/fix_build_core.patch
index b67a540199..fede1c09cc 100644
--- a/development/android-tools/fix_build_core.patch
+++ b/development/android-tools/fix_build_core.patch
@@ -1,16 +1,49 @@
+diff --git a/adb/adb.cpp b/adb/adb.cpp
+index 1ec145b25c..b6e943f6ee 100644
+--- a/adb/adb.cpp
++++ b/adb/adb.cpp
+@@ -44,8 +44,6 @@
+ #include <android-base/parsenetaddress.h>
+ #include <android-base/stringprintf.h>
+ #include <android-base/strings.h>
+-#include <build/version.h>
+-#include <platform_tools_version.h>
+
+ #include "adb_auth.h"
+ #include "adb_io.h"
+@@ -66,10 +64,10 @@ std::string adb_version() {
+ // Don't change the format of this --- it's parsed by ddmlib.
+ return android::base::StringPrintf(
+ "Android Debug Bridge version %d.%d.%d\n"
+- "Version %s-%s\n"
++ "Version %s\n"
+ "Installed as %s\n",
+ ADB_VERSION_MAJOR, ADB_VERSION_MINOR, ADB_SERVER_VERSION,
+- PLATFORM_TOOLS_VERSION, android::build::GetBuildNumber().c_str(),
++ PLATFORM_TOOLS_VERSION,
+ android::base::GetExecutablePath().c_str());
+ }
+
+diff --git a/adb/client/main.cpp b/adb/client/main.cpp
+index 0c5c28f1b3..b6a1281521 100644
+--- a/adb/client/main.cpp
++++ b/adb/client/main.cpp
+@@ -118,10 +118,6 @@ int adb_server_main(int is_daemon, const std::string& socket_spec, int ack_reply
+ init_transport_registration();
+ init_reconnect_handler();
+
+- if (!getenv("ADB_MDNS") || strcmp(getenv("ADB_MDNS"), "0") != 0) {
+- init_mdns_transport_discovery();
+- }
+-
+ if (!getenv("ADB_USB") || strcmp(getenv("ADB_USB"), "0") != 0) {
+ usb_init();
+ } else {
diff --git a/adb/client/usb_libusb.cpp b/adb/client/usb_libusb.cpp
-index 7025f283c..66fad6564 100644
+index 53f01a0ce5..b4c3aadc28 100644
--- a/adb/client/usb_libusb.cpp
+++ b/adb/client/usb_libusb.cpp
-@@ -21,6 +21,7 @@
- #include <stdint.h>
-
- #include <atomic>
-+#include <condition_variable>
- #include <chrono>
- #include <memory>
- #include <mutex>
-@@ -28,7 +29,7 @@
+@@ -30,7 +30,7 @@
#include <thread>
#include <unordered_map>
@@ -19,63 +52,53 @@ index 7025f283c..66fad6564 100644
#include <android-base/file.h>
#include <android-base/logging.h>
-diff --git a/adb/sysdeps/posix/network.cpp b/adb/sysdeps/posix/network.cpp
-index 45da5af4a..516c716d9 100644
---- a/adb/sysdeps/posix/network.cpp
-+++ b/adb/sysdeps/posix/network.cpp
-@@ -16,6 +16,7 @@
-
- #include "sysdeps/network.h"
-
-+#include <cstring>
- #include <errno.h>
- #include <netinet/in.h>
- #include <sys/socket.h>
-diff --git a/base/errors_unix.cpp b/base/errors_unix.cpp
-index 296995efe..48269b675 100644
---- a/base/errors_unix.cpp
-+++ b/base/errors_unix.cpp
-@@ -17,6 +17,7 @@
- #include "android-base/errors.h"
-
- #include <errno.h>
-+#include <string.h>
+diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp
+index 2fe3b1a9e0..a61b221ce3 100644
+--- a/fastboot/fastboot.cpp
++++ b/fastboot/fastboot.cpp
+@@ -59,10 +59,8 @@
+ #include <android-base/stringprintf.h>
+ #include <android-base/strings.h>
+ #include <android-base/unique_fd.h>
+-#include <build/version.h>
+ #include <libavb/libavb.h>
+ #include <liblp/liblp.h>
+-#include <platform_tools_version.h>
+ #include <sparse/sparse.h>
+ #include <ziparchive/zip_archive.h>
- namespace android {
- namespace base {
-diff --git a/base/file.cpp b/base/file.cpp
-index 2f697a1cc..81aef5758 100644
---- a/base/file.cpp
-+++ b/base/file.cpp
-@@ -22,6 +22,7 @@
- #include <sys/stat.h>
- #include <sys/types.h>
- #include <unistd.h>
-+#include <string.h>
+@@ -1783,7 +1781,7 @@ int FastBootTool::Main(int argc, char* argv[]) {
+ setvbuf(stdout, nullptr, _IONBF, 0);
+ setvbuf(stderr, nullptr, _IONBF, 0);
+ } else if (name == "version") {
+- fprintf(stdout, "fastboot version %s-%s\n", PLATFORM_TOOLS_VERSION, android::build::GetBuildNumber().c_str());
++ fprintf(stdout, "fastboot version %s\n", PLATFORM_TOOLS_VERSION);
+ fprintf(stdout, "Installed as %s\n", android::base::GetExecutablePath().c_str());
+ return 0;
+ #if !defined(_WIN32)
+diff --git a/fastboot/fs.cpp b/fastboot/fs.cpp
+index 8c0aa6bf4e..3ad5b53568 100644
+--- a/fastboot/fs.cpp
++++ b/fastboot/fs.cpp
+@@ -117,7 +117,7 @@ static int generate_ext4_image(const char* fileName, long long partSize,
+ static constexpr int block_size = 4096;
+ const std::string exec_dir = android::base::GetExecutableDirectory();
- #include <memory>
- #include <mutex>
-diff --git a/base/logging.cpp b/base/logging.cpp
-index 6357b4ba7..3c7dbce13 100644
---- a/base/logging.cpp
-+++ b/base/logging.cpp
-@@ -23,6 +23,7 @@
- #include <fcntl.h>
- #include <libgen.h>
- #include <time.h>
-+#include <string.h>
+- const std::string mke2fs_path = exec_dir + "/mke2fs";
++ const std::string mke2fs_path = exec_dir + "/mke2fs.android";
+ std::vector<const char*> mke2fs_args = {mke2fs_path.c_str(), "-t", "ext4", "-b"};
- // For getprogname(3) or program_invocation_short_name.
- #if defined(__ANDROID__) || defined(__APPLE__)
-diff --git a/libsparse/sparse_read.cpp b/libsparse/sparse_read.cpp
-index bd668735a..76cf43299 100644
---- a/libsparse/sparse_read.cpp
-+++ b/libsparse/sparse_read.cpp
-@@ -18,6 +18,7 @@
- #define _LARGEFILE64_SOURCE 1
+ std::string block_size_str = std::to_string(block_size);
+diff --git a/libcutils/include/cutils/threads.h b/libcutils/include/cutils/threads.h
+index ba4846e33b..f3fccc4895 100644
+--- a/libcutils/include/cutils/threads.h
++++ b/libcutils/include/cutils/threads.h
+@@ -33,8 +33,6 @@ extern "C" {
+ // Deprecated: use android::base::GetThreadId instead, which doesn't truncate on Mac/Windows.
+ //
- #include <algorithm>
-+#include <cstring>
- #include <inttypes.h>
- #include <fcntl.h>
- #include <stdarg.h>
+-extern pid_t gettid();
+-
+ //
+ // Deprecated: use `_Thread_local` in C or `thread_local` in C++.
+ //