diff --git a/.checkpackageignore b/.checkpackageignore index 8b56337a35..68ac8d252c 100644 --- a/.checkpackageignore +++ b/.checkpackageignore @@ -131,7 +131,6 @@ package/am33x-cm3/0004-Makefile-add-fno-builtin.patch Upstream package/am33x-cm3/S93-am335x-pm-firmware-load Variables package/android-tools/0001-Fix-makefiles-for-out-of-tree-build.patch Upstream package/android-tools/0002-Fix-adbd-for-non-Ubuntu-systems.patch Upstream -package/android-tools/0003-Fix-build-issue-with-uclibc.patch Upstream package/android-tools/0004-Fix-build-issue-with-musl.patch Upstream package/android-tools/0005-makefiles-use-pkgconf-to-get-libs-deps.patch Upstream package/android-tools/0006-Fix-build-on-big-endian-systems.patch Upstream diff --git a/package/android-tools/0003-Adjust-base64-function-handling.patch b/package/android-tools/0003-Adjust-base64-function-handling.patch new file mode 100644 index 0000000000..30a6e680b9 --- /dev/null +++ b/package/android-tools/0003-Adjust-base64-function-handling.patch @@ -0,0 +1,96 @@ +From 946dbb00fe4b2a75c688a470fc0c3924aa018a24 Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Sun, 14 Jul 2024 11:39:49 +0200 +Subject: [PATCH] Adjust base64 function handling +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +In order to support libcs that do not provide b64_pton(), one of the +Debian patches adds a copy of b64_pton() and b64_ntop(). However, no +prototype is added for those functions, causing an "implicit +declaration" warning... or error depending on the compiler version +used: + +core/adbd/adb_auth_client.c:75:15: error: implicit declaration of function ‘b64_pton’ [-Wimplicit-function-declaration] + +This patch adds appropriate prototypes, but while at it, also renames +the internal copy of b64_*() functions to have an adb_ prefix in order +to clarify things and not clash with definitions potentially coming +from the C library. + +Upstream: N/A, we're too far from upstream +Signed-off-by: Thomas Petazzoni +--- + core/adb/adb_auth_client.c | 3 ++- + core/adbd/adb_auth_client.c | 3 ++- + core/adbd/base64.c | 4 ++-- + 3 files changed, 6 insertions(+), 4 deletions(-) + +diff --git a/core/adb/adb_auth_client.c b/core/adb/adb_auth_client.c +index 0b4913e..25b9828 100644 +--- a/core/adb/adb_auth_client.c ++++ b/core/adb/adb_auth_client.c +@@ -45,6 +45,7 @@ static char *key_paths[] = { + static fdevent listener_fde; + static int framework_fd = -1; + ++extern int adb_b64_pton(char const *src, u_char *target, size_t targsize); + + static void read_keys(const char *file, struct listnode *list) + { +@@ -72,7 +73,7 @@ static void read_keys(const char *file, struct listnode *list) + if (sep) + *sep = '\0'; + +- ret = __b64_pton(buf, (u_char *)&key->key, sizeof(key->key) + 4); ++ ret = adb_b64_pton(buf, (u_char *)&key->key, sizeof(key->key) + 4); + if (ret != sizeof(key->key)) { + D("%s: Invalid base64 data ret=%d\n", file, ret); + free(key); +diff --git a/core/adbd/adb_auth_client.c b/core/adbd/adb_auth_client.c +index 0b4913e..25b9828 100644 +--- a/core/adbd/adb_auth_client.c ++++ b/core/adbd/adb_auth_client.c +@@ -45,6 +45,7 @@ static char *key_paths[] = { + static fdevent listener_fde; + static int framework_fd = -1; + ++extern int adb_b64_pton(char const *src, u_char *target, size_t targsize); + + static void read_keys(const char *file, struct listnode *list) + { +@@ -72,7 +73,7 @@ static void read_keys(const char *file, struct listnode *list) + if (sep) + *sep = '\0'; + +- ret = __b64_pton(buf, (u_char *)&key->key, sizeof(key->key) + 4); ++ ret = adb_b64_pton(buf, (u_char *)&key->key, sizeof(key->key) + 4); + if (ret != sizeof(key->key)) { + D("%s: Invalid base64 data ret=%d\n", file, ret); + free(key); +diff --git a/core/adbd/base64.c b/core/adbd/base64.c +index 7270703..91fc1b2 100644 +--- a/core/adbd/base64.c ++++ b/core/adbd/base64.c +@@ -134,7 +134,7 @@ static const char Pad64 = '='; + */ + + int +-b64_ntop(src, srclength, target, targsize) ++adb_b64_ntop(src, srclength, target, targsize) + u_char const *src; + size_t srclength; + char *target; +@@ -212,7 +212,7 @@ b64_ntop(src, srclength, target, targsize) + */ + + int +-b64_pton(src, target, targsize) ++adb_b64_pton(src, target, targsize) + char const *src; + u_char *target; + size_t targsize; +-- +2.47.0 + diff --git a/package/android-tools/0003-Fix-build-issue-with-uclibc.patch b/package/android-tools/0003-Fix-build-issue-with-uclibc.patch deleted file mode 100644 index a951271873..0000000000 --- a/package/android-tools/0003-Fix-build-issue-with-uclibc.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 082ee80d3524fa3474644c09b441d7f7947675cc Mon Sep 17 00:00:00 2001 -From: Gary Bisson -Date: Sun, 1 Dec 2024 15:43:56 +0100 -Subject: [PATCH] Fix build issue with uclibc - -Signed-off-by: Gary Bisson ---- - core/adb/adb_auth_client.c | 2 +- - core/adbd/adb_auth_client.c | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/core/adb/adb_auth_client.c b/core/adb/adb_auth_client.c -index 0b4913e..068d837 100644 ---- a/core/adb/adb_auth_client.c -+++ b/core/adb/adb_auth_client.c -@@ -72,7 +72,7 @@ static void read_keys(const char *file, struct listnode *list) - if (sep) - *sep = '\0'; - -- ret = __b64_pton(buf, (u_char *)&key->key, sizeof(key->key) + 4); -+ ret = b64_pton(buf, (u_char *)&key->key, sizeof(key->key) + 4); - if (ret != sizeof(key->key)) { - D("%s: Invalid base64 data ret=%d\n", file, ret); - free(key); -diff --git a/core/adbd/adb_auth_client.c b/core/adbd/adb_auth_client.c -index 0b4913e..068d837 100644 ---- a/core/adbd/adb_auth_client.c -+++ b/core/adbd/adb_auth_client.c -@@ -72,7 +72,7 @@ static void read_keys(const char *file, struct listnode *list) - if (sep) - *sep = '\0'; - -- ret = __b64_pton(buf, (u_char *)&key->key, sizeof(key->key) + 4); -+ ret = b64_pton(buf, (u_char *)&key->key, sizeof(key->key) + 4); - if (ret != sizeof(key->key)) { - D("%s: Invalid base64 data ret=%d\n", file, ret); - free(key); --- -2.47.0 -