From cfd74da11a5290b2e555e2f9f06779f816324ee1 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Mon, 21 Jul 2025 12:57:50 -0700 Subject: [PATCH] apt: Fix build with clang and libc++ Backport a fix to address random access iterator's expectation of being const-qualified inside libc++ std::__insertion_sort_unguarded implementation Signed-off-by: Khem Raj Signed-off-by: Richard Purdie --- ...compilation-error-with-clang-libc-18.patch | 29 +++++++++++++++++++ meta/recipes-devtools/apt/apt_2.6.1.bb | 1 + 2 files changed, 30 insertions(+) create mode 100644 meta/recipes-devtools/apt/apt/0001-Fix-compilation-error-with-clang-libc-18.patch diff --git a/meta/recipes-devtools/apt/apt/0001-Fix-compilation-error-with-clang-libc-18.patch b/meta/recipes-devtools/apt/apt/0001-Fix-compilation-error-with-clang-libc-18.patch new file mode 100644 index 0000000000..e55205ca3f --- /dev/null +++ b/meta/recipes-devtools/apt/apt/0001-Fix-compilation-error-with-clang-libc-18.patch @@ -0,0 +1,29 @@ +From b4488583424b33f51cb031562a9e8df820ffda23 Mon Sep 17 00:00:00 2001 +From: Chongyun Lee +Date: Thu, 15 Aug 2024 21:31:24 +0800 +Subject: [PATCH] Fix compilation error with clang/libc++ 18 + +Upstream-Status: Backport [https://salsa.debian.org/apt-team/apt/-/commit/b4488583424b33f51cb031562a9e8df820ffda23] +Signed-off-by: Khem Raj +--- + apt-pkg/cacheset.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/apt-pkg/cacheset.h b/apt-pkg/cacheset.h +index 5dbb9bf08..1c67a65d6 100644 +--- a/apt-pkg/cacheset.h ++++ b/apt-pkg/cacheset.h +@@ -218,11 +218,11 @@ public: + operator container_iterator(void) const { return _iter; } + inline iterator_type& operator++() { ++_iter; return static_cast(*this); } + inline iterator_type operator++(int) { iterator_type tmp(*this); operator++(); return tmp; } +- inline iterator_type operator+(typename container_iterator::difference_type const &n) { return iterator_type(_iter + n); } ++ inline iterator_type operator+(typename container_iterator::difference_type const &n) const { return iterator_type(_iter + n); } + inline iterator_type operator+=(typename container_iterator::difference_type const &n) { _iter += n; return static_cast(*this); } + inline iterator_type& operator--() { --_iter;; return static_cast(*this); } + inline iterator_type operator--(int) { iterator_type tmp(*this); operator--(); return tmp; } +- inline iterator_type operator-(typename container_iterator::difference_type const &n) { return iterator_type(_iter - n); } ++ inline iterator_type operator-(typename container_iterator::difference_type const &n) const { return iterator_type(_iter - n); } + inline typename container_iterator::difference_type operator-(iterator_type const &b) { return (_iter - b._iter); } + inline iterator_type operator-=(typename container_iterator::difference_type const &n) { _iter -= n; return static_cast(*this); } + inline bool operator!=(iterator_type const &i) const { return _iter != i._iter; } diff --git a/meta/recipes-devtools/apt/apt_2.6.1.bb b/meta/recipes-devtools/apt/apt_2.6.1.bb index 50ac2ea812..b039599395 100644 --- a/meta/recipes-devtools/apt/apt_2.6.1.bb +++ b/meta/recipes-devtools/apt/apt_2.6.1.bb @@ -15,6 +15,7 @@ SRC_URI = "${DEBIAN_MIRROR}/main/a/apt/${BPN}_${PV}.tar.xz \ file://0001-Remove-using-std-binary_function.patch \ file://0001-strutl-Add-missing-include-cstdint-gcc-15.patch \ file://0001-Raise-cmake_minimum_required-to-3.13-to-avoid-warnin.patch \ + file://0001-Fix-compilation-error-with-clang-libc-18.patch \ " SRC_URI:append:class-native = " \ -- 2.47.2