Skip to content

Build system installs libtool wrappers when using slibtool #13674

Description

@orlitzky

Description

slibtool is a reimplementation of GNU libtool in C. It's fairly mature; for example, plenty of Gentoo users build their entire systems with it.

One place where incompatibilities arise, however, is when the build system uses $LIBTOOL for part of the build/install process, but then switches to some other manual process that (unknowingly) depends on the internals of GNU libtool. When building PHP with LIBTOOL=rlibtool, one such case arises: the following targets use $(LIBTOOL) to build their dependencies, but then switch to $(INSTALL) to install them:

  1. install-cli
  2. install-fpm
  3. install-phpdbg
  4. install-cgi

With GNU libtool, the $(INSTALL) command does actually install the executable. slibtool however places its wrapper script in that location, placing the true executable in a .libs/ subdirectory instead. This leads to the wrapper scripts being installed when LIBTOOL=rlibtool was used for the build. For example,

$ head ~/tmp/php/usr/bin/php
#!/bin/sh
# libtool compatible executable wrapper
# Generated by rlibtool (slibtool 0.5.35)
# [commit reference: unknown]

if [ -z "$LD_LIBRARY_PATH" ]; then
	DL_PATH=
	COLON=
	LCOLON=
else

I think this can be fixed by using $(LIBTOOL) --mode=install $(INSTALL) rather than just $(INSTALL) to install these programs. It may also be more correct to install opcache and the libphp from the embed SAPI in the same manner, though nobody has complained about those not working yet.

PHP Version

git HEAD

Operating System

No response

Activity

  1. orlitzky commented on Mar 11, 2024

    @orlitzky
    ContributorAuthor

    I forgot to mention: to reproduce, install slibtool and then use make LIBTOOL=rlibtool and make LIBTOOL=rlibtool install to build/install PHP.

  2. petk commented on Mar 11, 2024

    @petk
    Member

    I think we can do that, yes. It's not exactly synced indeed. I'll check it out. Libtool install mode has some side effects in those .la text files and updates them a bit...

  3. midipix commented on Aug 8, 2024

    @midipix

    Hi! Just had my attention drawn to this, a couple of quick comments:

    • to properly handle recursive make, the command should actually be make LIBTOOL=rlibtool MAKE="make LIBTOOL=rlibtool"

    • using --mode=install rather than the non-[s]libtool install scripts is indeed the correct and right thing to do.

    I hope that helps!

  4. added a commit that references this issue on Jan 3, 2026
    9f2172d
  5. added a commit that references this issue on Feb 23, 2026
    db6cca2
  6. orlitzky commented on Feb 23, 2026

    @orlitzky
    ContributorAuthor

    Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions