From 68bf362ea2385a641be9f5ed9ce2acdf55a1ecf1 Mon Sep 17 00:00:00 2001 From: proukornew Date: Fri, 14 May 2021 00:49:28 +0300 Subject: [PATCH] Fix for Cygwin's environment build-profile The Cygwin environment has two g++ compilers, each with a different problem for compiling Stockfish at the moment: (a) g++.exe : full posix build compiler, linked to cygwin dll. => This one has a problem embedding the net. (b) x86_64-w64-mingw32-g++.exe : native Windows build compiler. => This one manages to embed the net, but has a problem related to libgcov when we use the profile-build target of Stockfish. This patch solves the problem for compiler (b), so that our recommended command line if you want to build an optimized version of Stockfish on Cygwin becomes something like the following (you can change the ARCH value to whatever you want, but note the COMP and CXX variables pointing at the right compiler): ``` make -j profile-build ARCH=x86-64-modern COMP=mingw CXX=x86_64-w64-mingw32-c++.exe ``` closes https://github.com/official-stockfish/Stockfish/pull/3463 No functional change --- AUTHORS | 1 + src/Makefile | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/AUTHORS b/AUTHORS index 7e63591a..1334844f 100644 --- a/AUTHORS +++ b/AUTHORS @@ -23,6 +23,7 @@ Alfredo Menezes (lonfom169) Ali AlZhrani (Cooffe) Andrew Grant (AndyGrant) Andrey Neporada (nepal) +Andreï Vetrov (proukornew) Andy Duplain Antoine Champion (antoinechampion) Aram Tumanian (atumanian) diff --git a/src/Makefile b/src/Makefile index 33a270fe..9508e18b 100644 --- a/src/Makefile +++ b/src/Makefile @@ -884,13 +884,13 @@ clang-profile-use: gcc-profile-make: $(MAKE) ARCH=$(ARCH) COMP=$(COMP) \ - EXTRACXXFLAGS='-fprofile-generate' \ + EXTRACXXFLAGS='-fprofile-generate="./"' \ EXTRALDFLAGS='-lgcov' \ all gcc-profile-use: $(MAKE) ARCH=$(ARCH) COMP=$(COMP) \ - EXTRACXXFLAGS='-fprofile-use -fno-peel-loops -fno-tracer' \ + EXTRACXXFLAGS='-fprofile-use="./" -fno-peel-loops -fno-tracer' \ EXTRALDFLAGS='-lgcov' \ all -- 2.39.2