From 8b6bc5091ef51cd7f69e5252d17e118e6e12bd21 Mon Sep 17 00:00:00 2001 From: Evan Date: Mon, 24 Nov 2025 09:11:00 +0100 Subject: [PATCH] Update rustflags for target configurations add targets for linux windows and apple --- .cargo/config.toml | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index 57efc7f..d1fe24e 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -15,8 +15,23 @@ # specific language governing permissions and limitations # under the License. -[target.aarch64-apple-darwin] +[target.'cfg(target_os = "linux")'] rustflags = [ - "-C", "link-arg=-undefined", - "-C", "link-arg=dynamic_lookup", -] \ No newline at end of file + "-C", + "link-arg=-Wl,--gc-sections", + "-C", + "link-arg=-Wl,--as-needed", + "-C", + "link-arg=-Wl,-z,norelro", + "-C", + "relocation-model=pic", +] + +[target.x86_64-apple-darwin] +rustflags = ["-C", "link-arg=-undefined", "-C", "link-arg=dynamic_lookup"] + +[target.aarch64-apple-darwin] +rustflags = ["-C", "link-arg=-undefined", "-C", "link-arg=dynamic_lookup"] + +[target.x86_64-pc-windows-msvc] +rustflags = ["-C", "target-feature=+crt-static"]