Skip to content

Commit

Permalink
autoPatchelfHook: Patch PIC exes/libs as well
Browse files Browse the repository at this point in the history
If there is a shared object or executable that's using
position-independent code, the file's mime type is
"application/x-pie-executable", so until this change its dependencies
wouldn't be patched.

This simply adds the mime type to the search loop.

Signed-off-by: aszlig <aszlig@nix.build>
(cherry picked from commit ff5cecf)
Reason: The fix is non-intrusive and should not break anything that
        wasn't broken before. I've tested whether oracle-instantclient
        builds and it still does. Other than that no other package is
        using autoPatchelfHook in NixOS 18.03.
  • Loading branch information
aszlig committed Jun 8, 2018
1 parent f4fdffd commit 9b3c53e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkgs/build-support/setup-hooks/auto-patchelf.sh
Expand Up @@ -15,6 +15,7 @@ findElfs() {
while [ -n "$1" ]; do
mimeType="$(file -b -N --mime-type "$1")"
if [ "$mimeType" = application/x-executable \
-o "$mimeType" = application/x-pie-executable \
-o "$mimeType" = application/x-sharedlib ]; then
echo "$1"
fi
Expand Down

0 comments on commit 9b3c53e

Please sign in to comment.