kwin fails to link with Clang + lld: duplicate symbol: KWINEFFECTS()
Trying to compile kwin with Clang + lld now fails to link with the following error. This used to work until at least 337261bb (can't bisect to exact commit since now I'm getting other compilation errors with older commits because of code changes in other libraries).
[ 27%] Linking CXX executable ../bin/kwin_x11
ld.lld: error: duplicate symbol: KWINEFFECTS()
>>> defined at logging.cpp:10 (/home/saiko/src/kde/kwin/src/effects/logging.cpp:10)
>>> logging.cpp.o:(KWINEFFECTS()) in archive ../lib/libkwin4_effect_builtins.a
>>> defined at screenshotdbusinterface1.cpp:22 (/home/saiko/src/kde/kwin/src/effects/screenshot/screenshotdbusinterface1.cpp:22)
>>> screenshotdbusinterface1.cpp.o:(.text+0xA0) in archive ../lib/libkwin4_effect_screenshot.a
clang-13: error: linker command failed with exit code 1 (use -v to see invocation)
Steps to reproduce (assuming in kwin repository with an affected commit such as 2b628ea4 checked out):
mkdir build
cd build
CC=clang CXX=clang++ LDFLAGS='-fuse-ld=lld' cmake ..
make
Tested with 2b628ea4.