mirror of
https://git.freebsd.org/ports.git
synced 2025-07-17 09:19:15 -04:00
Switch strip test to using readelf(1) instead of file(1) to identify symbols.
This has been slightly faster in my tests since readelf(1) will fail on the file much quicker if it doesn't find the ELF headers. This also more directly finds the symbol table. With hat: portmgr
This commit is contained in:
parent
c183f5d5d6
commit
16f2336cda
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=399699
1 changed files with 6 additions and 8 deletions
|
@ -173,15 +173,13 @@ stripped() {
|
|||
[ -n "${STRIP}" ] || return 0
|
||||
# Split file and result into 2 lines and read separately to ensure
|
||||
# files with spaces are kept intact.
|
||||
find ${STAGEDIR} -type f \
|
||||
-exec /usr/bin/file --exclude ascii -nNF "${LF}" {} + |
|
||||
# Using readelf -h ... /ELF Header:/ will match on all ELF files.
|
||||
find ${STAGEDIR} -type f ! -name '*.a' \
|
||||
-exec readelf -S {} + 2>/dev/null | awk '\
|
||||
/File:/ {sub(/File: /, "", $0); file=$0} \
|
||||
/SYMTAB/ {print file}' |
|
||||
while read f; do
|
||||
read output
|
||||
case "${output}" in
|
||||
*ELF\ *\ executable,\ *FreeBSD*,\ not\ stripped*|*ELF\ *\ shared\ object,\ *FreeBSD*,\ not\ stripped*)
|
||||
warn "'${f#${STAGEDIR}${PREFIX}/}' is not stripped consider trying INSTALL_TARGET=install-strip or using \${STRIP_CMD}"
|
||||
;;
|
||||
esac
|
||||
warn "'${f#${STAGEDIR}${PREFIX}/}' is not stripped consider trying INSTALL_TARGET=install-strip or using \${STRIP_CMD}"
|
||||
done
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue