]> git.sesse.net Git - stockfish/commitdiff
Fix Makefile for clang 16
authorSebastian Buchwald <UniQP@web.de>
Sat, 11 Mar 2023 21:08:35 +0000 (22:08 +0100)
committerJoost VandeVondele <Joost.VandeVondele@gmail.com>
Tue, 14 Mar 2023 07:25:14 +0000 (08:25 +0100)
The clang 16 release will remove the -fexperimental-new-pass-manager
flag (see https://github.com/llvm/llvm-project/commit/69b2b7282e92a1b576b7bd26f3b16716a5027e8e).
Thus, the commit adapts the Makefile to use this flag only for older
clang versions.

closes https://github.com/official-stockfish/Stockfish/pull/4437

No functional change

src/Makefile

index 774ba6ea8c4b57991342591108cbf4c962c36b7e..e257bc6347d91da3977e6b351b8b5d22c3be6fe6 100644 (file)
@@ -584,7 +584,10 @@ ifeq ($(optimize),yes)
        endif
 
        ifeq ($(comp),clang)
-               CXXFLAGS += -fexperimental-new-pass-manager
+               clangmajorversion = $(shell $(CXX) -dumpversion 2>/dev/null | cut -f1 -d.)
+               ifeq ($(shell expr $(clangmajorversion) \< 16),1)
+                       CXXFLAGS += -fexperimental-new-pass-manager
+               endif
        endif
 endif