Skip to content

fix phpembed.lib getting LTCG symbols, which frankenphp can't link - #26107

Open
henderkes wants to merge 2 commits into
php:PHP-8.6from
henderkes:fix/win-ltcg-embed
Open

henderkes wants to merge 2 commits into
php:PHP-8.6from
henderkes:fix/win-ltcg-embed

Conversation

@henderkes

Copy link
Copy Markdown
Contributor

to fix php/frankenphp#2897
see: https://github.com/php/frankenphp/blob/main/.github/workflows/windows.yaml#L150

The LTCG objects are fine in the .exe, but in the .lib they mean that every embedder would have to use the exact VS version of the toolchain the releases are built with, which frankenphp can't as Go only works with mingw-gcc or clang-cl.

Additionally readline callbacks hardcoded php.exe. For frankenphp it would be enough to GetModuleHandle(NULL);, but here we read the module that contains sapi_module.activate in case someone embeds phpembed.lib in their own dll.

@shivammathur

@shivammathur

Copy link
Copy Markdown
Member

@henderkes

Please check these two cases on Windows.

  • Does php -a open the shell with readline loaded when an extension hooks sapi_module.activate?
  • Does piping a script into a CLI built without libedit work in a new console when readline is available at runtime?

@henderkes

henderkes commented Dec 6, 2026 •

Copy link
Copy Markdown
Contributor Author

@henderkes

Please check these two cases on Windows.

  • Does php -a open the shell with readline loaded when an extension hooks sapi_module.activate?

If hooked in minit yes. If hooked on dll load I assume it would fail. Let me think about how to fix this... could I just scan for sapi name instead with the assumption nobody overwrites that? Edit: I'm not sure that's a good idea, I know swoole or micro sapi do some fiddling.

  • Does piping a script into a CLI built without libedit work in a new console when readline is available at runtime?

Oh no, I think I broke that. I'll just pass HAVE_LIBEDIT to embed too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants