-
Notifications
You must be signed in to change notification settings - Fork 3
Fix libxcrypt algorithm detection in config.m4 #1
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
Conversation
Using using LDFLAGS should work (but there is an error mixing CFLAGS there) Please try after e7a9d75 |
If fix is OK, I will release a RC2 shortly |
8ff0926
to
586d449
Compare
586d449
to
3a848da
Compare
@remicollet If you're interested in CI for GitHub Actions, I can create a separate PR for that :) |
Please post config.log (failing part with build sources and command) |
@remicollet
|
No, it still doesn't seem to work. The
|
It worked correctly with only the following modifications. Does this cause unintended behavior in EL?
|
I'd like to understand why command is bad for you and OK for me
Should be
P.S. and adding both LDFLAGS and LIBS add the library twice... |
Can you tell us about your environment so I can investigate? Is it due to the compiler version...? I ran CI. For now, sha512 and yescrypt are disabled on Debian / Alpine due to similar issues. |
This is probably due to the gcc version. It works fine in clang. NG:
|
I only use GCC (8.5, 11.5, 13.3, 14.2) I run the build on Fedora 39, 40, 41 and RHEL 8, 9 against PHP 8.0 to 8.4 |
I've confirmed that using https://github.com/zeriyoshi/php-xpass-tester EL8 / EL9 result: https://github.com/zeriyoshi/php-xpass-tester/actions/runs/10643794080 With this configuration, I believe it will work correctly on both Debian and Alpine Linux. |
config.m4
Outdated
@@ -12,15 +12,15 @@ if test "$PHP_XPASS" != "no"; then | |||
PHP_EVAL_LIBLINE([$LIBXCRYPT_LIBS], [XPASS_SHARED_LIBADD]) | |||
|
|||
old_CFLAGS=$CFLAGS; CFLAGS="$CFLAGS $LIBXCRYPT_CFLAGS" | |||
old_LDFLAGS=$LDFLAGS; LDFLAGS="$LIBXCRYPT_LIBS $LDFLAGS" | |||
old_LDFLAGS=$LDFLAGS; LDFLAGS="$LDFLAGS" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please drop this no-effect line
This is quite strange, in php-src various ext use |
@petk, perhaps you can help here with |
Hm, yes it seems that LIBS is a better place to append the $LIBXCRYPT_LIBS.
Yes, the changes in the PR are ok. And those LDFLAGS adjustments are redundant as already noted. |
When building: ./configure --with-iconv=shared,/path/to/libiconv the iconv couldn't be found due to linker error Autoconf places LDFLAGS before the conftest.c file in the test compile command and LIBS after it. GCC also requires this. Similar issue discovered at remicollet/php-xpass#1
@remicollet @petk |
Squashed, amended and merged in 97bfb67 Thanks a lot |
When building iconv as shared and with external library (for example, libiconv): ./configure --with-iconv=shared,/path/to/libiconv the iconv couldn't be found due to a linker error. Autoconf places LDFLAGS before the conftest.c file in the test compile command and LIBS after it. GCC also requires this: gcc -L... conftest.c -liconv Similar issue discovered at remicollet/php-xpass#1
The current config.m4 appears to be unable to properly detect libxcrypt algorithms.
I believe the environment variable that should be set is
LIBS
, notLDFLAGS
.I tested it on Debian using the following Dockerfile:
I discovered this while making it testable in the PHP Extension skeleton I'm creating.
https://github.com/zeriyoshi/pskel
It can run tests on Debian / Alpine / Windows using GitHub Actions and calculate coverage.
If you're interested in this skeleton, please let me know :)