This is an automated email from the ASF dual-hosted git repository.

leginee pushed a commit to branch win10-msvc-trunk
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit c398e42b7b4c131506d8e23d32730667a8e0054c
Author: Peter Kovacs <[email protected]>
AuthorDate: Sun Aug 23 00:03:01 2026 +0200

    vcl: the x64 entry point is LibMain, not LibMain@16
    
    LibMain is WINAPI (__stdcall).  x86 decorates it LibMain@12 -- three 4-byte
    parameters -- and x64 has no stdcall @N decoration at all, so the entry
    symbol is the undecorated name.  The gbuild X86_64 branch had @16, which
    looks like @12 scaled for 8-byte pointers; the decoration does not scale, it
    disappears.  The linker said as much:
    
        LINK : error LNK2001: unresolved external symbol "LibMain@16".
          Symbols defined that may match:  LibMain
    
    vcl/util/makefile.mk -- the dmake build of the same library -- already has
    this right, and carries the comment explaining why.  This is the gbuild
    half; the two paths drift in both directions, so a change to either is worth
    checking against the other.
    
    Co-Authored-By: Claude Opus 5 <[email protected]>
    Claude-Session: https://claude.ai/code/session_01VrM7EMKgiuyVcCUe9nSbZR
---
 main/vcl/Library_vcl.mk | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/main/vcl/Library_vcl.mk b/main/vcl/Library_vcl.mk
index 991e00bf50..d15395c310 100644
--- a/main/vcl/Library_vcl.mk
+++ b/main/vcl/Library_vcl.mk
@@ -520,8 +520,12 @@ $(eval $(call gb_Library_add_ldflags,vcl,\
 ))
 endif
 ifeq ($(CPUNAME),X86_64)
+# LibMain is WINAPI (__stdcall): x86 decorates it LibMain@12; x64 has no
+# stdcall @N decoration at all, so the entry symbol is the undecorated
+# LibMain -- not LibMain@16.  (vcl/util/makefile.mk, the dmake path, already
+# gets this right; this is the gbuild half.)
 $(eval $(call gb_Library_add_ldflags,vcl,\
-       /ENTRY:LibMain@16 \
+       /ENTRY:LibMain \
 ))
 endif
 endif

Reply via email to