fix(cmake): keep the SEH personalities out of libxml2's export set #18086

Merged
eliasbruno124-dev merged 1 commit from upstream-pr/18086 into main 2026-11-12 07:59:00 +00:00
eliasbruno124-dev commented 2026-11-10 11:07:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by eliasbruno124-dev on 2026-11-10T11:07:06Z.


What

With GCC whose exceptions are SEH, as MSYS2 ships it, core/libs/CMakeLists.txt calls link_libraries(windows_seh_personalities), and every later target gets the object library. Since #14421 that includes LibXml2, the bundled libxml2 that cmake/LibXml2.cmake adds for libSceNKWebKitRequirements. libxml2's install(EXPORT "LibXml2") then fails at generation:

CMake Error in 3rdparty/libxml2/CMakeLists.txt:
  install(EXPORT "LibXml2" ...) includes target "LibXml2" which requires
  target "windows_seh_personalities" that is not in any export set.

The Windows MSYS2 workflow stops at this configure step in its run of 2026-11-10 on c387acefa8, the first scheduled run after #14421 was merged; the run before it started from 572f7aa6d8, which predates that merge. It is the failure #12731 fixed for nghttp2_static.

Remove windows_seh_personalities from LibXml2's LINK_LIBRARIES and INTERFACE_LINK_LIBRARIES after the subdirectory is added, with the loop libSceHttp2 uses for nghttp2. libxml2 is C and needs no personality routine; the libraries that link it still get the object library through link_libraries. Where the target is not defined (DWARF toolchains, Linux, macOS), removing it from the lists changes nothing.

#12994 proposes isolating bundled subprojects from inherited link libraries in general, for nghttp2, mbedtls and glslang. It was written before libxml2 was added and does not change cmake/LibXml2.cmake. This is the targeted form already merged for nghttp2, so the MSYS2 build configures again now; if #12994 is merged, libxml2 can move to its helper there.

Tested

Windows 11 Pro 10.0.26300, CMake 4.4.5, Ninja, Release, BUILD_TESTING=ON, install rules on, submodules at the revisions of the tested commit. Two MSYS2 compilers, both with SEH exceptions: MINGW64 GCC 16.2.0-6 and UCRT64 GCC 16.2.0-6.

  • main 39bac5d055, MINGW64: configuration completes and generation fails with the error above. main 70aab1bf93 fails the same way.
  • This change on 39bac5d055 (cce56f2e92), MINGW64, same build directory and options: configuration and generation pass. cmake --build build --target LibXml2 builds libxml2.a. In the generated build graph, libxml2.a no longer depends on the SehPersonalities object, like libnghttp2.a, and libSceNKWebKitRequirements.prx still links it.
  • This change, UCRT64, fresh build directory: configuration and generation pass and the whole default build completes, all 8,946 steps: the 407 libraries under core/libs/libs, the relinker and the test executables. One link step of the first pass, guest_jsc_trivial_returns_tests.exe, failed copying libSceJsc.prx to tests/ while four other libSceJsc test executables linked at the same moment; a second cmake --build finished without a failure.
  • python tools/check_conventions.py --base origin/main and git diff --check pass.

Not tested: ctest. The suite was not run on this machine, which was in use by other GPU work, so the tests of the UCRT64 build are left to CI. The MINGW64 build stops at libc, whose FileStream.hpp calls _fflush_nolock, which msvcrt does not declare; BUILD.md names UCRT64, so that is not a regression. Linux, macOS and WinLibs builds were not run.

