diff options
author | Mathieu Arnold <mat@FreeBSD.org> | 2014-12-17 13:21:56 +0000 |
---|---|---|
committer | Mathieu Arnold <mat@FreeBSD.org> | 2014-12-17 13:21:56 +0000 |
commit | 64835f0cdc52b538b4d0bca8a163eaa4b2c88377 (patch) | |
tree | 4202a3b2243a0e4544eabc8d5f6b2ecccb217330 /Mk/Scripts/qa.sh | |
parent | - Strip binary (diff) |
Make Perl link all .so it builds with libperl.so.
It makes upgrading from one Perl major version to another way easier. For
binary package users, it means pkg upgrade will detect the libperl.so.x.yy
change, and reinstall the affected packages. For users using ports, it will
save rebuild time as it's easier to detect what ports really need to be
rebuilt.
PR: 195821
Differential Revision: https://reviews.freebsd.org/D1241
Submitted by: mat
Reviewed by: antoine, bdrewery
Exp-run by: antoine
With hat: perl
Sponsored by: Absolight
Notes
Notes:
svn path=/head/; revision=374847
Diffstat (limited to 'Mk/Scripts/qa.sh')
-rw-r--r-- | Mk/Scripts/qa.sh | 51 |
1 files changed, 50 insertions, 1 deletions
diff --git a/Mk/Scripts/qa.sh b/Mk/Scripts/qa.sh index 32eda0b051f7..7a82dcaa6394 100644 --- a/Mk/Scripts/qa.sh +++ b/Mk/Scripts/qa.sh @@ -206,7 +206,56 @@ libtool() { fi } -checks="shebang symlinks paths stripped desktopfileutils sharedmimeinfo suidfiles libtool" +libperl() { + local has_some_libperl_so files found + if [ -n "${SITE_ARCH_REL}" ]; then + has_some_libperl_so=0 + files=0 + while read f; do + # No results presents a blank line from heredoc. + [ -z "${f}" ] && continue + files=$((files+1)) + found=`readelf -d $f | awk "BEGIN {libperl=1; rpath=10; runpath=100} + /NEEDED.*${LIBPERL}/ { libperl = 0 } + /RPATH.*perl.*CORE/ { rpath = 0 } + /RUNPATH.*perl.*CORE/ { runpath = 0 } + END {print libperl+rpath+runpath} + "` + # FIXME When 8.4 goes out of commission, replace the ;; + # with ;& in the case below. Also, change the logic on + # detecting if there was a file with libperl.so + if [ "$found" -ne "0" ]; then + case "$found" in + *1) + warn "${f} is not linked with ${LIBPERL}, not respecting lddlflags?" + ;; #;& + *1?) + has_some_libperl_so=1 + warn "${f} does not have a rpath to ${LIBPERL}, not respecting lddlflags?" + ;; #;& + 1??) + has_some_libperl_so=1 + warn "${f} does not have a runpath to ${LIBPERL}, not respecting lddlflags?" + ;; #;& + esac + else + has_some_libperl_so=1 + fi + # Use heredoc to avoid losing rc from find|while subshell + done <<-EOT + $(find ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL} -name '*.so') + EOT + + if [ $files -gt 0 -a $has_some_libperl_so -eq 0 ]; then + err "None of the .so in ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL} are linked with ${LIBPERL}, see above for the full list." + return 1 + else + return 0 + fi + fi +} + +checks="shebang symlinks paths stripped desktopfileutils sharedmimeinfo suidfiles libtool libperl" ret=0 cd ${STAGEDIR} |