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 cc9450c3d9265fcae1dd8f18e0e28ec08aa529ff
Author: Peter Kovacs <[email protected]>
AuthorDate: Fri Aug 21 17:48:06 2026 +0200

    solenv: keep version-script wildcards out of the MSVC export list
    
        ijavaloader.uno.exp : error LNK2001: unresolved external symbol __ZTI*
        introspection.uno.dll : fatal error LNK1120: 2 unresolved externals
    
    trunk added _ZTI* and _ZTS* to solenv/src/component.map, deliberately not
    platform-gated, so that C++ typeinfo stays exported across library
    boundaries.  That reasoning is right, and on ELF and Mach-O it is all that
    happens.
    
    On Windows the same file is also an export list: getcsym.awk copies the
    global: section verbatim into a .dxp, so link.exe is asked to export a 
symbol
    literally named "_ZTI*" -- Itanium ABI mangling MSVC never emits, with an
    asterisk in it.
    
    Wildcards in a version script are a GCC concept, and the GCC branch of this
    same rule already treats them as one: it greps them out into a
    .symbols-regexp and resolves them against the real object files.  An MSVC 
.def
    has no equivalent, so dropping them loses nothing.
    
    Eleven sites: ten unrolled in _tg_def.mk plus the template.  The other ten
    getcsym.awk calls are inside .IF "$(GUI)"=="OS2" and are left alone.
    
    72 modules use component.map.  Only two failed this run, because the rest 
did
    not relink -- the other 70 were latent.
    
    Co-Authored-By: Claude Opus 5 <[email protected]>
    Claude-Session: https://claude.ai/code/session_01W7pjcp2sXU1HaUwXT7kc29
---
 main/solenv/inc/_tg_def.mk | 80 ++++++++++++++++++++++++++++++++++++++++++++++
 main/solenv/inc/tg_def.mk  |  8 +++++
 2 files changed, 88 insertions(+)