Overlap: none of the 1,986 open pull request heads fetched on 2026-11-10 changes cmake/LibXml2.cmake; #12994 is the related one, as described above. tools/pr_overlap.py --branch fix/cmake-libxml2-seh-export did not finish on this machine (its diffs fetch blobs on demand in a partial clone, and the connection was dropped), so this comes from the file lists of those heads. The branch merges cleanly into main 2c41a032c6, which was not configured here.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a (build configuration)
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5240227769 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18086). Originally posted by [eliasbruno124-dev](https://github.com/eliasbruno124-dev) on 2026-11-10T11:07:06Z. --- ### What With GCC whose exceptions are SEH, as MSYS2 ships it, `core/libs/CMakeLists.txt` calls `link_libraries(windows_seh_personalities)`, and every later target gets the object library. Since #14421 that includes `LibXml2`, the bundled libxml2 that `cmake/LibXml2.cmake` adds for `libSceNKWebKitRequirements`. libxml2's `install(EXPORT "LibXml2")` then fails at generation: ``` CMake Error in 3rdparty/libxml2/CMakeLists.txt: install(EXPORT "LibXml2" ...) includes target "LibXml2" which requires target "windows_seh_personalities" that is not in any export set. ``` The Windows MSYS2 workflow stops at this configure step in [its run of 2026-11-10](https://github.com/boykopovar/AnyPS5/actions/runs/42782767490) on `c387acefa8`, the first scheduled run after #14421 was merged; the run before it started from `572f7aa6d8`, which predates that merge. It is the failure #12731 fixed for `nghttp2_static`. Remove `windows_seh_personalities` from `LibXml2`'s `LINK_LIBRARIES` and `INTERFACE_LINK_LIBRARIES` after the subdirectory is added, with the loop `libSceHttp2` uses for nghttp2. libxml2 is C and needs no personality routine; the libraries that link it still get the object library through `link_libraries`. Where the target is not defined (DWARF toolchains, Linux, macOS), removing it from the lists changes nothing. #12994 proposes isolating bundled subprojects from inherited link libraries in general, for nghttp2, mbedtls and glslang. It was written before libxml2 was added and does not change `cmake/LibXml2.cmake`. This is the targeted form already merged for nghttp2, so the MSYS2 build configures again now; if #12994 is merged, libxml2 can move to its helper there. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Windows 11 Pro 10.0.26300, CMake 4.4.5, Ninja, Release, `BUILD_TESTING=ON`, install rules on, submodules at the revisions of the tested commit. Two MSYS2 compilers, both with SEH exceptions: MINGW64 GCC 16.2.0-6 and UCRT64 GCC 16.2.0-6. - `main` `39bac5d055`, MINGW64: configuration completes and generation fails with the error above. `main` `70aab1bf93` fails the same way. - This change on `39bac5d055` (`cce56f2e92`), MINGW64, same build directory and options: configuration and generation pass. `cmake --build build --target LibXml2` builds `libxml2.a`. In the generated build graph, `libxml2.a` no longer depends on the `SehPersonalities` object, like `libnghttp2.a`, and `libSceNKWebKitRequirements.prx` still links it. - This change, UCRT64, fresh build directory: configuration and generation pass and the whole default build completes, all 8,946 steps: the 407 libraries under `core/libs/libs`, the relinker and the test executables. One link step of the first pass, `guest_jsc_trivial_returns_tests.exe`, failed copying `libSceJsc.prx` to `tests/` while four other libSceJsc test executables linked at the same moment; a second `cmake --build` finished without a failure. - `python tools/check_conventions.py --base origin/main` and `git diff --check` pass. Not tested: `ctest`. The suite was not run on this machine, which was in use by other GPU work, so the tests of the UCRT64 build are left to CI. The MINGW64 build stops at `libc`, whose `FileStream.hpp` calls `_fflush_nolock`, which msvcrt does not declare; BUILD.md names UCRT64, so that is not a regression. Linux, macOS and WinLibs builds were not run. Overlap: none of the 1,986 open pull request heads fetched on 2026-11-10 changes `cmake/LibXml2.cmake`; #12994 is the related one, as described above. `tools/pr_overlap.py --branch fix/cmake-libxml2-seh-export` did not finish on this machine (its diffs fetch blobs on demand in a partial clone, and the connection was dropped), so this comes from the file lists of those heads. The branch merges cleanly into `main` `2c41a032c6`, which was not configured here. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none <!-- #PR, or none --> - [x] Fixes: none <!-- issue it closes as Fixes #N, or none --> - [x] Unblocks: none <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> - [x] GPUs tested: n/a (build configuration) <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> - [x] AI-assisted: yes <!-- yes / no -->
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!18086
No description provided.