Skip to content
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

Fix error linking with pthread #469

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

TysonAndre
Copy link
Contributor

Noticed in php 8.3-dev configured with --disable-all

The "-pthread" flag wasn't actually getting used in the makefile.

config.m4 Outdated
@@ -122,7 +122,7 @@ if test "$PHP_APCU" != "no"; then
}
]])],[ dnl -Success-
APCU_CFLAGS="-D_GNU_SOURCE -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
PHP_ADD_LIBRARY(pthread)
PHP_ADD_LIBRARY(pthread,, APCU_SHARED_LIBADD)
PHP_LDFLAGS="$PHP_LDFLAGS -lpthread"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, do we need the PHP_LDFLAGS adjustment? As I understand it, if apcu is not build shared PHP_ADD_LIBRARY should already be adding it to LIBS.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm assuming not, and can't think of any reason to have this, but not 100% sure and haven't checked back to 7.0. It gets added to the Makefile but nothing in the Makefile uses PHP_LDFLAGS.

Even when compiling apcu statically this still wouldn't affect other modules

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case I think we should drop these lines and see if anyone complains...

Noticed in php 8.3-dev configured with --disable-all

The "-pthread" flag wasn't actually getting used in the makefile.
@TysonAndre
Copy link
Contributor Author

php/php-src@ea372e7 is also relevant - neither the old nor new version work in php < 7.4.14.

A possible alternative is to manually concatenate the string instead

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.

2 participants