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]);
      |                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Dmitry Baryshkov
2024-05-24 14:57:03 +03:00
committed by Khem Raj
parent f09c477f9a
commit 88f604fa71
2 changed files with 27 additions and 0 deletions
@@ -0,0 +1,26 @@
From 9f4d839847666019cadf57aa34fd366801c11a44 Mon Sep 17 00:00:00 2001
From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
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 <dmitry.baryshkov@linaro.org>
---
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
@@ -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"