Mesa (main): meson: drop dladdr check on win32

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jun 28 15:03:47 UTC 2022


Module: Mesa
Branch: main
Commit: edc7f40a83169c16dfd4612f84515ec4c0c9f6f6
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=edc7f40a83169c16dfd4612f84515ec4c0c9f6f6

Author: Michel Zou <xantares09 at hotmail.com>
Date:   Mon Jun 27 21:08:40 2022 +0200

meson: drop dladdr check on win32

since !17208 there are 2 paths for disk_cache_get_function_identifier
on mingw: DETECT_OS_WINDOWS or HAVE_DLADDR (if dlfcn shims is present)

../src/util/disk_cache_os.c:47:1: error: redefinition of 'disk_cache_get_function_identifier'
   47 | disk_cache_get_function_identifier(void *ptr, struct mesa_sha1 *ctx)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../src/util/disk_cache_os.c:36:
../src/util/disk_cache.h:121:1: note: previous definition of 'disk_cache_get_function_identifier' with type '_Bool(void *, struct _SHA1_CTX *)'
  121 | disk_cache_get_function_identifier(void *ptr, struct mesa_sha1 *ctx)

here we disable the dladdr path from meson for consistency with msvc

fixes: 2dcbe8727

Reviewed-by: Jesse Natalie <jenatali at microsoft.com>
Reviewed-by: Yonggang Luo <luoyonggang at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17261>

---

 meson.build | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/meson.build b/meson.build
index 4313d4d2a4f..5570a8a1f39 100644
--- a/meson.build
+++ b/meson.build
@@ -1535,12 +1535,14 @@ ld_args_build_id = cc.get_supported_link_arguments('-Wl,--build-id=sha1')
 
 # check for dl support
 dep_dl = null_dep
-if not cc.has_function('dlopen')
-  dep_dl = cc.find_library('dl', required : host_machine.system() != 'windows')
-endif
-if cc.has_function('dladdr', dependencies : dep_dl)
-  # This is really only required for util/disk_cache.h
-  pre_args += '-DHAVE_DLADDR'
+if host_machine.system() != 'windows'
+  if not cc.has_function('dlopen')
+    dep_dl = cc.find_library('dl', required : true)
+  endif
+  if cc.has_function('dladdr', dependencies : dep_dl)
+    # This is really only required for util/disk_cache.h
+    pre_args += '-DHAVE_DLADDR'
+  endif
 endif
 
 if cc.has_function('dl_iterate_phdr')



More information about the mesa-commit mailing list