git: 41a5b768e326 - main - misc/wavedrom: Fix build with rust 1.99.0
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 14 Oct 2026 07:40:16 UTC
The branch main has been updated by mikael:
URL: https://cgit.FreeBSD.org/ports/commit/?id=41a5b768e3264609c92f15762cabfc5ea9b06b30
commit 41a5b768e3264609c92f15762cabfc5ea9b06b30
Author: Mikael Urankar <mikael@FreeBSD.org>
AuthorDate: 2026-10-12 14:18:28 +0000
Commit: Mikael Urankar <mikael@FreeBSD.org>
CommitDate: 2026-10-14 07:38:05 +0000
misc/wavedrom: Fix build with rust 1.99.0
Fix the following error:
error: invalid definition of the runtime `free` symbol used by the standard library
--> wavedrom-wasm/src/lib.rs:21:1
|
21 | pub unsafe extern "C" fn free(ptr: *mut u8, size: usize) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: expected `unsafe extern "C" fn(*mut c_void)` (for the current target)
found `unsafe extern "C" fn(*mut u8, usize)`
= help: either fix the signature or remove any attributes like `#[unsafe(no_mangle)]`, `#[unsafe(export_name = "free")]`, or `#[link_name = "free"]`
= note: `#[deny(invalid_runtime_symbol_definitions)]` on by default
PR: 299016
Approved by: portmgr (build fix blanket)
---
misc/wavedrom/files/patch-rust-1.99.0 | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/misc/wavedrom/files/patch-rust-1.99.0 b/misc/wavedrom/files/patch-rust-1.99.0
new file mode 100644
index 000000000000..fbf1458d30f3
--- /dev/null
+++ b/misc/wavedrom/files/patch-rust-1.99.0
@@ -0,0 +1,28 @@
+error: invalid definition of the runtime `free` symbol used by the standard library
+ --> wavedrom-wasm/src/lib.rs:21:1
+ |
+21 | pub unsafe extern "C" fn free(ptr: *mut u8, size: usize) {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: expected `unsafe extern "C" fn(*mut c_void)` (for the current target)
+ found `unsafe extern "C" fn(*mut u8, usize)`
+ = help: either fix the signature or remove any attributes like `#[unsafe(no_mangle)]`, `#[unsafe(export_name = "free")]`, or `#[link_name = "free"]`
+ = note: `#[deny(invalid_runtime_symbol_definitions)]` on by default
+
+
+--- wavedrom-wasm/src/lib.rs.orig 2026-10-12 16:14:03 UTC
++++ wavedrom-wasm/src/lib.rs
+@@ -15,13 +15,6 @@ pub unsafe extern "C" fn malloc(size: usize) -> *const
+ Vec::with_capacity(size).leak().as_ptr() as *const u8
+ }
+
+-/// # Safety
+-/// Only call on malloced chunks
+-#[no_mangle]
+-pub unsafe extern "C" fn free(ptr: *mut u8, size: usize) {
+- unsafe { Vec::from_raw_parts(ptr, 0, size) };
+-}
+-
+ #[repr(u8)]
+ enum RenderError {
+ JsonDeserializeError = 1,