Skip to content
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

Upgrade to platform-tools-35.0.1 #144

Merged
merged 2 commits into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ set(ANDROID_MKE2FS_NAME "mke2fs.android")

# Version of android-tools and the version of boringssl being used.
# See: https://android.googlesource.com/platform/external/boringssl/+/platform-tools-${ANDROID_VERSION}/BORINGSSL_REVISION
set(ANDROID_VERSION 34.0.5)
set(BORINGSSL_VERSION e28988ecaa5e72523a982915084c9422e495116d)
set(ANDROID_VERSION 35.0.1)
set(BORINGSSL_VERSION 538b2a6cf0497cf8bb61ae726a484a3d7a34e54e)

# Vendor string used in version outputs.
set(ANDROID_VENDOR android-tools)
Expand Down
7 changes: 4 additions & 3 deletions patches/adb/0002-adb-disable-mdns-transport-support.patch
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ diff --git a/client/main.cpp b/client/main.cpp
index 4fa58faf..c14b3463 100644
--- a/client/main.cpp
+++ b/client/main.cpp
@@ -129,9 +129,6 @@ int adb_server_main(int is_daemon, const std::string& socket_spec, int ack_reply
@@ -132,10 +132,6 @@ int adb_server_main(int is_daemon, const std::string& socket_spec, const char* o

init_reconnect_handler();

adb_wifi_init();
- if (!getenv("ADB_MDNS") || strcmp(getenv("ADB_MDNS"), "0") != 0) {
- init_mdns_transport_discovery();
- }
-
if (!getenv("ADB_USB") || strcmp(getenv("ADB_USB"), "0") != 0) {
if (should_use_libusb()) {
libusb::usb_init();
26 changes: 0 additions & 26 deletions patches/adb/0025-Add-explicit-import-for-algorithm.patch

This file was deleted.

26 changes: 0 additions & 26 deletions patches/base/0001-LoadedArsc-un-const-T-in-std-vector-T.patch

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,51 @@ Subject: [PATCH] PosixUtils: don't use reserved name std{out,err} for

musl's std{out,err} are macros.
---
libs/androidfw/PosixUtils.cpp | 40 +++++++++----------
libs/androidfw/include/androidfw/PosixUtils.h | 4 +-
libs/androidfw/tests/PosixUtils_test.cpp | 4 +-
3 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/libs/androidfw/PosixUtils.cpp b/libs/androidfw/PosixUtils.cpp
index 026912883a73..c01bfcd29eb8 100644
index 8ddc5724..8dd1cd68 100644
--- a/libs/androidfw/PosixUtils.cpp
+++ b/libs/androidfw/PosixUtils.cpp
@@ -50,17 +50,17 @@ namespace android {
@@ -46,17 +46,17 @@ namespace android {
namespace util {

std::unique_ptr<ProcResult> ExecuteBinary(const std::vector<std::string>& argv) {
- int stdout[2]; // stdout[0] read, stdout[1] write
ProcResult ExecuteBinary(const std::vector<std::string>& argv) {
- int stdout[2]; // [0] read, [1] write
- if (pipe(stdout) != 0) {
+ int fdout[2]; // fdout[0] read, fdout[1] write
+ int fdout[2]; // [0] read, [1] write
+ if (pipe(fdout) != 0) {
PLOG(ERROR) << "pipe";
return nullptr;
PLOG(ERROR) << "out pipe";
return ProcResult{-1};
}

- int stderr[2]; // stdout[0] read, stdout[1] write
- int stderr[2]; // [0] read, [1] write
- if (pipe(stderr) != 0) {
+ int fderr[2]; // fderr[0] read, fderr[1] write
+ int fderr[2]; // [0] read, [1] write
+ if (pipe(fderr) != 0) {
PLOG(ERROR) << "pipe";
PLOG(ERROR) << "err pipe";
- close(stdout[0]);
- close(stdout[1]);
+ close(fdout[0]);
+ close(fdout[1]);
return nullptr;
return ProcResult{-1};
}

@@ -89,12 +89,12 @@ std::unique_ptr<ProcResult> ExecuteBinary(const std::vector<std::string>& argv)

@@ -73,10 +73,10 @@ ProcResult ExecuteBinary(const std::vector<std::string>& argv) {
switch (pid) {
case -1: // error
free(argv0);
- close(stdout[0]);
- close(stdout[1]);
- close(stderr[0]);
- close(stderr[1]);
+ close(fdout[0]);
+ close(fdout[1]);
+ close(fderr[0]);
+ close(fderr[1]);
PLOG(ERROR) << "fork";
return ProcResult{-1};
case 0: // child
@@ -90,12 +90,12 @@ ProcResult ExecuteBinary(const std::vector<std::string>& argv) {
exit(1);
}

Expand All @@ -57,7 +68,7 @@ index 026912883a73..c01bfcd29eb8 100644
abort();
}
execvp(argv0[0], const_cast<char* const*>(argv0));
@@ -102,23 +102,23 @@ std::unique_ptr<ProcResult> ExecuteBinary(const std::vector<std::string>& argv)
@@ -103,22 +103,22 @@ ProcResult ExecuteBinary(const std::vector<std::string>& argv) {
abort();
default: // parent
free(argv0);
Expand All @@ -72,58 +83,19 @@ index 026912883a73..c01bfcd29eb8 100644
- close(stderr[0]);
+ close(fdout[0]);
+ close(fderr[0]);
return nullptr;
return ProcResult{-1};
}
std::unique_ptr<ProcResult> result(new ProcResult());
result->status = status;
- const auto out = ReadFile(stdout[0]);
- result->stdout_str = out ? *out : "";
ProcResult result(status);
- auto out = ReadFile(stdout[0]);
+ auto out = ReadFile(fdout[0]);
result.stdout_str = out ? std::move(*out) : "";
- close(stdout[0]);
- const auto err = ReadFile(stderr[0]);
- result->stderr_str = err ? *err : "";
- close(stderr[0]);
+ const auto out = ReadFile(fdout[0]);
+ result->stdout_ = out ? *out : "";
- auto err = ReadFile(stderr[0]);
+ close(fdout[0]);
+ const auto err = ReadFile(fderr[0]);
+ result->stderr_ = err ? *err : "";
+ auto err = ReadFile(fderr[0]);
result.stderr_str = err ? std::move(*err) : "";
- close(stderr[0]);
+ close(fderr[0]);
return result;
return std::move(result);
}
}
diff --git a/libs/androidfw/include/androidfw/PosixUtils.h b/libs/androidfw/include/androidfw/PosixUtils.h
index bb2084740a44..c6bb3fb42757 100644
--- a/libs/androidfw/include/androidfw/PosixUtils.h
+++ b/libs/androidfw/include/androidfw/PosixUtils.h
@@ -23,8 +23,8 @@ namespace util {

struct ProcResult {
int status;
- std::string stdout_str;
- std::string stderr_str;
+ std::string stdout_;
+ std::string stderr_;
};

// Fork, exec and wait for an external process. Return nullptr if the process could not be launched,
diff --git a/libs/androidfw/tests/PosixUtils_test.cpp b/libs/androidfw/tests/PosixUtils_test.cpp
index c7b3eba1451f..44816b279c1a 100644
--- a/libs/androidfw/tests/PosixUtils_test.cpp
+++ b/libs/androidfw/tests/PosixUtils_test.cpp
@@ -30,14 +30,14 @@ TEST(PosixUtilsTest, AbsolutePathToBinary) {
const auto result = ExecuteBinary({"/bin/date", "--help"});
ASSERT_THAT(result, NotNull());
ASSERT_EQ(result->status, 0);
- ASSERT_GE(result->stdout_str.find("usage: date "), 0);
+ ASSERT_GE(result->stdout_.find("usage: date "), 0);
}

TEST(PosixUtilsTest, RelativePathToBinary) {
const auto result = ExecuteBinary({"date", "--help"});
ASSERT_THAT(result, NotNull());
ASSERT_EQ(result->status, 0);
- ASSERT_GE(result->stdout_str.find("usage: date "), 0);
+ ASSERT_GE(result->stdout_.find("usage: date "), 0);
}

TEST(PosixUtilsTest, BadParameters) {

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
From 81759a376a14b910b0dcc5d3e07934522fe523ed Mon Sep 17 00:00:00 2001
From: Biswapriyo Nath <nathbappai@gmail.com>
Date: Wed, 24 Apr 2024 17:40:51 +0000
Subject: [PATCH] boringssl: Workaround compiler error with gcc-14 and _Generic

This workarounds the following compiler error:

internal.h: In function 'uint32_t CRYPTO_addc_u32(uint32_t, uint32_t, uint32_t, uint32_t*)':
internal.h:1151:7: error: expected primary-expression before 'unsigned'
1151 | unsigned: __builtin_addc, \
| ^~~~~~~~
internal.h:1158:10: note: in expansion of macro 'CRYPTO_GENERIC_ADDC'
1158 | return CRYPTO_GENERIC_ADDC(x, y, carry, out_carry);
| ^~~~~~~~~~~~~~~~~~~
---
crypto/internal.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/crypto/internal.h b/crypto/internal.h
index e9da01065..68dc75ef8 100644
--- a/crypto/internal.h
+++ b/crypto/internal.h
@@ -1144,7 +1144,7 @@ static inline uint64_t CRYPTO_rotr_u64(uint64_t value, int shift) {

// CRYPTO_addc_* returns |x + y + carry|, and sets |*out_carry| to the carry
// bit. |carry| must be zero or one.
-#if OPENSSL_HAS_BUILTIN(__builtin_addc)
+#if OPENSSL_HAS_BUILTIN(__builtin_addc) && (!defined(__GNUC__) || (defined(__GNUC__) && (__GNUC__ < 14)))

#define CRYPTO_GENERIC_ADDC(x, y, carry, out_carry) \
(_Generic((x), \
@@ -1196,7 +1196,7 @@ static inline uint64_t CRYPTO_addc_u64(uint64_t x, uint64_t y, uint64_t carry,

// CRYPTO_subc_* returns |x - y - borrow|, and sets |*out_borrow| to the borrow
// bit. |borrow| must be zero or one.
-#if OPENSSL_HAS_BUILTIN(__builtin_subc)
+#if OPENSSL_HAS_BUILTIN(__builtin_subc) && (!defined(__GNUC__) || (defined(__GNUC__) && (__GNUC__ < 14)))

#define CRYPTO_GENERIC_SUBC(x, y, borrow, out_borrow) \
(_Generic((x), \
--
2.44.0

Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,12 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1529526b..a393b7d7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -140,7 +140,7 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CLANG)
@@ -139,7 +139,7 @@ set(CMAKE_C_STANDARD_REQUIRED ON)
if(CMAKE_COMPILER_IS_GNUCXX OR CLANG)
# Note clang-cl is odd and sets both CLANG and MSVC. We base our configuration
# primarily on our normal Clang one.
# TODO(bbe) took out -Wmissing-field-initializers for pki - fix and put back or disable only for pki
- set(C_CXX_FLAGS "-Werror -Wformat=2 -Wsign-compare -Wwrite-strings -Wvla -Wshadow -Wtype-limits")
+ set(C_CXX_FLAGS "-Wformat=2 -Wsign-compare -Wwrite-strings -Wvla -Wshadow -Wtype-limits")
- set(C_CXX_FLAGS "-Werror -Wformat=2 -Wsign-compare -Wwrite-strings -Wvla -Wshadow -Wtype-limits -Wmissing-field-initializers")
+ set(C_CXX_FLAGS "-Wformat=2 -Wsign-compare -Wwrite-strings -Wvla -Wshadow -Wtype-limits -Wmissing-field-initializers")
if(MSVC)
# clang-cl sets different default warnings than clang. It also treats -Wall
# as -Weverything, to match MSVC. Instead -W3 is the alias for -Wall.
--
2.40.1

Original file line number Diff line number Diff line change
Expand Up @@ -516,24 +516,24 @@ index dbaeb93..0cc119c 100644
@@ -24,7 +23,9 @@
#include <string_view>
#include <vector>

-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
static constexpr const char* CGROUPV2_CONTROLLER_NAME = "cgroup2";

@@ -38,7 +39,9 @@ bool SetTaskProfiles(int tid, const std::vector<std::string>& profiles, bool use

static constexpr const char* CGROUPV2_HIERARCHY_NAME = "cgroup2";
[[deprecated]] static constexpr const char* CGROUPV2_CONTROLLER_NAME = "cgroup2";
@@ -40,7 +41,9 @@ bool SetTaskProfiles(pid_t tid, const std::vector<std::string>& profiles,
bool SetProcessProfiles(uid_t uid, pid_t pid, const std::vector<std::string>& profiles);
bool SetUserProfiles(uid_t uid, const std::vector<std::string>& profiles);

-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
bool SetTaskProfiles(int tid, std::initializer_list<std::string_view> profiles,

bool SetTaskProfiles(pid_t tid, std::initializer_list<std::string_view> profiles,
bool use_fd_cache = false);
@@ -49,7 +52,9 @@ bool SetTaskProfiles(int tid, std::span<const std::string_view> profiles,
bool SetProcessProfiles(uid_t uid, pid_t pid, std::span<const std::string_view> profiles);
Expand Down Expand Up @@ -878,13 +878,13 @@ index 16207e6..9a12458 100644
@@ -20,7 +20,9 @@
#include <keymaster/android_keymaster_messages.h>
#include <trusty_keymaster/ipc/keymaster_ipc.h>

-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
const uint32_t TRUSTY_KEYMASTER_RECV_BUF_SIZE = 2 * PAGE_SIZE;

const uint32_t TRUSTY_KEYMASTER_RECV_BUF_SIZE = 2 * 4096;
const uint32_t TRUSTY_KEYMASTER_SEND_BUF_SIZE =
@@ -35,6 +37,8 @@ keymaster_error_t translate_error(int err);
keymaster_error_t trusty_keymaster_send(uint32_t command, const keymaster::Serializable& req,
Expand Down
Loading
Loading