From: Nathan Bossart Date: Wed, 29 Apr 2026 17:25:09 +0000 (-0500) Subject: Suppress "has no symbols" linker warnings on macOS. X-Git-Tag: REL_15_18~35 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=76cdf922b0e7525efcc6181dc46e380fc40721e9;p=thirdparty%2Fpostgresql.git Suppress "has no symbols" linker warnings on macOS. After a recent macOS update, building Postgres produces warnings that look like this: ranlib: warning: 'libpgport_shlib.a(pg_cpu_x86.c.o)' has no symbols ranlib: warning: 'libpgport_shlib.a(pg_popcount_x86.c.o)' has no symbols To fix, add a dummy symbol to files that may otherwise have none. Per project policy, this is a candidate for back-patching into out-of-support branches: it suppresses annoying compiler warnings but changes no behavior. Reported-by: Zhang Mingli Reviewed-by: John Naylor Reviewed-by: Tom Lane Discussion: https://postgr.es/m/229aaaf3-f529-44ed-8e50-00cb6909af21%40Spark Backpatch-through: 13 --- diff --git a/src/common/protocol_openssl.c b/src/common/protocol_openssl.c index 8d1da8be387..01e9924cd72 100644 --- a/src/common/protocol_openssl.c +++ b/src/common/protocol_openssl.c @@ -114,4 +114,10 @@ SSL_CTX_set_max_proto_version(SSL_CTX *ctx, int version) return 1; /* success */ } -#endif /* !SSL_CTX_set_min_proto_version */ +#else /* !SSL_CTX_set_min_proto_version */ + +/* prevent linker complaints about empty module */ +extern int protocol_openssl_dummy_variable; +int protocol_openssl_dummy_variable = 0; + +#endif /* SSL_CTX_set_min_proto_version */