This is an automated email from the ASF dual-hosted git repository. leginee pushed a commit to branch bazel-migration in repository https://gitbox.apache.org/repos/asf/openoffice.git
commit 49198212414ae0f9ac2c775d80b0877db2d7059b Author: Peter Kovacs <[email protected]> AuthorDate: Wed Jul 22 00:56:00 2026 +0200 build/win64: per-module x64 BUILD wiring (defs, manifests, /ENTRY, asm) [P5] Arch-conditional build fixes surfaced while widening the x64 build through the GUI / app-framework tier. All select() on //build:arch_x64; x86 unchanged. - jvmaccess: x86 uses an explicit x86-mangled .def, but there is no mscx.map; the source uses JVMACCESS_DLLPUBLIC (__declspec(dllexport)), so x64 links with an empty def (util/jvmaccessx64.def, LIBRARY only) and dllexport emits all 16 exports with x64 mangling (like cppuhelper). - vcl: /ENTRY:LibMain@12 is x86 stdcall decoration; x64 has no @N -> select /ENTRY:LibMain. - basic: wnt.asm is the x86 stdcall trampoline for Basic Declare'd DLL calls; excluded on x64 (dllmgr.cxx uses the not-implemented stub there). - idl (svidl) / shell (lngconvex): these exec-tool bundles stage their own <tool>.exe.manifest hardcoding processorArchitecture="x86"; on the x64 host the loader then rejects the amd64 msvcr90.dll (0xC000007B). Add util/amd64/ <tool>.exe.manifest (amd64) and select the data entry (staged by basename). Co-Authored-By: Claude Opus 4.8 <[email protected]> (cherry picked from commit 85b1ad448fa260940ad9d6460b8eb4c738e65398) --- main/basic/BUILD.bazel | 8 ++++++-- main/idl/BUILD.bazel | 11 +++++++++-- main/idl/util/amd64/svidl.exe.manifest | 9 +++++++++ main/jvmaccess/BUILD.bazel | 8 +++++++- main/jvmaccess/util/jvmaccessx64.def | 8 ++++++++ main/shell/BUILD.bazel | 8 ++++++-- main/shell/util/amd64/lngconvex.exe.manifest | 9 +++++++++ main/vcl/BUILD.bazel | 8 ++++++-- 8 files changed, 60 insertions(+), 9 deletions(-) diff --git a/main/basic/BUILD.bazel b/main/basic/BUILD.bazel index 17a4d0c84b..3f11f1978c 100644 --- a/main/basic/BUILD.bazel +++ b/main/basic/BUILD.bazel @@ -66,8 +66,12 @@ cc_binary( "source/inc/**", ]) + [ "inc/pch/precompiled_basic.cxx", - "source/runtime/wnt.asm", - ], + ] + select({ + # wnt.asm is the x86 stdcall trampoline for Basic Declare'd DLL calls; on + # x64 dllmgr.cxx uses the not-implemented stub instead (no asm to assemble). + "//build:arch_x64": [], + "//conditions:default": ["source/runtime/wnt.asm"], + }), copts = _COPTS, defines = _DEFINES + ["BASIC_DLLIMPLEMENTATION"], linkshared = True, diff --git a/main/idl/BUILD.bazel b/main/idl/BUILD.bazel index 8f1580a617..1c6c2dc8b5 100644 --- a/main/idl/BUILD.bazel +++ b/main/idl/BUILD.bazel @@ -72,8 +72,15 @@ cc_binary( "//main/basegfx:basegfx", "//main/i18npool:i18nisolang1MSC", "//main/external/msvcp90:crt_dlls", - "util/svidl.exe.manifest", - ], + # App manifest declares the CRT-assembly processorArchitecture; must match + # the (arch-selected) CRT. x64 svidl is exec-built for the x64 host, so it + # needs the amd64 manifest — an x86 manifest makes the loader reject the + # amd64 msvcr90.dll (0xC000007B STATUS_INVALID_IMAGE_FORMAT). Staged by + # basename, so both are named svidl.exe.manifest. + ] + select({ + "//build:arch_x64": ["util/amd64/svidl.exe.manifest"], + "//conditions:default": ["util/svidl.exe.manifest"], + }), visibility = ["//visibility:public"], ) diff --git a/main/idl/util/amd64/svidl.exe.manifest b/main/idl/util/amd64/svidl.exe.manifest new file mode 100644 index 0000000000..84685f3ebb --- /dev/null +++ b/main/idl/util/amd64/svidl.exe.manifest @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> + <assemblyIdentity version="1.0.0.0" processorArchitecture="amd64" name="svidl" type="win32"/> + <dependency> + <dependentAssembly> + <assemblyIdentity type="win32" name="Microsoft.VC90.CRT" version="9.0.30729.1" processorArchitecture="amd64" publicKeyToken="1fc8b3b9a1e18e3b"/> + </dependentAssembly> + </dependency> +</assembly> diff --git a/main/jvmaccess/BUILD.bazel b/main/jvmaccess/BUILD.bazel index 5687b21920..cde6c14b02 100644 --- a/main/jvmaccess/BUILD.bazel +++ b/main/jvmaccess/BUILD.bazel @@ -41,7 +41,13 @@ cc_binary( copts = _COPTS, defines = _DEFINES, linkshared = True, - win_def_file = "util/jvmaccess.def", + # x86 uses explicit x86-mangled exports; x64 has no mscx.map, but the source + # uses JVMACCESS_DLLPUBLIC (__declspec(dllexport)) so an empty def suffices on + # x64 (dllexport emits all 16 exports with x64 mangling — like cppuhelper). + win_def_file = select({ + "//build:arch_x64": "util/jvmaccessx64.def", + "//conditions:default": "util/jvmaccess.def", + }), deps = [ ":jvmaccess_headers", "//main/sal:sal_headers", diff --git a/main/jvmaccess/util/jvmaccessx64.def b/main/jvmaccess/util/jvmaccessx64.def new file mode 100644 index 0000000000..156eda72a0 --- /dev/null +++ b/main/jvmaccess/util/jvmaccessx64.def @@ -0,0 +1,8 @@ +; jvmaccess3MSC.dll x64 export file. +; Exports come from __declspec(dllexport) (JVMACCESS_DLLPUBLIC = SAL_DLLPUBLIC_EXPORT +; in inc/jvmaccess/jvmaccessdllapi.h), which emits all 16 /EXPORT: directives with +; correct x64 mangling — so this def only sets the LIBRARY name (same pattern as +; cppuhelper3MSC.def). The x86 jvmaccess.def lists explicit x86-mangled (__thiscall +; QAE) names; x64 mangling differs (QEAA/PEAX/AEBV) and there is no mscx.map to +; regenerate from, but dllexport already provides every export. +LIBRARY jvmaccess3MSC diff --git a/main/shell/BUILD.bazel b/main/shell/BUILD.bazel index 40a0e7f998..0e999bec7c 100644 --- a/main/shell/BUILD.bazel +++ b/main/shell/BUILD.bazel @@ -408,8 +408,12 @@ cc_binary( "//main/basegfx:basegfx", "//main/i18npool:i18nisolang1MSC", "//main/external/msvcp90:crt_dlls", - "util/lngconvex.exe.manifest", - ], + # amd64 app manifest for the x64 (exec) tool — matches the arch-selected CRT + # (an x86 manifest → loader rejects amd64 msvcr90.dll, 0xC000007B). + ] + select({ + "//build:arch_x64": ["util/amd64/lngconvex.exe.manifest"], + "//conditions:default": ["util/lngconvex.exe.manifest"], + }), visibility = ["//visibility:public"], ) diff --git a/main/shell/util/amd64/lngconvex.exe.manifest b/main/shell/util/amd64/lngconvex.exe.manifest new file mode 100644 index 0000000000..fdc3c82696 --- /dev/null +++ b/main/shell/util/amd64/lngconvex.exe.manifest @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> + <assemblyIdentity version="1.0.0.0" processorArchitecture="amd64" name="lngconvex" type="win32"/> + <dependency> + <dependentAssembly> + <assemblyIdentity type="win32" name="Microsoft.VC90.CRT" version="9.0.30729.1" processorArchitecture="amd64" publicKeyToken="1fc8b3b9a1e18e3b"/> + </dependentAssembly> + </dependency> +</assembly> diff --git a/main/vcl/BUILD.bazel b/main/vcl/BUILD.bazel index 8cbae9417b..2887a03f9c 100644 --- a/main/vcl/BUILD.bazel +++ b/main/vcl/BUILD.bazel @@ -134,9 +134,13 @@ cc_binary( "advapi32.lib", "gdi32.lib", "gdiplus.lib", "imm32.lib", "mpr.lib", "msimg32.lib", "ole32.lib", "shell32.lib", "user32.lib", "uuid.lib", "version.lib", "winspool.lib", - "/ENTRY:LibMain@12", + # LibMain is WINAPI (__stdcall): x86 decorates it _LibMain@12; x64 has no + # stdcall @N decoration, so the entry symbol is the undecorated LibMain. "/MANIFEST:NO", - ], + ] + select({ + "//build:arch_x64": ["/ENTRY:LibMain"], + "//conditions:default": ["/ENTRY:LibMain@12"], + }), visibility = ["//visibility:public"], )
