-
Notifications
You must be signed in to change notification settings - Fork 7.8k
PHP 8.3 build fails with --enable-mbstring
enabled
#11514
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
cc @alexdowad |
same |
Interesting: Apparently you are building PHP for a host which supports AVX/AVX2, and your compiler knows about References for these functions: |
The prototypes for both of these functions are in |
@GrahamCampbell Could you let me know what C compiler is used on this host? CC to @nielsdos in case he has any ideas. |
https://stackoverflow.com/a/32630658/1320374 This is an older answer. But I guess it's still possible that some older compilers don't support these functions. There's a suggested workaround, but we'd still need to know what compiler version to apply it to, and whether it works at all (it uses a different SIMD operation instead). |
|
I can reproduce this with GCC 7.x, but not with GCC 8.x. It seems indeed that GCC 7.x is missing some intrinsics. I'd suggest applying the workaround from the SO post for versions of GCC <= 7.x. I'll check whether the suggested intrinsics are equivalent. This should be fairly easy to do. |
Awesome!! Thank you! |
@nielsdos So I guess it means the entire PHP codebase should avoid the intrinsics which are not implemented in GCC 7. |
Avoid, or maybe polyfill like what I'm going to do here. |
Just checked the equivalence. The solution on SO is equivalent. |
I tweaked the #if check such that the workaround only applies on GCC versions older than 8.0. I tested this with GCC 7.5, 8.4, 9.4, GCC 13.1.1, and Clang 10.0.
@nielsdos 👏 Excellent work, sir. I tip my hat to you. |
Thank you everyone! |
I'm having the same issue (on master), but my gcc version is
|
@SjonHortensius What distro + distro version do you use? And does your CPU support AVX2 ? |
@nielsdos sorry I just realized this runs in a debian chroot with gcc 6.3. The cpu supports avx2. Should that work? |
@SjonHortensius That should work. But I'm not seeing that instrinsic on line 5179: https://github.com/php/php-src/blob/master/ext/mbstring/mbstring.c#L5179 |
Description
A full reproduction is available at brefphp/aws-lambda-layers#91.
PHP Version
8.3.0alpha2
Operating System
AL2 with oniguruma 6.9.8 installed from source.
The text was updated successfully, but these errors were encountered: