Are you using gentoo's -9999 ebuild for LLVM or are you building it yourself? Can you post the output of llvm-config --ldflags and also equery u ncurses