Skip to content

fix(frankenphp): drop the -mthreads shim now that Go no longer passes the flag - #1280

Merged
crazywhalecc merged 1 commit into
crazywhalecc:v3from
m-this:mfe/fix/drop-mthreads-shim
Nov 2, 2026
Merged

crazywhalecc merged 1 commit into
crazywhalecc:v3from
m-this:mfe/fix/drop-mthreads-shim

Conversation

@m-this

@m-this m-this commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Back in July I added a wrapper around clang in #1201 because Go passed the MinGW-only -mthreads flag to the C compiler for cgo builds, which clang rejects for the MSVC target. #1209 then turned that wrapper into a compiled shim. I also reported the problem upstream as golang/go#80290, and Go 1.27 no longer passes the flag, so the shim has nothing left to strip. It still gets compiled on every build, because the probe only asks clang whether it rejects the flag, and clang still does. This removes MTHREADS_SHIM_C and windowsCgoCompilers(), and sets CC and CXX back to clang.exe and clang++.exe.

  • go-win downloads the latest stable Go (1.27.3 today), and FrankenPHP's go.mod requires go 1.27, so the old behaviour can't come back through a normal build.
  • Tested on windows-latest with PHP 8.5: build and smoke test pass without the shim.

That run sets SPC_CMD_VAR_FRANKENPHP_GO_TAGS=nobrotli, because v3 currently fails on Windows with or without this change: cgo can't find libbrotlicommon through pkg-config (same failure on unmodified v3). That's a separate bug, fixed in #1281.

… the flag

- Go 1.27 stopped passing -mthreads to the C compiler (golang/go#80290)
- go-win fetches the latest stable Go and FrankenPHP's go.mod requires 1.27,
  so no supported build can hit the old behaviour
- CC and CXX are plain clang.exe and clang++.exe again
@crazywhalecc
crazywhalecc merged commit 47643b0 into crazywhalecc:v3 Nov 2, 2026
8 checks passed
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.

3 participants