mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 00:33:09 +00:00
Revert LTO for mingw on windows.
LTO with static linking is still only working with the latest versions of gcc, causing problems for some devs. on a modern mingw toolchain LTO optimizations can still be enabled as: ``` CXXFLAGS='-flto' make -j ARCH=x86-64-modern COMP=mingw profile-build ``` fixes https://github.com/official-stockfish/Stockfish/issues/2769 closes https://github.com/official-stockfish/Stockfish/pull/2774 No functional change.
This commit is contained in:
parent
aecfca2dc2
commit
ca41ee6632
1 changed files with 11 additions and 1 deletions
12
src/Makefile
12
src/Makefile
|
@ -344,10 +344,20 @@ endif
|
|||
### needs access to the optimization flags.
|
||||
ifeq ($(optimize),yes)
|
||||
ifeq ($(debug), no)
|
||||
ifeq ($(comp),$(filter $(comp),gcc clang mingw))
|
||||
ifeq ($(comp),$(filter $(comp),gcc clang))
|
||||
CXXFLAGS += -flto
|
||||
LDFLAGS += $(CXXFLAGS)
|
||||
endif
|
||||
|
||||
# To use LTO and static linking on windows, the tool chain requires a recent gcc:
|
||||
# gcc version 10.1 in msys2 or TDM-GCC version 9.2 are know to work, older might not.
|
||||
# So, only enable it for a cross from Linux by default.
|
||||
ifeq ($(comp),mingw)
|
||||
ifeq ($(KERNEL),Linux)
|
||||
CXXFLAGS += -flto
|
||||
LDFLAGS += $(CXXFLAGS)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue