Build a crosslink database in cache_directory.