Merge branch 'ondrej-enforce-minimal-libuv-version' into 'main'
Abort when libuv at runtime mismatches libuv at compile time See merge request isc-projects/bind9!6176
This commit is contained in:
@@ -207,6 +207,18 @@ isc__nm_threadpool_initialize(uint32_t workers) {
|
||||
}
|
||||
}
|
||||
|
||||
#if HAVE_DECL_UV_UDP_LINUX_RECVERR
|
||||
#define MINIMAL_UV_VERSION UV_VERSION(1, 42, 0)
|
||||
#elif HAVE_DECL_UV_UDP_MMSG_FREE
|
||||
#define MINIMAL_UV_VERSION UV_VERSION(1, 40, 0)
|
||||
#elif HAVE_DECL_UV_UDP_RECVMMSG
|
||||
#define MINIMAL_UV_VERSION UV_VERSION(1, 37, 0)
|
||||
#elif HAVE_DECL_UV_UDP_MMSG_CHUNK
|
||||
#define MINIMAL_UV_VERSION UV_VERSION(1, 35, 0)
|
||||
#else
|
||||
#define MINIMAL_UV_VERSION UV_VERSION(1, 0, 0)
|
||||
#endif
|
||||
|
||||
void
|
||||
isc__netmgr_create(isc_mem_t *mctx, uint32_t workers, isc_nm_t **netmgrp) {
|
||||
isc_nm_t *mgr = NULL;
|
||||
@@ -214,6 +226,14 @@ isc__netmgr_create(isc_mem_t *mctx, uint32_t workers, isc_nm_t **netmgrp) {
|
||||
|
||||
REQUIRE(workers > 0);
|
||||
|
||||
if (uv_version() < MINIMAL_UV_VERSION) {
|
||||
isc_error_fatal(__FILE__, __LINE__,
|
||||
"libuv version too old: running with libuv %s "
|
||||
"when compiled with libuv %s will lead to "
|
||||
"libuv failures because of unknown flags",
|
||||
uv_version_string(), UV_VERSION_STRING);
|
||||
}
|
||||
|
||||
isc__nm_threadpool_initialize(workers);
|
||||
|
||||
mgr = isc_mem_get(mctx, sizeof(*mgr));
|
||||
|
||||
@@ -23,6 +23,23 @@
|
||||
|
||||
#define UV_VERSION(major, minor, patch) ((major << 16) | (minor << 8) | (patch))
|
||||
|
||||
/*
|
||||
* Copied verbatim from libuv/src/version.c
|
||||
*/
|
||||
|
||||
#define UV_STRINGIFY(v) UV_STRINGIFY_HELPER(v)
|
||||
#define UV_STRINGIFY_HELPER(v) #v
|
||||
|
||||
#define UV_VERSION_STRING_BASE \
|
||||
UV_STRINGIFY(UV_VERSION_MAJOR) \
|
||||
"." UV_STRINGIFY(UV_VERSION_MINOR) "." UV_STRINGIFY(UV_VERSION_PATCH)
|
||||
|
||||
#if UV_VERSION_IS_RELEASE
|
||||
#define UV_VERSION_STRING UV_VERSION_STRING_BASE
|
||||
#else
|
||||
#define UV_VERSION_STRING UV_VERSION_STRING_BASE "-" UV_VERSION_SUFFIX
|
||||
#endif
|
||||
|
||||
#if !defined(UV__ERR)
|
||||
#define UV__ERR(x) (-(x))
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user