You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by da...@apache.org on 2026/02/21 14:25:42 UTC

(openoffice) branch windows-amd64 updated (3f8f95abcd -> 9a9ee5926b)

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

damjan pushed a change to branch windows-amd64
in repository https://gitbox.apache.org/repos/asf/openoffice.git


    from 3f8f95abcd Fix ADO driver data types that differ between i386 and amd64.
     new 73bcf912b9 Fix the curl debug build on Windows. It always copied the "release" binaries, which don't exist in debug builds. Also on amd64, the binaries have a "_debug" suffix.
     new 0c2e3065a0 Invert the broken logic for when to pass typelib_TypeClass_STRUCT and typelib_TypeClass_EXCEPTION on the stack vs registers.
     new 607903dd38 Many fixes to the privateSnippetExecutor and callVirtualMethod assembly language functions on Windows/AMD64: - Write return values <= 8 bytes in size to *pRegisterReturn,   instead of overwriting pRegisterReturn with it. - Return values > 8 bytes in size have already been written into   *pRegisterReturn by the called function, so don't do anything   else. Previously we were writing pRegisterReturn into   *pRegisterReturn, corrupting it... - Keep the stack aligned to a  [...]
     new 9a9ee5926b The asserted pointer size for AMD64 should be 64 bits.

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../source/cpp_uno/msvc_win64_x86-64/abi.cxx       |  4 +-
 .../source/cpp_uno/msvc_win64_x86-64/call.asm      | 48 ++++++++++++++--------
 .../source/cpp_uno/msvc_win64_x86-64/except.cxx    |  6 +--
 main/curl/makefile.mk                              | 14 +++++++
 4 files changed, 49 insertions(+), 23 deletions(-)


(openoffice) 04/04: The asserted pointer size for AMD64 should be 64 bits.

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

damjan pushed a commit to branch windows-amd64
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit 9a9ee5926b5d74d68385183cdd7d12a171389780
Author: Damjan Jovanovic <da...@apache.org>
AuthorDate: Sat Feb 21 16:13:44 2026 +0200

    The asserted pointer size for AMD64 should be 64 bits.
    
    Patch by: me
---
 main/bridges/source/cpp_uno/msvc_win64_x86-64/except.cxx | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/main/bridges/source/cpp_uno/msvc_win64_x86-64/except.cxx b/main/bridges/source/cpp_uno/msvc_win64_x86-64/except.cxx
index a4249c556e..98218480ab 100644
--- a/main/bridges/source/cpp_uno/msvc_win64_x86-64/except.cxx
+++ b/main/bridges/source/cpp_uno/msvc_win64_x86-64/except.cxx
@@ -399,7 +399,7 @@ RaiseInfo::RaiseInfo( typelib_TypeDescription * pTypeDescr ) throw ()
 	, _n2( 0 )
 {
 	// a must be
-	OSL_ENSURE( sizeof(sal_Int32) == sizeof(ExceptionType *), "### pointer size differs from sal_Int32!" );
+	OSL_ENSURE( sizeof(sal_Int64) == sizeof(ExceptionType *), "### pointer size differs from sal_Int64!" );
 
 	::typelib_typedescription_acquire( pTypeDescr );
 	this->pTypeDescr = pTypeDescr;
@@ -581,8 +581,8 @@ void mscx_raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp )
 
 	// a must be
 	OSL_ENSURE(
-        sizeof(sal_Int32) == sizeof(void *),
-        "### pointer size differs from sal_Int32!" );
+        sizeof(sal_Int64) == sizeof(void *),
+        "### pointer size differs from sal_Int64!" );
 	RaiseInfo *raiseInfo = ExceptionInfos::getRaiseInfo( pTypeDescr );
 	ULONG_PTR arFilterArgs[4];
 	arFilterArgs[0] = MSVC_magic_number;


(openoffice) 02/04: Invert the broken logic for when to pass typelib_TypeClass_STRUCT and typelib_TypeClass_EXCEPTION on the stack vs registers.

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

damjan pushed a commit to branch windows-amd64
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit 0c2e3065a0ed4b4c7df10daac0547e1eff282ac7
Author: Damjan Jovanovic <da...@apache.org>
AuthorDate: Sun Feb 8 09:44:08 2026 +0200

    Invert the broken logic for when to pass typelib_TypeClass_STRUCT and
    typelib_TypeClass_EXCEPTION on the stack vs registers.
    
    Patch by: me
---
 main/bridges/source/cpp_uno/msvc_win64_x86-64/abi.cxx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/main/bridges/source/cpp_uno/msvc_win64_x86-64/abi.cxx b/main/bridges/source/cpp_uno/msvc_win64_x86-64/abi.cxx
index 244635ebe0..01176dc825 100644
--- a/main/bridges/source/cpp_uno/msvc_win64_x86-64/abi.cxx
+++ b/main/bridges/source/cpp_uno/msvc_win64_x86-64/abi.cxx
@@ -70,12 +70,12 @@ bool x86_64::return_in_hidden_param( typelib_TypeDescriptionReference *pTypeRef
                 if ( pTypeDescr->nSize > 8 )
                 {
                     TYPELIB_DANGER_RELEASE( pTypeDescr );
-                    return false;
+                    return true;
                 }
                 else
                 {
                     TYPELIB_DANGER_RELEASE( pTypeDescr );
-                    return true;
+                    return false;
                 }
             }
 


