diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2016-02-18 22:52:44 +0100 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2016-02-18 22:54:11 +0100 |
commit | d71a4851e8a2ef52f6d806d65822290cdbae8804 (patch) | |
tree | e52597e69d0b90f7af724982bf47b4f6207948c4 /pkgs/stdenv/generic | |
parent | bf63de1613396a1a4d1f27fea73f125988d468a7 (diff) |
Don't try to apply patchelf to non-ELF binaries
Diffstat (limited to 'pkgs/stdenv/generic')
-rw-r--r-- | pkgs/stdenv/generic/setup.sh | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index 7d25472993c59..8081b69bffd37 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -180,6 +180,17 @@ installBin() { } +# Return success if the specified file is an ELF object. +isELF() { + local fn="$1" + local magic + exec {fd}< "$fn" + read -n 4 -u $fd magic + exec {fd}<&- + if [[ "$magic" =~ ELF ]]; then return 0; else return 1; fi +} + + ###################################################################### # Initialisation. |