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 4121fbddf465ac5d00b7bd1958223bb93dd0de51
Author: Peter Kovacs <[email protected]>
AuthorDate: Sun Aug 23 00:01:24 2026 +0200

    solenv: the MSVC export-list wildcard filter must match "*" alone
    
    cc9450c3d9 added a filter to keep GCC version-script wildcards out of the
    MSVC export list, and copied the pattern from the GCC branch three lines
    below it:
    
        $(GREP) -v "[*?]" $@ > [email protected]
    
    In the GCC branch that is right -- Itanium-mangled names are _Z..., so a "?"
    there really is a wildcard.  On MSVC it is catastrophic: every MSVC-mangled
    C++ name BEGINS with "?", so the filter did not drop wildcards, it dropped
    every C++ symbol from every MSVC export list.  cppu/util linked
    unsafe_uno_uno.dll against a purpenvhelper3MSC.def holding one name,
    GetVersionInfo, and failed LNK2019 on Environment_initWithEnterable and
    createMapping.
    
    Only "*" ever needs dropping here.  Real "?" wildcards exist in the tree but
    only in gcc3/s5abi/C52 maps, which the MSVC branch never selects; the only
    wildcards MSVC sees are _ZTI* and _ZTS* from solenv/src/component.map.
    
    Note for anyone hitting a stale one: a .dxp depends on its .map, so fixing
    this rule does not regenerate the bad ones.  Delete the .dxp and .def by
    hand or the build relinks against the wrong export list.
    
    Eleven sites, the same eleven as cc9450c3d9.
    
    Co-Authored-By: Claude Opus 5 <[email protected]>
    Claude-Session: https://claude.ai/code/session_01VrM7EMKgiuyVcCUe9nSbZR
---
 main/solenv/inc/_tg_def.mk | 50 +++++++++++++++++++++++++++-------------------
 main/solenv/inc/tg_def.mk  |  5 +++--
 2 files changed, 33 insertions(+), 22 deletions(-)

diff --git a/main/solenv/inc/_tg_def.mk b/main/solenv/inc/_tg_def.mk
index cdad8c8716..d650fdff28 100644
--- a/main/solenv/inc/_tg_def.mk
+++ b/main/solenv/inc/_tg_def.mk
@@ -45,8 +45,9 @@ $(DEF1EXPORTFILE) : $(SHL1VERSIONMAP)
 # Wildcards in a version script are a GCC concept -- the GCC branch below
 # pulls them out into a .symbols-regexp and matches them against the real
 # objects.  MSVC has no equivalent, and asking link.exe to export a literal
-# "_ZTI*" fails with LNK2001, so drop those lines here.
-       $(COMMAND_ECHO)-$(GREP) -v "[*?]" $@ > [email protected]
+# "_ZTI*" fails with LNK2001, so drop those lines here.  Match "*" alone:
+# every MSVC-mangled C++ name begins with "?", so "[*?]" would drop the lot.
+       $(COMMAND_ECHO)-$(GREP) -v "[*]" $@ > [email protected]
        $(COMMAND_ECHO)$(RENAME) [email protected] $@
 .ENDIF
 .IF "$(COM)"=="GCC"
@@ -337,8 +338,9 @@ $(DEF2EXPORTFILE) : $(SHL2VERSIONMAP)
 # Wildcards in a version script are a GCC concept -- the GCC branch below
 # pulls them out into a .symbols-regexp and matches them against the real
 # objects.  MSVC has no equivalent, and asking link.exe to export a literal
-# "_ZTI*" fails with LNK2001, so drop those lines here.
-       $(COMMAND_ECHO)-$(GREP) -v "[*?]" $@ > [email protected]
+# "_ZTI*" fails with LNK2001, so drop those lines here.  Match "*" alone:
+# every MSVC-mangled C++ name begins with "?", so "[*?]" would drop the lot.
+       $(COMMAND_ECHO)-$(GREP) -v "[*]" $@ > [email protected]
        $(COMMAND_ECHO)$(RENAME) [email protected] $@
 .ENDIF
 .IF "$(COM)"=="GCC"
