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

    set_soenv: point ILIB at the x64 .NET Framework import libraries
    
    The modern-MSVC branch computes an $arch for the Windows SDK and the VC
    libraries, then appends the .NET Framework SDK path unconditionally:
    
        $wps.$sdk_lib.$ds."ucrt".$ds.$arch.
        $wps.$sdk_lib.$ds."um".$ds.$arch.
        $wps.$FRAME_HOME.$LIB.            <- always x86
        $wps.$COMPATH.$LIB.$ds.$arch;
    
    So an x64 climaker.exe linked the x86 mscoree.lib and died:
    
        LINK : error LNK2001: unresolved external symbol "_CorExeMain".
        mscoree.lib : warning LNK4272: library machine type "x86" conflicts
                      with target machine type "x64"
    
    $arch cannot simply be reused: the SDK keeps x86 import libraries directly
    in lib/ and the x64 ones in lib/x64 -- there is no lib/x86.  Hence the
    explicit conditional.  The legacy X86_64 branch below had the same omission
    and gets the same treatment.
    
    Co-Authored-By: Claude Opus 5 <[email protected]>
    Claude-Session: https://claude.ai/code/session_01VrM7EMKgiuyVcCUe9nSbZR
---
 main/set_soenv.in | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/main/set_soenv.in b/main/set_soenv.in
index 57c7bd5e67..7bac838649 100644
--- a/main/set_soenv.in
+++ b/main/set_soenv.in
@@ -1120,9 +1120,15 @@ if ($platform =~ m/cygwin|os2/)
           }
           # ucrt before um: both ship a few of the same names and the CRT's
           # copy is the one that matches the headers on INCLUDE.
+          # The .NET Framework SDK keeps its x86 import libraries directly in
+          # lib/ and the x64 ones in lib/x64 -- there is no lib/x86, so this
+          # cannot simply reuse $arch.  Without the suffix an x64 climaker.exe
+          # links the x86 mscoree.lib and dies LNK2001 on _CorExeMain.
+          my $frame_lib = $FRAME_HOME.$LIB;
+          $frame_lib .= $ds."x64" if ( $arch eq "x64" );
           $ILIB   .=    $wps.$sdk_lib.$ds."ucrt".$ds.$arch.
                         $wps.$sdk_lib.$ds."um".$ds.$arch.
-                        $wps.$FRAME_HOME.$LIB.
+                        $wps.$frame_lib.
                         $wps.$COMPATH.$LIB.$ds.$arch;
       } elsif ( ( $CPUNAME eq "INTEL" ) || ( ( $CPUNAME eq "X86_64" ) && ( 
"@BUILD_WIN64@" ne "TRUE" ) ) ) {
           $ILIB   .=    $wps.$PSDK_HOME.$LIB.
@@ -1130,7 +1136,7 @@ if ($platform =~ m/cygwin|os2/)
                         $wps.$COMPATH.$LIB;
       } elsif ( $CPUNAME eq "X86_64" ) {
           $ILIB   .=    $wps.$PSDK_HOME.$LIB.$ds."x64".
-                        $wps.$FRAME_HOME.$LIB.
+                        $wps.$FRAME_HOME.$LIB.$ds."x64".
                         $wps.$COMPATH.$LIB.$ds."amd64";
       } else {
           print "Unsupported Windows CPU: $CPUNAME\n";

Reply via email to