(openoffice) 01/04: Fix the curl debug build on Windows. It always copied the "release" binaries, which don't exist in debug builds. Also on amd64, the binaries have a "_debug" suffix.

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

damjan pushed a commit to branch windows-amd64
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit 73bcf912b95884e9bef09c783349f0b7cfa68715
Author: Damjan Jovanovic <da...@apache.org>
AuthorDate: Fri Feb 20 03:58:33 2026 +0200

    Fix the curl debug build on Windows.
    It always copied the "release" binaries, which don't exist in debug builds.
    Also on amd64, the binaries have a "_debug" suffix.
    
    Patch by: me
---
 main/curl/makefile.mk | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/main/curl/makefile.mk b/main/curl/makefile.mk
index f17ba876d9..95a96bc02a 100644
--- a/main/curl/makefile.mk
+++ b/main/curl/makefile.mk
@@ -119,11 +119,25 @@ BUILD_ACTION=CC="cl.exe" nmake -f Makefile.vc mode=dll VC=9 DEBUG=yes EXCFLAGS=$
 .ENDIF
 
 .IF "$(CPUNAME)"=="INTEL"
+
+.IF "$(debug)"==""
 OUT2BIN=$(BUILD_DIR)$/../builds/libcurl-vc9-X86-release-dll-ssl-dll-zlib-dll-ipv6-sspi/bin/libcurl.dll
 OUT2LIB=$(BUILD_DIR)$/../builds/libcurl-vc9-X86-release-dll-ssl-dll-zlib-dll-ipv6-sspi/lib/libcurl.lib
+.ELSE
+OUT2BIN=$(BUILD_DIR)$/../builds/libcurl-vc9-X86-debug-dll-ssl-dll-zlib-dll-ipv6-sspi/bin/libcurl_debug.dll
+OUT2LIB=$(BUILD_DIR)$/../builds/libcurl-vc9-X86-debug-dll-ssl-dll-zlib-dll-ipv6-sspi/lib/libcurl_debug.lib
+.ENDIF
+
 .ELIF "$(CPUNAME)"=="X86_64"
+
+.IF "$(debug)"==""
 OUT2BIN=$(BUILD_DIR)$/../builds/libcurl-vc9-X64-release-dll-ssl-dll-zlib-dll-ipv6-sspi/bin/libcurl.dll
 OUT2LIB=$(BUILD_DIR)$/../builds/libcurl-vc9-X64-release-dll-ssl-dll-zlib-dll-ipv6-sspi/lib/libcurl.lib
+.ELSE
+OUT2BIN=$(BUILD_DIR)$/../builds/libcurl-vc9-X64-debug-dll-ssl-dll-zlib-dll-ipv6-sspi/bin/libcurl_debug.dll
+OUT2LIB=$(BUILD_DIR)$/../builds/libcurl-vc9-X64-debug-dll-ssl-dll-zlib-dll-ipv6-sspi/lib/libcurl_debug.lib
+.ENDIF
+
 .ENDIF
 
 .ENDIF


(openoffice) 03/04: Many fixes to the privateSnippetExecutor and callVirtualMethod assembly language functions on Windows/AMD64: - Write return values <= 8 bytes in size to *pRegisterReturn, instead of overwriting pRegisterReturn with it. - Return values > 8 bytes in size have already been written into *pRegisterReturn by the called function, so don't do anything else. Previously we were writing pRegisterReturn into *pRegisterReturn, corrupting it... - Keep the stack aligned to a 16 byte boundary afte [...]

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

damjan pushed a commit to branch windows-amd64
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit 607903dd38f9217a1b2aa61f7ce75d257336de99
Author: Damjan Jovanovic <da...@apache.org>
AuthorDate: Fri Feb 20 04:18:44 2026 +0200

    Many fixes to the privateSnippetExecutor and callVirtualMethod
    assembly language functions on Windows/AMD64:
    - Write return values <= 8 bytes in size to *pRegisterReturn,
      instead of overwriting pRegisterReturn with it.
    - Return values > 8 bytes in size have already been written into
      *pRegisterReturn by the called function, so don't do anything
      else. Previously we were writing pRegisterReturn into
      *pRegisterReturn, corrupting it...
    - Keep the stack aligned to a 16 byte boundary after the prolog.
    - Generate .pdata and .xdata sections in the PE32+ binary
      to allow proper exception unwinding, which is necessary to allow
      both C++ and SEH exceptions to pass through functions. (On Win64,
      the only functions that are allowed to lack this static data
      describing how to unwind them, are leaf functions that don't
      touch the RBP register.)
    - Improve documentation in the comments.
    
    Patch by: me
---
 .../source/cpp_uno/msvc_win64_x86-64/call.asm      | 48 ++++++++++++++--------
 1 file changed, 30 insertions(+), 18 deletions(-)

