hashdist / hashstack-old

Obsolete repository, use "hashstack" instead
3 stars 4 forks source link

Write a script to check ldd paths in all .so libraries and executables #74

Closed certik closed 11 years ago

certik commented 11 years ago

The script will go over all .so and executable files in the opt directory, call ldd on them and check for each that:

$ ldd opt/lapack/7fv5/lib/liblapack.so 
    linux-vdso.so.1 =>  (0x00007fffa61ca000)
    libblas.so => not found
    libgfortran.so.3 => /usr/lib64/libgfortran.so.3 (0x00002b10183eb000)
    libm.so.6 => /lib64/libm.so.6 (0x00002b10186dd000)
    libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00002b1018961000)
    libc.so.6 => /lib64/libc.so.6 (0x00002b1018b78000)
    /lib64/ld-linux-x86-64.so.2 (0x0000003e90200000)
$ ldd opt/lapack/7fv5/lib/liblapack.so 
    linux-vdso.so.1 =>  (0x00007fff8c0ad000)
    libblas.so => /usr/lib/libblas.so (0x00007fee12e15000)
    libgfortran.so.3 => /usr/lib/x86_64-linux-gnu/libgfortran.so.3 (0x00007fee12afe000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fee12801000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fee125eb000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fee1222c000)
    libquadmath.so.0 => /usr/lib/x86_64-linux-gnu/libquadmath.so.0 (0x00007fee11ff5000)
    /lib64/ld-linux-x86-64.so.2 (0x00007fee13bbb000)

So we should probably have a list of allowed systemwide libraries (linux-vdso.so, libgfortran.so, libm.so, ...) and everything else needs to link to our own version.

We should run this script (by hand) on all platforms to check that things are linked properly. The reason is that the build systems many times behave differently if they "see" systemwide library or not, so it is not enough to check this on one machine.

dagss commented 11 years ago

This should probably be part of https://github.com/hashdist/hashdist/issues/13 ; i.e., the RPATH post-processing checks this. For now this could be all it does.

Or do you mean something that checks after you move binaries from one machine to the next?

certik commented 11 years ago

See the PR #75 which implements what I needed. It is a bit fragile to be run automatically though.

Sent from my mobile phone. On Jun 13, 2013 2:31 AM, "Dag Sverre Seljebotn" notifications@github.com wrote:

This should probably be part of hashdist/hashdist#13https://github.com/hashdist/hashdist/issues/13; i.e., the RPATH post-processing checks this. For now this could be all it does.

Or do you mean something that checks after you move binaries from one machine to the next?

— Reply to this email directly or view it on GitHubhttps://github.com/hashdist/python-hpcmp2/issues/74#issuecomment-19378618 .