Skip to contentSkip to conversation

android-tools: fix building with GCC 14

PATCH In review Dmitry Baryshkov 3 participants 4 messages May 24, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 android-tools: fix building with GCC 14

libstdc++ in GCC 14 has dropped several nested includes. Include the <algorithms> header to fix build error:

system/core/fs_mgr/liblp/utility.cpp: In function 'bool android::fs_mgr::UpdateMetadataForInPlaceSnapshot(LpMetadata*, uint32_t, uint32_t)':
system/core/fs_mgr/liblp/utility.cpp:264:28: error: no matching function for call to 'find(std::vector<LpMetadataPartitionGroup*>::iterator, std::vector<LpMetadataPartitionGroup*>::iterator, __gnu_cxx::__alloc_traits<std::allocator<LpMetadataPartitionGroup>, LpMetadataPartitionGroup>::value_type*)'

  264 |         auto it = std::find(new_group_ptrs.begin(), new_group_ptrs.end(),
      |                   ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  265 |                             &metadata->groups[partition.group_index]);
      |                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
---
 .../0001-liblp-fix-building-with-GCC-14.patch | 26 +++++++++++++++++++
 .../android-tools/android-tools_29.0.6.r14.bb |  1 +
 2 files changed, 27 insertions(+)
 create mode 100644 meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools/0001-liblp-fix-building-with-GCC-14.patch
meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools/0001-liblp-fix-building-with-GCC-14.patch new file +26 -0
new file mode 100644
index 000000000000..ccd289c81ba9
@@ -0,0 +1,26 @@
+From 9f4d839847666019cadf57aa34fd366801c11a44 Mon Sep 17 00:00:00 2001
+From: Dmitry Baryshkov <[email protected]>
+Date: Fri, 24 May 2024 14:13:35 +0300
+Subject: [PATCH] liblp: fix building with GCC 14
+
+Upstream-Status: Pending
+Signed-off-by: Dmitry Baryshkov <[email protected]>
+---
+ system/core/fs_mgr/liblp/utility.cpp | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/system/core/fs_mgr/liblp/utility.cpp b/system/core/fs_mgr/liblp/utility.cpp
+index 48c5c8318d99..0aa8023aa87d 100644
+--- a/system/core/fs_mgr/liblp/utility.cpp
++++ b/system/core/fs_mgr/liblp/utility.cpp
+@@ -24,6 +24,7 @@
+ #include <sys/ioctl.h>
+ #endif
+ 
++#include <algorithm>
+ #include <map>
+ #include <string>
+ #include <vector>
+-- 
+2.39.2
+
meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools_29.0.6.r14.bb +1 -0
index f63b5c04b364..176107f2a7e2 100644
@@ -52,6 +52,7 @@ SRC_URI += " \
     file://0003-Update-usage-of-usbdevfs_urb-to-match-new-kernel-UAP.patch \
     file://0004-adb-Fix-build-on-big-endian-systems.patch \
     file://0005-adb-Allow-adbd-to-be-run-as-root.patch \
+    file://0001-liblp-fix-building-with-GCC-14.patch \
 "
 
 S = "${WORKDIR}/git"
Signature · 1 line
2.39.2
#1 lore raw

PATCH 2/2 android-tools: fix UNPACKDIR conversion leftovers

With the intruction of the UNPACKDIR the remount script is placed in the UNPACKDIR and not in S.

---
 .../recipes-devtool/android-tools/android-tools_29.0.6.r14.bb   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools_29.0.6.r14.bb +1 -1
