[Ffmpeg-devel] [patch] make SONAME encoding optional

Jacob Meuser jakemsr
Sun Dec 18 07:09:38 CET 2005


On Sun, Dec 18, 2005 at 06:14:59AM +0100, Luca Barbato wrote:
> Jacob Meuser wrote:
> >the SONAME stuff is wrong for OpenBSD.  SONAMES should have both major
> >and minor numbers there.  but in general, SONAMES aren't used in OpenBSD.
> 
> That makes no sense. You use just major since just major version changes 
> mean that the abi changes. I wonder why they aren't used or used that way.

SONAME is generally thought of as uncecessary complication by OpenBSD devs.

$ find /usr/lib -name \*.so\* | wc -l
        66
$ find /usr/lib -name \*.so\* | xargs readelf -a | grep SONAME
 0x000000000000000e (SONAME)             Library soname: [libstdc++.so.40.0]
$ 

I'm not sure why libstdc++ has SONAME as opposed to the other system libs.

also, libtool does not encode SONAME on OpenBSD.

$ find /usr/local/lib -name \*.so\* | wc -l
       183
$ find /usr/local/lib -name \*.so\* | xargs readelf -a | grep SONAME
 0x000000000000000e (SONAME)             Library soname: [libxvidcore.so.4]
 0x000000000000000e (SONAME)             Library soname: [libfltk.so.4.0]
 0x000000000000000e (SONAME)             Library soname: [libfltk_forms.so.4.0]
 0x000000000000000e (SONAME)             Library soname: [libfltk_gl.so.4.0]
 0x000000000000000e (SONAME)             Library soname: [libfltk_images.so.4.0]
$ 

hmmm, looks like xvidcore needs to be fixed.

anyway, it's mostly a matter of simplification.  you can see the major
and minor versions in the name of the library itself, no need to go
digging into the binary.

also,

$ find /usr/lib -name \*.so\* -a -type l -ls
$ find /usr/local/lib -name \*.so\* -a -type l -ls
 45798    0 lrwxr-xr-x    1 root     wheel          16 Dec  4 14:47 /usr/local/lib/libdb.so.4.2 -> db4/libdb.so.4.2
 45799    0 lrwxr-xr-x    1 root     wheel          20 Dec  4 14:47 /usr/local/lib/libdb_cxx.so.4.2 -> db4/libdb_cxx.so.4.2
 46354    0 lrwxr-xr-x    1 root     wheel          15 Dec  4 14:55 /usr/local/lib/libgif.so.5.4 -> libungif.so.5.4
$ 

no symlinks for libfoo.so -> libfoo.so.X.X either.

so, it's very clean and easy to see what's going on.  also makes it
easy to have multiple library versions, since there won't be any
filename clash; you can only have one libfoo.so.

of course, libraries MUST use proper "Sun style" versioning in this
scheme, but it seems most library authors do this anyway.  of course
there are many out there that don't use any versioning, be it SONAME
or the library name itself.  in such cases, the port maintainers
have to add this themselves.  FreeBSD has a bit about this in their
developer's handbook:

http://www.freebsd.org/doc/en_US.ISO8859-1/books/developers-handbook/policies-shlib.html

> >
> >patch below adds a --disable-sonames option to disable SONAME encoding.
> >
> >I figure this is more flexible than adding OS specific stuff.
> >
> 
> Right
> 
> >the patch also changes the libpostproc Makefile to use LIBVERSION
> >in SHFLAGS like the other library Makefiles do.
> >
> 
> Right it could conform the other Makefiles.

there are some other things in the Makefiles that could be more
consistent.  for example,

libavformat/Makefile
@@ -114,8 +114,8 @@ ifeq ($(CONFIG_WIN32),yes)
 	install $(INSTALLSTRIP) -m 755 $(SLIBNAME) "$(prefix)"
 else
 	install -d $(libdir)
	install $(INSTALLSTRIP) -m 755 $(SLIBNAME) $(libdir)/$(SLIBPREF)avformat-$(VERSION)$(SLIBSUF)
	ln -sf $(SLIBPREF)avformat-$(VERSION)$(SLIBSUF) $(libdir)/$(SLIBNAME)
 	$(LDCONFIG) || true
 endif
 else


libavutil/Makefile
@@ -65,8 +65,8 @@ ifeq ($(CONFIG_WIN32),yes)
 	install $(INSTALLSTRIP) -m 755 $(SLIBNAME) "$(prefix)"
 else
 	install -d $(libdir)
	install $(INSTALLSTRIP) -m 755 $(SLIBNAME) $(libdir)/libavutil-$(VERSION)$(SLIBSUF)
	ln -sf libavutil-$(VERSION)$(SLIBSUF) $(libdir)/$(SLIBNAME)
 	$(LDCONFIG) || true
 endif
 else


libavformat is using SLIBPREF, while libavutil hardcodes 'lib'.

-- 
<jakemsr at jakemsr.com>





More information about the ffmpeg-devel mailing list