diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2017-09-21 01:33:00 -0400 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2017-12-13 16:08:18 -0500 |
commit | b8a21aa918e97bc9bc050afdfd28a81da3f1bd9a (patch) | |
tree | e4ba7db350f5c25a1085c3d52a23057c50f566a3 /pkgs/build-support/setup-hooks/separate-debug-info.sh | |
parent | 91ca46f6934c0749527f275c8b8f8cb5c8c29ae2 (diff) |
misc setup-hooks: Use env vars to refer to binutils programs
This is more robust for cross-compilation
Diffstat (limited to 'pkgs/build-support/setup-hooks/separate-debug-info.sh')
-rw-r--r-- | pkgs/build-support/setup-hooks/separate-debug-info.sh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pkgs/build-support/setup-hooks/separate-debug-info.sh b/pkgs/build-support/setup-hooks/separate-debug-info.sh index c90d2cd520136..19dbb10d18e72 100644 --- a/pkgs/build-support/setup-hooks/separate-debug-info.sh +++ b/pkgs/build-support/setup-hooks/separate-debug-info.sh @@ -19,7 +19,7 @@ _separateDebugInfo() { if ! isELF "$i"; then continue; fi # Extract the Build ID. FIXME: there's probably a cleaner way. - local id="$(readelf -n "$i" | sed 's/.*Build ID: \([0-9a-f]*\).*/\1/; t; d')" + local id="$($READELF -n "$i" | sed 's/.*Build ID: \([0-9a-f]*\).*/\1/; t; d')" if [ "${#id}" != 40 ]; then echo "could not find build ID of $i, skipping" >&2 continue @@ -28,8 +28,8 @@ _separateDebugInfo() { # Extract the debug info. header "separating debug info from $i (build ID $id)" mkdir -p "$dst/${id:0:2}" - objcopy --only-keep-debug "$i" "$dst/${id:0:2}/${id:2}.debug" - strip --strip-debug "$i" + $OBJCOPY --only-keep-debug "$i" "$dst/${id:0:2}/${id:2}.debug" + $STRIP --strip-debug "$i" # Also a create a symlink <original-name>.debug. ln -sfn ".build-id/${id:0:2}/${id:2}.debug" "$dst/../$(basename "$i")" |