Bug 1326227

Summary: apxs creates symlink to libphp
Product: Red Hat Software Collections Reporter: Ondřej Pták <optak>
Component: httpdAssignee: Luboš Uhliarik <luhliari>
Status: CLOSED WONTFIX QA Contact: BaseOS QE - Apps <qe-baseos-apps>
Severity: low Docs Contact:
Priority: unspecified    
Version: httpd24CC: jorton, rcollet
Target Milestone: ---   
Target Release: 3.4   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-09-26 12:55:33 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
part of reproducer: minimal module none

Description Ondřej Pták 2016-04-12 08:21:36 UTC
Created attachment 1146286 [details]
part of reproducer: minimal module

Description of problem:
Building httpd module with apxs tool generates symlink to php (for example from php55 collection), even if module don't need php.
This is nothing serious, but I can see no reason why apxs should create such symlink.

Version-Release number of selected component (if applicable):
httpd24-httpd-devel-2.4.18-7

How reproducible:
always

Steps to Reproduce:
requires: httpd24-httpd-devel, php55-php
1. ls -l /opt/rh/httpd24/root/usr/lib64/httpd/modules/libphp*
2. apxs -ci mod_dummy.c
3.

Actual results:
1)
-rwxr-xr-x. 1 root root 4353016 Jun 10  2015 /opt/rh/httpd24/root/usr/lib64/httpd/modules/libphp55-php5.so
3)
-rwxr-xr-x. 1 root root 4353016 Jun 10  2015 /opt/rh/httpd24/root/usr/lib64/httpd/modules/libphp55-php5.so
lrwxrwxrwx. 1 root root      16 Apr 12 04:11 /opt/rh/httpd24/root/usr/lib64/httpd/modules/libphp5.so -> libphp55-php5.so

Expected results:
1)
-rwxr-xr-x. 1 root root 4353016 Jun 10  2015 /opt/rh/httpd24/root/usr/lib64/httpd/modules/libphp55-php5.so
3)
-rwxr-xr-x. 1 root root 4353016 Jun 10  2015 /opt/rh/httpd24/root/usr/lib64/httpd/modules/libphp55-php5.so

Additional info:

Comment 1 Joe Orton 2017-03-31 07:16:33 UTC
The reasons are that:

a) apxs runs instdso.sh to install the module DSO, which runs libtool --mode=install, which runs "ldconfig -n" on the directory after copying.

b) libphp*.so is installed with a different filename to the module SONAME.

# readelf -d /opt/rh/httpd24/root/usr/lib64/httpd/modules/librh-php70-php7.so | grep SONAME
 0x000000000000000e (SONAME)             Library soname: [libphp7.so]

... so ldconfig creates a symlink from libphp7.so to librh-php70-php7.so

Remi. I don't suppose that (b) is trivial to fix?

We could probably work around (a) as well, e.g by preventing libtool running ldconfig somehow (not clear how), but it seems low priority, I'm going to defer this.

Comment 2 Joe Orton 2017-03-31 07:17:08 UTC
Actually CC'ing Remi for question in comment 1.

Comment 3 Joe Orton 2017-03-31 07:19:47 UTC
I suppose in theory somebody could depend on the ldconfig behaviour to create the "right" module name to reference in LoadModule.  I'm a bit reluctant to touch this to maybe break something, probably we should fix this in Fedora first and see what happens.

Comment 10 Joe Orton 2019-09-26 12:55:33 UTC
I can't see any way around this without major surgery to libtool to not run ldconfig for modules, which seems correct but overkill.