From edc7f40a83169c16dfd4612f84515ec4c0c9f6f6 Mon Sep 17 00:00:00 2001 From: Michel Zou Date: Mon, 27 Jun 2022 21:08:40 +0200 Subject: [PATCH] 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 Reviewed-by: Yonggang Luo Part-of: --- 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')