msys2 / MINGW-packages

Package scripts for MinGW-w64 targets to build under MSYS2.
https://packages.msys2.org
BSD 3-Clause "New" or "Revised" License
2.25k stars 1.21k forks source link

Stockfish engine build by clang failed although clang package is completely installed #3472

Closed abdulbadii closed 4 months ago

abdulbadii commented 6 years ago

As tried for Stockfish compilation using clang I found the error messages:

$ make profile-build ARCH=x86-64-modern COMP=clang
Config:
debug: 'no'
sanitize: 'no'
optimize: 'yes'
arch: 'x86_64'
bits: '64'
kernel: 'MINGW64_NT-10.0'
os: 'Windows_NT'
prefetch: 'yes'
popcnt: 'yes'
sse: 'yes'
pext: 'no'

Flags:
CXX: clang++
CXXFLAGS: -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11  -pedantic -Wextra -Wshadow -m64 -DNDEBUG -O3 -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT
LDFLAGS:  -latomic -m64 -lpthread
Testing config sanity. If this fails, try 'make help' ...

Step 1/4. Building instrumented executable ...
make ARCH=x86-64-modern COMP=clang clang-profile-make
make[1]: Entering directory '/d/MSYS/usr/src/CorChess-master'
make ARCH=x86-64-modern COMP=clang \
EXTRACXXFLAGS='-fprofile-instr-generate ' \
EXTRALDFLAGS=' -fprofile-instr-generate' \
all
make[2]: Entering directory '/d/MSYS/usr/src/CorChess-master'
clang++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -m64 -DNDEBUG -O3 -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT   -c -o benchmark.o benchmark.cpp
clang++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -m64 -DNDEBUG -O3 -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT   -c -o bitbase.o bitbase.cpp
clang++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -m64 -DNDEBUG -O3 -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT   -c -o bitboard.o bitboard.cpp
clang++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -m64 -DNDEBUG -O3 -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT   -c -o endgame.o endgame.cpp
clang++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -m64 -DNDEBUG -O3 -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT   -c -o evaluate.o evaluate.cpp
clang++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -m64 -DNDEBUG -O3 -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT   -c -o main.o main.cpp
clang++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -m64 -DNDEBUG -O3 -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT   -c -o material.o material.cpp
clang++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -m64 -DNDEBUG -O3 -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT   -c -o misc.o misc.cpp
clang++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -m64 -DNDEBUG -O3 -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT   -c -o movegen.o movegen.cpp
clang++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -m64 -DNDEBUG -O3 -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT   -c -o movepick.o movepick.cpp
clang++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -m64 -DNDEBUG -O3 -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT   -c -o pawns.o pawns.cpp
clang++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -m64 -DNDEBUG -O3 -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT   -c -o position.o position.cpp
clang++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -m64 -DNDEBUG -O3 -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT   -c -o psqt.o psqt.cpp
clang++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -m64 -DNDEBUG -O3 -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT   -c -o search.o search.cpp
clang++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -m64 -DNDEBUG -O3 -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT   -c -o thread.o thread.cpp
clang++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -m64 -DNDEBUG -O3 -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT   -c -o timeman.o timeman.cpp
clang++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -m64 -DNDEBUG -O3 -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT   -c -o tt.o tt.cpp
clang++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -m64 -DNDEBUG -O3 -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT   -c -o uci.o uci.cpp
clang++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -m64 -DNDEBUG -O3 -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT   -c -o ucioption.o ucioption.cpp
clang++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -m64 -DNDEBUG -O3 -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT   -c -o syzygy/tbprobe.o syzygy/tbprobe.cpp
clang++ -o stockfish benchmark.o bitbase.o bitboard.o endgame.o evaluate.o main.o material.o misc.o movegen.o movepick.o pawns.o position.o psqt.o search.o thread.o timeman.o tt.o uci.o ucioption.o syzygy/tbprobe.o -fprofile-instr-generate -latomic -m64 -lpthread
bitboard.o:(.lprfc+0x20): multiple definition of `__profc__ZNSaIcEC2Ev'
benchmark.o:(.lprfc+0x0): first defined here
bitboard.o:(.lprfc+0x210): multiple definition of `__profc__ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE13_M_local_dataEv'
benchmark.o:(.lprfc+0x170): first defined here
bitboard.o:(.lprfc+0x218): multiple definition of `__profc__ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderC2EPcRKS3_'
benchmark.o:(.lprfc+0x1d0): first defined here
bitboard.o:(.lprfc+0x220): multiple definition of `__profc__ZNSaIcEC2ERKS_'
benchmark.o:(.lprfc+0x190): first defined here
bitboard.o:(.lprfc+0x28): multiple definition of `__profc__ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2EPKcRKS3_'
benchmark.o:(.lprfc+0x8): first defined here
bitboard.o:(.lprfc+0x38): multiple definition of `__profc__ZNSaIcED2Ev'
benchmark.o:(.lprfc+0x20): first defined here
bitboard.o:(.lprfc+0x288): multiple definition of `__profc__ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE16_M_get_allocatorEv'
benchmark.o:(.lprfc+0x178): first defined here
bitboard.o:(.lprfc+0x280): multiple definition of `__profc__ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv'
benchmark.o:(.lprfc+0x2a0): first defined here
bitboard.o:(.lprfc+0x228): multiple definition of `__profc__ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7_M_dataEPc'
benchmark.o:(.lprfc+0x198): first defined here
bitboard.o:(.lprfc+0x230): multiple definition of `__profc__ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_capacityEy'
benchmark.o:(.lprfc+0x1a0): first defined here
bitboard.o:(.lprfc+0x1f8): multiple definition of `__profc__ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7_M_dataEv'
benchmark.o:(.lprfc+0x138): first defined here
...
syzygy/tbprobe.o:(.text+0xf1ec): undefined reference to `__llvm_profile_register_function'
syzygy/tbprobe.o:(.text+0xf1f8): more undefined references to `__llvm_profile_register_function' follow
syzygy/tbprobe.o:(.text+0x11dd5): undefined reference to `__llvm_profile_register_names_function'
...

I didn't catch all the messages as beyond terminal capacity.. Has anyone experienced this and would share some helpful idea ?

mati865 commented 6 years ago

Clang with mingw-w64 is still far from being drop-in replacement for GCC. PGO is one of the features that don't work.

mati865 commented 9 months ago

Can has advanced a lot since this report, is this still an issue?

oltolm commented 4 months ago

No feedback for a long time. Can we close this?