Skip to content

Commit

Permalink
Fix: Improved Fix For Issue When dladdr not in libc
Browse files Browse the repository at this point in the history
An improved fix for issue pistacheio#1230, previously addressed by PR pistacheio#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.
  • Loading branch information
dgreatwood committed Sep 30, 2024
1 parent e07dc0b commit e9cb3a5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.4.6.20240919
0.4.7.20240930

0 comments on commit e9cb3a5

Please sign in to comment.