yay, build complete. Now what ?

Dennis Clarke dclarke at blastwave.org
Tue Jan 29 19:42:30 PST 2013


> > > set LD_LIBRARY_PATH to $prefix/lib
> > 
> > That there looks like a build error.  One should never, ever, need 
> to specify LD_IBRARY_PATH in order to run a binary in some location 
> like /opt/foo.  The RPATH *should* be in the binary itself. 
> > 
> > Otherwise there is no promise that the binary will operate as 
> expected. 
> 
> fwiw, both debian and fedora discourage the use of RPATH
> 
> http://wiki.debian.org/RpathIssue
> http://fedoraproject.org/wiki/Packaging:Guidelines#Beware_of_Rpath
> 

For no better reason than "because I could" I went back and did a rebuild but this time with an RPATH of /opt/xorg/lib in the output bins : 

aster $ readelf -d /opt/xorg/bin/xlsatoms

Dynamic section at offset 0x1a80 contains 23 entries:
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [libxcb.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x000000000000000f (RPATH)              Library rpath: [/opt/xorg/lib]
 0x000000000000000c (INIT)               0x400a70
 0x000000000000000d (FINI)               0x4016b8
 0x0000000000000004 (HASH)               0x400260
 0x000000006ffffef5 (GNU_HASH)           0x400328
 0x0000000000000005 (STRTAB)             0x400648
 0x0000000000000006 (SYMTAB)             0x400360
 0x000000000000000a (STRSZ)              394 (bytes)
 0x000000000000000b (SYMENT)             24 (bytes)
 0x0000000000000015 (DEBUG)              0x0
 0x0000000000000003 (PLTGOT)             0x601c50
 0x0000000000000002 (PLTRELSZ)           528 (bytes)
 0x0000000000000014 (PLTREL)             RELA
 0x0000000000000017 (JMPREL)             0x400860
 0x0000000000000007 (RELA)               0x400830
 0x0000000000000008 (RELASZ)             48 (bytes)
 0x0000000000000009 (RELAENT)            24 (bytes)
 0x000000006ffffffe (VERNEED)            0x400810
 0x000000006fffffff (VERNEEDNUM)         1
 0x000000006ffffff0 (VERSYM)             0x4007d2
 0x0000000000000000 (NULL)               0x0


The result is that LD_LIBRARY_PATH is not required and there is no way for this bin 
to accidentally pick up a system provided lib.  I guess there may be a way around 
that, but it would mean the user did something on purpose to make that happen. 

aster $ ldd /opt/xorg/bin/xlsatoms
        linux-vdso.so.1 =>  (0x00007fff66b44000)
        libxcb.so.1 => /opt/xorg/lib/libxcb.so.1 (0x00007f0d4ddc8000)
        libc.so.6 => /lib/libc.so.6 (0x00007f0d4da62000)
        libXau.so.6 => /opt/xorg/lib/libXau.so.6 (0x00007f0d4d85e000)
        libXdmcp.so.6 => /opt/xorg/lib/libXdmcp.so.6 (0x00007f0d4d658000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f0d4dff2000)

dc



More information about the xorg mailing list