diff options
| -rw-r--r-- | meta/recipes-devtools/fmt/fmt/0001-Fix-compilation-on-clang-21-libc-21-4477.patch | 46 | ||||
| -rw-r--r-- | meta/recipes-devtools/fmt/fmt_11.2.0.bb | 4 |
2 files changed, 49 insertions, 1 deletions
diff --git a/meta/recipes-devtools/fmt/fmt/0001-Fix-compilation-on-clang-21-libc-21-4477.patch b/meta/recipes-devtools/fmt/fmt/0001-Fix-compilation-on-clang-21-libc-21-4477.patch new file mode 100644 index 0000000000..911fa90a40 --- /dev/null +++ b/meta/recipes-devtools/fmt/fmt/0001-Fix-compilation-on-clang-21-libc-21-4477.patch | |||
| @@ -0,0 +1,46 @@ | |||
| 1 | From f4345467fce7edbc6b36c3fa1cf197a67be617e2 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Remy Jette <remy@remyjette.com> | ||
| 3 | Date: Sat, 21 Jun 2025 07:28:14 -0700 | ||
| 4 | Subject: [PATCH] Fix compilation on clang-21 / libc++-21 (#4477) | ||
| 5 | |||
| 6 | `<cstdlib>` was not being included, so malloc and free were only declared | ||
| 7 | via transitive includes. Some includes changed in the latest libc++-21 | ||
| 8 | build which broke fmt. | ||
| 9 | |||
| 10 | Also changed `malloc`/`free` to `std::malloc` and `std::free`, as | ||
| 11 | putting those symbols in the global namespace is optional for the | ||
| 12 | implementation when including `<cstdlib>`. | ||
| 13 | |||
| 14 | Upstream-Status: Backport [https://github.com/fmtlib/fmt/pull/4477] | ||
| 15 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 16 | --- | ||
| 17 | include/fmt/format.h | 5 +++-- | ||
| 18 | 1 file changed, 3 insertions(+), 2 deletions(-) | ||
| 19 | |||
| 20 | Index: fmt-11.2.0/include/fmt/format.h | ||
| 21 | =================================================================== | ||
| 22 | --- fmt-11.2.0.orig/include/fmt/format.h | ||
| 23 | +++ fmt-11.2.0/include/fmt/format.h | ||
| 24 | @@ -44,6 +44,7 @@ | ||
| 25 | # include <cmath> // std::signbit | ||
| 26 | # include <cstddef> // std::byte | ||
| 27 | # include <cstdint> // uint32_t | ||
| 28 | +# include <cstdlib> // std::malloc, std::free | ||
| 29 | # include <cstring> // std::memcpy | ||
| 30 | # include <limits> // std::numeric_limits | ||
| 31 | # include <new> // std::bad_alloc | ||
| 32 | @@ -744,12 +745,12 @@ template <typename T> struct allocator { | ||
| 33 | |||
| 34 | T* allocate(size_t n) { | ||
| 35 | FMT_ASSERT(n <= max_value<size_t>() / sizeof(T), ""); | ||
| 36 | - T* p = static_cast<T*>(malloc(n * sizeof(T))); | ||
| 37 | + T* p = static_cast<T*>(std::malloc(n * sizeof(T))); | ||
| 38 | if (!p) FMT_THROW(std::bad_alloc()); | ||
| 39 | return p; | ||
| 40 | } | ||
| 41 | |||
| 42 | - void deallocate(T* p, size_t) { free(p); } | ||
| 43 | + void deallocate(T* p, size_t) { std::free(p); } | ||
| 44 | }; | ||
| 45 | |||
| 46 | } // namespace detail | ||
diff --git a/meta/recipes-devtools/fmt/fmt_11.2.0.bb b/meta/recipes-devtools/fmt/fmt_11.2.0.bb index d0d4cea23e..fd5dc0c4ab 100644 --- a/meta/recipes-devtools/fmt/fmt_11.2.0.bb +++ b/meta/recipes-devtools/fmt/fmt_11.2.0.bb | |||
| @@ -5,7 +5,9 @@ LICENSE = "MIT" | |||
| 5 | LIC_FILES_CHKSUM = "file://LICENSE;md5=b9257785fc4f3803a4b71b76c1412729" | 5 | LIC_FILES_CHKSUM = "file://LICENSE;md5=b9257785fc4f3803a4b71b76c1412729" |
| 6 | 6 | ||
| 7 | SRC_URI = "git://github.com/fmtlib/fmt;branch=master;protocol=https;tag=${PV}\ | 7 | SRC_URI = "git://github.com/fmtlib/fmt;branch=master;protocol=https;tag=${PV}\ |
| 8 | file://0001-Workaround-an-ABI-issue-in-spdlog.patch" | 8 | file://0001-Workaround-an-ABI-issue-in-spdlog.patch \ |
| 9 | file://0001-Fix-compilation-on-clang-21-libc-21-4477.patch \ | ||
| 10 | " | ||
| 9 | SRCREV = "40626af88bd7df9a5fb80be7b25ac85b122d6c21" | 11 | SRCREV = "40626af88bd7df9a5fb80be7b25ac85b122d6c21" |
| 10 | 12 | ||
| 11 | inherit cmake | 13 | inherit cmake |
