mirror of
https://github.com/official-stockfish/Stockfish.git
synced 2026-07-22 12:47:08 +00:00
feat(build): use lld for clang if available
Also simplify the CI. closes https://github.com/official-stockfish/Stockfish/pull/6592 No functional change
This commit is contained in:
@@ -74,7 +74,6 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
export CXXFLAGS="-Werror"
|
export CXXFLAGS="-Werror"
|
||||||
if [ "${{ matrix.ver }}" -ge 20 ]; then
|
if [ "${{ matrix.ver }}" -ge 20 ]; then
|
||||||
export LDFLAGS="-fuse-ld=lld"
|
|
||||||
apt install -y lld
|
apt install -y lld
|
||||||
fi
|
fi
|
||||||
make clean
|
make clean
|
||||||
|
|||||||
+16
-3
@@ -855,14 +855,27 @@ endif
|
|||||||
### needs access to the optimization flags.
|
### needs access to the optimization flags.
|
||||||
ifeq ($(optimize),yes)
|
ifeq ($(optimize),yes)
|
||||||
ifeq ($(debug),no)
|
ifeq ($(debug),no)
|
||||||
|
ifneq ($(KERNEL),Darwin)
|
||||||
|
LLD_BIN := $(shell command -v ld.lld 2>/dev/null)
|
||||||
|
ifeq ($(LLD_BIN),)
|
||||||
|
LLD_BIN := $(shell command -v lld 2>/dev/null)
|
||||||
|
endif
|
||||||
|
ifneq ($(LLD_BIN),)
|
||||||
|
ifeq ($(comp),clang)
|
||||||
|
LDFLAGS += -fuse-ld=lld
|
||||||
|
else ifeq ($(comp),gcc)
|
||||||
|
ifneq ($(gccisclang),)
|
||||||
|
LDFLAGS += -fuse-ld=lld
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(comp),$(filter $(comp),clang icx))
|
ifeq ($(comp),$(filter $(comp),clang icx))
|
||||||
CXXFLAGS += -flto=full
|
CXXFLAGS += -flto=full
|
||||||
ifeq ($(comp),icx)
|
ifeq ($(comp),icx)
|
||||||
CXXFLAGS += -fwhole-program-vtables
|
CXXFLAGS += -fwhole-program-vtables
|
||||||
endif
|
endif
|
||||||
ifeq ($(target_windows),yes)
|
|
||||||
CXXFLAGS += -fuse-ld=lld
|
|
||||||
endif
|
|
||||||
LDFLAGS += $(CXXFLAGS)
|
LDFLAGS += $(CXXFLAGS)
|
||||||
|
|
||||||
# GCC and CLANG use different methods for parallelizing LTO and CLANG pretends to be
|
# GCC and CLANG use different methods for parallelizing LTO and CLANG pretends to be
|
||||||
|
|||||||
Reference in New Issue
Block a user