diff --git a/scripts/libmakepkg/tidy/strip.sh.in b/scripts/libmakepkg/tidy/strip.sh.in index 6c435058..e0a30353 100644 --- a/scripts/libmakepkg/tidy/strip.sh.in +++ b/scripts/libmakepkg/tidy/strip.sh.in @@ -156,7 +156,7 @@ tidy_strip() { local binary strip_flags find . -type f -perm -u+w -print0 2>/dev/null | LC_ALL=C sort -z | while IFS= read -rd '' binary ; do - local STRIPLTO=0 + local STATICLIB=0 case "$(LC_ALL=C readelf -h "$binary" 2>/dev/null)" in *Type:*'DYN (Shared object file)'*) # Libraries (.so) or Relocatable binaries strip_flags="$STRIP_SHARED";; @@ -167,7 +167,7 @@ tidy_strip() { *Type:*'REL (Relocatable file)'*) # Libraries (.a) or objects if ar t "$binary" &>/dev/null; then # Libraries (.a) strip_flags="$STRIP_STATIC" - STRIPLTO=1 + STATICLIB=1 elif [[ $binary = *'.ko' || $binary = *'.o' ]]; then # Kernel module or object file strip_flags="$STRIP_SHARED" else @@ -177,9 +177,9 @@ tidy_strip() { *) continue ;; esac - collect_debug_symbols "$binary" + (( ! STATICLIB )) && collect_debug_symbols "$binary" strip_file "$binary" ${strip_flags} - (( STRIPLTO )) && strip_lto "$binary" + (( STATICLIB )) && strip_lto "$binary" done elif check_option "debug" "y"; then