From c8c5334e273f060ca81f6d3e7adea0b9b39b3aa8 Mon Sep 17 00:00:00 2001 From: Matthias Petermann Date: Tue, 24 Dec 2024 11:41:20 +0100 Subject: [PATCH] Remove jemalloc as a depencency in case the build target os is FreeBSD. Background: the original implementation of jemalloc comes from FreeBSD and is still part of the base system. This will lead to linker errors due to duplicate symbols in case of static build. https://man.freebsd.org/cgi/man.cgi?jemalloc(3) --- Cargo.toml | 2 +- src/main.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 218de72b..8df6df17 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,7 +43,7 @@ toml = "0.8.2" uuid = { version = "1.8.0", features = ["v4"] } validator = {version="0.18.1", features = ["derive"] } -[target.'cfg(not(target_env = "msvc"))'.dependencies] +[target.'cfg(not(any(target_env = "msvc", target_os = "freebsd")))'.dependencies] tikv-jemallocator = "0.5" [features] diff --git a/src/main.rs b/src/main.rs index 755ecc57..9efc90e1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -22,10 +22,10 @@ //! //! Neolink source code is available online at //! -#[cfg(not(target_env = "msvc"))] +#[cfg(not(any(target_env = "msvc", target_os = "freebsd")))] use tikv_jemallocator::Jemalloc; -#[cfg(not(target_env = "msvc"))] +#[cfg(not(any(target_env = "msvc", target_os = "freebsd")))] #[global_allocator] static GLOBAL: Jemalloc = Jemalloc;