@@ -629,8 +631,9 @@ $(DEF3EXPORTFILE) : $(SHL3VERSIONMAP)
 # Wildcards in a version script are a GCC concept -- the GCC branch below
 # pulls them out into a .symbols-regexp and matches them against the real
 # objects.  MSVC has no equivalent, and asking link.exe to export a literal
-# "_ZTI*" fails with LNK2001, so drop those lines here.
-       $(COMMAND_ECHO)-$(GREP) -v "[*?]" $@ > [email protected]
+# "_ZTI*" fails with LNK2001, so drop those lines here.  Match "*" alone:
+# every MSVC-mangled C++ name begins with "?", so "[*?]" would drop the lot.
+       $(COMMAND_ECHO)-$(GREP) -v "[*]" $@ > [email protected]
        $(COMMAND_ECHO)$(RENAME) [email protected] $@
 .ENDIF
 .IF "$(COM)"=="GCC"
@@ -921,8 +924,9 @@ $(DEF4EXPORTFILE) : $(SHL4VERSIONMAP)
 # Wildcards in a version script are a GCC concept -- the GCC branch below
 # pulls them out into a .symbols-regexp and matches them against the real
 # objects.  MSVC has no equivalent, and asking link.exe to export a literal
-# "_ZTI*" fails with LNK2001, so drop those lines here.
-       $(COMMAND_ECHO)-$(GREP) -v "[*?]" $@ > [email protected]
+# "_ZTI*" fails with LNK2001, so drop those lines here.  Match "*" alone:
+# every MSVC-mangled C++ name begins with "?", so "[*?]" would drop the lot.
+       $(COMMAND_ECHO)-$(GREP) -v "[*]" $@ > [email protected]
        $(COMMAND_ECHO)$(RENAME) [email protected] $@
 .ENDIF
 .IF "$(COM)"=="GCC"
@@ -1213,8 +1217,9 @@ $(DEF5EXPORTFILE) : $(SHL5VERSIONMAP)
 # Wildcards in a version script are a GCC concept -- the GCC branch below
 # pulls them out into a .symbols-regexp and matches them against the real
 # objects.  MSVC has no equivalent, and asking link.exe to export a literal
-# "_ZTI*" fails with LNK2001, so drop those lines here.
-       $(COMMAND_ECHO)-$(GREP) -v "[*?]" $@ > [email protected]
+# "_ZTI*" fails with LNK2001, so drop those lines here.  Match "*" alone:
+# every MSVC-mangled C++ name begins with "?", so "[*?]" would drop the lot.
+       $(COMMAND_ECHO)-$(GREP) -v "[*]" $@ > [email protected]
        $(COMMAND_ECHO)$(RENAME) [email protected] $@
 .ENDIF
 .IF "$(COM)"=="GCC"
@@ -1505,8 +1510,9 @@ $(DEF6EXPORTFILE) : $(SHL6VERSIONMAP)
 # Wildcards in a version script are a GCC concept -- the GCC branch below
 # pulls them out into a .symbols-regexp and matches them against the real
 # objects.  MSVC has no equivalent, and asking link.exe to export a literal
-# "_ZTI*" fails with LNK2001, so drop those lines here.
-       $(COMMAND_ECHO)-$(GREP) -v "[*?]" $@ > [email protected]
+# "_ZTI*" fails with LNK2001, so drop those lines here.  Match "*" alone:
+# every MSVC-mangled C++ name begins with "?", so "[*?]" would drop the lot.
+       $(COMMAND_ECHO)-$(GREP) -v "[*]" $@ > [email protected]
        $(COMMAND_ECHO)$(RENAME) [email protected] $@
 .ENDIF
 .IF "$(COM)"=="GCC"
@@ -1797,8 +1803,9 @@ $(DEF7EXPORTFILE) : $(SHL7VERSIONMAP)
 # Wildcards in a version script are a GCC concept -- the GCC branch below
 # pulls them out into a .symbols-regexp and matches them against the real
 # objects.  MSVC has no equivalent, and asking link.exe to export a literal
-# "_ZTI*" fails with LNK2001, so drop those lines here.
-       $(COMMAND_ECHO)-$(GREP) -v "[*?]" $@ > [email protected]
+# "_ZTI*" fails with LNK2001, so drop those lines here.  Match "*" alone:
+# every MSVC-mangled C++ name begins with "?", so "[*?]" would drop the lot.
+       $(COMMAND_ECHO)-$(GREP) -v "[*]" $@ > [email protected]
        $(COMMAND_ECHO)$(RENAME) [email protected] $@
 .ENDIF
 .IF "$(COM)"=="GCC"
