[M3devel] how to find dependent .so files?

Jay jay.krell at cornell.edu
Tue Apr 28 10:03:13 CEST 2009


Normally we have:
 
 /usr/local/cm3/bin/someexe 
 /usr/local/cm3/lib/libfoo.so symlink to ../pkg/foo/target/libfoo.so 
 /usr/local/cm3/lib/libbar.so symlink to ../pkg/bar/target/libbar.so 
 
Linking from someexe to $ORIGIN/../lib works, ok.
But from libfoo to libbar requires $ORIGIN/../../../lib.
  or $ORIGIN/../../bar/target.
 
Currently on FreeBSD I set the runpath to
 $ORIGIN/../lib:$ORIGIN/../../../lib 
 
or maybe
 $ORIGIN/../lib:$ORIGIN/../../lib:$ORIGIN/../../../lib
 
I want to claim this is working, but there are unresolved Tinderbox problems.
Let's assume for now it does.
 
I find something as long as "../../.." starts feeling dangerous.
It could land somewhere unrelated.
I'd prefer a shorter runpath like just $ORIGIN/../lib.
 
 
To fix this I propose one of two changes.
 
 
1) Reverse the symlink relationship:
 replace 
  /usr/local/cm3/lib/libfoo.so symlink to ../pkg/foo/target/libfoo.so 
 with 
  /usr/local/cm3/lib/libfoo.so real file  
  /usr/local/cm3/pkg/foo/target/libfoo.so symlink to previous 
 
 
This is kind of model changing.
There is a package store and all files do really ship into it.
Shorter more convenient paths are a higher level construct.
I guess. It's a nice model, kind of, but also inconvenient.
 
 
or
2)
  Make them hardlinks. 
  Does that work? 
  It seems less model changing. Sort of. It's really
  extremely similar to previous, except that the package
  store remains rather self contained.
 
Meanwhile, shipped non-public binaries:
  /usr/local/cm3/pkg/someexe/target/someexe
 
would would not work.
 I think they exist though, e.g. obliq. 
 
 Maybe ship them to /usr/local/cm3/lib? 
 
 
NT386 isn't relevant, so go ahead apply symlinks/hardlinks to the problem pretty arbitrarily I think.
  There all the .so files (.dll) are in \cm3\bin next to the .exes.
  The searchpath for .dlls and .exes is roughly the same.
  NTFS has always had hardlinks.
  NTFS as of Vista has symlinks.
  FAT does not have either.
  Cygwin supports symlinks anywhere via higher level mechanisms (either its own files   or usermode Explorer "shortcuts" (think of Mac "aliases")).
 
 
 - Jay


More information about the M3devel mailing list