* [Buildroot] [PATCH 0/3] Fix two android-tools build issues
@ 2024-12-04 20:47 Thomas Petazzoni via buildroot
2024-12-04 20:48 ` [Buildroot] [PATCH 1/3] package/android-tools: convert all patches to Git-formatted patches Thomas Petazzoni via buildroot
` (3 more replies)
0 siblings, 4 replies; 9+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-12-04 20:47 UTC (permalink / raw)
To: buildroot; +Cc: Thomas Petazzoni
Hello,
The android-tools has been causing failures in the autobuilders pretty
much every day for the past few months, so it was about time to fix
those issues.
This patch series fixes the two most prominent issues:
- An issue related to u64 definition on powerpc64/mips64, which has
been occurring in the autobuilders since at least Feb 2021. This
patch should be backported to 2024.02.x.
- An issue related to GCC 14.x. Since the support of GCC 14.x is not
in 2024.02.x, this second fix is not strictly needed in 2024.02.x,
but also shouldn't be harmful.
A preparation patch converting the existing patch stack to be
applicable with "git am" is proposed, as it was needed to preserve my
sanity while working on the patch series.
Thomas Petazzoni (3):
package/android-tools: convert all patches to Git-formatted patches
package/android-tools: fix build issue on mips64 and powerpc64
package/android-tools: fix b64_pton() issue with GCC >= 14.x
.checkpackageignore | 9 +-
...-Fix-makefiles-for-out-of-tree-build.patch | 7 +-
...0002-Fix-adbd-for-non-Ubuntu-systems.patch | 9 +-
...0003-Adjust-base64-function-handling.patch | 96 +++++++++++++++++++
.../0003-Fix-build-issue-with-uclibc.patch | 36 -------
.../0004-Fix-build-issue-with-musl.patch | 25 +++--
...efiles-use-pkgconf-to-get-libs-deps.patch} | 47 +++++----
...006-Fix-build-on-big-endian-systems.patch} | 20 +++-
...clude-cdefs.h-wherever-it-is-needed.patch} | 18 ++--
...smacros.h-to-compile-with-glibc-2.28.patch | 42 --------
...minor-major-build-failure-due-to-gli.patch | 59 ++++++++++++
...les-for-out-of-tree-ext4_utils-build.patch | 4 +-
...atch-for-openssl-1.1.0-compatibility.patch | 4 +-
...stboot.c-reorder-functions-to-avoid-.patch | 4 +-
...parse_read.c-add-missing-output_file.patch | 4 +-
...s-make_ext4fs_main.c-disable-Android.patch | 4 +-
...014-core-adbd-adb.c-open-code-capset.patch | 4 +-
...b.c-include-correct-header-for-prctl.patch | 4 +-
...s-make_ext4fs.c-define-__SANE_USERSP.patch | 68 +++++++++++++
19 files changed, 320 insertions(+), 144 deletions(-)
create mode 100644 package/android-tools/0003-Adjust-base64-function-handling.patch
delete mode 100644 package/android-tools/0003-Fix-build-issue-with-uclibc.patch
rename package/android-tools/{0005-Use-pkgconf-to-get-libs-deps.patch => 0005-makefiles-use-pkgconf-to-get-libs-deps.patch} (57%)
rename package/android-tools/{0006-fix-big-endian-build.patch => 0006-Fix-build-on-big-endian-systems.patch} (75%)
rename package/android-tools/{0007-include-cdefs-h-when-needed.patch => 0007-Include-cdefs.h-wherever-it-is-needed.patch} (71%)
delete mode 100644 package/android-tools/0008-Include-sysmacros.h-to-compile-with-glibc-2.28.patch
create mode 100644 package/android-tools/0008-usb_linux.c-fix-minor-major-build-failure-due-to-gli.patch
create mode 100644 package/android-tools/0016-extras-ext4_utils-make_ext4fs.c-define-__SANE_USERSP.patch
--
2.47.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH 1/3] package/android-tools: convert all patches to Git-formatted patches
2024-12-04 20:47 [Buildroot] [PATCH 0/3] Fix two android-tools build issues Thomas Petazzoni via buildroot
@ 2024-12-04 20:48 ` Thomas Petazzoni via buildroot
2024-12-06 22:44 ` Peter Korsgaard
2024-12-04 20:48 ` [Buildroot] [PATCH 2/3] package/android-tools: fix build issue on mips64 and powerpc64 Thomas Petazzoni via buildroot
` (2 subsequent siblings)
3 siblings, 1 reply; 9+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-12-04 20:48 UTC (permalink / raw)
To: buildroot; +Cc: Thomas Petazzoni
This will make it easier to modify the patch series moving forward. No
functional changes.
On one patch, we added the SoB from Giulio, which was missing. Giulio
was the original contributor of the patch, and nobody touched it since
it was introduced.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
.checkpackageignore | 8 +--
...-Fix-makefiles-for-out-of-tree-build.patch | 7 ++-
...0002-Fix-adbd-for-non-Ubuntu-systems.patch | 9 ++-
.../0003-Fix-build-issue-with-uclibc.patch | 8 ++-
.../0004-Fix-build-issue-with-musl.patch | 25 ++++----
...efiles-use-pkgconf-to-get-libs-deps.patch} | 47 +++++++++------
...006-Fix-build-on-big-endian-systems.patch} | 20 +++++--
...clude-cdefs.h-wherever-it-is-needed.patch} | 18 ++++--
...smacros.h-to-compile-with-glibc-2.28.patch | 42 -------------
...minor-major-build-failure-due-to-gli.patch | 59 +++++++++++++++++++
...les-for-out-of-tree-ext4_utils-build.patch | 4 +-
...atch-for-openssl-1.1.0-compatibility.patch | 4 +-
...stboot.c-reorder-functions-to-avoid-.patch | 4 +-
...parse_read.c-add-missing-output_file.patch | 4 +-
...s-make_ext4fs_main.c-disable-Android.patch | 4 +-
...014-core-adbd-adb.c-open-code-capset.patch | 4 +-
| 4 +-
17 files changed, 162 insertions(+), 109 deletions(-)
rename package/android-tools/{0005-Use-pkgconf-to-get-libs-deps.patch => 0005-makefiles-use-pkgconf-to-get-libs-deps.patch} (57%)
rename package/android-tools/{0006-fix-big-endian-build.patch => 0006-Fix-build-on-big-endian-systems.patch} (75%)
rename package/android-tools/{0007-include-cdefs-h-when-needed.patch => 0007-Include-cdefs.h-wherever-it-is-needed.patch} (71%)
delete mode 100644 package/android-tools/0008-Include-sysmacros.h-to-compile-with-glibc-2.28.patch
create mode 100644 package/android-tools/0008-usb_linux.c-fix-minor-major-build-failure-due-to-gli.patch
diff --git a/.checkpackageignore b/.checkpackageignore
index b793026881..11e410b4ea 100644
--- a/.checkpackageignore
+++ b/.checkpackageignore
@@ -273,10 +273,10 @@ package/android-tools/0001-Fix-makefiles-for-out-of-tree-build.patch lib_patch.U
package/android-tools/0002-Fix-adbd-for-non-Ubuntu-systems.patch lib_patch.Upstream
package/android-tools/0003-Fix-build-issue-with-uclibc.patch lib_patch.Upstream
package/android-tools/0004-Fix-build-issue-with-musl.patch lib_patch.Upstream
-package/android-tools/0005-Use-pkgconf-to-get-libs-deps.patch lib_patch.Upstream
-package/android-tools/0006-fix-big-endian-build.patch lib_patch.Upstream
-package/android-tools/0007-include-cdefs-h-when-needed.patch lib_patch.Upstream
-package/android-tools/0008-Include-sysmacros.h-to-compile-with-glibc-2.28.patch lib_patch.Sob lib_patch.Upstream
+package/android-tools/0005-makefiles-use-pkgconf-to-get-libs-deps.patch lib_patch.Upstream
+package/android-tools/0006-Fix-build-on-big-endian-systems.patch lib_patch.Upstream
+package/android-tools/0007-Include-cdefs.h-wherever-it-is-needed.patch lib_patch.Upstream
+package/android-tools/0008-usb_linux.c-fix-minor-major-build-failure-due-to-gli.patch lib_patch.Upstream
package/android-tools/0009-Fix-makefiles-for-out-of-tree-ext4_utils-build.patch lib_patch.Upstream
package/android-tools/0010-adb-added-patch-for-openssl-1.1.0-compatibility.patch lib_patch.Upstream
package/aoetools/0001-Change-shell-script-interpreter-from-bin-bash-to-bin.patch lib_patch.Upstream
diff --git a/package/android-tools/0001-Fix-makefiles-for-out-of-tree-build.patch b/package/android-tools/0001-Fix-makefiles-for-out-of-tree-build.patch
index af0723620f..ad047657a1 100644
--- a/package/android-tools/0001-Fix-makefiles-for-out-of-tree-build.patch
+++ b/package/android-tools/0001-Fix-makefiles-for-out-of-tree-build.patch
@@ -1,4 +1,7 @@
-[PATCH] Fix makefiles for out-of-tree build
+From 1fe49c34aa3e32e801af5c56293ec71ff6e7e2bc Mon Sep 17 00:00:00 2001
+From: Gary Bisson <gary.bisson@boundarydevices.com>
+Date: Sun, 1 Dec 2024 15:43:17 +0100
+Subject: [PATCH] Fix makefiles for out-of-tree build
Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
---
@@ -158,5 +161,5 @@ index 9e8b751..94a069b 100644
LIBS+= -lz -lselinux
--
-2.5.1
+2.47.0
diff --git a/package/android-tools/0002-Fix-adbd-for-non-Ubuntu-systems.patch b/package/android-tools/0002-Fix-adbd-for-non-Ubuntu-systems.patch
index 35f6c8a3be..7f39e6662b 100644
--- a/package/android-tools/0002-Fix-adbd-for-non-Ubuntu-systems.patch
+++ b/package/android-tools/0002-Fix-adbd-for-non-Ubuntu-systems.patch
@@ -1,4 +1,7 @@
-[PATCH] Fix adbd for non-Ubuntu systems
+From d433d5c340f3b36de58ea8550fd140dbdaea13b4 Mon Sep 17 00:00:00 2001
+From: Gary Bisson <gary.bisson@boundarydevices.com>
+Date: Sun, 1 Dec 2024 15:43:33 +0100
+Subject: [PATCH] Fix adbd for non-Ubuntu systems
Remove glib/dbus dependencies and partially restore services.c to be
closer to the original source code in order to run on systems without
@@ -7,7 +10,7 @@ sudo.
Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
---
core/adbd/adb.c | 1 -
- core/adbd/services.c | 160 ++++-------------------------------------------
+ core/adbd/services.c | 160 +++------------------------------------
debian/makefiles/adbd.mk | 4 +-
3 files changed, 14 insertions(+), 151 deletions(-)
@@ -260,5 +263,5 @@ index 49dab8c..22c1816 100644
OBJS= $(patsubst %, %.o, $(basename $(SRCS)))
--
-2.5.1
+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
index 95517c307b..a951271873 100644
--- a/package/android-tools/0003-Fix-build-issue-with-uclibc.patch
+++ b/package/android-tools/0003-Fix-build-issue-with-uclibc.patch
@@ -1,7 +1,11 @@
-[PATCH] Fix build issue with uclibc
+From 082ee80d3524fa3474644c09b441d7f7947675cc Mon Sep 17 00:00:00 2001
+From: Gary Bisson <gary.bisson@boundarydevices.com>
+Date: Sun, 1 Dec 2024 15:43:56 +0100
+Subject: [PATCH] Fix build issue with uclibc
Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
---
+ core/adb/adb_auth_client.c | 2 +-
core/adbd/adb_auth_client.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
@@ -32,5 +36,5 @@ index 0b4913e..068d837 100644
D("%s: Invalid base64 data ret=%d\n", file, ret);
free(key);
--
-2.6.1
+2.47.0
diff --git a/package/android-tools/0004-Fix-build-issue-with-musl.patch b/package/android-tools/0004-Fix-build-issue-with-musl.patch
index 964eb87a6d..affd75b259 100644
--- a/package/android-tools/0004-Fix-build-issue-with-musl.patch
+++ b/package/android-tools/0004-Fix-build-issue-with-musl.patch
@@ -1,4 +1,7 @@
-[PATCH] Fix build issue with musl
+From d14ca3e3362448590adaebacb76d4d8046f9b556 Mon Sep 17 00:00:00 2001
+From: Gary Bisson <gary.bisson@boundarydevices.com>
+Date: Sun, 1 Dec 2024 15:44:16 +0100
+Subject: [PATCH] Fix build issue with musl
arpa/nameser.h doesn't use the same macro name to avoid several
inclusions.
@@ -8,19 +11,12 @@ TEMP_FAILURE_RETRY macro.
Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
---
- core/adbd/arpa_nameser.h | 12 +++++++++---
- core/adbd/base64.c | 1 -
- core/adbd/framebuffer_service.c | 1 +
- core/adbd/qemu_pipe.h | 1 -
- core/include/cutils/android_reboot.h | 8 ++++++--
- core/include/cutils/bitops.h | 10 ++++++----
- core/include/cutils/partition_utils.h | 8 ++++++--
- extras/ext4_utils/sha1.c | 3 ---
- extras/ext4_utils/sha1.h | 13 ++++++-------
- 9 files changed, 34 insertions(+), 23 deletions(-)
+ core/adbd/arpa_nameser.h | 3 +++
+ core/adbd/framebuffer_service.c | 1 +
+ 2 files changed, 4 insertions(+)
diff --git a/core/adbd/arpa_nameser.h b/core/adbd/arpa_nameser.h
-index 438dc04..b2a28d6 100644
+index 438dc04..f3d2fee 100644
--- a/core/adbd/arpa_nameser.h
+++ b/core/adbd/arpa_nameser.h
@@ -52,6 +52,8 @@
@@ -32,7 +28,7 @@ index 438dc04..b2a28d6 100644
#define BIND_4_COMPAT
-@@ -574,4 +579,5 @@ __END_DECLS
+@@ -574,4 +576,5 @@ __END_DECLS
#define XLOG(...) do {} while (0)
#endif
@@ -51,4 +47,5 @@ index 20c08d2..48e0241 100644
#include <sys/ioctl.h>
#include <sys/mman.h>
--
-2.6.1
+2.47.0
+
diff --git a/package/android-tools/0005-Use-pkgconf-to-get-libs-deps.patch b/package/android-tools/0005-makefiles-use-pkgconf-to-get-libs-deps.patch
similarity index 57%
rename from package/android-tools/0005-Use-pkgconf-to-get-libs-deps.patch
rename to package/android-tools/0005-makefiles-use-pkgconf-to-get-libs-deps.patch
index 63ea1fb6a4..8136ac832d 100644
--- a/package/android-tools/0005-Use-pkgconf-to-get-libs-deps.patch
+++ b/package/android-tools/0005-makefiles-use-pkgconf-to-get-libs-deps.patch
@@ -1,4 +1,7 @@
-makefiles: use pkgconf to get libs deps
+From 10f3f6fb75da72f155e72794d6647e4fa21a87d0 Mon Sep 17 00:00:00 2001
+From: Giulio Benetti <giulio.benetti@micronovasrl.com>
+Date: Sun, 1 Dec 2024 15:45:01 +0100
+Subject: [PATCH] makefiles: use pkgconf to get libs deps
LIBS lists library dependencies without taking into account static linking
that need ordered listing and more libraries listed since differently from
@@ -10,26 +13,36 @@ needed libraries are listed during linking.
Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
---
-diff -urpN android-tools-4.2.2+git20130218.orig/debian/makefiles/adbd.mk android-tools-4.2.2+git20130218/debian/makefiles/adbd.mk
---- android-tools-4.2.2+git20130218.orig/debian/makefiles/adbd.mk 2019-04-08 16:05:02.967710428 +0200
-+++ android-tools-4.2.2+git20130218/debian/makefiles/adbd.mk 2019-04-08 16:30:42.463084426 +0200
+ debian/makefiles/adb.mk | 2 +-
+ debian/makefiles/adbd.mk | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/debian/makefiles/adb.mk b/debian/makefiles/adb.mk
+index 654b9f1..a03c93a 100644
+--- a/debian/makefiles/adb.mk
++++ b/debian/makefiles/adb.mk
+@@ -41,7 +41,7 @@ CPPFLAGS+= -DHAVE_TERMIO_H
+ CPPFLAGS+= -I$(SRCDIR)/core/adb
+ CPPFLAGS+= -I$(SRCDIR)/core/include
+
+-LIBS+= -lc -lpthread -lz -lcrypto
++LIBS+= -lc -lpthread -lz `pkg-config --libs libcrypto`
+
+ OBJS= $(SRCS:.c=.o)
+
+diff --git a/debian/makefiles/adbd.mk b/debian/makefiles/adbd.mk
+index 22c1816..a8eee3a 100644
+--- a/debian/makefiles/adbd.mk
++++ b/debian/makefiles/adbd.mk
@@ -44,7 +44,7 @@ CPPFLAGS+= -DADBD_NON_ANDROID
CPPFLAGS+= -I$(SRCDIR)/core/adbd
CPPFLAGS+= -I$(SRCDIR)/core/include
-
+
-LIBS+= -lc -lpthread -lz -lcrypto -lcrypt
+LIBS+= -lc -lpthread -lz `pkg-config --libs libcrypto` -lcrypt
-
+
OBJS= $(patsubst %, %.o, $(basename $(SRCS)))
+
+--
+2.47.0
-diff -urpN android-tools-4.2.2+git20130218.orig/debian/makefiles/adb.mk android-tools-4.2.2+git20130218/debian/makefiles/adb.mk
---- android-tools-4.2.2+git20130218.orig/debian/makefiles/adb.mk 2019-04-08 16:05:02.959701400 +0200
-+++ android-tools-4.2.2+git20130218/debian/makefiles/adb.mk 2019-04-08 16:31:06.529426250 +0200
-@@ -41,7 +41,7 @@ CPPFLAGS+= -DHAVE_TERMIO_H
- CPPFLAGS+= -I$(SRCDIR)/core/adb
- CPPFLAGS+= -I$(SRCDIR)/core/include
-
--LIBS+= -lc -lpthread -lz -lcrypto
-+LIBS+= -lc -lpthread -lz `pkg-config --libs libcrypto`
-
- OBJS= $(SRCS:.c=.o)
diff --git a/package/android-tools/0006-fix-big-endian-build.patch b/package/android-tools/0006-Fix-build-on-big-endian-systems.patch
similarity index 75%
rename from package/android-tools/0006-fix-big-endian-build.patch
rename to package/android-tools/0006-Fix-build-on-big-endian-systems.patch
index c35fdcb8c4..d7fcb1cf0f 100644
--- a/package/android-tools/0006-fix-big-endian-build.patch
+++ b/package/android-tools/0006-Fix-build-on-big-endian-systems.patch
@@ -1,4 +1,7 @@
-Fix build on big endian systems
+From 8f7e9458dbfca969d3edc9cf409b3439e98f4c5a Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date: Sun, 1 Dec 2024 15:45:26 +0100
+Subject: [PATCH] Fix build on big endian systems
The usb_linux_client.c file defines cpu_to_le16/32 by using the C
library htole16/32 function calls. However, cpu_to_le16/32 are used
@@ -14,9 +17,13 @@ To solve this, we simply open-code cpu_to_le16/32 in a way that allows
them to be used when initializing structures.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ core/adb/usb_linux_client.c | 11 +++++++++--
+ core/adbd/usb_linux_client.c | 11 +++++++++--
+ 2 files changed, 18 insertions(+), 4 deletions(-)
-Index: b/core/adb/usb_linux_client.c
-===================================================================
+diff --git a/core/adb/usb_linux_client.c b/core/adb/usb_linux_client.c
+index fb1dad0..a981e96 100644
--- a/core/adb/usb_linux_client.c
+++ b/core/adb/usb_linux_client.c
@@ -34,8 +34,15 @@
@@ -37,8 +44,8 @@ Index: b/core/adb/usb_linux_client.c
struct usb_handle
{
-Index: b/core/adbd/usb_linux_client.c
-===================================================================
+diff --git a/core/adbd/usb_linux_client.c b/core/adbd/usb_linux_client.c
+index 33875a8..0e4d200 100644
--- a/core/adbd/usb_linux_client.c
+++ b/core/adbd/usb_linux_client.c
@@ -34,8 +34,15 @@
@@ -59,3 +66,6 @@ Index: b/core/adbd/usb_linux_client.c
struct usb_handle
{
+--
+2.47.0
+
diff --git a/package/android-tools/0007-include-cdefs-h-when-needed.patch b/package/android-tools/0007-Include-cdefs.h-wherever-it-is-needed.patch
similarity index 71%
rename from package/android-tools/0007-include-cdefs-h-when-needed.patch
rename to package/android-tools/0007-Include-cdefs.h-wherever-it-is-needed.patch
index da4ee13a17..d4e483c6d7 100644
--- a/package/android-tools/0007-include-cdefs-h-when-needed.patch
+++ b/package/android-tools/0007-Include-cdefs.h-wherever-it-is-needed.patch
@@ -1,4 +1,7 @@
-Include cdefs.h wherever it is needed
+From d3f0157bf2ac1afc9a810ccbe188110df724129d Mon Sep 17 00:00:00 2001
+From: "Yann E. MORIN" <yann.morin.1998@free.fr>
+Date: Sun, 1 Dec 2024 15:46:15 +0100
+Subject: [PATCH] Include cdefs.h wherever it is needed
cdefs.h is included from within a lot of glibc headers, so it almost
invariably and automagically gets pulled in with glibc.
@@ -11,12 +14,12 @@ So we must include it when we are going to use macros it provides.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
- core/adbd/services.c | 1 +
- core/libcutils/android_reboot.c | 1 +
- 2 files changed, 2 insertions(+), 0 deletion(-)
+ core/adbd/services.c | 1 +
+ core/libcutils/android_reboot.c | 1 +
+ 2 files changed, 2 insertions(+)
diff --git a/core/adbd/services.c b/core/adbd/services.c
-index 20c08d2..48e0241 100644
+index 5adcefe..6de1951 100644
--- a/core/adbd/services.c
+++ b/core/adbd/services.c
@@ -20,6 +20,7 @@
@@ -28,7 +31,7 @@ index 20c08d2..48e0241 100644
#include "sysdeps.h"
diff --git a/core/libcutils/android_reboot.c b/core/libcutils/android_reboot.c
-index 20c08d2..48e0241 100644
+index 79c05f8..9386006 100644
--- a/core/libcutils/android_reboot.c
+++ b/core/libcutils/android_reboot.c
@@ -23,6 +23,7 @@
@@ -39,3 +42,6 @@ index 20c08d2..48e0241 100644
#include <cutils/android_reboot.h>
+--
+2.47.0
+
diff --git a/package/android-tools/0008-Include-sysmacros.h-to-compile-with-glibc-2.28.patch b/package/android-tools/0008-Include-sysmacros.h-to-compile-with-glibc-2.28.patch
deleted file mode 100644
index 77b457f604..0000000000
--- a/package/android-tools/0008-Include-sysmacros.h-to-compile-with-glibc-2.28.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-usb_linux.c: fix minor()/major() build failure due to glibc 2.28
-
-glibc 2.28 no longer includes <sys/sysmacros.h> from <sys/types.h>,
-and therefore <sys/sysmacros.h> must be included explicitly when
-major()/minor() are used.
-
-This commit adds a patch to directly include <sys/sysmacros.h> into
-all usb_linux.c files where minor() and major() macros are used.
-
-diff -urpN host-android-tools-4.2.2+git20130218.orig/core/adb/usb_linux.c host-android-tools-4.2.2+git20130218/core/adb/usb_linux.c
---- host-android-tools-4.2.2+git20130218.orig/core/adb/usb_linux.c 2013-02-18 15:49:03.000000000 +0100
-+++ host-android-tools-4.2.2+git20130218/core/adb/usb_linux.c 2018-09-09 11:47:16.476292546 +0200
-@@ -20,6 +20,7 @@
- #include <string.h>
-
- #include <sys/ioctl.h>
-+#include <sys/sysmacros.h>
- #include <sys/types.h>
- #include <sys/time.h>
- #include <dirent.h>
-diff -urpN host-android-tools-4.2.2+git20130218.orig/core/adbd/usb_linux.c host-android-tools-4.2.2+git20130218/core/adbd/usb_linux.c
---- host-android-tools-4.2.2+git20130218.orig/core/adbd/usb_linux.c 2018-09-09 02:32:57.154503866 +0200
-+++ host-android-tools-4.2.2+git20130218/core/adbd/usb_linux.c 2018-09-09 11:47:28.148353880 +0200
-@@ -20,6 +20,7 @@
- #include <string.h>
-
- #include <sys/ioctl.h>
-+#include <sys/sysmacros.h>
- #include <sys/types.h>
- #include <sys/time.h>
- #include <dirent.h>
-diff -urpN host-android-tools-4.2.2+git20130218.orig/core/fastboot/usb_linux.c host-android-tools-4.2.2+git20130218/core/fastboot/usb_linux.c
---- host-android-tools-4.2.2+git20130218.orig/core/fastboot/usb_linux.c 2013-02-18 15:49:03.000000000 +0100
-+++ host-android-tools-4.2.2+git20130218/core/fastboot/usb_linux.c 2018-09-09 11:46:53.028169154 +0200
-@@ -33,6 +33,7 @@
-
- #include <sys/ioctl.h>
- #include <sys/stat.h>
-+#include <sys/sysmacros.h>
- #include <sys/types.h>
- #include <dirent.h>
- #include <fcntl.h>
diff --git a/package/android-tools/0008-usb_linux.c-fix-minor-major-build-failure-due-to-gli.patch b/package/android-tools/0008-usb_linux.c-fix-minor-major-build-failure-due-to-gli.patch
new file mode 100644
index 0000000000..38b3b9a482
--- /dev/null
+++ b/package/android-tools/0008-usb_linux.c-fix-minor-major-build-failure-due-to-gli.patch
@@ -0,0 +1,59 @@
+From 99c20bd08065d9c78d81ba7aa48a2a113ab28c26 Mon Sep 17 00:00:00 2001
+From: Giulio Benetti <giulio.benetti@micronovasrl.com>
+Date: Sun, 1 Dec 2024 15:46:50 +0100
+Subject: [PATCH] usb_linux.c: fix minor()/major() build failure due to glibc
+ 2.28
+
+glibc 2.28 no longer includes <sys/sysmacros.h> from <sys/types.h>,
+and therefore <sys/sysmacros.h> must be included explicitly when
+major()/minor() are used.
+
+This commit adds a patch to directly include <sys/sysmacros.h> into
+all usb_linux.c files where minor() and major() macros are used.
+
+Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
+---
+ core/adb/usb_linux.c | 1 +
+ core/adbd/usb_linux.c | 1 +
+ core/fastboot/usb_linux.c | 1 +
+ 3 files changed, 3 insertions(+)
+
+diff --git a/core/adb/usb_linux.c b/core/adb/usb_linux.c
+index 7bf2057..f748267 100644
+--- a/core/adb/usb_linux.c
++++ b/core/adb/usb_linux.c
+@@ -20,6 +20,7 @@
+ #include <string.h>
+
+ #include <sys/ioctl.h>
++#include <sys/sysmacros.h>
+ #include <sys/types.h>
+ #include <sys/time.h>
+ #include <dirent.h>
+diff --git a/core/adbd/usb_linux.c b/core/adbd/usb_linux.c
+index 7bf2057..f748267 100644
+--- a/core/adbd/usb_linux.c
++++ b/core/adbd/usb_linux.c
+@@ -20,6 +20,7 @@
+ #include <string.h>
+
+ #include <sys/ioctl.h>
++#include <sys/sysmacros.h>
+ #include <sys/types.h>
+ #include <sys/time.h>
+ #include <dirent.h>
+diff --git a/core/fastboot/usb_linux.c b/core/fastboot/usb_linux.c
+index b7a9ca3..2dac62b 100644
+--- a/core/fastboot/usb_linux.c
++++ b/core/fastboot/usb_linux.c
+@@ -33,6 +33,7 @@
+
+ #include <sys/ioctl.h>
+ #include <sys/stat.h>
++#include <sys/sysmacros.h>
+ #include <sys/types.h>
+ #include <dirent.h>
+ #include <fcntl.h>
+--
+2.47.0
+
diff --git a/package/android-tools/0009-Fix-makefiles-for-out-of-tree-ext4_utils-build.patch b/package/android-tools/0009-Fix-makefiles-for-out-of-tree-ext4_utils-build.patch
index 80ea1ec1fe..94216102cf 100644
--- a/package/android-tools/0009-Fix-makefiles-for-out-of-tree-ext4_utils-build.patch
+++ b/package/android-tools/0009-Fix-makefiles-for-out-of-tree-ext4_utils-build.patch
@@ -1,4 +1,4 @@
-From d24abbec201975a5eb7f8589614cfb424b8c80b6 Mon Sep 17 00:00:00 2001
+From 3c4319da20fab4e48ec02e28f5b013b4a33b5fe4 Mon Sep 17 00:00:00 2001
From: Alex Kaplan <kaplan2539@gmail.com>
Date: Sat, 10 Nov 2018 19:50:51 -0800
Subject: [PATCH] Fix makefiles for out-of-tree ext4_utils build
@@ -44,5 +44,5 @@ index cb64916..c5904bf 100644
LIBS+= -lz -lselinux
--
-2.7.4
+2.47.0
diff --git a/package/android-tools/0010-adb-added-patch-for-openssl-1.1.0-compatibility.patch b/package/android-tools/0010-adb-added-patch-for-openssl-1.1.0-compatibility.patch
index 2de338368f..96ca5b737a 100644
--- a/package/android-tools/0010-adb-added-patch-for-openssl-1.1.0-compatibility.patch
+++ b/package/android-tools/0010-adb-added-patch-for-openssl-1.1.0-compatibility.patch
@@ -1,4 +1,4 @@
-From bb3da0e32be4f2260940edf3ee0f88103dfd0dcc Mon Sep 17 00:00:00 2001
+From 79bf5cdee607241434e0d1c5b72e724eb1d20102 Mon Sep 17 00:00:00 2001
From: Eneas U de Queiroz <cote2004-github@yahoo.com>
Date: Tue, 5 Feb 2019 01:12:19 +0200
Subject: [PATCH] adb: added patch for openssl 1.1.0 compatibility
@@ -43,5 +43,5 @@ index 9039d42..debd2ef 100644
out:
BN_free(n0inv);
--
-2.14.1
+2.47.0
diff --git a/package/android-tools/0011-core-fastboot-fastboot.c-reorder-functions-to-avoid-.patch b/package/android-tools/0011-core-fastboot-fastboot.c-reorder-functions-to-avoid-.patch
index b5592e6992..17a7619bf0 100644
--- a/package/android-tools/0011-core-fastboot-fastboot.c-reorder-functions-to-avoid-.patch
+++ b/package/android-tools/0011-core-fastboot-fastboot.c-reorder-functions-to-avoid-.patch
@@ -1,4 +1,4 @@
-From 9724d78fda4eb023f83d2fd30e665b436d7a7f97 Mon Sep 17 00:00:00 2001
+From 6919b6619a9c744d2220f7af6e211c50662ba94b Mon Sep 17 00:00:00 2001
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Date: Sun, 14 Jul 2024 11:41:10 +0200
Subject: [PATCH] core/fastboot/fastboot.c: reorder functions to avoid implicit
@@ -50,5 +50,5 @@ index 3de6d7d..9b2c86f 100644
{
if (match_fastboot_with_serial(info, NULL) == 0) {
--
-2.45.2
+2.47.0
diff --git a/package/android-tools/0012-core-libsparse-sparse_read.c-add-missing-output_file.patch b/package/android-tools/0012-core-libsparse-sparse_read.c-add-missing-output_file.patch
index 9a6a77eceb..9e35a4782d 100644
--- a/package/android-tools/0012-core-libsparse-sparse_read.c-add-missing-output_file.patch
+++ b/package/android-tools/0012-core-libsparse-sparse_read.c-add-missing-output_file.patch
@@ -1,4 +1,4 @@
-From 2812c2005cfa4bfc5741651c8310e36f28c0327e Mon Sep 17 00:00:00 2001
+From 72b9e79c81a237f1839afb4fdee680eafdd180d9 Mon Sep 17 00:00:00 2001
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Date: Sun, 14 Jul 2024 11:41:56 +0200
Subject: [PATCH] core/libsparse/sparse_read.c: add missing output_file.h
@@ -33,5 +33,5 @@ index 704bcfa..0a8f838 100644
#if defined(__APPLE__) && defined(__MACH__)
#define lseek64 lseek
--
-2.45.2
+2.47.0
diff --git a/package/android-tools/0013-extras-ext4_utils-make_ext4fs_main.c-disable-Android.patch b/package/android-tools/0013-extras-ext4_utils-make_ext4fs_main.c-disable-Android.patch
index c11e88bf07..b6902982f7 100644
--- a/package/android-tools/0013-extras-ext4_utils-make_ext4fs_main.c-disable-Android.patch
+++ b/package/android-tools/0013-extras-ext4_utils-make_ext4fs_main.c-disable-Android.patch
@@ -1,4 +1,4 @@
-From 83f9bed233b86dd2bbf603611b13b673caeccb69 Mon Sep 17 00:00:00 2001
+From 01e86db8460d873aec15d658bfc717b026c0545f Mon Sep 17 00:00:00 2001
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Date: Sun, 14 Jul 2024 11:46:51 +0200
Subject: [PATCH] extras/ext4_utils/make_ext4fs_main.c: disable
@@ -50,5 +50,5 @@ index 17d3735..cb58011 100644
if (!sehnd && mountpoint) {
sehnd = selinux_android_file_context_handle();
--
-2.45.2
+2.47.0
diff --git a/package/android-tools/0014-core-adbd-adb.c-open-code-capset.patch b/package/android-tools/0014-core-adbd-adb.c-open-code-capset.patch
index 1496b8bca4..36a9208c60 100644
--- a/package/android-tools/0014-core-adbd-adb.c-open-code-capset.patch
+++ b/package/android-tools/0014-core-adbd-adb.c-open-code-capset.patch
@@ -1,4 +1,4 @@
-From 2b5060146b0890f7f1a63ef891af1358b8cdf9bc Mon Sep 17 00:00:00 2001
+From 850fd3f4a0384ebe492a466a9b1149060619aacb Mon Sep 17 00:00:00 2001
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Date: Sun, 14 Jul 2024 12:57:22 +0200
Subject: [PATCH] core/adbd/adb.c: open code capset()
@@ -48,5 +48,5 @@ index 7fe6445..98b1de1 100644
D("Local port disabled\n");
} else {
--
-2.45.2
+2.47.0
--git a/package/android-tools/0015-core-adbd-adb.c-include-correct-header-for-prctl.patch b/package/android-tools/0015-core-adbd-adb.c-include-correct-header-for-prctl.patch
index cfbefecb26..0a35dbcc74 100644
--- a/package/android-tools/0015-core-adbd-adb.c-include-correct-header-for-prctl.patch
+++ b/package/android-tools/0015-core-adbd-adb.c-include-correct-header-for-prctl.patch
@@ -1,4 +1,4 @@
-From c14070011e070d8674cf3578708cbae433090a47 Mon Sep 17 00:00:00 2001
+From 8f351150de38641c8ce2e9b7f9a5cba29ccd8f7e Mon Sep 17 00:00:00 2001
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Date: Sun, 14 Jul 2024 13:00:02 +0200
Subject: [PATCH] core/adbd/adb.c: include correct header for prctl()
@@ -30,5 +30,5 @@ index 98b1de1..10f420b 100644
#else
#include "usb_vendors.h"
--
-2.45.2
+2.47.0
--
2.47.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH 2/3] package/android-tools: fix build issue on mips64 and powerpc64
2024-12-04 20:47 [Buildroot] [PATCH 0/3] Fix two android-tools build issues Thomas Petazzoni via buildroot
2024-12-04 20:48 ` [Buildroot] [PATCH 1/3] package/android-tools: convert all patches to Git-formatted patches Thomas Petazzoni via buildroot
@ 2024-12-04 20:48 ` Thomas Petazzoni via buildroot
2024-12-06 22:44 ` Peter Korsgaard
2024-12-04 20:48 ` [Buildroot] [PATCH 3/3] package/android-tools: fix b64_pton() issue with GCC >= 14.x Thomas Petazzoni
2024-12-04 21:48 ` [Buildroot] [PATCH 0/3] Fix two android-tools build issues Arnout Vandecappelle via buildroot
3 siblings, 1 reply; 9+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-12-04 20:48 UTC (permalink / raw)
To: buildroot; +Cc: Thomas Petazzoni
The kernel headers on mips64 and powerpc64 were historically "broken",
defining u64 as an "unsigned long" instead of "unsigned long
long". This has been fixed in the upstream Linux kernel by introducing
the __SANE_USERSPACE_TYPES__ definition.
Our commit a2e178d6b45dfc5b8d1d50fcbbfc0bec5ebf1ae2 ("android-tools:
disable on some architecture with old kernel headers") already
disabled building fastboot on powerpc64 and mips64 systems that have
too old kernel headers. However, it turns out that even with the new
kernel headers, there are build issues because
__SANE_USERSPACE_TYPES__ isn't defined everywhere it should be in the
android-tools code base. The Debian patche
debian/patches/ppc64el-ftbfs.patch adds some definitions, but it's
missing one file, and in another the definition comes too late.
This commit adds an extra patch that fixes this up, and makes fastboot
build properly on mips64 and powerpc64.
Fixes:
http://autobuild.buildroot.net/results/8528ff876e695f79bdfe64f5330d9d51eeef66cb/ (powerpc64)
http://autobuild.buildroot.net/results/36ac6af73b618c28d1636093da333f7ebd9d6cfe/ (mips64)
This issue has been occurring as far as Feb 2021, with the first
occurence apparently being:
http://autobuild.buildroot.net/results/d9521b4bfeafb1140c21745dbfe28d476a9b71ec/
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
...s-make_ext4fs.c-define-__SANE_USERSP.patch | 68 +++++++++++++++++++
1 file changed, 68 insertions(+)
create mode 100644 package/android-tools/0016-extras-ext4_utils-make_ext4fs.c-define-__SANE_USERSP.patch
diff --git a/package/android-tools/0016-extras-ext4_utils-make_ext4fs.c-define-__SANE_USERSP.patch b/package/android-tools/0016-extras-ext4_utils-make_ext4fs.c-define-__SANE_USERSP.patch
new file mode 100644
index 0000000000..5f3650cc77
--- /dev/null
+++ b/package/android-tools/0016-extras-ext4_utils-make_ext4fs.c-define-__SANE_USERSP.patch
@@ -0,0 +1,68 @@
+From 5db9529436f13b8c073a0310da3a1107f84645da Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
+Date: Wed, 4 Dec 2024 20:51:22 +0100
+Subject: [PATCH] extras/ext4_utils/make_ext4fs.c: define
+ __SANE_USERSPACE_TYPES__
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The Debian patch ppc64el-ftbfs.patch is already defining
+__SANE_USERSPACE_TYPES__ in a few files to solve a conflict between
+kernel header definitions and local definition of some types, on
+powerpc64 and mips64.
+
+However, the Debian patch lacks an update to ext4_utils.c, and has the
+definition too late in make_ext4fs.c. This commit therefore fixes
+those two remaining issues, fixing:
+
+error: conflicting types for ‘u64’; have ‘long unsigned int’
+
+Upstream: N/A, we're too far from upstream
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
+---
+ extras/ext4_utils/ext4_utils.c | 5 ++++-
+ extras/ext4_utils/make_ext4fs.c | 4 ++++
+ 2 files changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/extras/ext4_utils/ext4_utils.c b/extras/ext4_utils/ext4_utils.c
+index e95f5cc..9f6836f 100644
+--- a/extras/ext4_utils/ext4_utils.c
++++ b/extras/ext4_utils/ext4_utils.c
+@@ -14,6 +14,10 @@
+ * limitations under the License.
+ */
+
++#if defined(__linux__)
++#define __SANE_USERSPACE_TYPES__
++#endif
++
+ #include "ext4_utils.h"
+ #include "uuid.h"
+ #include "allocate.h"
+@@ -36,7 +40,6 @@
+ #endif
+
+ #if defined(__linux__)
+-#define __SANE_USERSPACE_TYPES__
+ #include <linux/fs.h>
+ #elif defined(__APPLE__) && defined(__MACH__)
+ #include <sys/disk.h>
+diff --git a/extras/ext4_utils/make_ext4fs.c b/extras/ext4_utils/make_ext4fs.c
+index 3124aed..332a213 100644
+--- a/extras/ext4_utils/make_ext4fs.c
++++ b/extras/ext4_utils/make_ext4fs.c
+@@ -14,6 +14,10 @@
+ * limitations under the License.
+ */
+
++#if defined(__linux__)
++#define __SANE_USERSPACE_TYPES__
++#endif
++
+ #include "make_ext4fs.h"
+ #include "ext4_utils.h"
+ #include "allocate.h"
+--
+2.47.0
+
--
2.47.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH 3/3] package/android-tools: fix b64_pton() issue with GCC >= 14.x
2024-12-04 20:47 [Buildroot] [PATCH 0/3] Fix two android-tools build issues Thomas Petazzoni via buildroot
2024-12-04 20:48 ` [Buildroot] [PATCH 1/3] package/android-tools: convert all patches to Git-formatted patches Thomas Petazzoni via buildroot
2024-12-04 20:48 ` [Buildroot] [PATCH 2/3] package/android-tools: fix build issue on mips64 and powerpc64 Thomas Petazzoni via buildroot
@ 2024-12-04 20:48 ` Thomas Petazzoni
2024-12-06 22:44 ` Peter Korsgaard
2024-12-04 21:48 ` [Buildroot] [PATCH 0/3] Fix two android-tools build issues Arnout Vandecappelle via buildroot
3 siblings, 1 reply; 9+ messages in thread
From: Thomas Petazzoni @ 2024-12-04 20:48 UTC (permalink / raw)
To: buildroot; +Cc: Thomas Petazzoni
The android-tools code base uses the __b64_pton() function, which
isn't provided by all C libraries. So the Debian patch
debian/patches/add_adbd.patch adds an implementation of b64_pton(),
but doesn't actually use it, nor defines a prototype for it. Our
existing patch 0003-Fix-build-issue-with-uclibc.patch switches the
code to use the b64_pton() function... but still without providing a
prototype, causing the following build failures with GCC >= 14.x:
adb_auth_client.c:75:15: error: implicit declaration of function 'b64_pton'
To fix this, we rework 0003-Fix-build-issue-with-uclibc.patch into a
patch that:
(1) Renames b64_pton() to adb_b64_pton() to make sure it won't clash
with implementations provided by some C libraries, and adjusts
the call sites accordingly.
(2) Adds a prototype definition of adb_b64_pton() in places where
this function is used.
Fixes:
http://autobuild.buildroot.net/results/b25b25337c7ad89c33f8bd20b646850bd993ec53ae9/
Even though GCC 14.x support was merged in Buildroot in May 2024, this
particular b64_pton() only started appearing on July 15 2024, with the
first occurence being:
http://autobuild.buildroot.net/results/1cbe87bbe3c56f28444b3aaba1ba1d05f947d36e/
Indeed, it's not before July 15 2024 that we merged commit
d201f2f5cd0d1e0389430cda78adead37977a6cd ("package/android-tools: add
patches to fix build with GCC 14.x"), which fixed other GCC 14.x
issues, which were hiding this b64_pton() problem.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
.checkpackageignore | 1 -
...0003-Adjust-base64-function-handling.patch | 96 +++++++++++++++++++
.../0003-Fix-build-issue-with-uclibc.patch | 40 --------
3 files changed, 96 insertions(+), 41 deletions(-)
create mode 100644 package/android-tools/0003-Adjust-base64-function-handling.patch
delete mode 100644 package/android-tools/0003-Fix-build-issue-with-uclibc.patch
diff --git a/.checkpackageignore b/.checkpackageignore
index 11e410b4ea..0dcca5ebc7 100644
--- a/.checkpackageignore
+++ b/.checkpackageignore
@@ -271,7 +271,6 @@ package/am33x-cm3/0004-Makefile-add-fno-builtin.patch lib_patch.Upstream
package/am33x-cm3/S93-am335x-pm-firmware-load lib_sysv.Variables
package/android-tools/0001-Fix-makefiles-for-out-of-tree-build.patch lib_patch.Upstream
package/android-tools/0002-Fix-adbd-for-non-Ubuntu-systems.patch lib_patch.Upstream
-package/android-tools/0003-Fix-build-issue-with-uclibc.patch lib_patch.Upstream
package/android-tools/0004-Fix-build-issue-with-musl.patch lib_patch.Upstream
package/android-tools/0005-makefiles-use-pkgconf-to-get-libs-deps.patch lib_patch.Upstream
package/android-tools/0006-Fix-build-on-big-endian-systems.patch lib_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 <thomas.petazzoni@bootlin.com>
+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 <thomas.petazzoni@bootlin.com>
+---
+ 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 <gary.bisson@boundarydevices.com>
-Date: Sun, 1 Dec 2024 15:43:56 +0100
-Subject: [PATCH] Fix build issue with uclibc
-
-Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
----
- 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
-
--
2.47.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [Buildroot] [PATCH 0/3] Fix two android-tools build issues
2024-12-04 20:47 [Buildroot] [PATCH 0/3] Fix two android-tools build issues Thomas Petazzoni via buildroot
` (2 preceding siblings ...)
2024-12-04 20:48 ` [Buildroot] [PATCH 3/3] package/android-tools: fix b64_pton() issue with GCC >= 14.x Thomas Petazzoni
@ 2024-12-04 21:48 ` Arnout Vandecappelle via buildroot
2024-12-04 21:52 ` Thomas Petazzoni
3 siblings, 1 reply; 9+ messages in thread
From: Arnout Vandecappelle via buildroot @ 2024-12-04 21:48 UTC (permalink / raw)
To: Thomas Petazzoni, buildroot
On 04/12/2024 21:47, Thomas Petazzoni via buildroot wrote:
> Hello,
>
> The android-tools has been causing failures in the autobuilders pretty
> much every day for the past few months, so it was about time to fix
> those issues.
>
> This patch series fixes the two most prominent issues:
>
> - An issue related to u64 definition on powerpc64/mips64, which has
> been occurring in the autobuilders since at least Feb 2021. This
> patch should be backported to 2024.02.x.
>
> - An issue related to GCC 14.x. Since the support of GCC 14.x is not
> in 2024.02.x, this second fix is not strictly needed in 2024.02.x,
> but also shouldn't be harmful.
>
> A preparation patch converting the existing patch stack to be
> applicable with "git am" is proposed, as it was needed to preserve my
> sanity while working on the patch series.
>
> Thomas Petazzoni (3):
> package/android-tools: convert all patches to Git-formatted patches
> package/android-tools: fix build issue on mips64 and powerpc64
> package/android-tools: fix b64_pton() issue with GCC >= 14.x
Series applied to master,thanks. Though I don't like the "we're too far from
upstream" part too much :-)
Regards,
Arnout
>
> .checkpackageignore | 9 +-
> ...-Fix-makefiles-for-out-of-tree-build.patch | 7 +-
> ...0002-Fix-adbd-for-non-Ubuntu-systems.patch | 9 +-
> ...0003-Adjust-base64-function-handling.patch | 96 +++++++++++++++++++
> .../0003-Fix-build-issue-with-uclibc.patch | 36 -------
> .../0004-Fix-build-issue-with-musl.patch | 25 +++--
> ...efiles-use-pkgconf-to-get-libs-deps.patch} | 47 +++++----
> ...006-Fix-build-on-big-endian-systems.patch} | 20 +++-
> ...clude-cdefs.h-wherever-it-is-needed.patch} | 18 ++--
> ...smacros.h-to-compile-with-glibc-2.28.patch | 42 --------
> ...minor-major-build-failure-due-to-gli.patch | 59 ++++++++++++
> ...les-for-out-of-tree-ext4_utils-build.patch | 4 +-
> ...atch-for-openssl-1.1.0-compatibility.patch | 4 +-
> ...stboot.c-reorder-functions-to-avoid-.patch | 4 +-
> ...parse_read.c-add-missing-output_file.patch | 4 +-
> ...s-make_ext4fs_main.c-disable-Android.patch | 4 +-
> ...014-core-adbd-adb.c-open-code-capset.patch | 4 +-
> ...b.c-include-correct-header-for-prctl.patch | 4 +-
> ...s-make_ext4fs.c-define-__SANE_USERSP.patch | 68 +++++++++++++
> 19 files changed, 320 insertions(+), 144 deletions(-)
> create mode 100644 package/android-tools/0003-Adjust-base64-function-handling.patch
> delete mode 100644 package/android-tools/0003-Fix-build-issue-with-uclibc.patch
> rename package/android-tools/{0005-Use-pkgconf-to-get-libs-deps.patch => 0005-makefiles-use-pkgconf-to-get-libs-deps.patch} (57%)
> rename package/android-tools/{0006-fix-big-endian-build.patch => 0006-Fix-build-on-big-endian-systems.patch} (75%)
> rename package/android-tools/{0007-include-cdefs-h-when-needed.patch => 0007-Include-cdefs.h-wherever-it-is-needed.patch} (71%)
> delete mode 100644 package/android-tools/0008-Include-sysmacros.h-to-compile-with-glibc-2.28.patch
> create mode 100644 package/android-tools/0008-usb_linux.c-fix-minor-major-build-failure-due-to-gli.patch
> create mode 100644 package/android-tools/0016-extras-ext4_utils-make_ext4fs.c-define-__SANE_USERSP.patch
>
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Buildroot] [PATCH 0/3] Fix two android-tools build issues
2024-12-04 21:48 ` [Buildroot] [PATCH 0/3] Fix two android-tools build issues Arnout Vandecappelle via buildroot
@ 2024-12-04 21:52 ` Thomas Petazzoni
0 siblings, 0 replies; 9+ messages in thread
From: Thomas Petazzoni @ 2024-12-04 21:52 UTC (permalink / raw)
To: Arnout Vandecappelle; +Cc: buildroot
On Wed, 4 Dec 2024 22:48:11 +0100
Arnout Vandecappelle <arnout@mind.be> wrote:
> Series applied to master,thanks. Though I don't like the "we're too far from
> upstream" part too much :-)
Me neither of course... but that android-tools stuff is really really
far from upstream. I recently discovered
https://github.com/nmeum/android-tools/ which seems to be an attempt
at having a "common" place for a CMake build system for those
android-tools.
They also have lots of patches, though:
https://github.com/nmeum/android-tools/tree/master/patches
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Buildroot] [PATCH 1/3] package/android-tools: convert all patches to Git-formatted patches
2024-12-04 20:48 ` [Buildroot] [PATCH 1/3] package/android-tools: convert all patches to Git-formatted patches Thomas Petazzoni via buildroot
@ 2024-12-06 22:44 ` Peter Korsgaard
0 siblings, 0 replies; 9+ messages in thread
From: Peter Korsgaard @ 2024-12-06 22:44 UTC (permalink / raw)
To: Thomas Petazzoni via buildroot; +Cc: Thomas Petazzoni
>>>>> "Thomas" == Thomas Petazzoni via buildroot <buildroot@buildroot.org> writes:
> This will make it easier to modify the patch series moving forward. No
> functional changes.
> On one patch, we added the SoB from Giulio, which was missing. Giulio
> was the original contributor of the patch, and nobody touched it since
> it was introduced.
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Committed to 2024.02.x and 2024.08.x, thanks.
--
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Buildroot] [PATCH 3/3] package/android-tools: fix b64_pton() issue with GCC >= 14.x
2024-12-04 20:48 ` [Buildroot] [PATCH 3/3] package/android-tools: fix b64_pton() issue with GCC >= 14.x Thomas Petazzoni
@ 2024-12-06 22:44 ` Peter Korsgaard
0 siblings, 0 replies; 9+ messages in thread
From: Peter Korsgaard @ 2024-12-06 22:44 UTC (permalink / raw)
To: Thomas Petazzoni; +Cc: buildroot
>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@bootlin.com> writes:
> The android-tools code base uses the __b64_pton() function, which
> isn't provided by all C libraries. So the Debian patch
> debian/patches/add_adbd.patch adds an implementation of b64_pton(),
> but doesn't actually use it, nor defines a prototype for it. Our
> existing patch 0003-Fix-build-issue-with-uclibc.patch switches the
> code to use the b64_pton() function... but still without providing a
> prototype, causing the following build failures with GCC >= 14.x:
> adb_auth_client.c:75:15: error: implicit declaration of function 'b64_pton'
> To fix this, we rework 0003-Fix-build-issue-with-uclibc.patch into a
> patch that:
> (1) Renames b64_pton() to adb_b64_pton() to make sure it won't clash
> with implementations provided by some C libraries, and adjusts
> the call sites accordingly.
> (2) Adds a prototype definition of adb_b64_pton() in places where
> this function is used.
> Fixes:
> http://autobuild.buildroot.net/results/b25b25337c7ad89c33f8bd20b646850bd993ec53ae9/
> Even though GCC 14.x support was merged in Buildroot in May 2024, this
> particular b64_pton() only started appearing on July 15 2024, with the
> first occurence being:
> http://autobuild.buildroot.net/results/1cbe87bbe3c56f28444b3aaba1ba1d05f947d36e/
> Indeed, it's not before July 15 2024 that we merged commit
> d201f2f5cd0d1e0389430cda78adead37977a6cd ("package/android-tools: add
> patches to fix build with GCC 14.x"), which fixed other GCC 14.x
> issues, which were hiding this b64_pton() problem.
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Committed to 2024.02.x and 2024.08.x, thanks.
--
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Buildroot] [PATCH 2/3] package/android-tools: fix build issue on mips64 and powerpc64
2024-12-04 20:48 ` [Buildroot] [PATCH 2/3] package/android-tools: fix build issue on mips64 and powerpc64 Thomas Petazzoni via buildroot
@ 2024-12-06 22:44 ` Peter Korsgaard
0 siblings, 0 replies; 9+ messages in thread
From: Peter Korsgaard @ 2024-12-06 22:44 UTC (permalink / raw)
To: Thomas Petazzoni via buildroot; +Cc: Thomas Petazzoni
>>>>> "Thomas" == Thomas Petazzoni via buildroot <buildroot@buildroot.org> writes:
> The kernel headers on mips64 and powerpc64 were historically "broken",
> defining u64 as an "unsigned long" instead of "unsigned long
> long". This has been fixed in the upstream Linux kernel by introducing
> the __SANE_USERSPACE_TYPES__ definition.
> Our commit a2e178d6b45dfc5b8d1d50fcbbfc0bec5ebf1ae2 ("android-tools:
> disable on some architecture with old kernel headers") already
> disabled building fastboot on powerpc64 and mips64 systems that have
> too old kernel headers. However, it turns out that even with the new
> kernel headers, there are build issues because
> __SANE_USERSPACE_TYPES__ isn't defined everywhere it should be in the
> android-tools code base. The Debian patche
> debian/patches/ppc64el-ftbfs.patch adds some definitions, but it's
> missing one file, and in another the definition comes too late.
> This commit adds an extra patch that fixes this up, and makes fastboot
> build properly on mips64 and powerpc64.
> Fixes:
> http://autobuild.buildroot.net/results/8528ff876e695f79bdfe64f5330d9d51eeef66cb/ (powerpc64)
> http://autobuild.buildroot.net/results/36ac6af73b618c28d1636093da333f7ebd9d6cfe/ (mips64)
> This issue has been occurring as far as Feb 2021, with the first
> occurence apparently being:
> http://autobuild.buildroot.net/results/d9521b4bfeafb1140c21745dbfe28d476a9b71ec/
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Committed to 2024.02.x and 2024.08.x, thanks.
--
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2024-12-06 22:44 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-04 20:47 [Buildroot] [PATCH 0/3] Fix two android-tools build issues Thomas Petazzoni via buildroot
2024-12-04 20:48 ` [Buildroot] [PATCH 1/3] package/android-tools: convert all patches to Git-formatted patches Thomas Petazzoni via buildroot
2024-12-06 22:44 ` Peter Korsgaard
2024-12-04 20:48 ` [Buildroot] [PATCH 2/3] package/android-tools: fix build issue on mips64 and powerpc64 Thomas Petazzoni via buildroot
2024-12-06 22:44 ` Peter Korsgaard
2024-12-04 20:48 ` [Buildroot] [PATCH 3/3] package/android-tools: fix b64_pton() issue with GCC >= 14.x Thomas Petazzoni
2024-12-06 22:44 ` Peter Korsgaard
2024-12-04 21:48 ` [Buildroot] [PATCH 0/3] Fix two android-tools build issues Arnout Vandecappelle via buildroot
2024-12-04 21:52 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox