]> git.sesse.net Git - stockfish/commitdiff
Fix for Cygwin's environment build-profile (fixed)
authorproukornew <proukornevv@gmail.com>
Fri, 18 Jun 2021 21:52:46 +0000 (00:52 +0300)
committerJoost VandeVondele <Joost.VandeVondele@gmail.com>
Sat, 19 Jun 2021 09:22:30 +0000 (11:22 +0200)
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/3569

No functional change

src/Makefile

index 33a270fe19f3c276272b31c3566836d147902210..bf3c3560bbd8efa375d3cc62eac520d173c86813 100644 (file)
@@ -883,14 +883,15 @@ clang-profile-use:
        all
 
 gcc-profile-make:
+       @mkdir -p profdir
        $(MAKE) ARCH=$(ARCH) COMP=$(COMP) \
-       EXTRACXXFLAGS='-fprofile-generate' \
+       EXTRACXXFLAGS='-fprofile-generate=profdir' \
        EXTRALDFLAGS='-lgcov' \
        all
 
 gcc-profile-use:
        $(MAKE) ARCH=$(ARCH) COMP=$(COMP) \
-       EXTRACXXFLAGS='-fprofile-use -fno-peel-loops -fno-tracer' \
+       EXTRACXXFLAGS='-fprofile-use=profdir -fno-peel-loops -fno-tracer' \
        EXTRALDFLAGS='-lgcov' \
        all