Opened 5 years ago

Closed 4 months ago

#59439 closed defect (fixed)

php is overlinked to icu and libxml2's other dependencies

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.6.2
Keywords: Cc:
Port: php

Description

Because php73 and earlier use xml2-config to locate libxml2, each of the php subports that use libxml2 are overlinked to libxml2's dependencies. php73 and earlier should be patched to use pkg-config to locate libxml2 instead. It looks like upstream already fixed this problem for php74; maybe we can backport it to earlier versions.

Change History (8)

comment:1 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Backporting that is a little tricky because of unrelated whitespace changes that were made to the affected files right before.

comment:2 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Has duplicate #60980.

comment:3 Changed 4 years ago by blair (Blair Zajac)

In the mean time, since the change may never be backported to older PHP versions and may not be worth the effort, can all but php74* add port:icu as a dependency? This would make it easier to find those ports to revbump when icu is upgraded.

comment:4 Changed 4 years ago by jmroot (Joshua Root)

Adding --dynamic to the xml2-config call looks like it would be a pretty simple patch (now that that's an option).

comment:5 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Yes, that is what I began to do a few months ago but I have not yet completed the work. There are several PHP modules, in addition to PHP itself, that are affected so I need to identify and revbump each of them.

comment:6 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

What had delayed me in resolving this issue was that although I could patch php to use xml2-config --libs --dynamic to fix the overlinking in places where it uses libxml2 directly, there are also places where php uses libxslt and although I could patch php to use xslt-config --libs --dynamic it is nonfunctional and does not resolve the overlinking and the developers of libxslt do not know how to fix it; see https://gitlab.gnome.org/GNOME/libxslt/-/issues/36.

comment:7 Changed 16 months ago by ryandesign (Ryan Carsten Schmidt)

libxslt was changed in version 1.1.36. Whereas before its xslt-config output was correct for static linking but not for dynamic linking when both kinds of libraries are installed, it is now the other way around: correct for dynamic linking and incorrect for static linking. The developer of libxslt doesn't know how to make it work for both cases and intends to bypass the problem by removing the ability for libxslt to install both kinds of libraries at once, despite my objections to that course of action.

However now that xslt-config does the right thing for our use case, at least for the moment, that should make it possible to fix php 7.3 and earlier the way I want to.

comment:8 Changed 4 months ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: assignedclosed

In 5f9d7645b3296dc0643735a28a0074fa74b82f36/macports-ports (master):

php: Fix overlinking with libxml2

Closes: #59439

Note: See TracTickets for help on using tickets.