Skip to content

Conversation

@NattyNarwhal
Copy link
Member

The version of libtool we're using is old enough to vote, and occasionally issues crop up related to it (i.e. this should fix GH-17310 incidentally). Update it to the latest version from upstream (serial 63 from 2.5.4). I don't believe we carry any patches that don't just replicate fixes in newer versions, so it should be OK to just use upstream's version. Newer libtool has more files that we have to include manually if not using aclocal, and some macro names were changed, so adapt to this.

Tested on linux/ppc64 and macos/arm64, with autoconf 2.72. I'm a little worried about the impact this might have on other platforms since this is a major bump. In particular, AIX might be turbulent, since library naming conventions changed a lot in libtool.

This now comes with some extra files that libtool seems to need;
normally aclocal handles this for you, but we don't use aclocal.
@jordikroon
Copy link
Contributor

Nice work! I can't judge if this will give other side effect. But I can confirm that this will resolve the $PATH quotation issue.

If merged PR #21065 will be obsolete.

@iluuu1994
Copy link
Member

Previous attempt: GH-13476. /cc @petk

@petk
Copy link
Member

petk commented Jan 29, 2026

Hello, we can try updating this, yes.

In my PR (#13476) I've tried to avoid having multiple libtool m4 files for simplicity - there they are merged into a single m4 file. Otherwise, scripts/phpize.m4 and scripts/phpize.in would also need to be adjusted for this a bit further. And, probably having some basic updating script for libtool would be useful probably here.

Otherwise, another thing we can try here is to remove all libtool related files in php-src and use the libtoolize tool, which kind of comes with standard Autotools build system. The reason libtool was bundled into PHP was that it was once a very buggy tool and there were constant issues on some systems libtoolize approach didn't work. But this might be very different story today.

@NattyNarwhal
Copy link
Member Author

Otherwise, scripts/phpize.m4 and scripts/phpize.in would also need to be adjusted for this a bit further.

Did it this way, since I want to keep closer to libtool upstream.

And, probably having some basic updating script for libtool would be useful probably here.

Working on a script to update autotools stuff. WRT last paragraph. if we do want to stop vendoring libtool, said script would be useful as a basis for how we want to invoke libtoolize.

@petk
Copy link
Member

petk commented Jan 30, 2026

Can you please also mention in the final commit message some of these:

The libtool 1.5.26 is bundled with PHP since the very early days of the
Autotools build system to ease the building process and avoid additional
dependency on the system Libtool. This updates the bundled libtool to
2.5.4 version.

Fixes and implementations:

- Fixed race conditions when building PHP in parallel ("cannot create
  .libs" warnings).
- Implements request #70374 (Update libtool.m4)

Changes:
- On macOS linker now uses -undefined dynamic_lookup flag for shared
  extensions and shared embed SAPI (libphp) instead of older
  '-undefined suppress -flat_namespace' combination.

And please rename the scripts/dev/update-libtool to scripts/dev/update-libtool.sh. Those config.guess and config.sub updates aren't exactly part of libtool. I'm not sure this belongs here.

@petk
Copy link
Member

petk commented Jan 30, 2026

Here, I'd suggest to also recheck if these two code snippets AC_PROVIDE_IFELSE([PHP_REQUIRE_CXX], [], [ are still relevant for libtool 2.5.4+ in phpize.m4 and configure.ac files. Last time I wasn't able to reproduce this issue and I think that could be removed. But I'm not sure.

AC_PREREQ([2.68])
AC_INIT([PHP],[8.6.0-dev],[https://github.com/php/php-src/issues],[php],[https://www.php.net])
AC_CONFIG_SRCDIR([main/php_version.h])
AC_CONFIG_MACRO_DIRS([build])
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure about this anymore, but the last time I was checking this macro, this would require automake (additional build dependency) and could break some builds.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, this is new in Autoconf 2.70+. In any case this for now at least shouldn't be here yet.

Sign up for free to 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.

./configure producing errors on macOS

4 participants