Skip to content

depends: Bump dlfcn-win32 to v1.4.2#148

Merged
garbear merged 1 commit intokodi-game:Piersfrom
garbear:update-dlfcn-win32
Mar 11, 2026
Merged

depends: Bump dlfcn-win32 to v1.4.2#148
garbear merged 1 commit intokodi-game:Piersfrom
garbear:update-dlfcn-win32

Conversation

@garbear
Copy link
Member

@garbear garbear commented Mar 1, 2026

Description

As title says, I bumped dlfcn-win32 to v1.4.2, and updated the patches.

Notable changes:

  • CMake 4.0 support was added in v1.4.2 (dropped our CMake policy patches)
  • Windows ARM64 support was added in v1.4.0.

dlfcn-win32 fork

I rebased the windows UWP patch, but it crashes patch.exe on Azure, so I forked the dlfcn-win32 repo and tagged v1.4.2 with Alwin's commit.

Error on azure was:

Performing patch step for 'dlfcn-win32'
patching file src/dlfcn.c
Assertation failed!

Program: C:\Strawberry\c\bin\patch.exe
File: .\src\patch\2.5.9\patch-2.5.9-src\patch.c, Line 354

Expression: hunk
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(254,5): error MSB8066: Custom build for 'D:\a\1\s\build\CMakeFiles\ff81d8f751455c61eb06ec168b49c1e8\dlfcn-win32-mkdir.rule;D:\a\1\s\build\CMakeFiles\ff81d8f751455c61eb06ec168b49c1e8\dlfcn-win32-download.rule;D:\a\1\s\build\CMakeFiles\ff81d8f751455c61eb06ec168b49c1e8\dlfcn-win32-update.rule;D:\a\1\s\build\CMakeFiles\ff81d8f751455c61eb06ec168b49c1e8\dlfcn-win32-patch.rule;D:\a\1\s\build\CMakeFiles\ff81d8f751455c61eb06ec168b49c1e8\dlfcn-win32-configure.rule;D:\a\1\s\build\CMakeFiles\ff81d8f751455c61eb06ec168b49c1e8\dlfcn-win32-build.rule;D:\a\1\s\build\CMakeFiles\ff81d8f751455c61eb06ec168b49c1e8\dlfcn-win32-install.rule;D:\a\1\s\build\CMakeFiles\b92e65488deb09c80c81783db8877d8a\dlfcn-win32-complete.rule;D:\a\1\s\build\CMakeFiles\2519d97468e2ef66918e641805db7c70\dlfcn-win32.rule;D:\a\1\kodi\cmake\addons\CMakeLists.txt' exited with code 3. [D:\a\1\s\build\dlfcn-win32.vcxproj]

Then in the depends file I set the repo to my fork + the commit:

dlfcn-win32 https://github.com/garbear/dlfcn-win32/archive/refs/tags/v1.4.2-uwp2.tar.gz

How has this been tested?

Compile-tested on Windows 10 x64. Runtime testing in progress.

Other add-ons

The following add-ons also use dlfcn-win32 and should be updated:

@garbear garbear force-pushed the update-dlfcn-win32 branch 7 times, most recently from 89ccec8 to 1dd5d77 Compare March 1, 2026 08:42
@garbear garbear requested a review from Copilot March 4, 2026 07:08
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR bumps the dlfcn-win32 dependency from v1.2.0 to v1.4.2 for both windows (desktop) and windowsstore (UWP) build targets. The upgrade brings CMake 4.0 compatibility (eliminating the need for the CMake policy patch) and adds Windows ARM64 support. For the UWP target, since the official v1.4.2 upstream release broke the Azure patch step, the author uses a personal fork (garbear/dlfcn-win32) with the UWP changes already committed at tag v1.4.2-uwp2, removing the need for the UWP patch file as well.

Changes:

  • Updated dependency URLs and SHA256 hashes for both windows and windowsstore targets to v1.4.2.
  • Removed the now-unnecessary CMake policy bump patches for both targets (handled natively in v1.4.2); removed the UWP patch for windowsstore (baked into the fork tag).
  • Updated 0001-dlopen_with_widechar.patch for windows to reflect the new source file path (src/dlfcn.c) and line numbers in v1.4.2; added a .gitattributes entry to prevent LF/CRLF corruption of patch files.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
depends/windows/dlfcn-win32/dlfcn-win32.txt Updated URL to official v1.4.2 release
depends/windows/dlfcn-win32/dlfcn-win32.sha256 Updated SHA256 for v1.4.2 tarball
depends/windows/dlfcn-win32/0001-dlopen_with_widechar.patch Rebased widechar patch onto v1.4.2 source layout (now at src/dlfcn.c, line ~415), added proper git patch header
depends/windows/dlfcn-win32/0001-Bump-policy_max-in-cmake_minimum_required-to-3.10.patch Removed (CMake 4.0 now supported natively by v1.4.2)
depends/windowsstore/dlfcn-win32/dlfcn-win32.txt Updated URL to forked v1.4.2-uwp2 tag
depends/windowsstore/dlfcn-win32/dlfcn-win32.sha256 Updated SHA256 for UWP fork tarball
depends/windowsstore/dlfcn-win32/0001-win10-fixed-uwp-build.patch Removed (UWP changes are now in the forked tag)
depends/windowsstore/dlfcn-win32/0001-Bump-policy_max-in-cmake_minimum_required-to-3.10.patch Removed (CMake 4.0 support in v1.4.2)
.gitattributes Added -text attributes for patch files to prevent line ending changes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@garbear
Copy link
Member Author

garbear commented Mar 10, 2026

OK, I dropped the personal repo, and modified the Azure pipeline to wrap patch.exe in a wrapper that invokes with --binary.

@garbear garbear force-pushed the update-dlfcn-win32 branch from dd84a84 to 931fe5c Compare March 10, 2026 21:48
@garbear garbear merged commit f394413 into kodi-game:Piers Mar 11, 2026
6 checks passed
@garbear garbear deleted the update-dlfcn-win32 branch March 11, 2026 00:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants