I saw the similar issue when building Terra compiler. Elliott Slaughter, author of Terra compiler, investigated the issue and concluded that the problem in how LLVM itself is being built.
For me, the issue was fixed by building a project in a Docker container.