public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/wasmedge] epel8: Update to 0.17.0
@ 2026-06-02 11:08 hydai
0 siblings, 0 replies; only message in thread
From: hydai @ 2026-06-02 11:08 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/wasmedge
Branch : epel8
Commit : 6b8e25c33fc06ba2b5ea2bdb2aa9fa85b67e4de3
Author : hydai <hydai@hyd.ai>
Date : 2026-06-02T10:29:15+00:00
Stats : +587/-1788 in 7 file(s)
URL : https://src.fedoraproject.org/rpms/wasmedge/c/6b8e25c33fc06ba2b5ea2bdb2aa9fa85b67e4de3?branch=epel8
Log:
Update to 0.17.0
Add fmt 6 / spdlog 1.5 compatibility patch (Patch0) for EPEL 8. RHEL 8 ships fmt 6.2.1 and spdlog
1.5.0, older than upstream expects; the patch uses conditional guards only (FMT_VERSION /
__has_include) with no behavior change on newer fmt. Drops the previous revert-fmt and LLVM 19/20
backport patches, which 0.17.0 no longer needs.
Signed-off-by: hydai <hydai@hyd.ai>
---
diff --git a/0001-LLVM-LLVMX86_MMXTypeKind-is-removed-in-LLVM20-4064.patch b/0001-LLVM-LLVMX86_MMXTypeKind-is-removed-in-LLVM20-4064.patch
deleted file mode 100644
index 5a95793..0000000
--- a/0001-LLVM-LLVMX86_MMXTypeKind-is-removed-in-LLVM20-4064.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From b63e201d46452453ee7c2acf07967cd292d7e3da Mon Sep 17 00:00:00 2001
-From: hydai <hydai@secondstate.io>
-Date: Wed, 19 Mar 2025 12:57:06 +0800
-Subject: [PATCH] [LLVM] LLVMX86_MMXTypeKind is removed in LLVM20 (#4064)
-
-Signed-off-by: hydai <z54981220@gmail.com>
----
- lib/llvm/llvm.h | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/lib/llvm/llvm.h b/lib/llvm/llvm.h
-index 9b08d97b..7b0bb53e 100644
---- a/lib/llvm/llvm.h
-+++ b/lib/llvm/llvm.h
-@@ -556,8 +556,10 @@ public:
- return 128;
- case LLVMPPC_FP128TypeKind:
- return 128;
-+#if LLVM_VERSION_MAJOR < 20
- case LLVMX86_MMXTypeKind:
- return 64;
-+#endif
- case LLVMIntegerTypeKind:
- return getIntegerBitWidth();
- case LLVMVectorTypeKind:
---
-2.43.0
-
diff --git a/0001-LLVM-Support-LLVM-19-3809.patch b/0001-LLVM-Support-LLVM-19-3809.patch
deleted file mode 100644
index 6c937a5..0000000
--- a/0001-LLVM-Support-LLVM-19-3809.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 0ada5daa015f9d4de831b84526693dbd1b7a1951 Mon Sep 17 00:00:00 2001
-From: "Shen-Ta Hsieh(BestSteve)" <ibmibmibm.tw@gmail.com>
-Date: Tue, 1 Oct 2024 16:05:58 +0800
-Subject: [PATCH] [LLVM] Support LLVM 19 (#3809)
-
-* Remove unused and deprecated llvm-c functions
-
-Signed-off-by: Shen-Ta Hsieh <beststeve@secondstate.io>
-(cherry picked from commit 4e0f9f1118e278b41e9a02b0e7f42735955815f4)
----
- lib/llvm/llvm.h | 6 ------
- 1 file changed, 6 deletions(-)
-
-diff --git a/lib/llvm/llvm.h b/lib/llvm/llvm.h
-index 31ac95d4..5b278849 100644
---- a/lib/llvm/llvm.h
-+++ b/lib/llvm/llvm.h
-@@ -1228,12 +1228,6 @@ public:
- Value createNeg(Value V, const char *Name = "") noexcept {
- return LLVMBuildNeg(Ref, V.unwrap(), Name);
- }
-- Value createNSWNeg(Value V, const char *Name = "") noexcept {
-- return LLVMBuildNSWNeg(Ref, V.unwrap(), Name);
-- }
-- Value createNUWNeg(Value V, const char *Name = "") noexcept {
-- return LLVMBuildNUWNeg(Ref, V.unwrap(), Name);
-- }
- Value createFNeg(Value V, const char *Name = "") noexcept {
- return LLVMBuildFNeg(Ref, V.unwrap(), Name);
- }
---
-2.50.1
-
diff --git a/0001-fix-runtime-refine-the-overflow-detection-when-wrapp.patch b/0001-fix-runtime-refine-the-overflow-detection-when-wrapp.patch
deleted file mode 100644
index c332c3e..0000000
--- a/0001-fix-runtime-refine-the-overflow-detection-when-wrapp.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From 37cc9fa19bd23edbbdaa9252059b17f191fa4d17 Mon Sep 17 00:00:00 2001
-From: YiYing He <yiying@secondstate.io>
-Date: Wed, 17 Dec 2025 20:27:38 +0800
-Subject: [PATCH] fix(runtime): refine the overflow detection when wrapping
- memory instance
-
-Signed-off-by: YiYing He <yiying@secondstate.io>
----
- include/runtime/instance/memory.h | 24 +++++++++++++++++++-----
- 1 file changed, 19 insertions(+), 5 deletions(-)
-
-diff --git a/include/runtime/instance/memory.h b/include/runtime/instance/memory.h
-index ce511a7b..9d849598 100644
---- a/include/runtime/instance/memory.h
-+++ b/include/runtime/instance/memory.h
-@@ -241,14 +241,28 @@ public:
- return reinterpret_cast<T>(&DataPtr[Offset]);
- }
-
-- /// Get array of object at specific offset of memory.
-+ /// Get array of object with count at specific offset of memory.
- template <typename T>
-- Span<T> getSpan(uint32_t Offset, uint32_t Size) const noexcept {
-- uint32_t ByteSize = static_cast<uint32_t>(sizeof(T) * Size);
-- if (unlikely(!checkAccessBound(Offset, ByteSize))) {
-+ Span<T> getSpan(uint32_t Offset, uint32_t Count) const noexcept {
-+ uint32_t Size;
-+#if defined(_MSC_VER) && !defined(__clang__) // MSVC
-+ // Should extend for memory64 proposal.
-+ uint64_t Num =
-+ static_cast<uint64_t>(sizeof(T)) * static_cast<uint64_t>(Count);
-+ if ((Num >> 32) != 0) {
-+ return Span<T>();
-+ }
-+ Size = static_cast<uint32_t>(Num);
-+#else
-+ if (unlikely(__builtin_mul_overflow(static_cast<uint32_t>(sizeof(T)), Count,
-+ &Size))) {
-+ return Span<T>();
-+ }
-+#endif
-+ if (unlikely(!checkAccessBound(Offset, Size))) {
- return Span<T>();
- }
-- return Span<T>(reinterpret_cast<T *>(&DataPtr[Offset]), Size);
-+ return Span<T>(reinterpret_cast<T *>(&DataPtr[Offset]), Count);
- }
-
- /// Get array of object at specific offset of memory.
---
-2.43.0
-
diff --git a/0001-fmt6-compat.patch b/0001-fmt6-compat.patch
new file mode 100644
index 0000000..97a53f9
--- /dev/null
+++ b/0001-fmt6-compat.patch
@@ -0,0 +1,559 @@
+diff --git a/include/ast/type.h b/include/ast/type.h
+index 03fbf53ef..81399e0a7 100644
+--- a/include/ast/type.h
++++ b/include/ast/type.h
+@@ -797,9 +797,9 @@ private:
+ template <>
+ struct fmt::formatter<WasmEdge::AST::FunctionType>
+ : fmt::formatter<std::string_view> {
+- fmt::format_context::iterator
+- format(const WasmEdge::AST::FunctionType &Type,
+- fmt::format_context &Ctx) const noexcept {
++ template <typename FmtCtx>
++ auto format(const WasmEdge::AST::FunctionType &Type,
++ FmtCtx &Ctx) WASMEDGE_FMT_CONST noexcept -> decltype(Ctx.out()) {
+ using namespace std::literals;
+
+ fmt::memory_buffer Buffer;
+diff --git a/include/common/enum_ast.hpp b/include/common/enum_ast.hpp
+index 2535559a1..fab6bca27 100644
+--- a/include/common/enum_ast.hpp
++++ b/include/common/enum_ast.hpp
+@@ -133,9 +133,9 @@ static inline constexpr const auto ComponentCanonOptCodeStr = []() constexpr {
+ template <>
+ struct fmt::formatter<WasmEdge::ASTNodeAttr>
+ : fmt::formatter<std::string_view> {
+- fmt::format_context::iterator
+- format(const WasmEdge::ASTNodeAttr &Attr,
+- fmt::format_context &Ctx) const noexcept {
++ template <typename FmtCtx>
++ auto format(const WasmEdge::ASTNodeAttr &Attr,
++ FmtCtx &Ctx) WASMEDGE_FMT_CONST noexcept -> decltype(Ctx.out()) {
+ return formatter<std::string_view>::format(WasmEdge::ASTNodeAttrStr[Attr],
+ Ctx);
+ }
+@@ -143,9 +143,9 @@ struct fmt::formatter<WasmEdge::ASTNodeAttr>
+
+ template <>
+ struct fmt::formatter<WasmEdge::OpCode> : fmt::formatter<std::string_view> {
+- fmt::format_context::iterator
+- format(const WasmEdge::OpCode &Code,
+- fmt::format_context &Ctx) const noexcept {
++ template <typename FmtCtx>
++ auto format(const WasmEdge::OpCode &Code,
++ FmtCtx &Ctx) WASMEDGE_FMT_CONST noexcept -> decltype(Ctx.out()) {
+ return formatter<std::string_view>::format(WasmEdge::OpCodeStr[Code], Ctx);
+ }
+ };
+diff --git a/include/common/enum_errcode.hpp b/include/common/enum_errcode.hpp
+index 71fa512b0..dcaeb77d0 100644
+--- a/include/common/enum_errcode.hpp
++++ b/include/common/enum_errcode.hpp
+@@ -151,9 +151,9 @@ static inline constexpr const auto ErrCodeStr = []() constexpr {
+
+ template <>
+ struct fmt::formatter<WasmEdge::WasmPhase> : fmt::formatter<std::string_view> {
+- fmt::format_context::iterator
+- format(const WasmEdge::WasmPhase &Phase,
+- fmt::format_context &Ctx) const noexcept {
++ template <typename FmtCtx>
++ auto format(const WasmEdge::WasmPhase &Phase,
++ FmtCtx &Ctx) WASMEDGE_FMT_CONST noexcept -> decltype(Ctx.out()) {
+ return formatter<std::string_view>::format(WasmEdge::WasmPhaseStr[Phase],
+ Ctx);
+ }
+diff --git a/include/common/enum_errinfo.hpp b/include/common/enum_errinfo.hpp
+index 48b7c094f..13847b090 100644
+--- a/include/common/enum_errinfo.hpp
++++ b/include/common/enum_errinfo.hpp
+@@ -110,9 +110,9 @@ static inline constexpr auto IndexCategoryStr = []() constexpr {
+ template <>
+ struct fmt::formatter<WasmEdge::ErrInfo::PtrType>
+ : fmt::formatter<std::string_view> {
+- fmt::format_context::iterator
+- format(const WasmEdge::ErrInfo::PtrType &Type,
+- fmt::format_context &Ctx) const noexcept {
++ template <typename FmtCtx>
++ auto format(const WasmEdge::ErrInfo::PtrType &Type,
++ FmtCtx &Ctx) WASMEDGE_FMT_CONST noexcept -> decltype(Ctx.out()) {
+ return formatter<std::string_view>::format(
+ WasmEdge::ErrInfo::PtrTypeStr[Type], Ctx);
+ }
+@@ -121,9 +121,9 @@ struct fmt::formatter<WasmEdge::ErrInfo::PtrType>
+ template <>
+ struct fmt::formatter<WasmEdge::ErrInfo::MismatchCategory>
+ : fmt::formatter<std::string_view> {
+- fmt::format_context::iterator
+- format(const WasmEdge::ErrInfo::MismatchCategory &Category,
+- fmt::format_context &Ctx) const noexcept {
++ template <typename FmtCtx>
++ auto format(const WasmEdge::ErrInfo::MismatchCategory &Category,
++ FmtCtx &Ctx) WASMEDGE_FMT_CONST noexcept -> decltype(Ctx.out()) {
+ return formatter<std::string_view>::format(
+ WasmEdge::ErrInfo::MismatchCategoryStr[Category], Ctx);
+ }
+@@ -132,9 +132,9 @@ struct fmt::formatter<WasmEdge::ErrInfo::MismatchCategory>
+ template <>
+ struct fmt::formatter<WasmEdge::ErrInfo::IndexCategory>
+ : fmt::formatter<std::string_view> {
+- fmt::format_context::iterator
+- format(const WasmEdge::ErrInfo::IndexCategory &Category,
+- fmt::format_context &Ctx) const noexcept {
++ template <typename FmtCtx>
++ auto format(const WasmEdge::ErrInfo::IndexCategory &Category,
++ FmtCtx &Ctx) WASMEDGE_FMT_CONST noexcept -> decltype(Ctx.out()) {
+ return formatter<std::string_view>::format(
+ WasmEdge::ErrInfo::IndexCategoryStr[Category], Ctx);
+ }
+diff --git a/include/common/enum_types.hpp b/include/common/enum_types.hpp
+index c73f151b1..769b0e71b 100644
+--- a/include/common/enum_types.hpp
++++ b/include/common/enum_types.hpp
+@@ -111,8 +111,8 @@ static inline constexpr const auto ComponentTypeCodeStr = []() constexpr {
+
+ template <>
+ struct fmt::formatter<WasmEdge::ValMut> : fmt::formatter<std::string_view> {
+- fmt::format_context::iterator
+- format(const WasmEdge::ValMut &Mut, fmt::format_context &Ctx) const noexcept {
++ template <typename FmtCtx>
++ auto format(const WasmEdge::ValMut &Mut, FmtCtx &Ctx) WASMEDGE_FMT_CONST noexcept -> decltype(Ctx.out()) {
+ return formatter<std::string_view>::format(WasmEdge::ValMutStr[Mut], Ctx);
+ }
+ };
+@@ -120,9 +120,9 @@ struct fmt::formatter<WasmEdge::ValMut> : fmt::formatter<std::string_view> {
+ template <>
+ struct fmt::formatter<WasmEdge::ExternalType>
+ : fmt::formatter<std::string_view> {
+- fmt::format_context::iterator
+- format(const WasmEdge::ExternalType &Type,
+- fmt::format_context &Ctx) const noexcept {
++ template <typename FmtCtx>
++ auto format(const WasmEdge::ExternalType &Type,
++ FmtCtx &Ctx) WASMEDGE_FMT_CONST noexcept -> decltype(Ctx.out()) {
+ return formatter<std::string_view>::format(WasmEdge::ExternalTypeStr[Type],
+ Ctx);
+ }
+diff --git a/include/common/errcode.h b/include/common/errcode.h
+index 2661c5207..2e5f8688d 100644
+--- a/include/common/errcode.h
++++ b/include/common/errcode.h
+@@ -60,9 +60,9 @@ template <typename T> constexpr auto Unexpect(const Expect<T> &Val) {
+
+ template <>
+ struct fmt::formatter<WasmEdge::ErrCode> : fmt::formatter<std::string_view> {
+- fmt::format_context::iterator
+- format(const WasmEdge::ErrCode &Code,
+- fmt::format_context &Ctx) const noexcept {
++ template <typename FmtCtx>
++ auto format(const WasmEdge::ErrCode &Code,
++ FmtCtx &Ctx) WASMEDGE_FMT_CONST noexcept -> decltype(Ctx.out()) {
+ using namespace std::literals;
+ std::string Output =
+ fmt::format("{} failed: {}, Code: 0x{:03x}"sv, Code.getErrCodePhase(),
+@@ -74,9 +74,9 @@ struct fmt::formatter<WasmEdge::ErrCode> : fmt::formatter<std::string_view> {
+ template <>
+ struct fmt::formatter<WasmEdge::ErrCode::Value>
+ : fmt::formatter<WasmEdge::ErrCode> {
+- fmt::format_context::iterator
+- format(const WasmEdge::ErrCode::Value &Value,
+- fmt::format_context &Ctx) const noexcept {
++ template <typename FmtCtx>
++ auto format(const WasmEdge::ErrCode::Value &Value,
++ FmtCtx &Ctx) WASMEDGE_FMT_CONST noexcept -> decltype(Ctx.out()) {
+ return formatter<WasmEdge::ErrCode>::format(WasmEdge::ErrCode(Value), Ctx);
+ }
+ };
+diff --git a/include/common/errinfo.h b/include/common/errinfo.h
+index 251a85215..1176a3948 100644
+--- a/include/common/errinfo.h
++++ b/include/common/errinfo.h
+@@ -270,94 +270,94 @@ template <>
+ struct fmt::formatter<WasmEdge::ErrInfo::InfoFile>
+ : fmt::formatter<std::string_view> {
+ fmt::format_context::iterator format(const WasmEdge::ErrInfo::InfoFile &Info,
+- fmt::format_context &Ctx) const noexcept;
++ fmt::format_context &Ctx) WASMEDGE_FMT_CONST noexcept;
+ };
+ template <>
+ struct fmt::formatter<WasmEdge::ErrInfo::InfoLoading>
+ : fmt::formatter<std::string_view> {
+ fmt::format_context::iterator
+ format(const WasmEdge::ErrInfo::InfoLoading &Info,
+- fmt::format_context &Ctx) const noexcept;
++ fmt::format_context &Ctx) WASMEDGE_FMT_CONST noexcept;
+ };
+ template <>
+ struct fmt::formatter<WasmEdge::ErrInfo::InfoAST>
+ : fmt::formatter<std::string_view> {
+ fmt::format_context::iterator format(const WasmEdge::ErrInfo::InfoAST &Info,
+- fmt::format_context &Ctx) const noexcept;
++ fmt::format_context &Ctx) WASMEDGE_FMT_CONST noexcept;
+ };
+ template <>
+ struct fmt::formatter<WasmEdge::ErrInfo::InfoInstanceBound>
+ : fmt::formatter<std::string_view> {
+ fmt::format_context::iterator
+ format(const WasmEdge::ErrInfo::InfoInstanceBound &Info,
+- fmt::format_context &Ctx) const noexcept;
++ fmt::format_context &Ctx) WASMEDGE_FMT_CONST noexcept;
+ };
+ template <>
+ struct fmt::formatter<WasmEdge::ErrInfo::InfoForbidIndex>
+ : fmt::formatter<std::string_view> {
+ fmt::format_context::iterator
+ format(const WasmEdge::ErrInfo::InfoForbidIndex &Info,
+- fmt::format_context &Ctx) const noexcept;
++ fmt::format_context &Ctx) WASMEDGE_FMT_CONST noexcept;
+ };
+ template <>
+ struct fmt::formatter<WasmEdge::ErrInfo::InfoExporting>
+ : fmt::formatter<std::string_view> {
+ fmt::format_context::iterator
+ format(const WasmEdge::ErrInfo::InfoExporting &Info,
+- fmt::format_context &Ctx) const noexcept;
++ fmt::format_context &Ctx) WASMEDGE_FMT_CONST noexcept;
+ };
+ template <>
+ struct fmt::formatter<WasmEdge::ErrInfo::InfoLimit>
+ : fmt::formatter<std::string_view> {
+ fmt::format_context::iterator format(const WasmEdge::ErrInfo::InfoLimit &Info,
+- fmt::format_context &Ctx) const noexcept;
++ fmt::format_context &Ctx) WASMEDGE_FMT_CONST noexcept;
+ };
+ template <>
+ struct fmt::formatter<WasmEdge::ErrInfo::InfoRegistering>
+ : fmt::formatter<std::string_view> {
+ fmt::format_context::iterator
+ format(const WasmEdge::ErrInfo::InfoRegistering &Info,
+- fmt::format_context &Ctx) const noexcept;
++ fmt::format_context &Ctx) WASMEDGE_FMT_CONST noexcept;
+ };
+ template <>
+ struct fmt::formatter<WasmEdge::ErrInfo::InfoLinking>
+ : fmt::formatter<std::string_view> {
+ fmt::format_context::iterator
+ format(const WasmEdge::ErrInfo::InfoLinking &Info,
+- fmt::format_context &Ctx) const noexcept;
++ fmt::format_context &Ctx) WASMEDGE_FMT_CONST noexcept;
+ };
+ template <>
+ struct fmt::formatter<WasmEdge::ErrInfo::InfoExecuting>
+ : fmt::formatter<std::string_view> {
+ fmt::format_context::iterator
+ format(const WasmEdge::ErrInfo::InfoExecuting &Info,
+- fmt::format_context &Ctx) const noexcept;
++ fmt::format_context &Ctx) WASMEDGE_FMT_CONST noexcept;
+ };
+ template <>
+ struct fmt::formatter<WasmEdge::ErrInfo::InfoMismatch>
+ : fmt::formatter<std::string_view> {
+ fmt::format_context::iterator
+ format(const WasmEdge::ErrInfo::InfoMismatch &Info,
+- fmt::format_context &Ctx) const noexcept;
++ fmt::format_context &Ctx) WASMEDGE_FMT_CONST noexcept;
+ };
+ template <>
+ struct fmt::formatter<WasmEdge::ErrInfo::InfoInstruction>
+ : fmt::formatter<std::string_view> {
+ fmt::format_context::iterator
+ format(const WasmEdge::ErrInfo::InfoInstruction &Info,
+- fmt::format_context &Ctx) const noexcept;
++ fmt::format_context &Ctx) WASMEDGE_FMT_CONST noexcept;
+ };
+ template <>
+ struct fmt::formatter<WasmEdge::ErrInfo::InfoBoundary>
+ : fmt::formatter<std::string_view> {
+ fmt::format_context::iterator
+ format(const WasmEdge::ErrInfo::InfoBoundary &Info,
+- fmt::format_context &Ctx) const noexcept;
++ fmt::format_context &Ctx) WASMEDGE_FMT_CONST noexcept;
+ };
+ template <>
+ struct fmt::formatter<WasmEdge::ErrInfo::InfoProposal>
+ : fmt::formatter<std::string_view> {
+ fmt::format_context::iterator
+ format(const WasmEdge::ErrInfo::InfoProposal &Info,
+- fmt::format_context &Ctx) const noexcept;
++ fmt::format_context &Ctx) WASMEDGE_FMT_CONST noexcept;
+ };
+diff --git a/include/common/int128.h b/include/common/int128.h
+index 40f49e727..71a2b7133 100644
+--- a/include/common/int128.h
++++ b/include/common/int128.h
+@@ -554,7 +554,14 @@ using uint128_t = uint128;
+
+ #include <fmt/format.h>
+
++#if FMT_VERSION >= 80000
++#define WASMEDGE_FMT_CONST const
++#else
++#define WASMEDGE_FMT_CONST
++#endif
++
+ FMT_BEGIN_NAMESPACE
++#if FMT_VERSION >= 90000
+ namespace detail {
+ inline constexpr bool operator>=(detail::uint128_fallback LHS,
+ unsigned int RHS) {
+@@ -668,7 +675,9 @@ FMT_CONSTEXPR20 inline int count_digits(detail::uint128_fallback N) {
+ }
+
+ } // namespace detail
++#endif
+
++#if FMT_VERSION >= 80000
+ template <typename Char> struct formatter<WasmEdge::uint128, Char> {
+ private:
+ detail::dynamic_format_specs<Char> Specs;
+@@ -713,4 +722,27 @@ public:
+ #endif
+ }
+ };
++#else
++template <typename Char> struct formatter<WasmEdge::uint128, Char> {
++ template <typename ParseContext>
++ constexpr auto parse(ParseContext &Ctx) -> decltype(Ctx.begin()) {
++ return Ctx.begin();
++ }
++ template <typename FormatContext>
++ auto format(WasmEdge::uint128 V, FormatContext &Ctx) -> decltype(Ctx.out()) {
++ char Buf[40];
++ char *Pos = Buf + sizeof(Buf);
++ const WasmEdge::uint128 Ten(10U);
++ do {
++ *--Pos = static_cast<char>('0' + (V % Ten).low());
++ V /= Ten;
++ } while (V != WasmEdge::uint128(0U));
++ auto Out = Ctx.out();
++ for (const char *It = Pos; It != Buf + sizeof(Buf); ++It) {
++ *Out++ = *It;
++ }
++ return Out;
++ }
++};
++#endif
+ FMT_END_NAMESPACE
+diff --git a/include/common/spdlog.h b/include/common/spdlog.h
+index c94931c55..5c80be269 100644
+--- a/include/common/spdlog.h
++++ b/include/common/spdlog.h
+@@ -49,8 +49,9 @@ void setLoggingCallback(
+ template <>
+ struct fmt::formatter<std::filesystem::path>
+ : fmt::formatter<std::string_view> {
+- fmt::format_context::iterator format(const std::filesystem::path &Path,
+- fmt::format_context &Ctx) const {
++ template <typename FmtCtx>
++ auto format(const std::filesystem::path &Path,
++ FmtCtx &Ctx) WASMEDGE_FMT_CONST -> decltype(Ctx.out()) {
+ // mimic std::quoted
+ constexpr const char Delimiter = '"';
+ constexpr const char Escape = '\\';
+diff --git a/include/common/types.h b/include/common/types.h
+index de5d23764..188a0a58a 100644
+--- a/include/common/types.h
++++ b/include/common/types.h
+@@ -788,9 +788,9 @@ private:
+
+ template <>
+ struct fmt::formatter<WasmEdge::ValType> : fmt::formatter<std::string_view> {
+- fmt::format_context::iterator
+- format(const WasmEdge::ValType &Type,
+- fmt::format_context &Ctx) const noexcept {
++ template <typename FmtCtx>
++ auto format(const WasmEdge::ValType &Type,
++ FmtCtx &Ctx) WASMEDGE_FMT_CONST noexcept -> decltype(Ctx.out()) {
+ using namespace std::literals;
+ // For the number types, print the type directly.
+ if (!Type.isRefType()) {
+diff --git a/include/host/wasi/error.h b/include/host/wasi/error.h
+index 7ff181be2..6f0bda102 100644
+--- a/include/host/wasi/error.h
++++ b/include/host/wasi/error.h
+@@ -29,8 +29,8 @@ template <typename T> constexpr auto WasiUnexpect(const WasiExpect<T> &Val) {
+
+ template <>
+ struct fmt::formatter<__wasi_errno_t> : fmt::formatter<std::string_view> {
+- fmt::format_context::iterator
+- format(__wasi_errno_t ErrNo, fmt::format_context &Ctx) const noexcept {
++ template <typename FmtCtx>
++ auto format(__wasi_errno_t ErrNo, FmtCtx &Ctx) WASMEDGE_FMT_CONST noexcept -> decltype(Ctx.out()) {
+ fmt::memory_buffer Buffer;
+ using namespace std::literals;
+ auto Iter = std::back_inserter(Buffer);
+diff --git a/lib/common/errinfo.cpp b/lib/common/errinfo.cpp
+index 71400642d..27d4aabd4 100644
+--- a/lib/common/errinfo.cpp
++++ b/lib/common/errinfo.cpp
+@@ -7,14 +7,18 @@
+ #include "common/int128.h"
+
+ #include <spdlog/fmt/fmt.h>
++#if __has_include(<spdlog/fmt/ranges.h>)
+ #include <spdlog/fmt/ranges.h>
++#else
++#include <fmt/ranges.h>
++#endif
+
+ using namespace std::literals;
+
+ fmt::format_context::iterator
+ fmt::formatter<WasmEdge::ErrInfo::InfoFile>::format(
+ const WasmEdge::ErrInfo::InfoFile &Info,
+- fmt::format_context &Ctx) const noexcept {
++ fmt::format_context &Ctx) WASMEDGE_FMT_CONST noexcept {
+ fmt::memory_buffer Buffer;
+ fmt::format_to(std::back_inserter(Buffer), " File name: {}"sv,
+ Info.FileName);
+@@ -25,7 +29,7 @@ fmt::formatter<WasmEdge::ErrInfo::InfoFile>::format(
+ fmt::format_context::iterator
+ fmt::formatter<WasmEdge::ErrInfo::InfoLoading>::format(
+ const WasmEdge::ErrInfo::InfoLoading &Info,
+- fmt::format_context &Ctx) const noexcept {
++ fmt::format_context &Ctx) WASMEDGE_FMT_CONST noexcept {
+ fmt::memory_buffer Buffer;
+ fmt::format_to(std::back_inserter(Buffer), " Bytecode offset: 0x{:08x}"sv,
+ Info.Offset);
+@@ -36,7 +40,7 @@ fmt::formatter<WasmEdge::ErrInfo::InfoLoading>::format(
+ fmt::format_context::iterator
+ fmt::formatter<WasmEdge::ErrInfo::InfoAST>::format(
+ const WasmEdge::ErrInfo::InfoAST &Info,
+- fmt::format_context &Ctx) const noexcept {
++ fmt::format_context &Ctx) WASMEDGE_FMT_CONST noexcept {
+ fmt::memory_buffer Buffer;
+ fmt::format_to(std::back_inserter(Buffer), " At AST node: {}"sv,
+ Info.NodeAttr);
+@@ -47,7 +51,7 @@ fmt::formatter<WasmEdge::ErrInfo::InfoAST>::format(
+ fmt::format_context::iterator
+ fmt::formatter<WasmEdge::ErrInfo::InfoInstanceBound>::format(
+ const WasmEdge::ErrInfo::InfoInstanceBound &Info,
+- fmt::format_context &Ctx) const noexcept {
++ fmt::format_context &Ctx) WASMEDGE_FMT_CONST noexcept {
+ fmt::memory_buffer Buffer;
+ fmt::format_to(std::back_inserter(Buffer),
+ " Instance {} has limited number {} , Got: {}"sv,
+@@ -59,7 +63,7 @@ fmt::formatter<WasmEdge::ErrInfo::InfoInstanceBound>::format(
+ fmt::format_context::iterator
+ fmt::formatter<WasmEdge::ErrInfo::InfoForbidIndex>::format(
+ const WasmEdge::ErrInfo::InfoForbidIndex &Info,
+- fmt::format_context &Ctx) const noexcept {
++ fmt::format_context &Ctx) WASMEDGE_FMT_CONST noexcept {
+ fmt::memory_buffer Buffer;
+ auto Iter =
+ fmt::format_to(std::back_inserter(Buffer),
+@@ -77,7 +81,7 @@ fmt::formatter<WasmEdge::ErrInfo::InfoForbidIndex>::format(
+ fmt::format_context::iterator
+ fmt::formatter<WasmEdge::ErrInfo::InfoExporting>::format(
+ const WasmEdge::ErrInfo::InfoExporting &Info,
+- fmt::format_context &Ctx) const noexcept {
++ fmt::format_context &Ctx) WASMEDGE_FMT_CONST noexcept {
+ fmt::memory_buffer Buffer;
+ fmt::format_to(std::back_inserter(Buffer),
+ " Duplicated exporting name: \"{}\""sv, Info.ExtName);
+@@ -88,7 +92,7 @@ fmt::formatter<WasmEdge::ErrInfo::InfoExporting>::format(
+ fmt::format_context::iterator
+ fmt::formatter<WasmEdge::ErrInfo::InfoLimit>::format(
+ const WasmEdge::ErrInfo::InfoLimit &Info,
+- fmt::format_context &Ctx) const noexcept {
++ fmt::format_context &Ctx) WASMEDGE_FMT_CONST noexcept {
+ fmt::memory_buffer Buffer;
+ auto Iter = fmt::format_to(std::back_inserter(Buffer),
+ " In Limit type: {{ min: {}"sv, Info.LimMin);
+@@ -103,7 +107,7 @@ fmt::formatter<WasmEdge::ErrInfo::InfoLimit>::format(
+ fmt::format_context::iterator
+ fmt::formatter<WasmEdge::ErrInfo::InfoRegistering>::format(
+ const WasmEdge::ErrInfo::InfoRegistering &Info,
+- fmt::format_context &Ctx) const noexcept {
++ fmt::format_context &Ctx) WASMEDGE_FMT_CONST noexcept {
+ fmt::memory_buffer Buffer;
+ fmt::format_to(std::back_inserter(Buffer), " Module name: \"{}\""sv,
+ Info.ModName);
+@@ -114,7 +118,7 @@ fmt::formatter<WasmEdge::ErrInfo::InfoRegistering>::format(
+ fmt::format_context::iterator
+ fmt::formatter<WasmEdge::ErrInfo::InfoLinking>::format(
+ const WasmEdge::ErrInfo::InfoLinking &Info,
+- fmt::format_context &Ctx) const noexcept {
++ fmt::format_context &Ctx) WASMEDGE_FMT_CONST noexcept {
+ fmt::memory_buffer Buffer;
+ fmt::format_to(std::back_inserter(Buffer),
+ " When linking module: \"{}\" , {} name: \"{}\""sv,
+@@ -126,7 +130,7 @@ fmt::formatter<WasmEdge::ErrInfo::InfoLinking>::format(
+ fmt::format_context::iterator
+ fmt::formatter<WasmEdge::ErrInfo::InfoExecuting>::format(
+ const WasmEdge::ErrInfo::InfoExecuting &Info,
+- fmt::format_context &Ctx) const noexcept {
++ fmt::format_context &Ctx) WASMEDGE_FMT_CONST noexcept {
+ fmt::memory_buffer Buffer;
+ auto Iter =
+ fmt::format_to(std::back_inserter(Buffer), " When executing "sv);
+@@ -141,7 +145,7 @@ fmt::formatter<WasmEdge::ErrInfo::InfoExecuting>::format(
+ fmt::format_context::iterator
+ fmt::formatter<WasmEdge::ErrInfo::InfoMismatch>::format(
+ const WasmEdge::ErrInfo::InfoMismatch &Info,
+- fmt::format_context &Ctx) const noexcept {
++ fmt::format_context &Ctx) WASMEDGE_FMT_CONST noexcept {
+ fmt::memory_buffer Buffer;
+ auto Iter = fmt::format_to(std::back_inserter(Buffer),
+ " Mismatched {}. "sv, Info.Category);
+@@ -229,7 +233,7 @@ fmt::formatter<WasmEdge::ErrInfo::InfoMismatch>::format(
+ fmt::format_context::iterator
+ fmt::formatter<WasmEdge::ErrInfo::InfoInstruction>::format(
+ const WasmEdge::ErrInfo::InfoInstruction &Info,
+- fmt::format_context &Ctx) const noexcept {
++ fmt::format_context &Ctx) WASMEDGE_FMT_CONST noexcept {
+ uint16_t Payload = static_cast<uint16_t>(Info.Code);
+ fmt::memory_buffer Buffer;
+ auto Iter = fmt::format_to(std::back_inserter(Buffer),
+@@ -294,7 +298,7 @@ fmt::formatter<WasmEdge::ErrInfo::InfoInstruction>::format(
+ fmt::format_context::iterator
+ fmt::formatter<WasmEdge::ErrInfo::InfoBoundary>::format(
+ const WasmEdge::ErrInfo::InfoBoundary &Info,
+- fmt::format_context &Ctx) const noexcept {
++ fmt::format_context &Ctx) WASMEDGE_FMT_CONST noexcept {
+ fmt::memory_buffer Buffer;
+ WasmEdge::uint128_t OffFrom = Info.Offset;
+ if (Info.IsOffsetOverflow) {
+@@ -347,7 +351,7 @@ fmt::formatter<WasmEdge::ErrInfo::InfoBoundary>::format(
+ fmt::format_context::iterator
+ fmt::formatter<WasmEdge::ErrInfo::InfoProposal>::format(
+ const WasmEdge::ErrInfo::InfoProposal &Info,
+- fmt::format_context &Ctx) const noexcept {
++ fmt::format_context &Ctx) WASMEDGE_FMT_CONST noexcept {
+ fmt::memory_buffer Buffer;
+ if (auto Iter = WasmEdge::ProposalStr.find(Info.P);
+ Iter != WasmEdge::ProposalStr.end()) {
+diff --git a/lib/common/spdlog.cpp b/lib/common/spdlog.cpp
+index 39ba477bb..39f6a7ff8 100644
+--- a/lib/common/spdlog.cpp
++++ b/lib/common/spdlog.cpp
+@@ -9,7 +9,30 @@
+ // https://github.com/gabime/spdlog/pull/3198
+ #pragma clang diagnostic ignored "-Wextra-semi"
+ #endif
++#if __has_include(<spdlog/sinks/callback_sink.h>)
+ #include <spdlog/sinks/callback_sink.h>
++#else
++// Fallback for spdlog without callback_sink.h (e.g. RHEL 9 / EPEL 9 spdlog 1.10).
++#include <spdlog/sinks/base_sink.h>
++#include <functional>
++#include <mutex>
++namespace spdlog::sinks {
++template <typename Mutex> class callback_sink final : public base_sink<Mutex> {
++public:
++ explicit callback_sink(
++ std::function<void(const details::log_msg &)> Callback)
++ : Cb(std::move(Callback)) {}
++
++protected:
++ void sink_it_(const details::log_msg &Msg) override { Cb(Msg); }
++ void flush_() override {}
++
++private:
++ std::function<void(const details::log_msg &)> Cb;
++};
++using callback_sink_mt = callback_sink<std::mutex>;
++} // namespace spdlog::sinks
++#endif
+ #if defined(__clang_major__) && __clang_major__ >= 10
+ #pragma clang diagnostic pop
+ #endif
diff --git a/sources b/sources
index b22ae72..d2f6a58 100644
--- a/sources
+++ b/sources
@@ -10,3 +10,7 @@ SHA512 (WasmEdge-0.13.3-src.tar.gz) = b8b2e1974fd2ca5bfa0b10311812b69a2a0d2b9864
SHA512 (WasmEdge-0.13.4-src.tar.gz) = ec9b7d1d5eddeb263e4fd00b11e0cac8e11e73a00db0a53ef01ade13518841823274d5ad85be005a82cf8c58a5bec7a8ad6e54358abe4a784439692afbe43fcf
SHA512 (WasmEdge-0.13.5-src.tar.gz) = 9d3ece45897d2c9bb3848662fc4ab36c2e0f178450b00f7ea7d183b7162d150d1306e1781b2542463993bab2ec6732def8d63be20ec192b18d93d98c537fb48a
SHA512 (WasmEdge-0.14.0-src.tar.gz) = fa9ab14f1c477e1909efe88d760a2ab9212687328a885054f0830284bc71d559ab5263eefbbc564d88280b3907d5e3145ffeff87830eb13ad1f3fc4a599e4340
+SHA512 (WasmEdge-0.14.1-src.tar.gz) = cf708ad789c8d7cb8b5885d6b13dbb010fa433e93971fedb0c05dd2794ad69d79b08535c854ea8744243ff65c61f0de1b6e3fe2a981b69fc92701b4675cc80d4
+SHA512 (WasmEdge-0.15.0-src.tar.gz) = 3a41f362852dd04dc441ebe10fac266703bb146100cceec64df3fce76f57960ac7dacfc9c1243f4177899a5c4d50166158908b0ec4e88e3f226cad2fd350e6cd
+SHA512 (WasmEdge-0.16.1-src.tar.gz) = b09c8d83e3627085382109ea073ecc099b57e109b419171a29ab780ee36b371de9bd1864d478c15324f29baabd0c19dda8a32a37f46a738f39e47ef6d51a0770
+SHA512 (WasmEdge-0.17.0-src.tar.gz) = 3e0f9739c7cd5af4ad1e54ed009719c8e4d3d4bfc821103bd954f5bc662381278f97078b4d177f4fae599b3a199b55b6e1fd81ce75ab7711921779db2e89d567
diff --git a/wasmedge-revert-fmt.patch b/wasmedge-revert-fmt.patch
deleted file mode 100644
index dc6716a..0000000
--- a/wasmedge-revert-fmt.patch
+++ /dev/null
@@ -1,1664 +0,0 @@
-diff --git a/include/common/enum_ast.hpp b/include/common/enum_ast.hpp
-index be41833a..b7d0acc6 100644
---- a/include/common/enum_ast.hpp
-+++ b/include/common/enum_ast.hpp
-@@ -19,7 +19,6 @@
-
- #include "common/dense_enum_map.h"
- #include "common/spare_enum_map.h"
--#include "common/spdlog.h"
-
- #include <cstdint>
- #include <string>
-@@ -46,7 +45,8 @@ static inline constexpr auto ASTNodeAttrStr = []() constexpr {
- #undef UseASTNodeAttr
- };
- return DenseEnumMap(Array);
--}();
-+}
-+();
-
- /// Instruction opcode enumeration class.
- enum class OpCode : uint32_t {
-@@ -84,26 +84,7 @@ static inline constexpr const auto OpCodeStr = []() constexpr {
- #undef UseOpCode
- };
- return SpareEnumMap(Array);
--}();
-+}
-+();
-
- } // namespace WasmEdge
--
--template <>
--struct fmt::formatter<WasmEdge::ASTNodeAttr>
-- : fmt::formatter<std::string_view> {
-- fmt::format_context::iterator
-- format(const WasmEdge::ASTNodeAttr &Attr,
-- fmt::format_context &Ctx) const noexcept {
-- return formatter<std::string_view>::format(WasmEdge::ASTNodeAttrStr[Attr],
-- Ctx);
-- }
--};
--
--template <>
--struct fmt::formatter<WasmEdge::OpCode> : fmt::formatter<std::string_view> {
-- fmt::format_context::iterator
-- format(const WasmEdge::OpCode &Code,
-- fmt::format_context &Ctx) const noexcept {
-- return formatter<std::string_view>::format(WasmEdge::OpCodeStr[Code], Ctx);
-- }
--};
-diff --git a/include/common/enum_errcode.hpp b/include/common/enum_errcode.hpp
-index a50f49df..80f24bbf 100644
---- a/include/common/enum_errcode.hpp
-+++ b/include/common/enum_errcode.hpp
-@@ -16,7 +16,6 @@
-
- #include "common/dense_enum_map.h"
- #include "common/spare_enum_map.h"
--#include "common/spdlog.h"
-
- #include <cstdint>
- #include <string_view>
-@@ -42,7 +41,8 @@ static inline constexpr auto WasmPhaseStr = []() constexpr {
- #undef UseWasmPhase
- };
- return DenseEnumMap(Array);
--}();
-+}
-+();
-
- /// Error category C++ enumeration class.
- enum class ErrCategory : uint8_t {
-@@ -75,11 +75,6 @@ public:
- ? ErrCode::Value::UserDefError
- : static_cast<ErrCode::Value>(getCode());
- }
-- constexpr WasmPhase getErrCodePhase() const noexcept {
-- return getCategory() != ErrCategory::WASM
-- ? WasmPhase::UserDefined
-- : static_cast<WasmPhase>((getCode() >> 8) & 0x0FU);
-- }
-
- constexpr ErrCode() noexcept : Inner(0) {}
- constexpr ErrCode(const ErrCode &E) noexcept : Inner(E.Inner.Num) {}
-@@ -136,16 +131,7 @@ static inline constexpr const auto ErrCodeStr = []() constexpr {
- #undef UseErrCode
- };
- return SpareEnumMap(Array);
--}();
-+}
-+();
-
- } // namespace WasmEdge
--
--template <>
--struct fmt::formatter<WasmEdge::WasmPhase> : fmt::formatter<std::string_view> {
-- fmt::format_context::iterator
-- format(const WasmEdge::WasmPhase &Phase,
-- fmt::format_context &Ctx) const noexcept {
-- return formatter<std::string_view>::format(WasmEdge::WasmPhaseStr[Phase],
-- Ctx);
-- }
--};
-diff --git a/include/common/enum_errinfo.hpp b/include/common/enum_errinfo.hpp
-index f385010a..15f3ab1f 100644
---- a/include/common/enum_errinfo.hpp
-+++ b/include/common/enum_errinfo.hpp
-@@ -109,36 +109,3 @@ static inline constexpr auto IndexCategoryStr = []() constexpr {
-
- } // namespace ErrInfo
- } // namespace WasmEdge
--
--template <>
--struct fmt::formatter<WasmEdge::ErrInfo::PtrType>
-- : fmt::formatter<std::string_view> {
-- fmt::format_context::iterator
-- format(const WasmEdge::ErrInfo::PtrType &Type,
-- fmt::format_context &Ctx) const noexcept {
-- return formatter<std::string_view>::format(
-- WasmEdge::ErrInfo::PtrTypeStr[Type], Ctx);
-- }
--};
--
--template <>
--struct fmt::formatter<WasmEdge::ErrInfo::MismatchCategory>
-- : fmt::formatter<std::string_view> {
-- fmt::format_context::iterator
-- format(const WasmEdge::ErrInfo::MismatchCategory &Category,
-- fmt::format_context &Ctx) const noexcept {
-- return formatter<std::string_view>::format(
-- WasmEdge::ErrInfo::MismatchCategoryStr[Category], Ctx);
-- }
--};
--
--template <>
--struct fmt::formatter<WasmEdge::ErrInfo::IndexCategory>
-- : fmt::formatter<std::string_view> {
-- fmt::format_context::iterator
-- format(const WasmEdge::ErrInfo::IndexCategory &Category,
-- fmt::format_context &Ctx) const noexcept {
-- return formatter<std::string_view>::format(
-- WasmEdge::ErrInfo::IndexCategoryStr[Category], Ctx);
-- }
--};
-diff --git a/include/common/enum_types.hpp b/include/common/enum_types.hpp
-index 340e8ec1..ffd5d9f5 100644
---- a/include/common/enum_types.hpp
-+++ b/include/common/enum_types.hpp
-@@ -42,7 +42,8 @@ static inline constexpr const auto TypeCodeStr = []() constexpr {
- #undef UseTypeCode
- };
- return SpareEnumMap(Array);
--}();
-+}
-+();
-
- /// WASM Mutability C++ enumeration class.
- enum class ValMut : uint8_t {
-@@ -63,7 +64,8 @@ static inline constexpr auto ValMutStr = []() constexpr {
- #undef UseValMut
- };
- return DenseEnumMap(Array);
--}();
-+}
-+();
-
- /// WASM External type C++ enumeration class.
- enum class ExternalType : uint8_t {
-@@ -84,25 +86,7 @@ static inline constexpr auto ExternalTypeStr = []() constexpr {
- #undef UseExternalType
- };
- return DenseEnumMap(Array);
--}();
-+}
-+();
-
- } // namespace WasmEdge
--
--template <>
--struct fmt::formatter<WasmEdge::ValMut> : fmt::formatter<std::string_view> {
-- fmt::format_context::iterator
-- format(const WasmEdge::ValMut &Mut, fmt::format_context &Ctx) const noexcept {
-- return formatter<std::string_view>::format(WasmEdge::ValMutStr[Mut], Ctx);
-- }
--};
--
--template <>
--struct fmt::formatter<WasmEdge::ExternalType>
-- : fmt::formatter<std::string_view> {
-- fmt::format_context::iterator
-- format(const WasmEdge::ExternalType &Type,
-- fmt::format_context &Ctx) const noexcept {
-- return formatter<std::string_view>::format(WasmEdge::ExternalTypeStr[Type],
-- Ctx);
-- }
--};
-diff --git a/include/common/errcode.h b/include/common/errcode.h
-index 4f73a121..a0e5dd89 100644
---- a/include/common/errcode.h
-+++ b/include/common/errcode.h
-@@ -37,6 +37,20 @@
-
- namespace WasmEdge {
-
-+static inline WasmPhase getErrCodePhase(const ErrCode &Code) {
-+ return static_cast<WasmPhase>(Code.getCategory() == ErrCategory::WASM
-+ ? ((Code.getCode() & 0xF0U) >> 5)
-+ : 0x05U // WasmPhase::UserDefined
-+ );
-+}
-+
-+static inline std::ostream &operator<<(std::ostream &OS, const ErrCode &Code) {
-+ OS << WasmPhaseStr[getErrCodePhase(Code)]
-+ << " failed: " << ErrCodeStr[Code.getEnum()]
-+ << ", Code: " << convertUIntToHexStr(Code.getCode(), 2);
-+ return OS;
-+}
-+
- static inline constexpr bool likely(bool V) noexcept {
- return __builtin_expect(V, true);
- }
-@@ -58,25 +72,7 @@ template <typename T> constexpr auto Unexpect(const Expect<T> &Val) {
-
- } // namespace WasmEdge
-
-+#if FMT_VERSION >= 90000
- template <>
--struct fmt::formatter<WasmEdge::ErrCode> : fmt::formatter<std::string_view> {
-- fmt::format_context::iterator
-- format(const WasmEdge::ErrCode &Code,
-- fmt::format_context &Ctx) const noexcept {
-- using namespace std::literals;
-- std::string Output =
-- fmt::format("{} failed: {}, Code: 0x{:03x}"sv, Code.getErrCodePhase(),
-- WasmEdge::ErrCodeStr[Code.getEnum()], Code.getCode());
-- return formatter<std::string_view>::format(Output, Ctx);
-- }
--};
--
--template <>
--struct fmt::formatter<WasmEdge::ErrCode::Value>
-- : fmt::formatter<WasmEdge::ErrCode> {
-- fmt::format_context::iterator
-- format(const WasmEdge::ErrCode::Value &Value,
-- fmt::format_context &Ctx) const noexcept {
-- return formatter<WasmEdge::ErrCode>::format(WasmEdge::ErrCode(Value), Ctx);
-- }
--};
-+struct fmt::formatter<WasmEdge::ErrCode::Value> : ostream_formatter {};
-+#endif
-diff --git a/include/common/errinfo.h b/include/common/errinfo.h
-index a18bb1c3..45f3761c 100644
---- a/include/common/errinfo.h
-+++ b/include/common/errinfo.h
-@@ -37,6 +37,8 @@ struct InfoFile {
- InfoFile() = delete;
- InfoFile(const std::filesystem::path &FName) noexcept : FileName(FName) {}
-
-+ friend std::ostream &operator<<(std::ostream &OS, const struct InfoFile &Rhs);
-+
- std::filesystem::path FileName;
- };
-
-@@ -44,6 +46,9 @@ struct InfoLoading {
- InfoLoading() = delete;
- InfoLoading(const uint64_t Off) noexcept : Offset(Off) {}
-
-+ friend std::ostream &operator<<(std::ostream &OS,
-+ const struct InfoLoading &Rhs);
-+
- uint64_t Offset;
- };
-
-@@ -51,6 +56,8 @@ struct InfoAST {
- InfoAST() = delete;
- InfoAST(const ASTNodeAttr Attr) noexcept : NodeAttr(Attr) {}
-
-+ friend std::ostream &operator<<(std::ostream &OS, const struct InfoAST &Rhs);
-+
- ASTNodeAttr NodeAttr;
- };
-
-@@ -60,6 +67,9 @@ struct InfoInstanceBound {
- const uint32_t Lim) noexcept
- : Instance(Inst), Number(Num), Limited(Lim) {}
-
-+ friend std::ostream &operator<<(std::ostream &OS,
-+ const struct InfoInstanceBound &Rhs);
-+
- ExternalType Instance;
- uint32_t Number, Limited;
- };
-@@ -70,6 +80,9 @@ struct InfoForbidIndex {
- const uint32_t Bound) noexcept
- : Category(Cate), Index(Idx), Boundary(Bound) {}
-
-+ friend std::ostream &operator<<(std::ostream &OS,
-+ const struct InfoForbidIndex &Rhs);
-+
- IndexCategory Category;
- uint32_t Index, Boundary;
- };
-@@ -78,6 +91,9 @@ struct InfoExporting {
- InfoExporting() = delete;
- InfoExporting(std::string_view Ext) noexcept : ExtName(Ext) {}
-
-+ friend std::ostream &operator<<(std::ostream &OS,
-+ const struct InfoExporting &Rhs);
-+
- std::string ExtName;
- };
-
-@@ -87,6 +103,9 @@ struct InfoLimit {
- const uint32_t Max = 0) noexcept
- : LimHasMax(HasMax), LimMin(Min), LimMax(Max) {}
-
-+ friend std::ostream &operator<<(std::ostream &OS,
-+ const struct InfoLimit &Rhs);
-+
- bool LimHasMax;
- uint32_t LimMin, LimMax;
- };
-@@ -95,6 +114,9 @@ struct InfoRegistering {
- InfoRegistering() = delete;
- InfoRegistering(std::string_view Mod) noexcept : ModName(Mod) {}
-
-+ friend std::ostream &operator<<(std::ostream &OS,
-+ const struct InfoRegistering &Rhs);
-+
- std::string ModName;
- };
-
-@@ -104,6 +126,9 @@ struct InfoLinking {
- const ExternalType ExtT = ExternalType::Function) noexcept
- : ModName(Mod), ExtName(Ext), ExtType(ExtT) {}
-
-+ friend std::ostream &operator<<(std::ostream &OS,
-+ const struct InfoLinking &Rhs);
-+
- std::string ModName;
- std::string ExtName;
- ExternalType ExtType;
-@@ -115,6 +140,9 @@ struct InfoExecuting {
- : ModName(Mod), FuncName(Func) {}
- InfoExecuting(std::string_view Func) noexcept : ModName(""), FuncName(Func) {}
-
-+ friend std::ostream &operator<<(std::ostream &OS,
-+ const struct InfoExecuting &Rhs);
-+
- std::string ModName;
- std::string FuncName;
- };
-@@ -196,6 +224,9 @@ struct InfoMismatch {
- : Category(MismatchCategory::Version), ExpVersion(ExpV),
- GotVersion(GotV) {}
-
-+ friend std::ostream &operator<<(std::ostream &OS,
-+ const struct InfoMismatch &Rhs);
-+
- /// Mismatched category
- MismatchCategory Category;
-
-@@ -236,6 +267,9 @@ struct InfoInstruction {
- : Code(Op), Offset(Off), Args(ArgsVec), ArgsTypes(ArgsTypesVec),
- IsSigned(Signed) {}
-
-+ friend std::ostream &operator<<(std::ostream &OS,
-+ const struct InfoInstruction &Rhs);
-+
- OpCode Code;
- uint64_t Offset;
- std::vector<ValVariant> Args;
-@@ -250,6 +284,9 @@ struct InfoBoundary {
- const uint32_t Lim = std::numeric_limits<uint32_t>::max()) noexcept
- : Offset(Off), Size(Len), Limit(Lim) {}
-
-+ friend std::ostream &operator<<(std::ostream &OS,
-+ const struct InfoBoundary &Rhs);
-+
- uint64_t Offset;
- uint32_t Size;
- uint32_t Limit;
-@@ -259,104 +296,46 @@ struct InfoProposal {
- InfoProposal() = delete;
- InfoProposal(Proposal P) noexcept : P(P) {}
-
-+ friend std::ostream &operator<<(std::ostream &OS,
-+ const struct InfoProposal &Rhs);
-+
- Proposal P;
- };
-
- } // namespace ErrInfo
- } // namespace WasmEdge
-
-+#if FMT_VERSION >= 90000
- template <>
--struct fmt::formatter<WasmEdge::ErrInfo::InfoFile>
-- : fmt::formatter<std::string_view> {
-- fmt::format_context::iterator format(const WasmEdge::ErrInfo::InfoFile &Info,
-- fmt::format_context &Ctx) const noexcept;
--};
-+struct fmt::formatter<WasmEdge::ErrInfo::InfoFile> : ostream_formatter {};
- template <>
--struct fmt::formatter<WasmEdge::ErrInfo::InfoLoading>
-- : fmt::formatter<std::string_view> {
-- fmt::format_context::iterator
-- format(const WasmEdge::ErrInfo::InfoLoading &Info,
-- fmt::format_context &Ctx) const noexcept;
--};
-+struct fmt::formatter<WasmEdge::ErrInfo::InfoLoading> : ostream_formatter {};
- template <>
--struct fmt::formatter<WasmEdge::ErrInfo::InfoAST>
-- : fmt::formatter<std::string_view> {
-- fmt::format_context::iterator format(const WasmEdge::ErrInfo::InfoAST &Info,
-- fmt::format_context &Ctx) const noexcept;
--};
-+struct fmt::formatter<WasmEdge::ErrInfo::InfoAST> : ostream_formatter {};
- template <>
- struct fmt::formatter<WasmEdge::ErrInfo::InfoInstanceBound>
-- : fmt::formatter<std::string_view> {
-- fmt::format_context::iterator
-- format(const WasmEdge::ErrInfo::InfoInstanceBound &Info,
-- fmt::format_context &Ctx) const noexcept;
--};
-+ : ostream_formatter {};
- template <>
--struct fmt::formatter<WasmEdge::ErrInfo::InfoForbidIndex>
-- : fmt::formatter<std::string_view> {
-- fmt::format_context::iterator
-- format(const WasmEdge::ErrInfo::InfoForbidIndex &Info,
-- fmt::format_context &Ctx) const noexcept;
-+struct fmt::formatter<WasmEdge::ErrInfo::InfoForbidIndex> : ostream_formatter {
- };
- template <>
--struct fmt::formatter<WasmEdge::ErrInfo::InfoExporting>
-- : fmt::formatter<std::string_view> {
-- fmt::format_context::iterator
-- format(const WasmEdge::ErrInfo::InfoExporting &Info,
-- fmt::format_context &Ctx) const noexcept;
--};
-+struct fmt::formatter<WasmEdge::ErrInfo::InfoExporting> : ostream_formatter {};
- template <>
--struct fmt::formatter<WasmEdge::ErrInfo::InfoLimit>
-- : fmt::formatter<std::string_view> {
-- fmt::format_context::iterator format(const WasmEdge::ErrInfo::InfoLimit &Info,
-- fmt::format_context &Ctx) const noexcept;
--};
-+struct fmt::formatter<WasmEdge::ErrInfo::InfoLimit> : ostream_formatter {};
- template <>
--struct fmt::formatter<WasmEdge::ErrInfo::InfoRegistering>
-- : fmt::formatter<std::string_view> {
-- fmt::format_context::iterator
-- format(const WasmEdge::ErrInfo::InfoRegistering &Info,
-- fmt::format_context &Ctx) const noexcept;
-+struct fmt::formatter<WasmEdge::ErrInfo::InfoRegistering> : ostream_formatter {
- };
- template <>
--struct fmt::formatter<WasmEdge::ErrInfo::InfoLinking>
-- : fmt::formatter<std::string_view> {
-- fmt::format_context::iterator
-- format(const WasmEdge::ErrInfo::InfoLinking &Info,
-- fmt::format_context &Ctx) const noexcept;
--};
-+struct fmt::formatter<WasmEdge::ErrInfo::InfoLinking> : ostream_formatter {};
- template <>
--struct fmt::formatter<WasmEdge::ErrInfo::InfoExecuting>
-- : fmt::formatter<std::string_view> {
-- fmt::format_context::iterator
-- format(const WasmEdge::ErrInfo::InfoExecuting &Info,
-- fmt::format_context &Ctx) const noexcept;
--};
-+struct fmt::formatter<WasmEdge::ErrInfo::InfoExecuting> : ostream_formatter {};
- template <>
--struct fmt::formatter<WasmEdge::ErrInfo::InfoMismatch>
-- : fmt::formatter<std::string_view> {
-- fmt::format_context::iterator
-- format(const WasmEdge::ErrInfo::InfoMismatch &Info,
-- fmt::format_context &Ctx) const noexcept;
--};
-+struct fmt::formatter<WasmEdge::ErrInfo::InfoMismatch> : ostream_formatter {};
- template <>
--struct fmt::formatter<WasmEdge::ErrInfo::InfoInstruction>
-- : fmt::formatter<std::string_view> {
-- fmt::format_context::iterator
-- format(const WasmEdge::ErrInfo::InfoInstruction &Info,
-- fmt::format_context &Ctx) const noexcept;
-+struct fmt::formatter<WasmEdge::ErrInfo::InfoInstruction> : ostream_formatter {
- };
- template <>
--struct fmt::formatter<WasmEdge::ErrInfo::InfoBoundary>
-- : fmt::formatter<std::string_view> {
-- fmt::format_context::iterator
-- format(const WasmEdge::ErrInfo::InfoBoundary &Info,
-- fmt::format_context &Ctx) const noexcept;
--};
-+struct fmt::formatter<WasmEdge::ErrInfo::InfoBoundary> : ostream_formatter {};
- template <>
--struct fmt::formatter<WasmEdge::ErrInfo::InfoProposal>
-- : fmt::formatter<std::string_view> {
-- fmt::format_context::iterator
-- format(const WasmEdge::ErrInfo::InfoProposal &Info,
-- fmt::format_context &Ctx) const noexcept;
--};
-+struct fmt::formatter<WasmEdge::ErrInfo::InfoProposal> : ostream_formatter {};
-+#endif
-diff --git a/include/common/spdlog.h b/include/common/spdlog.h
-index b42970a1..b2940fb0 100644
---- a/include/common/spdlog.h
-+++ b/include/common/spdlog.h
-@@ -13,8 +13,8 @@
- //===----------------------------------------------------------------------===//
- #pragma once
-
--#include "common/filesystem.h"
- #define SPDLOG_NO_EXCEPTIONS 1
-+#include "spdlog/fmt/ostr.h"
- #include "spdlog/spdlog.h"
-
- namespace WasmEdge {
-@@ -32,26 +32,3 @@ void setErrorLoggingLevel();
-
- } // namespace Log
- } // namespace WasmEdge
--
--template <>
--struct fmt::formatter<std::filesystem::path>
-- : fmt::formatter<std::string_view> {
-- fmt::format_context::iterator format(const std::filesystem::path &Path,
-- fmt::format_context &Ctx) const {
-- // mimic std::quoted
-- constexpr const char Delimiter = '"';
-- constexpr const char Escape = '\\';
-- auto Quoted = fmt::memory_buffer();
-- auto Iter = std::back_inserter(Quoted);
-- *Iter++ = Delimiter;
-- for (const auto C : Path.u8string()) {
-- if (C == Delimiter || C == Escape) {
-- *Iter++ = Escape;
-- }
-- *Iter++ = C;
-- }
-- *Iter++ = Delimiter;
-- return fmt::formatter<std::string_view>::format(
-- std::string_view(Quoted.data(), Quoted.size()), Ctx);
-- }
--};
-diff --git a/include/common/types.h b/include/common/types.h
-index e0614486..baebaee8 100644
---- a/include/common/types.h
-+++ b/include/common/types.h
-@@ -164,6 +164,20 @@ public:
- friend bool operator!=(const ValType &LHS, const ValType &RHS) noexcept {
- return !(LHS == RHS);
- }
-+ friend std::ostream &operator<<(std::ostream &OS, const ValType &Type) {
-+ // For the number types, print the type directly.
-+ if (!Type.isRefType()) {
-+ OS << TypeCodeStr[Type.getCode()];
-+ return OS;
-+ }
-+ // For the reference types, print the details.
-+ OS << WasmEdge::TypeCodeStr[Type.getCode()] << " "
-+ << WasmEdge::TypeCodeStr[Type.getHeapTypeCode()];
-+ if (Type.getHeapTypeCode() == WasmEdge::TypeCode::TypeIndex) {
-+ OS << "[" << Type.getTypeIndex() << "]";
-+ }
-+ return OS;
-+ }
-
- TypeCode getCode() const noexcept { return Inner.Data.Code; }
- TypeCode getHeapTypeCode() const noexcept { return Inner.Data.HTCode; }
-@@ -601,27 +615,3 @@ template <typename T> inline T &retrieveExternRef(const RefVariant &Val) {
- // <<<<<<<< Functions to retrieve reference inners <<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- } // namespace WasmEdge
--
--template <>
--struct fmt::formatter<WasmEdge::ValType> : fmt::formatter<std::string_view> {
-- fmt::format_context::iterator
-- format(const WasmEdge::ValType &Type,
-- fmt::format_context &Ctx) const noexcept {
-- using namespace std::literals;
-- // For the number types, print the type directly.
-- if (!Type.isRefType()) {
-- return formatter<std::string_view>::format(
-- WasmEdge::TypeCodeStr[Type.getCode()], Ctx);
-- }
-- // For the reference types, print the details.
-- fmt::memory_buffer Buffer;
-- fmt::format_to(std::back_inserter(Buffer), "{} {}"sv,
-- WasmEdge::TypeCodeStr[Type.getCode()],
-- WasmEdge::TypeCodeStr[Type.getHeapTypeCode()]);
-- if (Type.getHeapTypeCode() == WasmEdge::TypeCode::TypeIndex) {
-- fmt::format_to(std::back_inserter(Buffer), "[{}]"sv, Type.getTypeIndex());
-- }
-- return formatter<std::string_view>::format(
-- std::string_view(Buffer.data(), Buffer.size()), Ctx);
-- }
--};
-diff --git a/include/host/wasi/error.h b/include/host/wasi/error.h
-index 9fc88976..cd779e99 100644
---- a/include/host/wasi/error.h
-+++ b/include/host/wasi/error.h
-@@ -4,9 +4,7 @@
- #pragma once
-
- #include "common/expected.h"
--#include "common/spdlog.h"
- #include "wasi/api.hpp"
--#include <string_view>
-
- namespace WasmEdge {
- namespace Host {
-@@ -26,296 +24,3 @@ template <typename T> constexpr auto WasiUnexpect(const WasiExpect<T> &Val) {
- } // namespace WASI
- } // namespace Host
- } // namespace WasmEdge
--
--template <>
--struct fmt::formatter<__wasi_errno_t> : fmt::formatter<std::string_view> {
-- fmt::format_context::iterator
-- format(__wasi_errno_t ErrNo, fmt::format_context &Ctx) const noexcept {
-- fmt::memory_buffer Buffer;
-- using namespace std::literals;
-- auto Iter = std::back_inserter(Buffer);
-- switch (ErrNo) {
-- case __WASI_ERRNO_SUCCESS:
-- fmt::format_to(
-- Iter, "No error occurred. System call completed successfully."sv);
-- break;
-- case __WASI_ERRNO_2BIG:
-- fmt::format_to(Iter, "Argument list too long."sv);
-- break;
-- case __WASI_ERRNO_ACCES:
-- fmt::format_to(Iter, "Permission denied."sv);
-- break;
-- case __WASI_ERRNO_ADDRINUSE:
-- fmt::format_to(Iter, "Address in use."sv);
-- break;
-- case __WASI_ERRNO_ADDRNOTAVAIL:
-- fmt::format_to(Iter, "Address not available."sv);
-- break;
-- case __WASI_ERRNO_AFNOSUPPORT:
-- fmt::format_to(Iter, "Address family not supported."sv);
-- break;
-- case __WASI_ERRNO_AGAIN:
-- fmt::format_to(Iter, "Resource unavailable, or operation would block."sv);
-- break;
-- case __WASI_ERRNO_ALREADY:
-- fmt::format_to(Iter, "Connection already in progress."sv);
-- break;
-- case __WASI_ERRNO_BADF:
-- fmt::format_to(Iter, "Bad file descriptor."sv);
-- break;
-- case __WASI_ERRNO_BADMSG:
-- fmt::format_to(Iter, "Bad message."sv);
-- break;
-- case __WASI_ERRNO_BUSY:
-- fmt::format_to(Iter, "Device or resource busy."sv);
-- break;
-- case __WASI_ERRNO_CANCELED:
-- fmt::format_to(Iter, "Operation canceled."sv);
-- break;
-- case __WASI_ERRNO_CHILD:
-- fmt::format_to(Iter, "No child processes."sv);
-- break;
-- case __WASI_ERRNO_CONNABORTED:
-- fmt::format_to(Iter, "Connection aborted."sv);
-- break;
-- case __WASI_ERRNO_CONNREFUSED:
-- fmt::format_to(Iter, "Connection refused."sv);
-- break;
-- case __WASI_ERRNO_CONNRESET:
-- fmt::format_to(Iter, "Connection reset."sv);
-- break;
-- case __WASI_ERRNO_DEADLK:
-- fmt::format_to(Iter, "Resource deadlock would occur."sv);
-- break;
-- case __WASI_ERRNO_DESTADDRREQ:
-- fmt::format_to(Iter, "Destination address required."sv);
-- break;
-- case __WASI_ERRNO_DOM:
-- fmt::format_to(Iter, "Mathematics argument out of domain of function."sv);
-- break;
-- case __WASI_ERRNO_DQUOT:
-- fmt::format_to(Iter, "Reserved."sv);
-- break;
-- case __WASI_ERRNO_EXIST:
-- fmt::format_to(Iter, "File exists."sv);
-- break;
-- case __WASI_ERRNO_FAULT:
-- fmt::format_to(Iter, "Bad address."sv);
-- break;
-- case __WASI_ERRNO_FBIG:
-- fmt::format_to(Iter, "File too large."sv);
-- break;
-- case __WASI_ERRNO_HOSTUNREACH:
-- fmt::format_to(Iter, "Host is unreachable."sv);
-- break;
-- case __WASI_ERRNO_IDRM:
-- fmt::format_to(Iter, "Identifier removed."sv);
-- break;
-- case __WASI_ERRNO_ILSEQ:
-- fmt::format_to(Iter, "Illegal byte sequence."sv);
-- break;
-- case __WASI_ERRNO_INPROGRESS:
-- fmt::format_to(Iter, "Operation in progress."sv);
-- break;
-- case __WASI_ERRNO_INTR:
-- fmt::format_to(Iter, "Interrupted function."sv);
-- break;
-- case __WASI_ERRNO_INVAL:
-- fmt::format_to(Iter, "Invalid argument."sv);
-- break;
-- case __WASI_ERRNO_IO:
-- fmt::format_to(Iter, "I/O error."sv);
-- break;
-- case __WASI_ERRNO_ISCONN:
-- fmt::format_to(Iter, "Socket is connected."sv);
-- break;
-- case __WASI_ERRNO_ISDIR:
-- fmt::format_to(Iter, "Is a directory."sv);
-- break;
-- case __WASI_ERRNO_LOOP:
-- fmt::format_to(Iter, "Too many levels of symbolic links."sv);
-- break;
-- case __WASI_ERRNO_MFILE:
-- fmt::format_to(Iter, "File descriptor value too large."sv);
-- break;
-- case __WASI_ERRNO_MLINK:
-- fmt::format_to(Iter, "Too many links."sv);
-- break;
-- case __WASI_ERRNO_MSGSIZE:
-- fmt::format_to(Iter, "Message too large."sv);
-- break;
-- case __WASI_ERRNO_MULTIHOP:
-- fmt::format_to(Iter, "Reserved."sv);
-- break;
-- case __WASI_ERRNO_NAMETOOLONG:
-- fmt::format_to(Iter, "Filename too long."sv);
-- break;
-- case __WASI_ERRNO_NETDOWN:
-- fmt::format_to(Iter, "Network is down."sv);
-- break;
-- case __WASI_ERRNO_NETRESET:
-- fmt::format_to(Iter, "Connection aborted by network."sv);
-- break;
-- case __WASI_ERRNO_NETUNREACH:
-- fmt::format_to(Iter, "Network unreachable."sv);
-- break;
-- case __WASI_ERRNO_NFILE:
-- fmt::format_to(Iter, "Too many files open in system."sv);
-- break;
-- case __WASI_ERRNO_NOBUFS:
-- fmt::format_to(Iter, "No buffer space available."sv);
-- break;
-- case __WASI_ERRNO_NODEV:
-- fmt::format_to(Iter, "No such device."sv);
-- break;
-- case __WASI_ERRNO_NOENT:
-- fmt::format_to(Iter, "No such file or directory."sv);
-- break;
-- case __WASI_ERRNO_NOEXEC:
-- fmt::format_to(Iter, "Executable file format error."sv);
-- break;
-- case __WASI_ERRNO_NOLCK:
-- fmt::format_to(Iter, "No locks available."sv);
-- break;
-- case __WASI_ERRNO_NOLINK:
-- fmt::format_to(Iter, "Reserved."sv);
-- break;
-- case __WASI_ERRNO_NOMEM:
-- fmt::format_to(Iter, "Not enough space."sv);
-- break;
-- case __WASI_ERRNO_NOMSG:
-- fmt::format_to(Iter, "No message of the desired type."sv);
-- break;
-- case __WASI_ERRNO_NOPROTOOPT:
-- fmt::format_to(Iter, "Protocol not available."sv);
-- break;
-- case __WASI_ERRNO_NOSPC:
-- fmt::format_to(Iter, "No space left on device."sv);
-- break;
-- case __WASI_ERRNO_NOSYS:
-- fmt::format_to(Iter, "Function not supported."sv);
-- break;
-- case __WASI_ERRNO_NOTCONN:
-- fmt::format_to(Iter, "The socket is not connected."sv);
-- break;
-- case __WASI_ERRNO_NOTDIR:
-- fmt::format_to(Iter,
-- "Not a directory or a symbolic link to a directory."sv);
-- break;
-- case __WASI_ERRNO_NOTEMPTY:
-- fmt::format_to(Iter, "Directory not empty."sv);
-- break;
-- case __WASI_ERRNO_NOTRECOVERABLE:
-- fmt::format_to(Iter, "State not recoverable."sv);
-- break;
-- case __WASI_ERRNO_NOTSOCK:
-- fmt::format_to(Iter, "Not a socket."sv);
-- break;
-- case __WASI_ERRNO_NOTSUP:
-- fmt::format_to(Iter,
-- "Not supported, or operation not supported on socket."sv);
-- break;
-- case __WASI_ERRNO_NOTTY:
-- fmt::format_to(Iter, "Inappropriate I/O control operation."sv);
-- break;
-- case __WASI_ERRNO_NXIO:
-- fmt::format_to(Iter, "No such device or address."sv);
-- break;
-- case __WASI_ERRNO_OVERFLOW:
-- fmt::format_to(Iter, "Value too large to be stored in data type."sv);
-- break;
-- case __WASI_ERRNO_OWNERDEAD:
-- fmt::format_to(Iter, "Previous owner died."sv);
-- break;
-- case __WASI_ERRNO_PERM:
-- fmt::format_to(Iter, "Operation not permitted."sv);
-- break;
-- case __WASI_ERRNO_PIPE:
-- fmt::format_to(Iter, "Broken pipe."sv);
-- break;
-- case __WASI_ERRNO_PROTO:
-- fmt::format_to(Iter, "Protocol error."sv);
-- break;
-- case __WASI_ERRNO_PROTONOSUPPORT:
-- fmt::format_to(Iter, "Protocol not supported."sv);
-- break;
-- case __WASI_ERRNO_PROTOTYPE:
-- fmt::format_to(Iter, "Protocol wrong type for socket."sv);
-- break;
-- case __WASI_ERRNO_RANGE:
-- fmt::format_to(Iter, "Result too large."sv);
-- break;
-- case __WASI_ERRNO_ROFS:
-- fmt::format_to(Iter, "Read-only file system."sv);
-- break;
-- case __WASI_ERRNO_SPIPE:
-- fmt::format_to(Iter, "Invalid seek."sv);
-- break;
-- case __WASI_ERRNO_SRCH:
-- fmt::format_to(Iter, "No such process."sv);
-- break;
-- case __WASI_ERRNO_STALE:
-- fmt::format_to(Iter, "Reserved."sv);
-- break;
-- case __WASI_ERRNO_TIMEDOUT:
-- fmt::format_to(Iter, "Connection timed out."sv);
-- break;
-- case __WASI_ERRNO_TXTBSY:
-- fmt::format_to(Iter, "Text file busy."sv);
-- break;
-- case __WASI_ERRNO_XDEV:
-- fmt::format_to(Iter, "Cross-device link."sv);
-- break;
-- case __WASI_ERRNO_NOTCAPABLE:
-- fmt::format_to(Iter, "Extension: Capabilities insufficient."sv);
-- break;
-- case __WASI_ERRNO_AIADDRFAMILY:
-- fmt::format_to(Iter,
-- "The specified network host does not have any network "
-- "addresses in the requested address family."sv);
-- break;
-- case __WASI_ERRNO_AIAGAIN:
-- fmt::format_to(Iter, "Try again later."sv);
-- break;
-- case __WASI_ERRNO_AIBADFLAG:
-- fmt::format_to(Iter, "Hints.ai_flags contains invalid flags"sv);
-- break;
-- case __WASI_ERRNO_AIFAIL:
-- fmt::format_to(
-- Iter, "The name server returned a permanent failure indication."sv);
-- break;
-- case __WASI_ERRNO_AIFAMILY:
-- fmt::format_to(Iter, "The requested address family is not supported."sv);
-- break;
-- case __WASI_ERRNO_AIMEMORY:
-- fmt::format_to(Iter, "Addrinfo out of memory."sv);
-- break;
-- case __WASI_ERRNO_AINODATA:
-- fmt::format_to(Iter, "Network host exists, but does not have any network "
-- "addresses defined."sv);
-- break;
-- case __WASI_ERRNO_AINONAME:
-- fmt::format_to(
-- Iter,
-- "Node or service is not known; or both node and service are NULL."sv);
-- break;
-- case __WASI_ERRNO_AISERVICE:
-- fmt::format_to(
-- Iter, "Service is not available for the requested socket type."sv);
-- break;
-- case __WASI_ERRNO_AISOCKTYPE:
-- fmt::format_to(Iter, "The requested socket type is not supported."sv);
-- break;
-- case __WASI_ERRNO_AISYSTEM:
-- fmt::format_to(Iter, "Other system error."sv);
-- break;
-- default:
-- fmt::format_to(
-- Iter, "Unknown error code {}"sv,
-- static_cast<std::underlying_type_t<__wasi_errno_t>>(ErrNo));
-- break;
-- }
-- return fmt::formatter<std::string_view>::format(
-- std::string_view(Buffer.data(), Buffer.size()), Ctx);
-- }
--};
-diff --git a/lib/common/CMakeLists.txt b/lib/common/CMakeLists.txt
-index bf2bf37e..a3c2d861 100644
---- a/lib/common/CMakeLists.txt
-+++ b/lib/common/CMakeLists.txt
-@@ -24,7 +24,7 @@ else()
- FetchContent_Declare(
- spdlog
- GIT_REPOSITORY https://github.com/gabime/spdlog.git
-- GIT_TAG v1.13.0
-+ GIT_TAG v1.9.0
- GIT_SHALLOW TRUE
- )
- set(SPDLOG_BUILD_SHARED OFF CACHE BOOL "Build shared library" FORCE)
-diff --git a/lib/common/errinfo.cpp b/lib/common/errinfo.cpp
-index 188a1836..2dfbff09 100644
---- a/lib/common/errinfo.cpp
-+++ b/lib/common/errinfo.cpp
-@@ -5,313 +5,266 @@
- #include "common/errcode.h"
- #include "common/hexstr.h"
-
--using namespace std::literals;
--
--fmt::format_context::iterator
--fmt::formatter<WasmEdge::ErrInfo::InfoFile>::format(
-- const WasmEdge::ErrInfo::InfoFile &Info,
-- fmt::format_context &Ctx) const noexcept {
-- fmt::memory_buffer Buffer;
-- fmt::format_to(std::back_inserter(Buffer), " File name: {}"sv,
-- Info.FileName);
-- return formatter<std::string_view>::format(
-- std::string_view(Buffer.data(), Buffer.size()), Ctx);
-+namespace WasmEdge {
-+namespace ErrInfo {
-+std::ostream &operator<<(std::ostream &OS, const struct InfoFile &Rhs) {
-+ OS << " File name: " << Rhs.FileName;
-+ return OS;
- }
-
--fmt::format_context::iterator
--fmt::formatter<WasmEdge::ErrInfo::InfoLoading>::format(
-- const WasmEdge::ErrInfo::InfoLoading &Info,
-- fmt::format_context &Ctx) const noexcept {
-- fmt::memory_buffer Buffer;
-- fmt::format_to(std::back_inserter(Buffer), " Bytecode offset: 0x{:08x}"sv,
-- Info.Offset);
-- return formatter<std::string_view>::format(
-- std::string_view(Buffer.data(), Buffer.size()), Ctx);
-+std::ostream &operator<<(std::ostream &OS, const struct InfoLoading &Rhs) {
-+ OS << " Bytecode offset: " << convertUIntToHexStr(Rhs.Offset);
-+ return OS;
- }
-
--fmt::format_context::iterator
--fmt::formatter<WasmEdge::ErrInfo::InfoAST>::format(
-- const WasmEdge::ErrInfo::InfoAST &Info,
-- fmt::format_context &Ctx) const noexcept {
-- fmt::memory_buffer Buffer;
-- fmt::format_to(std::back_inserter(Buffer), " At AST node: {}"sv,
-- Info.NodeAttr);
-- return formatter<std::string_view>::format(
-- std::string_view(Buffer.data(), Buffer.size()), Ctx);
-+std::ostream &operator<<(std::ostream &OS, const struct InfoAST &Rhs) {
-+ OS << " At AST node: " << ASTNodeAttrStr[Rhs.NodeAttr];
-+ return OS;
- }
-
--fmt::format_context::iterator
--fmt::formatter<WasmEdge::ErrInfo::InfoInstanceBound>::format(
-- const WasmEdge::ErrInfo::InfoInstanceBound &Info,
-- fmt::format_context &Ctx) const noexcept {
-- fmt::memory_buffer Buffer;
-- fmt::format_to(std::back_inserter(Buffer),
-- " Instance {} has limited number {} , Got: {}"sv,
-- Info.Instance, Info.Limited, Info.Number);
-- return formatter<std::string_view>::format(
-- std::string_view(Buffer.data(), Buffer.size()), Ctx);
-+std::ostream &operator<<(std::ostream &OS,
-+ const struct InfoInstanceBound &Rhs) {
-+ OS << " Instance " << ExternalTypeStr[Rhs.Instance]
-+ << " has limited number " << Rhs.Limited << " , Got: " << Rhs.Number;
-+ return OS;
- }
-
--fmt::format_context::iterator
--fmt::formatter<WasmEdge::ErrInfo::InfoForbidIndex>::format(
-- const WasmEdge::ErrInfo::InfoForbidIndex &Info,
-- fmt::format_context &Ctx) const noexcept {
-- fmt::memory_buffer Buffer;
-- auto Iter =
-- fmt::format_to(std::back_inserter(Buffer),
-- " When checking {} index: {} , Out of boundary: "sv,
-- Info.Category, Info.Index);
-- if (Info.Boundary > 0) {
-- fmt::format_to(Iter, "{}"sv, Info.Boundary - 1);
-+std::ostream &operator<<(std::ostream &OS, const struct InfoForbidIndex &Rhs) {
-+ OS << " When checking " << IndexCategoryStr[Rhs.Category]
-+ << " index: " << Rhs.Index << " , Out of boundary: ";
-+ if (Rhs.Boundary > 0) {
-+ OS << (Rhs.Boundary - 1);
- } else {
-- fmt::format_to(Iter, "empty"sv);
-+ OS << "empty";
- }
-- return formatter<std::string_view>::format(
-- std::string_view(Buffer.data(), Buffer.size()), Ctx);
-+ return OS;
- }
-
--fmt::format_context::iterator
--fmt::formatter<WasmEdge::ErrInfo::InfoExporting>::format(
-- const WasmEdge::ErrInfo::InfoExporting &Info,
-- fmt::format_context &Ctx) const noexcept {
-- fmt::memory_buffer Buffer;
-- fmt::format_to(std::back_inserter(Buffer),
-- " Duplicated exporting name: \"{}\""sv, Info.ExtName);
-- return formatter<std::string_view>::format(
-- std::string_view(Buffer.data(), Buffer.size()), Ctx);
-+std::ostream &operator<<(std::ostream &OS, const struct InfoExporting &Rhs) {
-+ OS << " Duplicated exporting name: \"" << Rhs.ExtName << "\"";
-+ return OS;
- }
-
--fmt::format_context::iterator
--fmt::formatter<WasmEdge::ErrInfo::InfoLimit>::format(
-- const WasmEdge::ErrInfo::InfoLimit &Info,
-- fmt::format_context &Ctx) const noexcept {
-- fmt::memory_buffer Buffer;
-- auto Iter = fmt::format_to(std::back_inserter(Buffer),
-- " In Limit type: {{ min: {}"sv, Info.LimMin);
-- if (Info.LimHasMax) {
-- Iter = fmt::format_to(Iter, " , max: {}"sv, Info.LimMax);
-+std::ostream &operator<<(std::ostream &OS, const struct InfoLimit &Rhs) {
-+ OS << " In Limit type: { min: " << Rhs.LimMin;
-+ if (Rhs.LimHasMax) {
-+ OS << " , max: " << Rhs.LimMax;
- }
-- fmt::format_to(Iter, " }}"sv);
-- return formatter<std::string_view>::format(
-- std::string_view(Buffer.data(), Buffer.size()), Ctx);
-+ OS << " }";
-+ return OS;
- }
-
--fmt::format_context::iterator
--fmt::formatter<WasmEdge::ErrInfo::InfoRegistering>::format(
-- const WasmEdge::ErrInfo::InfoRegistering &Info,
-- fmt::format_context &Ctx) const noexcept {
-- fmt::memory_buffer Buffer;
-- fmt::format_to(std::back_inserter(Buffer), " Module name: \"{}\""sv,
-- Info.ModName);
-- return formatter<std::string_view>::format(
-- std::string_view(Buffer.data(), Buffer.size()), Ctx);
-+std::ostream &operator<<(std::ostream &OS, const struct InfoRegistering &Rhs) {
-+ OS << " Module name: \"" << Rhs.ModName << "\"";
-+ return OS;
- }
-
--fmt::format_context::iterator
--fmt::formatter<WasmEdge::ErrInfo::InfoLinking>::format(
-- const WasmEdge::ErrInfo::InfoLinking &Info,
-- fmt::format_context &Ctx) const noexcept {
-- fmt::memory_buffer Buffer;
-- fmt::format_to(std::back_inserter(Buffer),
-- " When linking module: \"{}\" , {} name: \"{}\""sv,
-- Info.ModName, Info.ExtType, Info.ExtName);
-- return formatter<std::string_view>::format(
-- std::string_view(Buffer.data(), Buffer.size()), Ctx);
-+std::ostream &operator<<(std::ostream &OS, const struct InfoLinking &Rhs) {
-+ OS << " When linking module: \"" << Rhs.ModName << "\" , "
-+ << ExternalTypeStr[Rhs.ExtType] << " name: \"" << Rhs.ExtName << "\"";
-+ return OS;
- }
-
--fmt::format_context::iterator
--fmt::formatter<WasmEdge::ErrInfo::InfoExecuting>::format(
-- const WasmEdge::ErrInfo::InfoExecuting &Info,
-- fmt::format_context &Ctx) const noexcept {
-- fmt::memory_buffer Buffer;
-- auto Iter =
-- fmt::format_to(std::back_inserter(Buffer), " When executing "sv);
-- if (!Info.ModName.empty()) {
-- Iter = fmt::format_to(Iter, "module name: \"{}\" , "sv, Info.ModName);
-+std::ostream &operator<<(std::ostream &OS, const struct InfoExecuting &Rhs) {
-+ OS << " When executing ";
-+ if (Rhs.ModName != "") {
-+ OS << "module name: \"" << Rhs.ModName << "\" , ";
- }
-- fmt::format_to(Iter, "function name: \"{}\""sv, Info.FuncName);
-- return formatter<std::string_view>::format(
-- std::string_view(Buffer.data(), Buffer.size()), Ctx);
-+ OS << "function name: \"" << Rhs.FuncName << "\"";
-+ return OS;
- }
-
--fmt::format_context::iterator
--fmt::formatter<WasmEdge::ErrInfo::InfoMismatch>::format(
-- const WasmEdge::ErrInfo::InfoMismatch &Info,
-- fmt::format_context &Ctx) const noexcept {
-- fmt::memory_buffer Buffer;
-- auto Iter = fmt::format_to(std::back_inserter(Buffer),
-- " Mismatched {}. "sv, Info.Category);
-- auto FormatLimit = [](auto Out, bool LimHasMax, uint32_t LimMin,
-- uint32_t LimMax) {
-- Out = fmt::format_to(Out, "Limit{{{}"sv, LimMin);
-- if (LimHasMax) {
-- Out = fmt::format_to(Out, " , {}"sv, LimMax);
-- }
-- Out = fmt::format_to(Out, "}}"sv);
-- return Out;
-- };
-- switch (Info.Category) {
-- case WasmEdge::ErrInfo::MismatchCategory::Alignment:
-- fmt::format_to(Iter, "Expected: need to <= {} , Got: {}"sv,
-- static_cast<uint32_t>(Info.ExpAlignment),
-- 1UL << Info.GotAlignment);
-+std::ostream &operator<<(std::ostream &OS, const struct InfoMismatch &Rhs) {
-+ OS << " Mismatched " << MismatchCategoryStr[Rhs.Category] << ". ";
-+ switch (Rhs.Category) {
-+ case MismatchCategory::Alignment:
-+ OS << "Expected: need to <= " << static_cast<uint32_t>(Rhs.ExpAlignment)
-+ << " , Got: " << (1UL << Rhs.GotAlignment);
- break;
-- case WasmEdge::ErrInfo::MismatchCategory::ValueType:
-- fmt::format_to(Iter, "Expected: {} , Got: {}"sv, Info.ExpValType,
-- Info.GotValType);
-+ case MismatchCategory::ValueType:
-+ OS << "Expected: " << TypeCodeStr[Rhs.ExpValType.getCode()]
-+ << " , Got: " << TypeCodeStr[Rhs.GotValType.getCode()];
- break;
-- case WasmEdge::ErrInfo::MismatchCategory::ValueTypes:
-- fmt::format_to(Iter, "Expected: types{{{}}} , Got: types{{{}}}"sv,
-- fmt::join(Info.ExpParams, " , "sv),
-- fmt::join(Info.GotParams, " , "sv));
-+ case MismatchCategory::ValueTypes:
-+ OS << "Expected: types{";
-+ for (uint32_t I = 0; I < Rhs.ExpParams.size(); ++I) {
-+ OS << TypeCodeStr[Rhs.ExpParams[I].getCode()];
-+ if (I < Rhs.ExpParams.size() - 1) {
-+ OS << " , ";
-+ }
-+ }
-+ OS << "} , Got: types{";
-+ for (uint32_t I = 0; I < Rhs.GotParams.size(); ++I) {
-+ OS << TypeCodeStr[Rhs.GotParams[I].getCode()];
-+ if (I < Rhs.GotParams.size() - 1) {
-+ OS << " , ";
-+ }
-+ }
-+ OS << "}";
- break;
-- case WasmEdge::ErrInfo::MismatchCategory::Mutation:
-- fmt::format_to(Iter, "Expected: {} , Got: {}"sv, Info.ExpValMut,
-- Info.GotValMut);
-+ case MismatchCategory::Mutation:
-+ OS << "Expected: " << ValMutStr[Rhs.ExpValMut]
-+ << " , Got: " << ValMutStr[Rhs.GotValMut];
- break;
-- case WasmEdge::ErrInfo::MismatchCategory::ExternalType:
-- fmt::format_to(Iter, "Expected: {} , Got: {}", Info.ExpExtType,
-- Info.GotExtType);
-+ case MismatchCategory::ExternalType:
-+ OS << "Expected: " << ExternalTypeStr[Rhs.ExpExtType]
-+ << " , Got: " << ExternalTypeStr[Rhs.GotExtType];
- break;
-- case WasmEdge::ErrInfo::MismatchCategory::FunctionType:
-- fmt::format_to(Iter,
-- "Expected: FuncType {{params{{{}}} returns{{{}}}}} , "
-- "Got: FuncType {{params{{{}}} returns{{{}}}}}"sv,
-- fmt::join(Info.ExpParams, " , "sv),
-- fmt::join(Info.ExpReturns, " , "sv),
-- fmt::join(Info.GotParams, " , "sv),
-- fmt::join(Info.GotReturns, " , "sv));
-+ case MismatchCategory::FunctionType:
-+ OS << "Expected: FuncType {params{";
-+ for (uint32_t I = 0; I < Rhs.ExpParams.size(); ++I) {
-+ OS << TypeCodeStr[Rhs.ExpParams[I].getCode()];
-+ if (I < Rhs.ExpParams.size() - 1) {
-+ OS << " , ";
-+ }
-+ }
-+ OS << "} returns{";
-+ for (uint32_t I = 0; I < Rhs.ExpReturns.size(); ++I) {
-+ OS << TypeCodeStr[Rhs.ExpReturns[I].getCode()];
-+ if (I < Rhs.ExpReturns.size() - 1) {
-+ OS << " , ";
-+ }
-+ }
-+ OS << "}} , Got: FuncType {params{";
-+ for (uint32_t I = 0; I < Rhs.GotParams.size(); ++I) {
-+ OS << TypeCodeStr[Rhs.GotParams[I].getCode()];
-+ if (I < Rhs.GotParams.size() - 1) {
-+ OS << " , ";
-+ }
-+ }
-+ OS << "} returns{";
-+ for (uint32_t I = 0; I < Rhs.GotReturns.size(); ++I) {
-+ OS << TypeCodeStr[Rhs.GotReturns[I].getCode()];
-+ if (I < Rhs.GotReturns.size() - 1) {
-+ OS << " , ";
-+ }
-+ }
-+ OS << "}}";
- break;
-- case WasmEdge::ErrInfo::MismatchCategory::Table:
-- Iter = fmt::format_to(Iter, "Expected: TableType {{RefType{{{}}} "sv,
-- static_cast<WasmEdge::ValType>(Info.ExpValType));
-- Iter = FormatLimit(Iter, Info.ExpLimHasMax, Info.ExpLimMin, Info.ExpLimMax);
-- Iter = fmt::format_to(Iter, "}} , Got: TableType {{RefType{{{}}} "sv,
-- static_cast<WasmEdge::ValType>(Info.GotValType));
-- Iter = FormatLimit(Iter, Info.GotLimHasMax, Info.GotLimMin, Info.GotLimMax);
-- fmt::format_to(Iter, "}}"sv);
-+ case MismatchCategory::Table:
-+ OS << "Expected: TableType {RefType{"
-+ << TypeCodeStr[static_cast<ValType>(Rhs.ExpValType).getCode()]
-+ << "} Limit{" << Rhs.ExpLimMin;
-+ if (Rhs.ExpLimHasMax) {
-+ OS << " , " << Rhs.ExpLimMax;
-+ }
-+ OS << "}} , Got: TableType {RefType{"
-+ << TypeCodeStr[static_cast<ValType>(Rhs.GotValType).getCode()]
-+ << "} Limit{" << Rhs.GotLimMin;
-+ if (Rhs.GotLimHasMax) {
-+ OS << " , " << Rhs.GotLimMax;
-+ }
-+ OS << "}}";
- break;
-- case WasmEdge::ErrInfo::MismatchCategory::Memory:
-- Iter = fmt::format_to(Iter, "Expected: MemoryType {{"sv);
-- Iter = FormatLimit(Iter, Info.ExpLimHasMax, Info.ExpLimMin, Info.ExpLimMax);
-- Iter = fmt::format_to(Iter, "}} , Got: MemoryType {{"sv);
-- Iter = FormatLimit(Iter, Info.GotLimHasMax, Info.GotLimMin, Info.GotLimMax);
-- fmt::format_to(Iter, "}}"sv);
-+ case MismatchCategory::Memory:
-+ OS << "Expected: MemoryType {Limit{" << Rhs.ExpLimMin;
-+ if (Rhs.ExpLimHasMax) {
-+ OS << " , " << Rhs.ExpLimMax;
-+ }
-+ OS << "}} , Got: MemoryType {Limit{" << Rhs.GotLimMin;
-+ if (Rhs.GotLimHasMax) {
-+ OS << " , " << Rhs.GotLimMax;
-+ }
-+ OS << "}}";
- break;
-- case WasmEdge::ErrInfo::MismatchCategory::Global:
-- fmt::format_to(Iter,
-- "Expected: GlobalType {{Mutation{{{}}} ValType{{{}}}}} , "
-- "Got: GlobalType {{Mutation{{{}}} ValType{{{}}}}}"sv,
-- Info.ExpValMut, Info.ExpValType, Info.GotValMut,
-- Info.GotValType);
-+ case MismatchCategory::Global:
-+ OS << "Expected: GlobalType {Mutation{" << ValMutStr[Rhs.ExpValMut]
-+ << "} ValType{" << TypeCodeStr[Rhs.ExpValType.getCode()]
-+ << "}} , Got: GlobalType {Mutation{" << ValMutStr[Rhs.GotValMut]
-+ << "} ValType{" << TypeCodeStr[Rhs.GotValType.getCode()] << "}}";
- break;
-- case WasmEdge::ErrInfo::MismatchCategory::Version:
-- fmt::format_to(Iter, "Expected: {} , Got: {}"sv, Info.ExpVersion,
-- Info.GotVersion);
-+ case MismatchCategory::Version:
-+ OS << "Expected: " << Rhs.ExpVersion << " , Got: " << Rhs.GotVersion;
- break;
- default:
- break;
- }
-- return formatter<std::string_view>::format(
-- std::string_view(Buffer.data(), Buffer.size()), Ctx);
-+ return OS;
- }
-
--fmt::format_context::iterator
--fmt::formatter<WasmEdge::ErrInfo::InfoInstruction>::format(
-- const WasmEdge::ErrInfo::InfoInstruction &Info,
-- fmt::format_context &Ctx) const noexcept {
-- uint16_t Payload = static_cast<uint16_t>(Info.Code);
-- fmt::memory_buffer Buffer;
-- auto Iter = fmt::format_to(std::back_inserter(Buffer),
-- " In instruction: {} ("sv, Info.Code);
-+std::ostream &operator<<(std::ostream &OS, const struct InfoInstruction &Rhs) {
-+ uint16_t Payload = static_cast<uint16_t>(Rhs.Code);
-+ OS << " In instruction: " << OpCodeStr[Rhs.Code] << " (";
- if ((Payload >> 8) >= static_cast<uint16_t>(0xFCU)) {
-- Iter = fmt::format_to(Iter, "0x{:02x} "sv, Payload >> 8);
-+ OS << convertUIntToHexStr(Payload >> 8, 2) << " ";
- }
-- Iter = fmt::format_to(Iter, "0x{:02x}) , Bytecode offset: 0x{:08x}"sv,
-- Payload & 0xFFU, Info.Offset);
-- if (!Info.Args.empty()) {
-- Iter = fmt::format_to(Iter, " , Args: ["sv);
-- for (uint32_t I = 0; I < Info.Args.size(); ++I) {
-- switch (Info.ArgsTypes[I].getCode()) {
-- case WasmEdge::TypeCode::I32:
-- if (Info.IsSigned) {
-- Iter = fmt::format_to(Iter, "{}"sv, Info.Args[I].get<int32_t>());
-+ OS << convertUIntToHexStr(Payload & 0xFFU, 2)
-+ << ") , Bytecode offset: " << convertUIntToHexStr(Rhs.Offset);
-+ if (Rhs.Args.size() > 0) {
-+ OS << " , Args: [";
-+ for (uint32_t I = 0; I < Rhs.Args.size(); ++I) {
-+ switch (Rhs.ArgsTypes[I].getCode()) {
-+ case TypeCode::I32:
-+ if (Rhs.IsSigned) {
-+ OS << Rhs.Args[I].get<int32_t>();
- } else {
-- Iter = fmt::format_to(Iter, "{}"sv, Info.Args[I].get<uint32_t>());
-+ OS << Rhs.Args[I].get<uint32_t>();
- }
- break;
-- case WasmEdge::TypeCode::I64:
-- if (Info.IsSigned) {
-- Iter = fmt::format_to(Iter, "{}"sv, Info.Args[I].get<int64_t>());
-+ case TypeCode::I64:
-+ if (Rhs.IsSigned) {
-+ OS << Rhs.Args[I].get<int64_t>();
- } else {
-- Iter = fmt::format_to(Iter, "{}"sv, Info.Args[I].get<uint64_t>());
-+ OS << Rhs.Args[I].get<uint64_t>();
- }
- break;
-- case WasmEdge::TypeCode::F32:
-- Iter = fmt::format_to(Iter, "{}"sv, Info.Args[I].get<float>());
-+ case TypeCode::F32:
-+ OS << Rhs.Args[I].get<float>();
- break;
-- case WasmEdge::TypeCode::F64:
-- Iter = fmt::format_to(Iter, "{}"sv, Info.Args[I].get<double>());
-+ case TypeCode::F64:
-+ OS << Rhs.Args[I].get<double>();
- break;
-- case WasmEdge::TypeCode::V128: {
-- const auto Value = Info.Args[I].get<WasmEdge::uint64x2_t>();
-- Iter = fmt::format_to(Iter, "0x{:08x}{:08x}"sv, Value[1], Value[0]);
-+ case TypeCode::V128: {
-+ const auto Value = Rhs.Args[I].get<uint64x2_t>();
-+ OS << std::hex << Value[0] << Value[1];
- break;
- }
-- case WasmEdge::TypeCode::Ref:
-- case WasmEdge::TypeCode::RefNull:
-- Iter = fmt::format_to(Iter, "{}"sv, Info.ArgsTypes[I]);
-- if (Info.Args[I].get<WasmEdge::RefVariant>().isNull()) {
-- Iter = fmt::format_to(Iter, ":null"sv);
-+ case TypeCode::FuncRef:
-+ OS << TypeCodeStr[Rhs.ArgsTypes[I].getCode()];
-+ if (Rhs.Args[I].get<WasmEdge::RefVariant>().isNull()) {
-+ OS << ":null";
- } else {
-- Iter =
-- fmt::format_to(Iter, ":0x{:08x}"sv, Info.Args[I].get<uint64_t>());
-+ OS << ":" << &Rhs.Args[I].get<uint64_t>();
-+ }
-+ break;
-+ case TypeCode::ExternRef:
-+ OS << TypeCodeStr[Rhs.ArgsTypes[I].getCode()];
-+ if (Rhs.Args[I].get<WasmEdge::RefVariant>().isNull()) {
-+ OS << ":null";
-+ } else {
-+ OS << ":" << &Rhs.Args[I].get<uint64_t>();
- }
- break;
- default:
- break;
- }
-- if (I < Info.Args.size() - 1) {
-- Iter = fmt::format_to(Iter, " , "sv);
-+ if (I < Rhs.Args.size() - 1) {
-+ OS << " , ";
- }
- }
-- Iter = fmt::format_to(Iter, "]"sv);
-+ OS << "]";
- }
-- return formatter<std::string_view>::format(
-- std::string_view(Buffer.data(), Buffer.size()), Ctx);
-+ return OS;
- }
-
--fmt::format_context::iterator
--fmt::formatter<WasmEdge::ErrInfo::InfoBoundary>::format(
-- const WasmEdge::ErrInfo::InfoBoundary &Info,
-- fmt::format_context &Ctx) const noexcept {
-- fmt::memory_buffer Buffer;
-- fmt::format_to(std::back_inserter(Buffer),
-- " Accessing offset from: 0x{:08x} to: 0x{:08x} , Out of "
-- "boundary: 0x{:08x}"sv,
-- Info.Offset,
-- Info.Offset + (Info.Size > 0U ? Info.Size - 1U : 0U),
-- Info.Limit);
-- return formatter<std::string_view>::format(
-- std::string_view(Buffer.data(), Buffer.size()), Ctx);
-+std::ostream &operator<<(std::ostream &OS, const struct InfoBoundary &Rhs) {
-+ OS << " Accessing offset from: " << convertUIntToHexStr(Rhs.Offset)
-+ << " to: "
-+ << convertUIntToHexStr(Rhs.Offset + Rhs.Size - (Rhs.Size > 0 ? 1 : 0))
-+ << " , Out of boundary: " << convertUIntToHexStr(Rhs.Limit);
-+ return OS;
- }
-
--fmt::format_context::iterator
--fmt::formatter<WasmEdge::ErrInfo::InfoProposal>::format(
-- const WasmEdge::ErrInfo::InfoProposal &Info,
-- fmt::format_context &Ctx) const noexcept {
-- fmt::memory_buffer Buffer;
-- if (auto Iter = WasmEdge::ProposalStr.find(Info.P);
-- Iter != WasmEdge::ProposalStr.end()) {
-- fmt::format_to(
-- std::back_inserter(Buffer),
-- " This instruction or syntax requires enabling {} proposal"sv,
-- Iter->second);
-+std::ostream &operator<<(std::ostream &OS, const struct InfoProposal &Rhs) {
-+ if (auto Iter = ProposalStr.find(Rhs.P); Iter != ProposalStr.end()) {
-+ OS << " This instruction or syntax requires enabling proposal "
-+ << Iter->second;
- } else {
-- fmt::format_to(std::back_inserter(Buffer),
-- " Unknown proposal, Code 0x{:08x}"sv,
-- static_cast<uint32_t>(Info.P));
-+ OS << " Unknown proposal, Code "
-+ << convertUIntToHexStr(static_cast<uint32_t>(Rhs.P));
- }
-- return formatter<std::string_view>::format(
-- std::string_view(Buffer.data(), Buffer.size()), Ctx);
-+ return OS;
- }
-+
-+} // namespace ErrInfo
-+} // namespace WasmEdge
-diff --git a/test/errinfo/errinfoTest.cpp b/test/errinfo/errinfoTest.cpp
-index d074843a..bfc66ef7 100644
---- a/test/errinfo/errinfoTest.cpp
-+++ b/test/errinfo/errinfoTest.cpp
-@@ -5,7 +5,7 @@
-
- #include <cstdint>
- #include <gtest/gtest.h>
--#include <string_view>
-+#include <iostream>
- #include <vector>
-
- using namespace std::literals;
-@@ -14,115 +14,115 @@ namespace {
-
- TEST(ErrInfoTest, Info__File) {
- WasmEdge::ErrInfo::InfoFile Info1("file.txt");
-- fmt::print("{}\n"sv, Info1);
-+ std::cout << Info1 << std::endl;
- EXPECT_TRUE(true);
- }
-
- TEST(ErrInfoTest, Info__Loading) {
- WasmEdge::ErrInfo::InfoLoading Info1(30);
-- fmt::print("{}\n"sv, Info1);
-+ std::cout << Info1 << std::endl;
- EXPECT_TRUE(true);
- }
-
- TEST(ErrInfoTest, Info__AST) {
- WasmEdge::ErrInfo::InfoAST Info1(WasmEdge::ASTNodeAttr::Module);
-- fmt::print("{}\n"sv, Info1);
-+ std::cout << Info1 << std::endl;
- EXPECT_TRUE(true);
- }
-
- TEST(ErrInfoTest, Info__InstanceBound) {
- WasmEdge::ErrInfo::InfoInstanceBound Info1(WasmEdge::ExternalType::Memory, 2,
- 1);
-- fmt::print("{}\n"sv, Info1);
-+ std::cout << Info1 << std::endl;
- EXPECT_TRUE(true);
- }
-
- TEST(ErrInfoTest, Info__ForbidIndex) {
- WasmEdge::ErrInfo::InfoForbidIndex Info1(
- WasmEdge::ErrInfo::IndexCategory::FunctionType, 2, 1);
-- fmt::print("{}\n"sv, Info1);
-+ std::cout << Info1 << std::endl;
- WasmEdge::ErrInfo::InfoForbidIndex Info2(
- WasmEdge::ErrInfo::IndexCategory::Memory, 2, 0);
-- fmt::print("{}\n"sv, Info2);
-+ std::cout << Info2 << std::endl;
- EXPECT_TRUE(true);
- }
-
- TEST(ErrInfoTest, Info__Exporting) {
- WasmEdge::ErrInfo::InfoExporting Info1("export");
-- fmt::print("{}\n"sv, Info1);
-+ std::cout << Info1 << std::endl;
- EXPECT_TRUE(true);
- }
-
- TEST(ErrInfoTest, Info__Limit) {
- WasmEdge::ErrInfo::InfoLimit Info1(true, 10, 20);
-- fmt::print("{}\n"sv, Info1);
-+ std::cout << Info1 << std::endl;
- WasmEdge::ErrInfo::InfoLimit Info2(false, 30);
-- fmt::print("{}\n"sv, Info2);
-+ std::cout << Info2 << std::endl;
- EXPECT_TRUE(true);
- }
-
- TEST(ErrInfoTest, Info__Registering) {
- WasmEdge::ErrInfo::InfoRegistering Info1("host_func");
-- fmt::print("{}\n"sv, Info1);
-+ std::cout << Info1 << std::endl;
- EXPECT_TRUE(true);
- }
-
- TEST(ErrInfoTest, Info__Linking) {
- WasmEdge::ErrInfo::InfoLinking Info1("module", "func");
-- fmt::print("{}\n"sv, Info1);
-+ std::cout << Info1 << std::endl;
- EXPECT_TRUE(true);
- }
-
- TEST(ErrInfoTest, Info__Executing) {
- WasmEdge::ErrInfo::InfoExecuting Info1("", "func");
-- fmt::print("{}\n"sv, Info1);
-+ std::cout << Info1 << std::endl;
- WasmEdge::ErrInfo::InfoExecuting Info2("module", "func");
-- fmt::print("{}\n"sv, Info2);
-+ std::cout << Info2 << std::endl;
- EXPECT_TRUE(true);
- }
-
- TEST(ErrInfoTest, Info__Mismatch) {
- WasmEdge::ErrInfo::InfoMismatch Info1(static_cast<uint8_t>(16), 8888);
-- fmt::print("{}\n"sv, Info1);
-+ std::cout << Info1 << std::endl;
- WasmEdge::ErrInfo::InfoMismatch Info2(WasmEdge::TypeCode::ExternRef,
- WasmEdge::TypeCode::FuncRef);
-- fmt::print("{}\n"sv, Info2);
-+ std::cout << Info2 << std::endl;
- WasmEdge::ErrInfo::InfoMismatch Info3(
- {WasmEdge::TypeCode::I32, WasmEdge::TypeCode::FuncRef},
- {WasmEdge::TypeCode::F64, WasmEdge::TypeCode::ExternRef,
- WasmEdge::TypeCode::V128});
-- fmt::print("{}\n"sv, Info3);
-+ std::cout << Info3 << std::endl;
- WasmEdge::ErrInfo::InfoMismatch Info4(WasmEdge::ValMut::Const,
- WasmEdge::ValMut::Var);
-- fmt::print("{}\n"sv, Info4);
-+ std::cout << Info4 << std::endl;
- WasmEdge::ErrInfo::InfoMismatch Info5(WasmEdge::ExternalType::Function,
- WasmEdge::ExternalType::Global);
-- fmt::print("{}\n"sv, Info5);
-+ std::cout << Info5 << std::endl;
- WasmEdge::ErrInfo::InfoMismatch Info6(
- {WasmEdge::TypeCode::I32, WasmEdge::TypeCode::FuncRef},
- {WasmEdge::TypeCode::I64, WasmEdge::TypeCode::F64},
- {WasmEdge::TypeCode::F64, WasmEdge::TypeCode::ExternRef,
- WasmEdge::TypeCode::V128},
- {WasmEdge::TypeCode::V128});
-- fmt::print("{}\n"sv, Info6);
-+ std::cout << Info6 << std::endl;
- WasmEdge::ErrInfo::InfoMismatch Info7(WasmEdge::TypeCode::ExternRef, true, 10,
- 20, WasmEdge::TypeCode::FuncRef, true,
- 20, 50);
-- fmt::print("{}\n"sv, Info7);
-+ std::cout << Info7 << std::endl;
- WasmEdge::ErrInfo::InfoMismatch Info8(WasmEdge::TypeCode::ExternRef, false,
- 10, 10, WasmEdge::TypeCode::FuncRef,
- false, 20, 20);
-- fmt::print("{}\n"sv, Info8);
-+ std::cout << Info8 << std::endl;
- WasmEdge::ErrInfo::InfoMismatch Info9(true, 10, 20, true, 20, 50);
-- fmt::print("{}\n"sv, Info9);
-+ std::cout << Info9 << std::endl;
- WasmEdge::ErrInfo::InfoMismatch Info10(false, 10, 10, false, 20, 20);
-- fmt::print("{}\n"sv, Info10);
-+ std::cout << Info10 << std::endl;
- WasmEdge::ErrInfo::InfoMismatch Info11(
- WasmEdge::TypeCode::I32, WasmEdge::ValMut::Var, WasmEdge::TypeCode::I64,
- WasmEdge::ValMut::Const);
-- fmt::print("{}\n"sv, Info11);
-+ std::cout << Info11 << std::endl;
- WasmEdge::ErrInfo::InfoMismatch Info12(12345678U, 98765432U);
-- fmt::print("{}\n"sv, Info12);
-+ std::cout << Info12 << std::endl;
-
- EXPECT_TRUE(true);
- }
-@@ -137,58 +137,58 @@ TEST(ErrInfoTest, Info__Instruction) {
- {WasmEdge::TypeCode::I32,
- WasmEdge::TypeCode::I32,
- WasmEdge::TypeCode::I32});
-- fmt::print("{}\n"sv, Info1);
-+ std::cout << Info1 << std::endl;
- WasmEdge::ErrInfo::InfoInstruction Info2(WasmEdge::OpCode::Block, 255, Args,
- {WasmEdge::TypeCode::I32,
- WasmEdge::TypeCode::I32,
- WasmEdge::TypeCode::I32});
-- fmt::print("{}\n"sv, Info2);
-+ std::cout << Info2 << std::endl;
- WasmEdge::ErrInfo::InfoInstruction Info3(WasmEdge::OpCode::Block, 255, Args,
- {WasmEdge::TypeCode::I64,
- WasmEdge::TypeCode::I64,
- WasmEdge::TypeCode::I64});
-- fmt::print("{}\n"sv, Info3);
-+ std::cout << Info3 << std::endl;
- WasmEdge::ErrInfo::InfoInstruction Info4(WasmEdge::OpCode::Block, 255, Args,
- {WasmEdge::TypeCode::F32,
- WasmEdge::TypeCode::F32,
- WasmEdge::TypeCode::F32});
-- fmt::print("{}\n"sv, Info4);
-+ std::cout << Info4 << std::endl;
- WasmEdge::ErrInfo::InfoInstruction Info5(WasmEdge::OpCode::Block, 255, Args,
- {WasmEdge::TypeCode::F64,
- WasmEdge::TypeCode::F64,
- WasmEdge::TypeCode::F64});
-- fmt::print("{}\n"sv, Info5);
-+ std::cout << Info5 << std::endl;
- WasmEdge::ErrInfo::InfoInstruction Info6(WasmEdge::OpCode::Block, 255, Args,
- {WasmEdge::TypeCode::V128,
- WasmEdge::TypeCode::V128,
- WasmEdge::TypeCode::V128});
-- fmt::print("{}\n"sv, Info6);
-+ std::cout << Info6 << std::endl;
- WasmEdge::ErrInfo::InfoInstruction Info7(WasmEdge::OpCode::Block, 255, Args,
- {WasmEdge::TypeCode::FuncRef,
- WasmEdge::TypeCode::FuncRef,
- WasmEdge::TypeCode::FuncRef});
-- fmt::print("{}\n"sv, Info7);
-+ std::cout << Info7 << std::endl;
- WasmEdge::ErrInfo::InfoInstruction Info8(WasmEdge::OpCode::Block, 255, Args,
- {WasmEdge::TypeCode::ExternRef,
- WasmEdge::TypeCode::ExternRef,
- WasmEdge::TypeCode::ExternRef});
-- fmt::print("{}\n"sv, Info8);
-+ std::cout << Info8 << std::endl;
- EXPECT_TRUE(true);
- }
-
- TEST(ErrInfoTest, Info__Boundary) {
- WasmEdge::ErrInfo::InfoBoundary Info1(3, 5, 2);
-- fmt::print("{}\n"sv, Info1);
-+ std::cout << Info1 << std::endl;
- WasmEdge::ErrInfo::InfoBoundary Info2(3, 0, 2);
-- fmt::print("{}\n"sv, Info2);
-+ std::cout << Info2 << std::endl;
- EXPECT_TRUE(true);
- }
-
- TEST(ErrInfoTest, Info__Proposal) {
- WasmEdge::ErrInfo::InfoProposal Info1(WasmEdge::Proposal::SIMD);
-- fmt::print("{}\n"sv, Info1);
-+ std::cout << Info1 << std::endl;
- WasmEdge::ErrInfo::InfoProposal Info2(static_cast<WasmEdge::Proposal>(250U));
-- fmt::print("{}\n"sv, Info2);
-+ std::cout << Info2 << std::endl;
- EXPECT_TRUE(true);
- }
-
diff --git a/wasmedge.spec b/wasmedge.spec
index 09bd52e..04bf0ad 100644
--- a/wasmedge.spec
+++ b/wasmedge.spec
@@ -1,25 +1,21 @@
-%global version 0.14.0
+%global version 0.17.0
%global reponame WasmEdge
%global capi_soname 0
-%global capi_version 0.1.0
+%global capi_version 0.1.1
%undefine _annotated_build
Name: wasmedge
Version: %{version}
-Release: 4%{?dist}
+Release: 1%{?dist}
Summary: High performance WebAssembly Virtual Machine
# The entire source code is ASL 2.0 except LICENSE.spdx which is CC0
License: ASL 2.0 and CC0
URL: https://github.com/%{reponame}/%{reponame}
Source0: %{url}/releases/download/%{version}/%{reponame}-%{version}-src.tar.gz
-# Revert https://github.com/WasmEdge/WasmEdge/pull/2511 for old fmt version
-Patch0: wasmedge-revert-fmt.patch
-# https://github.com/WasmEdge/WasmEdge/pull/3809
-Patch1: 0001-LLVM-Support-LLVM-19-3809.patch
-# Patch from https://github.com/WasmEdge/WasmEdge/commit/b63e201d46452453ee7c2acf07967cd292d7e3da
-Patch2: 0001-LLVM-LLVMX86_MMXTypeKind-is-removed-in-LLVM20-4064.patch
-# Patch from https://github.com/WasmEdge/WasmEdge/commit/37cc9fa19bd23edbbdaa9252059b17f191fa4d17
-Patch3: 0001-fix-runtime-refine-the-overflow-detection-when-wrapp.patch
+# fmt 6 / spdlog 1.5 compatibility for EPEL 8: RHEL 8 ships fmt 6.2.1 and spdlog
+# 1.5.0, older than upstream expects. Conditional guards only (FMT_VERSION and
+# __has_include), no behavior change on newer fmt. Candidate for upstreaming.
+Patch0: 0001-fmt6-compat.patch
BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: gcc-toolset-11-toolchain
@@ -111,10 +107,27 @@ cd ..
%{_includedir}/%{name}/enum_types.h
%{_includedir}/%{name}/int128.h
%{_includedir}/%{name}/version.h
+%{_includedir}/%{name}/wasmedge_ast.h
+%{_includedir}/%{name}/wasmedge_basic.h
+%{_includedir}/%{name}/wasmedge_compiler.h
+%{_includedir}/%{name}/wasmedge_configure.h
+%{_includedir}/%{name}/wasmedge_context.h
+%{_includedir}/%{name}/wasmedge_deprecated.h
+%{_includedir}/%{name}/wasmedge_execution.h
+%{_includedir}/%{name}/wasmedge_experimental.h
+%{_includedir}/%{name}/wasmedge_instance.h
+%{_includedir}/%{name}/wasmedge_plugin.h
+%{_includedir}/%{name}/wasmedge_tools.h
+%{_includedir}/%{name}/wasmedge_value.h
+%{_includedir}/%{name}/wasmedge_vm.h
%{_includedir}/%{name}/wasmedge.h
%{_libdir}/lib%{name}.so
%changelog
+* Tue Jun 02 2026 hydai <z54981220@gmail.com> - 0.17.0-1
+- Update to 0.17.0
+- Add fmt 6 / spdlog 1.5 compatibility patch for EPEL 8 (Patch0)
+
* Mon Jan 05 2026 dm4 <dm4@secondstate.io> - 0.14.0-4
- Backport fix for CVE-2025-22921
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-06-02 11:08 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-02 11:08 [rpms/wasmedge] epel8: Update to 0.17.0 hydai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox