summaryrefslogtreecommitdiff
path: root/dev-db/mysql-connector-c/files/mysql-connector-c-8.0.27-res_n.patch
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-07-15 13:42:19 +0100
committerV3n3RiX <venerix@koprulu.sector>2022-07-15 13:42:19 +0100
commitbd8ca999980e9c0c9ae40a11789c858bb58769e3 (patch)
tree355d68a84921e04a81231e74fc062f229f76a733 /dev-db/mysql-connector-c/files/mysql-connector-c-8.0.27-res_n.patch
parentb3f2504c1d05b5999b74b2135860fc721e3adf68 (diff)
gentoo auto-resync : 15:07:2022 - 13:42:19
Diffstat (limited to 'dev-db/mysql-connector-c/files/mysql-connector-c-8.0.27-res_n.patch')
-rw-r--r--dev-db/mysql-connector-c/files/mysql-connector-c-8.0.27-res_n.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/dev-db/mysql-connector-c/files/mysql-connector-c-8.0.27-res_n.patch b/dev-db/mysql-connector-c/files/mysql-connector-c-8.0.27-res_n.patch
new file mode 100644
index 000000000000..34961b8ad9e2
--- /dev/null
+++ b/dev-db/mysql-connector-c/files/mysql-connector-c-8.0.27-res_n.patch
@@ -0,0 +1,49 @@
+# Musl doesn't have res_n* functions so we are falling back to the not
+# thread safe ones. Patch made with help from developer Fabian Groffen
+# <grobian@gentoo.org>.
+#
+# Closes: https://bugs.gentoo.org/761352
+# See also: https://github.com/mysql/mysql-server/pull/385
+# See also: https://bugs.mysql.com/bug.php?id=106034
+--- a/libmysql/CMakeLists.txt
++++ b/libmysql/CMakeLists.txt
+@@ -423,6 +423,19 @@ IF(HAS_WARN_FLAG)
+ )
+ ENDIF()
+
++check_symbol_exists(res_ninit "resolv.h" HAVE_RES_NINIT_FUNCTION)
++check_symbol_exists(res_nsearch "resolv.h" HAVE_RES_NSEARCH_FUNCTION)
++check_symbol_exists(res_nclose "resolv.h" HAVE_RES_NCLOSE_FUNCTION)
++IF (HAVE_RES_NINIT_FUNCTION)
++ add_compile_definitions(HAVE_RES_NINIT)
++ENDIF(HAVE_RES_NINIT_FUNCTION)
++IF (HAVE_RES_NSEARCH_FUNCTION)
++ add_compile_definitions(HAVE_RES_NSEARCH)
++ENDIF(HAVE_RES_NSEARCH_FUNCTION)
++IF (HAVE_RES_NCLOSE_FUNCTION)
++ add_compile_definitions(HAVE_RES_NCLOSE)
++ENDIF(HAVE_RES_NCLOSE_FUNCTION)
++
+ # Verify that libmysql_api_test runs OK
+ ADD_CUSTOM_COMMAND(TARGET libmysql_api_test POST_BUILD
+ COMMAND libmysql_api_test
+--- a/libmysql/dns_srv.cc
++++ b/libmysql/dns_srv.cc
+@@ -37,6 +37,17 @@
+ #include <netdb.h>
+ #include <resolv.h>
+
++/* we don't have anything else but the non-thread-safe variants */
++#if !defined(HAVE_RES_NINIT)
++#define res_ninit(X) (void)X
++#endif
++#if !defined(HAVE_RES_NSEARCH)
++#define res_nsearch(X,D,I,S,B,L) res_search(D,I,S,B,L)
++#endif
++#if !defined(HAVE_RES_NCLOSE)
++#define res_nclose(X) (void)X
++#endif
++
+ // POSIX version
+
+ static bool get_dns_srv(Dns_srv_data &data, const char *dnsname, int &error) {