index 176107f2a7e2..456c7400ef22 100644
@@ -139,7 +139,7 @@ do_compile() {
 
 do_install() {
     install -d ${D}${base_sbindir}
-    install -m 0755 ${S}/../remount -D ${D}${base_sbindir}/remount
+    install -m 0755 ${UNPACKDIR}/remount -D ${D}${base_sbindir}/remount
 
     for tool in img2simg simg2img fastboot adbd; do
         if echo ${TOOLS_TO_BUILD} | grep -q "$tool" ; then
Signature · 1 line
2.39.2
#2 lore raw
In reply to Dmitry Baryshkov
Quoted 24 lines · Dmitry Baryshkov via lists.openembedded.org

libstdc++ in GCC 14 has dropped several nested includes. Include the <algorithms> header to fix build error:

system/core/fs_mgr/liblp/utility.cpp: In function 'bool android::fs_mgr::UpdateMetadataForInPlaceSnapshot(LpMetadata*, uint32_t, uint32_t)':
system/core/fs_mgr/liblp/utility.cpp:264:28: error: no matching function for call to 'find(std::vector<LpMetadataPartitionGroup*>::iterator, std::vector<LpMetadataPartitionGroup*>::iterator, __gnu_cxx::__alloc_traits<std::allocator<LpMetadataPartitionGroup>, LpMetadataPartitionGroup>::value_type*)'

  264 |         auto it = std::find(new_group_ptrs.begin(), new_group_ptrs.end(),
      |                   ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  265 |                             &metadata->groups[partition.group_index]);
      |                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
---
 .../0001-liblp-fix-building-with-GCC-14.patch | 26 +++++++++++++++++++
 .../android-tools/android-tools_29.0.6.r14.bb |  1 +
 2 files changed, 27 insertions(+)
 create mode 100644 meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools/0001-liblp-fix-building-with-GCC-14.patch
meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools/0001-liblp-fix-building-with-GCC-14.patch new file +0 -0
new file mode 100644
index 000000000000..ccd289c81ba9

meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools/0001-liblp-fix-building-with-GCC-14.patch line 6

Quoted 6 lines
meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools/0001-liblp-fix-building-with-GCC-14.patch new file +6 -0
@@ -0,0 +1,26 @@
+From 9f4d839847666019cadf57aa34fd366801c11a44 Mon Sep 17 00:00:00 2001
+From: Dmitry Baryshkov <[email protected]>
+Date: Fri, 24 May 2024 14:13:35 +0300
+Subject: [PATCH] liblp: fix building with GCC 14
+
+Upstream-Status: Pending

This is worth upstreaming.

Quoted 44 lines
meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools/0001-liblp-fix-building-with-GCC-14.patch new file +20 -0
+Signed-off-by: Dmitry Baryshkov <[email protected]>
+---
+ system/core/fs_mgr/liblp/utility.cpp | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/system/core/fs_mgr/liblp/utility.cpp b/system/core/fs_mgr/liblp/utility.cpp
+index 48c5c8318d99..0aa8023aa87d 100644
+--- a/system/core/fs_mgr/liblp/utility.cpp
++++ b/system/core/fs_mgr/liblp/utility.cpp
+@@ -24,6 +24,7 @@
+ #include <sys/ioctl.h>
+ #endif
+
++#include <algorithm>
+ #include <map>
+ #include <string>
+ #include <vector>
+--
+2.39.2
+
meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools_29.0.6.r14.bb +1 -1
index f63b5c04b364..176107f2a7e2 100644
@@ -52,6 +52,7 @@ SRC_URI += " \
     file://0003-Update-usage-of-usbdevfs_urb-to-match-new-kernel-UAP.patch \
     file://0004-adb-Fix-build-on-big-endian-systems.patch \
     file://0005-adb-Allow-adbd-to-be-run-as-root.patch \
+    file://0001-liblp-fix-building-with-GCC-14.patch \
 "
 
 S = "${WORKDIR}/git"
--

2.39.2

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#110510): https://lists.openembedded.org/g/openembedded-devel/message/110510
Mute This Topic: https://lists.openembedded.org/mt/106279982/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#3 lore raw
Quoted 22 lines · Khem Raj
Quoted 18 lines · Dmitry Baryshkov via lists.openembedded.org

libstdc++ in GCC 14 has dropped several nested includes. Include the <algorithms> header to fix build error:

system/core/fs_mgr/liblp/utility.cpp: In function 'bool android::fs_mgr::UpdateMetadataForInPlaceSnapshot(LpMetadata*, uint32_t, uint32_t)':
system/core/fs_mgr/liblp/utility.cpp:264:28: error: no matching function for call to 'find(std::vector<LpMetadataPartitionGroup*>::iterator, std::vector<LpMetadataPartitionGroup*>::iterator, __gnu_cxx::__alloc_traits<std::allocator<LpMetadataPartitionGroup>, LpMetadataPartitionGroup>::value_type*)'

  264 |         auto it = std::find(new_group_ptrs.begin(), new_group_ptrs.end(),
      |                   ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  265 |                             &metadata->groups[partition.group_index]);
      |                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
---
 .../0001-liblp-fix-building-with-GCC-14.patch | 26 +++++++++++++++++++
 .../android-tools/android-tools_29.0.6.r14.bb |  1 +
 2 files changed, 27 insertions(+)
 create mode 100644 meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools/0001-liblp-fix-building-with-GCC-14.patch
Quoted 14 lines

meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools/0001-liblp-fix-building-with-GCC-14.patch line 6

Quoted 12 lines
meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools/0001-liblp-fix-building-with-GCC-14.patch new file +6 -0
new file mode 100644
index 000000000000..ccd289c81ba9
@@ -0,0 +1,26 @@
+From 9f4d839847666019cadf57aa34fd366801c11a44 Mon Sep 17 00:00:00 2001
+From: Dmitry Baryshkov <[email protected]>
+Date: Fri, 24 May 2024 14:13:35 +0300
+Subject: [PATCH] liblp: fix building with GCC 14
+
+Upstream-Status: Pending

This is worth upstreaming.

I'll see what can be done, but no promises with AOSP.

Quoted 3 lines
Quoted 3 lines
meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools/0001-liblp-fix-building-with-GCC-14.patch new file +2 -0
+Signed-off-by: Dmitry Baryshkov <[email protected]>
+---
Signature · 2 lines
With best wishes
Dmitry