string substitution removes part of path when linking versioned shared libraries

Reported by Jason Abernathy on 2012-03-09
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
EPICS Base
Undecided
Janet B. Anderson

Bug Description

Hello!

I am building an EPICS extension which has the shared library version inside of it's directory name.

The full path is:

~/E-Linac/Packages/advsplugins-2.20120308

and the shared library version is 2:

SHRLIB_VERSION = 2

Once the versioned library was built the build system tried to create a symbolic link:

ln -s libNDPluginGeometricTransform.so.2 /home/jabrnthy/E-Linac/Packages/advsplugins-20120308/debian/tmp/usr/lib/linux-x86/libNDPluginGeometricTransform.so
ln: creating symbolic link `/home/jabrnthy/E-Linac/Packages/advsplugins-20120308/debian/tmp/usr/lib/linux-x86/libNDPluginGeometricTransform.so': No such file or directory

The error occurred because the linking command in RULES_BUILD removes all substrings of the form ".$(SHRLIB_VERSION)" which, in this case, also removes the ".2" from the directory name.

To fix this problem I changed the two linking commands in RULES_BUILD from

line 389: ln -s $< $(subst .$(SHRLIB_VERSION),,$@)
line 412: ln -s $< $(subst .$(LOADABLE_SHRLIB_VERSION),,$@)

to

line 389: ln -s $< $(@:.$(SHRLIB_VERSION)=)
line 412: ln -s $< $(@:.$(LOADABLE_SHRLIB_VERSION)=)

This is a greedier substitution which will only remove the last occurrence of the substring.

Related branches

Andrew Johnson (anj) wrote :

Janet committed the fix, thanks Jason!

Changed in epics-base:
assignee: nobody → Janet B. Anderson (jba-aps)
status: New → Fix Committed
Andrew Johnson (anj) wrote :

Fix committed in 3.14.12.3 release.

Changed in epics-base:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers