The only way to do it with Apple's own tools is to make all your libraries your iCloud Photos Library in turn, one after the other. Each library will be uploaded into iCloud Photos, and iCloud will merge the libraries, and solve conflicts between duplicates. If you have exact duplicates across the libraries, iCloud will pick one of them as a keeper.
It is the only way to merge the libraries in a lossless way, while preserving all albums, folders, metadata, faces, places, and keep the edited versions paired with the originals, so you can revert all adjustments individually.
You will need enough iCloud storage to hold the merged libraries and a lot of patience, because uploading a large library can take several days.