From 00525a38807f6d771c5b1012ae08169b64745397 Mon Sep 17 00:00:00 2001 From: markoburcul Date: Mon, 9 Feb 2026 14:33:28 +0100 Subject: [PATCH] makefile: allow multiple definitions flag for Nim MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rust includes compiler_builtins crate in rln.lib for low-level ops GCC (mingw-winlibs) also provides its own implementation of these same builtins Both are being linked together → conflict --- Makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Makefile b/Makefile index 37341792c..6b258861d 100644 --- a/Makefile +++ b/Makefile @@ -43,6 +43,12 @@ ifeq ($(detected_OS),Windows) LIBS = -lws2_32 -lbcrypt -liphlpapi -luserenv -lntdll -lminiupnpc -lnatpmp -lpq NIM_PARAMS += $(foreach lib,$(LIBS),--passL:"$(lib)") + + # Allow multiple definitions when linking Rust static library with GCC + NIM_PARAMS += --passL:"-Wl,--allow-multiple-definition" + + export PATH := /c/msys64/usr/bin:/c/msys64/mingw64/bin:/c/msys64/usr/lib:/c/msys64/mingw64/lib:$(PATH) + endif ##########