You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For instance, openldap in current Nixpkgs is built with dontPatchELF because the binaries are broken otherwise. The reason seems to be that the RPATH generated by the compiler is:
... since presumably the /tmp/nix-build-openldap* contain the same libraries as /nix/store/bfkmdxmv3a3f0g3d2q8jkdz2wam93c5z-openldap-2.4.44/lib and is just (semi-)arbitrarily picked first.
Maybe it would be worth to have e.g. a flag --rpath-filter /nix/store to only allow RPATHs to the given path prefix during --shrink-rpath.
The text was updated successfully, but these errors were encountered:
dezgeg
added a commit
to dezgeg/patchelf
that referenced
this issue
Jun 3, 2016
FixesNixOS#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.
For instance,
openldap
in current Nixpkgs is built withdontPatchELF
because the binaries are broken otherwise. The reason seems to be that the RPATH generated by the compiler is:... which then
patchelf --shrink-rpath
shrinks to:... since presumably the
/tmp/nix-build-openldap*
contain the same libraries as/nix/store/bfkmdxmv3a3f0g3d2q8jkdz2wam93c5z-openldap-2.4.44/lib
and is just (semi-)arbitrarily picked first.Maybe it would be worth to have e.g. a flag
--rpath-filter /nix/store
to only allow RPATHs to the given path prefix during--shrink-rpath
.The text was updated successfully, but these errors were encountered: