@MaskRay At first, I tried compiling a separate binary and linking with some .cc files from ccls, however it turned out to be really hard because of LLVM stuff.
To avoid this errors, I've replaced contents of main function in main.cc (from ccls) and recompiled the main binary.