We need to remove both options --whole-archive and --color-diagnostics from the link step otherwise, we get link errors when building libc++ on z/OS.
What's the issue with using --whole-archive on z/OS? Also, if you don't use --whole-archive, some symbols in libc++abi might not be available from the dylib you build, so you'll end up with a malfunctioning/incomplete libc++.
Linker on z/OS does not support this option. When -Wl,--whole-archive is used the linker wants to include an object of that name and issues an error. Not sure if incomplete libc++ will apply to z/OS due to linker differences. If you know which symbol(s) might be missing let me know and I can check. Perhaps there is an existing test which will fail when those symbols are not present in libc++.