Skip to content

Fix compilation errors up until Clang 21.0 - #22141

Merged
kocsismate merged 3 commits into
php:masterfrom
kocsismate:clang21-fixes
May 28, 2026
Merged

Fix compilation errors up until Clang 21.0#22141
kocsismate merged 3 commits into
php:masterfrom
kocsismate:clang21-fixes

Conversation

@kocsismate

@kocsismatekocsismate commented May 24, 2026

Copy link
Copy Markdown
Member
  • The "pclmul" and "cldemote" CPU features are both only available on x86, and the __builtin_cpu_supports() checks in question fail on Clang, so they shouldn't even be tried to be run (similar fixes before: Fix build on Apple Clang 17+ #18629).
  • The res.h file in Lexbor contains some unterminated strings (e.g.
    {0x76, {0}, 0, 367, 0, 368}, {0x3b, "\xe2\x89\xaa\xe2\x83\x92", 6, 0, 0, 0},
    ), and a new compiler warning fails by default because of them. This needs to be suppressed.

- The "pclmul" and "cldemote" CPU features are both only available on x86-64, and the __builtin_cpu_supports() checks in question fail on Clang, so they shouldn't even be tried to be run (similar fixes before: php#18629).
- The res.h file in Lexbor contains some unterminated strings (e.g. https://github.com/php/php-src/blob/d58d3d2fd6c1cfa7e3489a9859eda63086af762f/ext/lexbor/lexbor/html/tokenizer/res.h#L203), and a new compiler warning fails by default because of them. This needs to be suppressed.
@ndossche

Copy link
Copy Markdown
Member

Changes in Zend header are fine.
Compile fails because the warning flag you added for Lexbor may be unknown by the compiler.

@kocsismate

Copy link
Copy Markdown
MemberAuthor

@ndossche I had to push a small fix for 32-bit after your review. Could you please recheck it?

@kocsismate
kocsismate merged commit a7aacec into php:masterMay 28, 2026
19 checks passed
@kocsismate
kocsismate deleted the clang21-fixes branch May 28, 2026 18:18
Sign up for freeto 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

@kocsismate@ndossche