From 320110c36eb8cddb4ef49ce205512b8a1989396d Mon Sep 17 00:00:00 2001 From: Binarybaron Date: Wed, 25 Jun 2025 20:19:29 +0200 Subject: [PATCH] fix(monero-sys): Allow opt-level to be max (linker opt issue) --- Cargo.toml | 3 --- monero-sys/src/bridge.h | 13 ++++++++++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index a4f378d3..f55619a9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,9 +2,6 @@ resolver = "2" members = ["electrum-pool", "monero-rpc", "monero-rpc-pool", "monero-sys", "src-tauri", "swap"] -[profile.release] -opt-level = 0 - [patch.crates-io] # patch until new release https://github.com/thomaseizinger/rust-jsonrpc-client/pull/51 jsonrpc_client = { git = "https://github.com/delta1/rust-jsonrpc-client.git", rev = "3b6081697cd616c952acb9c2f02d546357d35506" } diff --git a/monero-sys/src/bridge.h b/monero-sys/src/bridge.h index 7a80992e..c3510b45 100644 --- a/monero-sys/src/bridge.h +++ b/monero-sys/src/bridge.h @@ -282,7 +282,7 @@ namespace monero_rust_log } // Call the rust function to forward the log message. - forward_cpp_log( + monero_rust_log::forward_cpp_log( span_name.c_str(), level, m->file().length() > 0 ? m->file() : "", @@ -339,3 +339,14 @@ namespace monero_rust_log installed = false; } } // namespace + +#include +#include +#include + +// The following is a hack to ensure the linker includes the pair destructor in the binary +using String = std::string; +using StringMap = std::map; +using StringVec = std::vector; + +static std::pair _monero_sys_pair_instantiation;