[v3] - fix(windows): define LEXBOR_STATIC for PHP 8.5+ static builds#1173
[v3] - fix(windows): define LEXBOR_STATIC for PHP 8.5+ static builds#1173luthermonson wants to merge 1 commit into
Conversation
The ext/uri extension introduced in PHP 8.5 vendors lexbor headers. On Windows, lexbor's LXB_API macro defaults to __declspec(dllimport), which breaks static linking with unresolved external symbols for all lxb_* functions. Adding a BeforeStage patch that injects /D LEXBOR_STATIC into CFLAGS_URI makes LXB_API expand to nothing, allowing the uri extension to link into the static PHP build. Only applies to PHP >= 8.5.0 where ext/uri exists.
|
Isn't this better passed as a -D flag directly on configure? And certainly, this should be fixed in php-src, not here. |
|
i was trying to stay in windows and not step on too many toes, i can refactor |
|
php-src has different configure methods for windows (configure.js) and unix (makefile based). |
|
im really not familiar with upstream php-src yet just from what i'm exposed through spc. if i make these changes upstream can we get them in here pretty quick as it's a build change or will it take a while to sort through in a real release of 8.x? |
It just happens automatically through the next release of 8.5.x (or whatever version you created the PR against, you should always target the oldest supported version the change is relevant to, usually 8.4 now, 8.2 for security fixes).
If you're genuinely looking to become good at this, I would recommend leaving llms out of the process for now, because while they'll get things done, it's often times not in the fashion it should be done and the learning effect is minimal. |
The ext/uri extension introduced in PHP 8.5 vendors lexbor headers. On Windows, lexbor's LXB_API macro defaults to _declspec(dllimport), which breaks static linking with unresolved external symbols for all lxb* functions.
Adding a BeforeStage patch that injects /D LEXBOR_STATIC into CFLAGS_URI makes LXB_API expand to nothing, allowing the uri extension to link into the static PHP build.
Only applies to PHP >= 8.5.0 where ext/uri exists.