Michael Paquier писал(а) 2024-09-14 03:15:
On Fri, Sep 13, 2024 at 03:26:42PM -0700, Andrew Kane wrote:
This was my hunch as well since none of the source files changed. Also,
neither function is present with `dumpbin /EXPORTS /SYMBOLS
lib\postgres.lib`, which led me to believe it may need to be addressed
upstream.

Hmm.  Perhaps we are not careful enough with the calls of
msvc_gendef.pl in meson.build, missing some spots?
--
Michael

Dear colleagues

I found the reason of this bug and the fix for it.

dumpbin processes libraries to prepare DEF file. libcommon_srv.a does not have all necessary object files in the moment of processing due to meson optimisation:
this library marked as install=false, and all objects depend on
it also marked as install=false.
meson is smart enough to exclude obj-files, that are not required on later stages.

The option to set install=true is not good: all files are built correctly,
but not needed library will be installed.

Fortunatelly meson has option to force put all object files to library - add
dependency with the flag link_whole .

I made the one-line patch and it fixes this issue.

-        'dependencies': opts['dependencies'] + [ssl],
+ 'dependencies': opts['dependencies'] + [ssl] + [declare_dependency( link_whole : cflag_libs)],


P.S. Other libraries in this meson.build file (libcommon.a and libcommon_shlib.a) are not affected by this issue and patch, as they both marked install=true and build
without any missed files.



--
Best regards,

Vladlen Popolitov.
From 17f3f644ba7564446bb6892eaa8fb4a5d26616f0 Mon Sep 17 00:00:00 2001
From: Vladlen Popolitov <v.popoli...@postgrespro.ru>
Date: Mon, 23 Dec 2024 13:03:48 +0300
Subject: [PATCH v1] Fix meson.build to prevent missed obj files in lib under
 Windows

---
 src/common/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/common/meson.build b/src/common/meson.build
index 538e0f43d5..fe9e5277e1 100644
--- a/src/common/meson.build
+++ b/src/common/meson.build
@@ -190,7 +190,7 @@ foreach name, opts : pgcommon_variants
           include_directories('.'),
           opts.get('include_directories', []),
         ],
-        'dependencies': opts['dependencies'] + [ssl],
+        'dependencies': opts['dependencies'] + [ssl] + [declare_dependency( link_whole  : cflag_libs)],
       }
     )
   pgcommon += {name: lib}
-- 
2.39.5 (Apple Git-154)

Reply via email to