From e9cb3a5d27e1e995b55fd309a09c63cdec69d31d Mon Sep 17 00:00:00 2001 From: DMG Date: Mon, 30 Sep 2024 12:34:13 -0700 Subject: [PATCH] Fix: Improved Fix For Issue When dladdr not in libc An improved fix for issue #1230, previously addressed by PR #1245 which did: ... = dependency('dl', required: false) - support for "required: false" being added in Meson 0.62.0, where Pistache only requires Meson 0.53. Additionally, this new fix requires libdl only if the specific function dladdr() is not supplied by libc in any case, potentially avoiding pulling in libdl when not actually required. --- meson.build | 10 +++++++++- version.txt | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 4fb55ba8e..3e4ed0a6e 100644 --- a/meson.build +++ b/meson.build @@ -154,7 +154,15 @@ endif # #1230. # Note: If 'dl' is not available, per Meson it suggests that the # functionality is provided by libc -deps_libpistache += dependency('dl', required: false) +has_dladdr_func = compiler.has_function('dladdr') +if not has_dladdr_func + libdl_dep += dependency('dl') + has_dladdr_func = compiler.has_function('dladdr', dependencies: libdl_dep) + if not has_dladdr_func + warning('Unable to find dladdr(), even when trying to link to libdl') + endif + libpistache_deps += libdl_dep +endif version_array = [] if meson.version().version_compare('>=0.57.0') diff --git a/version.txt b/version.txt index ba40da522..b7f23394a 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.4.6.20240919 +0.4.7.20240930