* Re: [gentoo-portage-dev] RFC: Binary dependency tracking
[not found] ` <200503162102.25494.pauldv@gentoo.org>
@ 2005-04-05 22:38 ` Jeremy Huddleston
2005-04-06 7:23 ` Brian Harring
2005-04-06 10:12 ` Paul de Vrieze
0 siblings, 2 replies; 3+ messages in thread
From: Jeremy Huddleston @ 2005-04-05 22:38 UTC (permalink / raw
To: gentoo-portage-dev
[-- Attachment #1.1: Type: text/plain, Size: 694 bytes --]
Well, I've glossed over the dlopen() issues for now as I'm not sure the
best way to handle that or even if it needs to be addressed. How often
does something dlopen() a file if it doesn't know the exact filename at
compile time? It seems unlikely to me that this kind of dependency
would be introduced which wouldn't be uniquely satisfied by the RDEPEND.
Does anyone know of a case where we'd do something like:
#define LIBPNG_SONAME libpng.so.3 /* set by configure */
dlopen(LIBPNG_SONAME)
In any event, here's a patch to portage which creates the
soname.{PROVIDE,DEPEND} files as well as a small script to create them
where missing.
Please comment.
Thanks,
Jeremy
[-- Attachment #1.2: bindeps.patch --]
[-- Type: text/x-patch, Size: 2921 bytes --]
? ebuild.sh-multilib-pkg
Index: ebuild.sh
===================================================================
RCS file: /var/cvsroot/gentoo-src/portage/bin/ebuild.sh,v
retrieving revision 1.201.2.24
diff -p -u -4 -r1.201.2.24 ebuild.sh
--- ebuild.sh 26 Feb 2005 11:22:37 -0000 1.201.2.24
+++ ebuild.sh 5 Apr 2005 22:21:35 -0000
@@ -1034,26 +1034,49 @@ dyn_install() {
UNSAFE=$(($UNSAFE + 1))
echo "UNSAFE SetUID: $i"
done
- if [ -x /usr/bin/readelf -a -x /usr/bin/file ]; then
- for x in $(find "${D}/" -type f \( -perm -04000 -o -perm -02000 \) ); do
- f=$(file "${x}")
- if [ -z "${f/*SB executable*/}" -o -z "${f/*SB shared object*/}" ]; then
- /usr/bin/readelf -d "${x}" | egrep '\(FLAGS(.*)NOW' > /dev/null
- if [ $? != 0 ]; then
- if [ ! -z "${f/*statically linked*/}" ]; then
- #uncomment this line out after developers have had ample time to fix pkgs.
- #UNSAFE=$(($UNSAFE + 1))
- echo -ne '\a'
- echo "QA Notice: ${x:${#D}:${#x}} is setXid, dynamically linked and using lazy bindings."
- echo "This combination is generally discouraged. Try: CFLAGS='-Wl,-z,now' emerge ${PN}"
- echo -ne '\a'
- sleep 1
+ if [[ -x /usr/bin/readelf ]] ; then
+ if [[ -x /usr/bin/file ]] ; then
+ for x in $(find "${D}/" -type f \( -perm -04000 -o -perm -02000 \) ); do
+ f=$(file "${x}")
+ if [[ -z "${f/*SB executable*/}" || -z "${f/*SB shared object*/}" ]]; then
+ if ! /usr/bin/readelf -d "${x}" | egrep '\(FLAGS(.*)NOW' > /dev/null ; then
+ if [[ ! -z "${f/*statically linked*/}" ]] ; then
+ #uncomment this line out after developers have had ample time to fix pkgs.
+ #UNSAFE=$(($UNSAFE + 1))
+ echo -ne '\a'
+ echo "QA Notice: ${x:${#D}:${#x}} is setXid, dynamically linked and using lazy bindings."
+ echo "This combination is generally discouraged. Try: CFLAGS='-Wl,-z,now' emerge ${PN}"
+ echo -ne '\a'
+ sleep 1
+ fi
fi
fi
- fi
- done
+ done
+ fi
+
+ if hasq bindeps ${FEATURES} ; then
+ > ${BUILDDIR}/build-info/soname.DEPEND
+ > ${BUILDDIR}/build-info/soname.PROVIDE
+ for file in $(find "${D}/" -type f) ; do
+ local f=$(file ${file})
+
+ if [[ -z "${f/*SB executable*/}" || -z "${f/*SB shared object*/}" ]]; then
+ local soname=$(readelf -d ${file} | grep SONAME | sed 's/^.*\[\(.*\)\].*$/\1/')
+ local depend=$(readelf -d ${file} | grep NEEDED | sed 's/^.*\[\(.*\)\].*$/\1/')
+
+ if [[ -n ${soname} ]] ; then
+ echo "${soname} ${file/${D}/}" >> ${BUILDDIR}/build-info/soname.PROVIDE
+ fi
+
+ local dep=
+ for dep in ${depend} ; do
+ echo "${dep} ${file/${D}/}" >> ${BUILDDIR}/build-info/soname.DEPEND
+ done
+ fi
+ done
+ fi
fi
if [[ $UNSAFE > 0 ]]; then
die "There are ${UNSAFE} unsafe files. Portage will not install them."
[-- Attachment #1.3: mkbindeps.sh --]
[-- Type: application/x-shellscript, Size: 834 bytes --]
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread