Re: [AVFS] automake status report

Ralf Hoffmann <[email protected]> Fri, 10 Jun 2005 14:00:12 +0200
Newsgroups gmane.comp.file-systems.avfs.user
Message-ID <[email protected]>
Hi,

During some final testing I encountered a serious problem with symbol
collision in the shared library which prevented me from commiting my
changes. AVFS uses an own version of zlib but my application also uses
the (system wide) zlib so when the dynamic loader loads the avfs and
zlib library there are duplicate symbols. Unfortunately the dynamic
loader doesn't print any error but obviously choose the wrong symbols.
At the end I got weird errors in valgrind showing that something goes
wrong although the app doesn't crash.

After testing I found that the avfs-0.9.3 build system uses the option
-version-script with a symbol map which defines virt_ symbols global and
the rest local. However this is not portable and libtool doesn't offer a
similar option. So I used -export-symbol-regex virt_.* which only
exports the virt_ symbols. But this is not the same as exporting the
other symbols explicitly as local symbols.

After googling around I confirmed my assumptions so I have two options.
1.Force the use of -version-script which only works with GNU ld and the
  solaris ld.
2.Renaming the zlib symbols. Fortunatly the zlib already has some code
  for this. I tested this and it works fine.
  Symbol renaming in bzlib (which offers a BZ_API macro to do this) and
  libneon is also required.

I prefer the second option even it's more work. A static library doesn't
contain local or global symbol definition but I'm not sure what happens
when one links a static avfs lib and a static zlib into a program.
Symbol collisions could appear the same way.

I will ask on the libtool mailing list about this problem but I don't
expect a portable solution to this.

Best Regards,

Ralf Hoffmann

-- 
Homepage: http://www.boomerangsworld.de
E-Mail: Ralf Hoffmann <[email protected]>
  english or german




-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.  How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.  
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20