From a94849dc26b08978b53055712ce4425b60b48259 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Sat, 13 Jan 2024 15:11:26 -0800 Subject: [PATCH] mk/check-symbol-prefixes.sh: Make target argument mandatory. --- mk/check-symbol-prefixes.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/mk/check-symbol-prefixes.sh b/mk/check-symbol-prefixes.sh index 83e721b2f..ad67d74ec 100755 --- a/mk/check-symbol-prefixes.sh +++ b/mk/check-symbol-prefixes.sh @@ -17,6 +17,16 @@ set -eux -o pipefail IFS=$'\n\t' +for arg in $*; do + case $arg in + --target=*) + target=${arg#*=} + ;; + *) + ;; + esac +done + case "$OSTYPE" in darwin*) nm_exe=nm @@ -35,7 +45,7 @@ esac # # This is very liberal in filtering out symbols that "look like" # Rust-compiler-generated symbols. -find target -type f -name libring-*.rlib | while read -r infile; do +find target/$target -type f -name libring-*.rlib | while read -r infile; do bad=$($nm_exe --defined-only --extern-only --print-file-name "$infile" \ | ( grep -v -E " . _?(__imp__ZN4ring|ring_core_|__rustc|_ZN|DW.ref.rust_eh_personality)" || [[ $? == 1 ]] )) if [ ! -z "${bad-}" ]; then