strip: don't create debug packages from .a files
.a files are not valid ELF files so we can't run objcopy nor debugedit on them. Rename STRIPLTO to STATICLIB to be more descriptive. Signed-off-by: Morten Linderud <morten@linderud.pw>
This commit is contained in:
parent
7a4fff3310
commit
00d2b1f902
1 changed files with 4 additions and 4 deletions
|
@ -156,7 +156,7 @@ tidy_strip() {
|
||||||
|
|
||||||
local binary strip_flags
|
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
|
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
|
case "$(LC_ALL=C readelf -h "$binary" 2>/dev/null)" in
|
||||||
*Type:*'DYN (Shared object file)'*) # Libraries (.so) or Relocatable binaries
|
*Type:*'DYN (Shared object file)'*) # Libraries (.so) or Relocatable binaries
|
||||||
strip_flags="$STRIP_SHARED";;
|
strip_flags="$STRIP_SHARED";;
|
||||||
|
@ -167,7 +167,7 @@ tidy_strip() {
|
||||||
*Type:*'REL (Relocatable file)'*) # Libraries (.a) or objects
|
*Type:*'REL (Relocatable file)'*) # Libraries (.a) or objects
|
||||||
if ar t "$binary" &>/dev/null; then # Libraries (.a)
|
if ar t "$binary" &>/dev/null; then # Libraries (.a)
|
||||||
strip_flags="$STRIP_STATIC"
|
strip_flags="$STRIP_STATIC"
|
||||||
STRIPLTO=1
|
STATICLIB=1
|
||||||
elif [[ $binary = *'.ko' || $binary = *'.o' ]]; then # Kernel module or object file
|
elif [[ $binary = *'.ko' || $binary = *'.o' ]]; then # Kernel module or object file
|
||||||
strip_flags="$STRIP_SHARED"
|
strip_flags="$STRIP_SHARED"
|
||||||
else
|
else
|
||||||
|
@ -177,9 +177,9 @@ tidy_strip() {
|
||||||
*)
|
*)
|
||||||
continue ;;
|
continue ;;
|
||||||
esac
|
esac
|
||||||
collect_debug_symbols "$binary"
|
(( ! STATICLIB )) && collect_debug_symbols "$binary"
|
||||||
strip_file "$binary" ${strip_flags}
|
strip_file "$binary" ${strip_flags}
|
||||||
(( STRIPLTO )) && strip_lto "$binary"
|
(( STATICLIB )) && strip_lto "$binary"
|
||||||
done
|
done
|
||||||
|
|
||||||
elif check_option "debug" "y"; then
|
elif check_option "debug" "y"; then
|
||||||
|
|
Loading…
Add table
Reference in a new issue