From 9a5321aadb71f043de72ba1da50f6be0df072c8d Mon Sep 17 00:00:00 2001 From: "Yanjun Yang(Pluto)" Date: Thu, 2 Jul 2026 10:21:44 +0800 Subject: [PATCH] meson: fix build failure on glibc >= 2.34 without standalone libanl (#2484) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On glibc >= 2.34, getaddrinfo_a is no longer provided by a standalone libanl shared library — it is built directly into libc. Newer architectures (e.g. loongarch64, riscv64) have never shipped a separate libanl, causing the meson build to fail with: C++ shared or static library 'anl' not found Signed-off-by: Pluto Yang --- meson.build | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 319120d..3cd31c2 100644 --- a/meson.build +++ b/meson.build @@ -107,7 +107,12 @@ if host_machine.system() == 'windows' elif host_machine.system() == 'darwin' async_ns_dep = dependency('appleframeworks', modules: ['CFNetwork', 'CoreFoundation'], required: async_ns_opt) else - async_ns_dep = cxx.find_library('anl', required: async_ns_opt) + has_gai_a = cxx.has_function('getaddrinfo_a', args: '-D_GNU_SOURCE') + if has_gai_a + async_ns_dep = declare_dependency() + else + async_ns_dep = cxx.find_library('anl', required: async_ns_opt) + endif endif if async_ns_dep.found()