From c5d45d3220f74045aff249c47abd91d8d663b748 Mon Sep 17 00:00:00 2001 From: pschneider1968 <36973164+pschneider1968@users.noreply.github.com> Date: Mon, 27 Dec 2021 21:16:04 +0100 Subject: [PATCH] Fix Makefile for compilation with clang on Windows use static compilation and added exclusion of -latomic for Clang/MSYS2 as per ppigazzini's suggestion fixes #3872 closes https://github.com/official-stockfish/Stockfish/pull/3873 No functional change --- src/Makefile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Makefile b/src/Makefile index 406f029f..0e889888 100644 --- a/src/Makefile +++ b/src/Makefile @@ -404,12 +404,14 @@ ifeq ($(COMP),clang) ifneq ($(KERNEL),Darwin) ifneq ($(KERNEL),OpenBSD) ifneq ($(KERNEL),FreeBSD) + ifneq ($(findstring MINGW,$(KERNEL)),MINGW) ifneq ($(RTLIB),compiler-rt) LDFLAGS += -latomic endif endif endif endif + endif ifeq ($(arch),$(filter $(arch),armv7 armv8)) ifeq ($(OS),Android) @@ -420,6 +422,11 @@ ifeq ($(COMP),clang) CXXFLAGS += -m$(bits) LDFLAGS += -m$(bits) endif + + ifeq ($(findstring MINGW,$(KERNEL)),MINGW) + LDFLAGS += -static + endif + endif ifeq ($(KERNEL),Darwin) -- 2.39.2