You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(windows-clang): survive real-world spc rc18 behavior; verify against a full local run
Fixes found by running the lane end to end locally with stock spc.exe
v3.0.0-pgo-rc18 (PHP 8.5.7, LLVM 22.1.8) and building ePHPm against the
resulting SDK:
- configure: force PHP_TOOLSET = clang in the config.w32 body instead of
flipping the declaration default. spc passes --disable-all, and
conf_process_args resets every unseen configure arg to no (-> vs),
so a default flip silently produces an MSVC/CALL artifact. Also keep the
injected comment free of the literal ARG_WITH/ARG_ENABLE strings:
buildconf's preamble extractor greps for them and would copy comment
text into configure.js as broken JS.
- spc build: repeat --dl-custom-local. The build phase runs its own
downloader pass and otherwise re-resolves php-src, silently replacing
the patched tree with the stock tarball.
- VM-kind gate: the probe member is Zend\zend_execute.obj
(zend_vm_execute.h is #included by zend_execute.c; there is no
zend_vm_execute.obj).
- Package: strip HAVE_PRESERVE_NONE and the PHP_HAVE_BUILTIN_* defines
from BOTH staged config headers (php_config.h and config.w32.h -
zend_config.h includes the latter). With them present, rust-bindgen
panics on libclang calling convention 20 (preserve_none) and MSVC
consumers emit unlinkable __builtin_expect calls. Stripped, consumers
get the same portable CALL-view the MSVC-lane headers give while the
engine runs TAILCALL internally - verified: ePHPm links and runs the
clang SDK with zero source changes, 1.6-1.7x faster on CPU-bound PHP
than the MSVC SDK build.
$anchor1 = '"is Visual Studio. Use others at your own risk.", "vs");'
1305
+
$anchor1 = 'toolset_option_handle();'
1303
1306
if (-not $content.Contains($anchor1)) {
1304
-
Write-Error "config.w32 toolset-default anchor not found - php-src build system changed, refusing to build (would silently produce an MSVC/CALL artifact)"
1307
+
Write-Error "config.w32 toolset anchor not found - php-src build system changed, refusing to build (would silently produce an MSVC/CALL artifact)"
1305
1308
exit 1
1306
1309
}
1307
-
$content = $content.Replace($anchor1, '"is Visual Studio. Use others at your own risk.", "clang");')
1310
+
# NB: the comment must not contain the literal string ARG_WITH or
1311
+
# ARG_ENABLE — buildconf's preamble extractor greps for those and
1312
+
# would copy the comment line into configure.js as broken JS.
1313
+
$force = "/* Injected by php-sdk's windows-x86_64-clang lane: --disable-all resets`n every unseen configure arg to `"no`", so a declaration-default can never`n select the toolset. Force it before the handler runs. */`nPHP_TOOLSET = `"clang`";`ntoolset_option_handle();"
1314
+
$content = $content.Replace($anchor1, $force)
1308
1315
1309
1316
$anchor2 = 'AC_DEFINE("PHP_HAVE_BUILTIN_SMULLL_OVERFLOW", 1, "Define to 1 if the compiler supports ''__builtin_smulll_overflow''.");'
1310
1317
if (-not $content.Contains($anchor2)) {
@@ -1394,8 +1401,13 @@ jobs:
1394
1401
if ($spDir -and (Test-Path "$($spDir.FullName)\perl\bin\perl.exe")) {
0 commit comments