I have not compiled OpenSSL 3.0 yet, but I am pretty sure that -fvisibility=hidden will at least break the temporary shared objects created by the unit tests, if not everything else in OpenSSL.