summaryrefslogtreecommitdiffstats
path: root/README
diff options
context:
space:
mode:
authorTuomas Tynkkynen <tuomas@tuxera.com>2016-06-03 21:25:02 (GMT)
committerTuomas Tynkkynen <tuomas@tuxera.com>2016-06-03 21:25:02 (GMT)
commit48143414941d91016efca2b0ef6f32475d6eaa75 (patch)
treeb1348f8591c5f723404811adfdceba8df12c3616 /README
parent2e3fdc2030c75c19df6fc2924083cfad53856562 (diff)
downloadpatchelf-48143414941d91016efca2b0ef6f32475d6eaa75.zip
patchelf-48143414941d91016efca2b0ef6f32475d6eaa75.tar.gz
patchelf-48143414941d91016efca2b0ef6f32475d6eaa75.tar.bz2
Add '--allowed-rpath-prefixes' option to '--shrink-rpath'
Fixes #97. In essence, the problem is that some packages in Nixpkgs have RPATHs pointing to both $NIX_BUILD_TOP and $out, e.g.: /tmp/nix-build-openldap-2.4.44.drv-0/openldap-2.4.44/libraries/libldap_r/.libs /tmp/nix-build-openldap-2.4.44.drv-0/openldap-2.4.44/libraries/liblber/.libs /nix/store/bfkmdxmv3a3f0g3d2q8jkdz2wam93c5z-openldap-2.4.44/lib /nix/store/bfkmdxmv3a3f0g3d2q8jkdz2wam93c5z-openldap-2.4.44/lib64 Currently, running `patchelf --shrink-rpath` does the wrong thing by keeping the /tmp/ paths and deleting the /nix/store ones. Now we can fix the problem by using patchelf --shrink-rpath --allowed-rpath-prefixes $NIX_STORE_DIR in the Nixpkgs fixupPhase instead.
Diffstat (limited to 'README')
-rw-r--r--README8
1 files changed, 8 insertions, 0 deletions
diff --git a/README b/README
index eb291ba..406cefd 100644
--- a/README
+++ b/README
@@ -19,6 +19,14 @@ libraries. In particular, it can do the following:
an RPATH "/lib:/usr/lib:/foo/lib", and libfoo.so can only be found
in /foo/lib, then the new RPATH will be "/foo/lib".
+ In addition, the '--allowed-rpath-prefixes' option can be used for
+ further rpath tuning. For instance, if an executable has an RPATH
+ "/tmp/build-foo/.libs:/foo/lib", it is probably desirable to keep
+ the "/foo/lib" reference instead of the "/tmp" entry. To accomplish
+ that, use:
+
+ $ patchelf --shrink-rpath --allowed-rpath-prefixes /usr/lib:/foo/lib my-program
+
* Remove declared dependencies on dynamic libraries (DT_NEEDED
entries):