[OpenAFS-devel] Implement libafssetpag

Russ Allbery rra@stanford.edu
Fri, 13 May 2005 01:35:55 -0700


I just posted a patch to build libafssetpag to openafs-bugs.  The ticket
number is #18745 -- see it for the patch.

Here are the notes:

This patch adds a libafssetpag shared library, containing only the lsetpag
function.

Some notes:

 * I split off from afssyscalls.c the C support code required to do
   system calls (glue.c) and the setpag call (setpag.c) so that I could
   build a shared library without all of the other stuff in afssyscalls.c.

 * The PIC rules are ugly as sin to avoid having to do the hack that
   shlibafsauthent/libafsauthent/etc. did of copying all the makefile
   logic into another makefile somewhere else where it can diverge.  This
   avoids that, while still being incredibly ugly.  I don't know of a
   good solution shy of libtool that still works with parallel make; there
   are other good solutions that work if you don't care about parallel
   make.

   These rules, while nasty, do work and aren't too complex.

 * Proper symbol export control should be exercised for Linux, AIX, and
   Solaris, but I haven't tested AIX and Solaris and may have missed
   something.

 * A proper SONAME is set for Linux and Solaris, and the correct links are
   created on install and dest.  I haven't completely tested this at the
   moment because cvs head doesn't appear to compile, but if there are any
   problems, they're minor ones.

 * I added symbol versioning for Solaris and Linux just on general
   principles.  This way, if one ever wants to add lsetpag with an
   argument or something, we can maintain backward compatibility at least
   on those two platforms without an so bump.

Tested on Linux, verified that there are no text relocations in the
resulting shared library, and verified that symbol versioning happened
properly.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>