@@ -2089,8 +2096,9 @@ $(DEF8EXPORTFILE) : $(SHL8VERSIONMAP)
 # Wildcards in a version script are a GCC concept -- the GCC branch below
 # pulls them out into a .symbols-regexp and matches them against the real
 # objects.  MSVC has no equivalent, and asking link.exe to export a literal
-# "_ZTI*" fails with LNK2001, so drop those lines here.
-       $(COMMAND_ECHO)-$(GREP) -v "[*?]" $@ > [email protected]
+# "_ZTI*" fails with LNK2001, so drop those lines here.  Match "*" alone:
+# every MSVC-mangled C++ name begins with "?", so "[*?]" would drop the lot.
+       $(COMMAND_ECHO)-$(GREP) -v "[*]" $@ > [email protected]
        $(COMMAND_ECHO)$(RENAME) [email protected] $@
 .ENDIF
 .IF "$(COM)"=="GCC"
@@ -2381,8 +2389,9 @@ $(DEF9EXPORTFILE) : $(SHL9VERSIONMAP)
 # Wildcards in a version script are a GCC concept -- the GCC branch below
 # pulls them out into a .symbols-regexp and matches them against the real
 # objects.  MSVC has no equivalent, and asking link.exe to export a literal
-# "_ZTI*" fails with LNK2001, so drop those lines here.
-       $(COMMAND_ECHO)-$(GREP) -v "[*?]" $@ > [email protected]
+# "_ZTI*" fails with LNK2001, so drop those lines here.  Match "*" alone:
+# every MSVC-mangled C++ name begins with "?", so "[*?]" would drop the lot.
+       $(COMMAND_ECHO)-$(GREP) -v "[*]" $@ > [email protected]
        $(COMMAND_ECHO)$(RENAME) [email protected] $@
 .ENDIF
 .IF "$(COM)"=="GCC"
@@ -2673,8 +2682,9 @@ $(DEF10EXPORTFILE) : $(SHL10VERSIONMAP)
 # Wildcards in a version script are a GCC concept -- the GCC branch below
 # pulls them out into a .symbols-regexp and matches them against the real
 # objects.  MSVC has no equivalent, and asking link.exe to export a literal
-# "_ZTI*" fails with LNK2001, so drop those lines here.
-       $(COMMAND_ECHO)-$(GREP) -v "[*?]" $@ > [email protected]
+# "_ZTI*" fails with LNK2001, so drop those lines here.  Match "*" alone:
+# every MSVC-mangled C++ name begins with "?", so "[*?]" would drop the lot.
+       $(COMMAND_ECHO)-$(GREP) -v "[*]" $@ > [email protected]
        $(COMMAND_ECHO)$(RENAME) [email protected] $@
 .ENDIF
 .IF "$(COM)"=="GCC"
diff --git a/main/solenv/inc/tg_def.mk b/main/solenv/inc/tg_def.mk
index d63937a3d9..ab2642e838 100644
--- a/main/solenv/inc/tg_def.mk
+++ b/main/solenv/inc/tg_def.mk
@@ -50,8 +50,9 @@ $(DEF$(TNR)EXPORTFILE) : $(SHL$(TNR)VERSIONMAP)
 # Wildcards in a version script are a GCC concept -- the GCC branch below
 # pulls them out into a .symbols-regexp and matches them against the real
 # objects.  MSVC has no equivalent, and asking link.exe to export a literal
-# "_ZTI*" fails with LNK2001, so drop those lines here.
-       $(COMMAND_ECHO)-$(GREP) -v "[*?]" $@ > [email protected]
+# "_ZTI*" fails with LNK2001, so drop those lines here.  Match "*" alone:
+# every MSVC-mangled C++ name begins with "?", so "[*?]" would drop the lot.
+       $(COMMAND_ECHO)-$(GREP) -v "[*]" $@ > [email protected]
        $(COMMAND_ECHO)$(RENAME) [email protected] $@
 .ENDIF
 .IF "$(COM)"=="GCC"

Reply via email to