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: |
|
||||
export CXXFLAGS="-Werror"
|
||||
if [ "${{ matrix.ver }}" -ge 20 ]; then
|
||||
export LDFLAGS="-fuse-ld=lld"
|
||||
apt install -y lld
|
||||
fi
|
||||
make clean
|
||||
|
||||
+17
-4
@@ -854,15 +854,28 @@ endif
|
||||
### This is a mix of compile and link time options because the lto link phase
|
||||
### needs access to the optimization flags.
|
||||
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))
|
||||
CXXFLAGS += -flto=full
|
||||
ifeq ($(comp),icx)
|
||||
CXXFLAGS += -fwhole-program-vtables
|
||||
endif
|
||||
ifeq ($(target_windows),yes)
|
||||
CXXFLAGS += -fuse-ld=lld
|
||||
endif
|
||||
LDFLAGS += $(CXXFLAGS)
|
||||
|
||||
# GCC and CLANG use different methods for parallelizing LTO and CLANG pretends to be
|
||||
|
||||
Reference in New Issue
Block a user