From owner-svn-ports-all@freebsd.org Tue Jun 11 22:56:33 2019 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5602E15C957E; Tue, 11 Jun 2019 22:56:33 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E5E6F8404F; Tue, 11 Jun 2019 22:56:32 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CC3358605; Tue, 11 Jun 2019 22:56:32 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5BMuWnX086602; Tue, 11 Jun 2019 22:56:32 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5BMuWdW086601; Tue, 11 Jun 2019 22:56:32 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201906112256.x5BMuWdW086601@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 11 Jun 2019 22:56:32 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r503998 - head/Mk/Scripts X-SVN-Group: ports-head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/Mk/Scripts X-SVN-Commit-Revision: 503998 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E5E6F8404F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jun 2019 22:56:33 -0000 Author: bdrewery Date: Tue Jun 11 22:56:32 2019 New Revision: 503998 URL: https://svnweb.freebsd.org/changeset/ports/503998 Log: Speedup ELF file detection almost 100%. This uses the same pattern we have in qa.sh. Rather than using file(1), which reads the whole file and does too much magic, use readelf(1) which bails out if the file lacks the proper ELF headers. (This file is not yet used by anything) Sponsored by: DellEMC Modified: head/Mk/Scripts/generate-symbols.sh Modified: head/Mk/Scripts/generate-symbols.sh ============================================================================== --- head/Mk/Scripts/generate-symbols.sh Tue Jun 11 22:30:14 2019 (r503997) +++ head/Mk/Scripts/generate-symbols.sh Tue Jun 11 22:56:32 2019 (r503998) @@ -10,18 +10,11 @@ msg "Finding symbols" # Find all ELF files, strip them, and move symbols to PREFIX/usr/lib/debug/ORIG_PATH ELF_FILES=$(mktemp -t elf_files) -LF=$(printf '\nX') -LF=${LF%X} find ${STAGEDIR} -type f \ - -exec /usr/bin/file -nNF "${LF}" {} + | while read -r f; do - read -r output - case "${output}" in - ELF\ *\ executable,\ *FreeBSD*,\ not\ stripped*|\ - ELF\ *\ shared\ object,\ *FreeBSD*,\ not\ stripped*) - echo "${f}" - ;; - esac -done > ${ELF_FILES} + -exec /usr/bin/readelf -S {} + 2>/dev/null | awk ' \ + /File:/ {sub(/File: /, "", $0); file=$0} + /[[:space:]]\.debug_info[[:space:]]*PROGBITS/ {print file}' \ + > ${ELF_FILES} # Create all of the /usr/local/lib/* dirs lib_dir="${STAGEDIR}.debug${PREFIX}/lib/debug"