diff --git a/main/solenv/inc/_tg_def.mk b/main/solenv/inc/_tg_def.mk
index 17de3df7cb..8cb4459626 100644
--- a/main/solenv/inc/_tg_def.mk
+++ b/main/solenv/inc/_tg_def.mk
@@ -41,6 +41,14 @@ $(DEF1EXPORTFILE) : $(SHL1OBJS) $(SHL1LIBS)
 
 $(DEF1EXPORTFILE) : $(SHL1VERSIONMAP)
        $(COMMAND_ECHO)$(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
+.IF "$(COM)"!="GCC"
+# 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]
+       $(COMMAND_ECHO)$(RENAME) [email protected] $@
+.ENDIF
 .IF "$(COM)"=="GCC"
        $(COMMAND_ECHO)-$(GREP) -v "\*\|?" $@ | $(SED) -e 's@#.*@@' > 
[email protected]
        $(COMMAND_ECHO)-$(GREP) "\*\|?" $@ > [email protected]
@@ -325,6 +333,14 @@ $(DEF2EXPORTFILE) : $(SHL2OBJS) $(SHL2LIBS)
 
 $(DEF2EXPORTFILE) : $(SHL2VERSIONMAP)
        $(COMMAND_ECHO)$(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
+.IF "$(COM)"!="GCC"
+# 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]
+       $(COMMAND_ECHO)$(RENAME) [email protected] $@
+.ENDIF
 .IF "$(COM)"=="GCC"
        $(COMMAND_ECHO)-$(GREP) -v "\*\|?" $@ | $(SED) -e 's@#.*@@' > 
[email protected]
        $(COMMAND_ECHO)-$(GREP) "\*\|?" $@ > [email protected]
@@ -609,6 +625,14 @@ $(DEF3EXPORTFILE) : $(SHL3OBJS) $(SHL3LIBS)
 
 $(DEF3EXPORTFILE) : $(SHL3VERSIONMAP)
        $(COMMAND_ECHO)$(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
+.IF "$(COM)"!="GCC"
+# 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]
+       $(COMMAND_ECHO)$(RENAME) [email protected] $@
+.ENDIF
 .IF "$(COM)"=="GCC"
        $(COMMAND_ECHO)-$(GREP) -v "\*\|?" $@ | $(SED) -e 's@#.*@@' > 
[email protected]
        $(COMMAND_ECHO)-$(GREP) "\*\|?" $@ > [email protected]
@@ -893,6 +917,14 @@ $(DEF4EXPORTFILE) : $(SHL4OBJS) $(SHL4LIBS)
 
 $(DEF4EXPORTFILE) : $(SHL4VERSIONMAP)
        $(COMMAND_ECHO)$(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
+.IF "$(COM)"!="GCC"
+# 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]
+       $(COMMAND_ECHO)$(RENAME) [email protected] $@
+.ENDIF
 .IF "$(COM)"=="GCC"
        $(COMMAND_ECHO)-$(GREP) -v "\*\|?" $@ | $(SED) -e 's@#.*@@' > 
[email protected]
        $(COMMAND_ECHO)-$(GREP) "\*\|?" $@ > [email protected]
@@ -1177,6 +1209,14 @@ $(DEF5EXPORTFILE) : $(SHL5OBJS) $(SHL5LIBS)
 
 $(DEF5EXPORTFILE) : $(SHL5VERSIONMAP)
        $(COMMAND_ECHO)$(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
+.IF "$(COM)"!="GCC"
+# 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]
+       $(COMMAND_ECHO)$(RENAME) [email protected] $@
+.ENDIF
 .IF "$(COM)"=="GCC"
        $(COMMAND_ECHO)-$(GREP) -v "\*\|?" $@ | $(SED) -e 's@#.*@@' > 
[email protected]
        $(COMMAND_ECHO)-$(GREP) "\*\|?" $@ > [email protected]
@@ -1461,6 +1501,14 @@ $(DEF6EXPORTFILE) : $(SHL6OBJS) $(SHL6LIBS)
 
 $(DEF6EXPORTFILE) : $(SHL6VERSIONMAP)
        $(COMMAND_ECHO)$(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
+.IF "$(COM)"!="GCC"
+# 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]
+       $(COMMAND_ECHO)$(RENAME) [email protected] $@
+.ENDIF
 .IF "$(COM)"=="GCC"
        $(COMMAND_ECHO)-$(GREP) -v "\*\|?" $@ | $(SED) -e 's@#.*@@' > 
[email protected]
        $(COMMAND_ECHO)-$(GREP) "\*\|?" $@ > [email protected]
@@ -1745,6 +1793,14 @@ $(DEF7EXPORTFILE) : $(SHL7OBJS) $(SHL7LIBS)
 
 $(DEF7EXPORTFILE) : $(SHL7VERSIONMAP)
        $(COMMAND_ECHO)$(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
+.IF "$(COM)"!="GCC"
+# 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]
+       $(COMMAND_ECHO)$(RENAME) [email protected] $@
+.ENDIF
 .IF "$(COM)"=="GCC"
        $(COMMAND_ECHO)-$(GREP) -v "\*\|?" $@ | $(SED) -e 's@#.*@@' > 
[email protected]
        $(COMMAND_ECHO)-$(GREP) "\*\|?" $@ > [email protected]
@@ -2029,6 +2085,14 @@ $(DEF8EXPORTFILE) : $(SHL8OBJS) $(SHL8LIBS)
 
 $(DEF8EXPORTFILE) : $(SHL8VERSIONMAP)
        $(COMMAND_ECHO)$(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
+.IF "$(COM)"!="GCC"
+# 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]
+       $(COMMAND_ECHO)$(RENAME) [email protected] $@
+.ENDIF
 .IF "$(COM)"=="GCC"
        $(COMMAND_ECHO)-$(GREP) -v "\*\|?" $@ | $(SED) -e 's@#.*@@' > 
[email protected]
        $(COMMAND_ECHO)-$(GREP) "\*\|?" $@ > [email protected]
@@ -2313,6 +2377,14 @@ $(DEF9EXPORTFILE) : $(SHL9OBJS) $(SHL9LIBS)
 
 $(DEF9EXPORTFILE) : $(SHL9VERSIONMAP)
        $(COMMAND_ECHO)$(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
+.IF "$(COM)"!="GCC"
+# 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]
+       $(COMMAND_ECHO)$(RENAME) [email protected] $@
+.ENDIF
 .IF "$(COM)"=="GCC"
        $(COMMAND_ECHO)-$(GREP) -v "\*\|?" $@ | $(SED) -e 's@#.*@@' > 
[email protected]
        $(COMMAND_ECHO)-$(GREP) "\*\|?" $@ > [email protected]
@@ -2597,6 +2669,14 @@ $(DEF10EXPORTFILE) : $(SHL10OBJS) $(SHL10LIBS)
 
 $(DEF10EXPORTFILE) : $(SHL10VERSIONMAP)
        $(COMMAND_ECHO)$(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
+.IF "$(COM)"!="GCC"
+# 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]
+       $(COMMAND_ECHO)$(RENAME) [email protected] $@
+.ENDIF
 .IF "$(COM)"=="GCC"
        $(COMMAND_ECHO)-$(GREP) -v "\*\|?" $@ | $(SED) -e 's@#.*@@' > 
[email protected]
        $(COMMAND_ECHO)-$(GREP) "\*\|?" $@ > [email protected]
diff --git a/main/solenv/inc/tg_def.mk b/main/solenv/inc/tg_def.mk
index cdb9176211..7c6439557f 100644
--- a/main/solenv/inc/tg_def.mk
+++ b/main/solenv/inc/tg_def.mk
@@ -46,6 +46,14 @@ $(DEF$(TNR)EXPORTFILE) : $(SHL$(TNR)OBJS) $(SHL$(TNR)LIBS)
 
 $(DEF$(TNR)EXPORTFILE) : $(SHL$(TNR)VERSIONMAP)
        $(COMMAND_ECHO)$(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
+.IF "$(COM)"!="GCC"
+# 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]
+       $(COMMAND_ECHO)$(RENAME) [email protected] $@
+.ENDIF
 .IF "$(COM)"=="GCC"
        $(COMMAND_ECHO)-$(GREP) -v "\*\|?" $@ | $(SED) -e 's@#.*@@' > 
[email protected]
        $(COMMAND_ECHO)-$(GREP) "\*\|?" $@ > [email protected]

Reply via email to