[Xorp-users] Installed XORP image layout; rtld linker origin

Bruce Simpson bms at incunabulum.net
Thu Nov 26 12:17:45 PST 2009


I'd propose we bite the bullet for 1.7 and adopt a similar installation 
layout to that of the commercial SVN tree.
That is, all shared libraries go in $libdir, which is usually 
$DESTDIR/lib. This makes life much easier across the tree.

At the moment, most of the original XORP regression test suite builds, 
but not the BGP harness. This is good enough for most.

Fortunately, for benchmarking Thrift changes, I can get away with just 
using the RIB and libxipc itself, but for hard science on the critical 
BGP-RIB-FEA path, I'd need to go back in and fix that harness.

But I am using shared library builds, mostly to save on disk space and 
CPU on link during hacking. Regressions don't work for shared=true; rtld 
can't find the XORP libraries.  The tests build, but cannot be run. They 
aren't intended to be installed, but the RPATH still needs to get fixed.

In the Automake era, libtool handled all this for us. SCons does not use 
libtool, which is a blessing, and also a curse. libtool will integrate 
with Automake's 'gmake check' facility, so Automake test primaries will 
be invoked with the correct RPATH. The cost of the feature is that a 
shell script is generated for every dynamically-linked executable.

I'm working on a patch to deal with this situation now, and have just 
checked in the first part of it.

The SCons issue tracker has more information on how RPATH is supposed to 
work, here:
    http://scons.tigris.org/issues/show_bug.cgi?id=1644

Rev 11583:
%%%
When allowing the user to override CFLAGS/CXXFLAGS/LINKFLAGS on
the command line, don't obliterate what's already there.

SCons stashes some useful defaults in there, and RPATH support
breaks if you clobber LINKFLAGS in this way. This isn't a bug in
SCons, rather how we use it.

We need RPATH working to resolve some issues with:
 1) installing shared libraries in a retargettable system location (i.e.
    by using $ORIGIN relative paths in ELF rtld),
 2) running the regression tests in a non-cross, shared-library build.

Currently, we need to relink every time we change DESTDIR.

Don't forget that the RPATH variable needs to see expanded paths,
as they are passed to the linker unescaped. For $ORIGIN, each SConscript
will need to compute its own relative paths, depending on which directory
layout we're using in the stage tree or installation tree. Use
Python 2.6 os.path.relpath() for this.

While we're here, allow the user to override the AutoTest() builder's
default behaviour to ignore errors during a 'scons check' run,
by passing 'ignore_check_errors=true' on the command line.
%%%

cheers,
BMS



More information about the Xorp-users mailing list