https://bugs.freedesktop.org/show_bug.cgi?id=72307
--- Comment #3 from Tom neatnoise@gmail.com --- Yes It's gentoo's -9999 ebuild. The rest of packages (mesa-9999, libdrm-9999, glamor-9999, xf86 driver-9999) is from x11 overlay. I reinstalled gentoo system with systemd and kde environment yesterday. It's a new gentoo system. I've never had such problem before (gnome 2 + openrc).
$ llvm-config --ldflags -L/usr/lib/llvm -lpthread -lffi -ldl -lm
ncurses flags enabled: cxx gpm unicode disabled: -ada -debug -doc -minimal -profile -static-libs -tinfo -trace
Update. Thanks for a tip about ncurses. Gentoo KDE profile has set globally ncurses flag what carried it also to llvm. Ncurses support built in llvm leads to this error.
I've disabled ncurses flag in llvm, rebuilt llvm and mesa and KDE desktop is working without any problem.