Files
solana/sdk/bpf/scripts/strip.sh
mergify[bot] dd33aae3cf Add --bpf-out-dir argument to control where the final build products land (#13099)
(cherry picked from commit b169d9cfbe)

Co-authored-by: Michael Vines <mvines@gmail.com>
2020-10-23 07:56:35 +00:00

24 lines
487 B
Bash
Executable File

#!/usr/bin/env bash
so=$1
if [[ ! -r $so ]]; then
echo "Error: file not found: $so"
exit 1
fi
so_stripped=$2
if [[ -z $so_stripped ]]; then
echo "Usage: $0 unstripped.so stripped.so"
exit 1
fi
bpf_sdk=$(cd "$(dirname "$0")/.." && pwd)
# shellcheck source=sdk/bpf/env.sh
source "$bpf_sdk"/env.sh
set -e
out_dir=$(dirname "$so_stripped")
if [[ ! -d $out_dir ]]; then
mkdir -p "$out_dir"
fi
"$bpf_sdk"/dependencies/llvm-native/bin/llvm-objcopy --strip-all "$so" "$so_stripped"