Source: freetds
Version: 0.91-4
Severity: important

Dear Maintainer,

Any programme linked against tdsodbc has problems at runtime, with the error message "error while loading shared libraries: libtdsodbc.so.0: cannot open shared object file: No such file or directory"

See attached linkissue.txt and linkissue.c for a simple way to reproduce.

I believe the error is related to this part of debian/rules in the freetds source package:

override_dh_auto_install:
         dh_auto_install
         mkdir -p $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/odbc
mv $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libtdsodbc.so.0.0.0 \
 $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/odbc/libtdsodbc.so
rm -f $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libtdsodbc*


This override renames libtdsodbc.so.0.0.0 to libtdsodbc.so. However when the source is built (see attached sourcedirlisting.txt) it links libtdsodbc.so and libtdsodbc.so.0 to libtdsodbc.so.0.0.0, so as the package gets built we've lost libtdsodbc.so.0 and this is what gets complained about when I attempt to link to this library.

I'm not sure why dh_auto_install fails to do the right thing and needs to be overridden, but I suspect the solution is for the override to preserve the links instead of renaming files.


-- System Information:
Distributor ID: Debian
Description:    Debian GNU/Linux testing (jessie)
Release:        testing
Codename:       jessie
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.2.0-39-generic (SMP w/2 CPU cores)
Locale: LANG=en_GB.utf8, LC_CTYPE=en_GB.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash


int main(int argc, char *argv[])
{
  
}

$ cat linkissue.c
int main(int argc, char *argv[])
{
    
}
$ gcc linkissue.c -o linkissue -L /usr/lib/x86_64-linux-gnu/odbc/ -ltdsodbc
$./linkissue
./linkissue: error while loading shared libraries: libtdsodbc.so.0: cannot open 
shared object file: No such file or directory

lrwxrwxrwx 1 frankster frankster      19 Oct  7 11:04 libtdsodbc.so -> 
libtdsodbc.so.0.0.0
lrwxrwxrwx 1 frankster frankster      19 Oct  7 11:04 libtdsodbc.so.0 -> 
libtdsodbc.so.0.0.0
-rwxrwxr-x 1 frankster frankster 1544061 Oct  7 11:04 libtdsodbc.so.0.0.0

Reply via email to