diff --git a/main/bridges/source/cpp_uno/msvc_win64_x86-64/call.asm b/main/bridges/source/cpp_uno/msvc_win64_x86-64/call.asm
index 0b190228d8..402d7e2319 100644
--- a/main/bridges/source/cpp_uno/msvc_win64_x86-64/call.asm
+++ b/main/bridges/source/cpp_uno/msvc_win64_x86-64/call.asm
@@ -51,8 +51,8 @@ EXTERN cpp_vtable_call: PROC
 ; rbp+16 rsp+08 +----------------------------+ -------
 ;               | return address             |
 ; rbp+08 rsp--> +----------------------------+
-;               | old rbp                    |
-; rbp---------> +----------------------------+
+;               | caller's rbp               |
+; rbp---------> +----------------------------+ <------ 16 byte boundary
 ;               | pRegisterReturn memory     |
 ; rbp-08 -----> +----------------------------+
 ;               |                            |
@@ -72,11 +72,11 @@ EXTERN cpp_vtable_call: PROC
 ;
 
 privateSnippetExecutor PROC FRAME
-
 	push	rbp
+	.PUSHREG rbp
 	mov	rbp, rsp
+	.SETFRAME rbp, 0
 	sub	rsp, 48
-	.ALLOCSTACK(48)
 	.ENDPROLOG
 
 	; 4th param: sal_uInt64 *pRegisterReturn 
@@ -122,7 +122,7 @@ privateSnippetExecutor ENDP
 ; rbp+16 -----> +---------------------------------------------+ -------
 ;               | return address                              |
 ; rbp+08 -----> +---------------------------------------------+
-;               | old rbp                                     |
+;               | caller's rbp                                |
 ; rbp --------> +---------------------------------------------+ <---- 16 byte boundary
 ;               | (possible 16 byte alignment placeholder)    |
 ; rbp-08 -----> +---------------------------------------------+
@@ -134,8 +134,9 @@ privateSnippetExecutor ENDP
 callVirtualMethod PROC FRAME
 
 	push rbp
+	.PUSHREG rbp
 	mov rbp, rsp
-	.ENDPROLOG
+	.SETFRAME rbp, 0
 
 	; Save our register arguments to the shadow space:
 	mov 16[rbp], rcx
@@ -143,22 +144,28 @@ callVirtualMethod PROC FRAME
 	mov 32[rbp], r8
 	mov 40[rbp], r9
 
-	; We must maintain the stack aligned to a 16 byte boundary:
+	; nStack rounded to multiple of 2, so the stack is aligned to a 16 byte boundary:
 	mov eax, 56[rbp]
-	test eax, eax
-	jz populateArgumentRegisters
 	inc eax
 	shr eax, 1
 	shl eax, 1
 
+	; if nStack < 4, add (4 - nStack) empty slots to the stack:
+	mov r10d, 4
+	sub r10d, eax
+	js copyStack
+	shl r10, 3
+	sub rsp, r10
+
+copyStack:
 	mov r10, rax
 	shl rax, 3
 	add rax, 48[rbp]
-copyStack:
+copyStackLoop:
 	sub rax, 8
 	push [rax]
 	dec r10
-	jne copyStack
+	jne copyStackLoop
 
 populateArgumentRegisters:
 	; First 4 args are passed in registers. Floating point args needs to be
@@ -173,6 +180,9 @@ populateArgumentRegisters:
 	movsd xmm2, qword ptr 16[rsp]
 	mov r9, 24[rsp]
 	movsd xmm3, qword ptr 24[rsp]
+
+	.ENDPROLOG
+
 	
 callMethod:
 	; Find the method pointer
@@ -184,6 +194,7 @@ callMethod:
 	call qword ptr [r10]
 
 	mov r10d, 40[rbp]
+	mov r11, 32[rbp]
 	cmp r10, typelib_TypeClass_VOID
 	je cleanup
 	cmp r10, typelib_TypeClass_LONG
@@ -213,30 +224,31 @@ callMethod:
 
 	; https://docs.microsoft.com/en-us/cpp/build/x64-calling-convention?view=vs-2017
 	; "The same pointer must be returned by the callee in RAX."
-	jmp Lint64
+	jmp cleanup
 
 Lint64:
-	mov 32[rbp], rax
+	mov qword ptr [r11], rax
 	jmp cleanup
 
 Lint32:
-	mov 32[rbp], eax
+	mov dword ptr [r11], eax
 	jmp cleanup
 
 Lint16:
-	mov 32[rbp], ax
+	mov word ptr [r11], ax
 	jmp cleanup
 
 Lint8:
-	mov 32[rbp], al
+	mov byte ptr [r11], al
 	jmp cleanup
 
 Lfloat:
-	movsd qword ptr 32[rbp], xmm0
+	movsd qword ptr [r11], xmm0
 	jmp cleanup
 
 cleanup:
-	leave
+	lea rsp, 0[rbp]
+	pop rbp
 	ret
 
 callVirtualMethod ENDP