From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Mon, 26 Sep 2005 18:41:41 +0400 From: Alexey Tourbin To: ALT Devel discussion list Message-ID: <20050926144140.GC3650@solemn.turbinal.org> Mail-Followup-To: ALT Devel discussion list References: <4337EF11.3050407@gorodmasterov.com> <20050926130102.GA3650@solemn.turbinal.org> <4337F64B.20505@gorodmasterov.com> <20050926135708.GB3650@solemn.turbinal.org> <20050926141328.GB11525@basalt.office.altlinux.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="RYJh/3oyKhIjGcML" Content-Disposition: inline In-Reply-To: <20050926141328.GB11525@basalt.office.altlinux.org> Subject: [devel] Re: q: _perl_vendor_check_dso problems X-BeenThere: devel@altlinux.ru X-Mailman-Version: 2.1.5 Precedence: list Reply-To: ALT Devel discussion list List-Id: ALT Devel discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Sep 2005 14:42:45 -0000 Archived-At: List-Archive: List-Post: --RYJh/3oyKhIjGcML Content-Type: multipart/mixed; boundary="S1BNGpv0yoYahz37" Content-Disposition: inline --S1BNGpv0yoYahz37 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Sep 26, 2005 at 06:13:28PM +0400, Dmitry V. Levin wrote: > $ ldd -r /usr/lib/apache/libhttpd.so 2>&1 |grep -wc undefined > 50 >=20 > =E9=CD=C5=C5=D4 =D3=CD=D9=D3=CC =D0=CF=D7=C5=D3=C9=D4=D8 =CE=C1 =D0=C1=CB= =C5=D4 `rpmquery -f /usr/lib/apache/libhttpd.so` > =C2=C1=C7=D5. >=20 > =ED=CF=A3 =D4=C5=D2=D0=C5=CE=C9=C5 =D3=CB=CF=D2=CF =C9=D3=D3=D1=CB=CE=C5= =D4, =C9 rpmbuild =CE=C1=DE=CE=A3=D4 =CE=C1=D2=D5=DB=C9=D4=C5=CC=C5=CA =C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F=D3=D4=C1=CC=CF=D3=D8 =D3=C4=C5=CC=C1=D4=D8 =C4=D7=C5 =D7=C5=DD= =C9: 1) =F7=CD=C5=D3=D4=CF "${elf##*/lib/lib*.so*}" =CE=C1=D0=C9=D3=C1=D4=D8 =D0= =D2=C5=C4=C9=CB=C1=D4 elf1_is_public_library 2) =F0=CF=C4=D5=CD=C1=D4=D8, =CB=C1=CB =D7 brp-alt "=D0=D2=CF=D4=C1=DD=C9= =D4=D8" =D0=CF=CC=CE=D9=CA =D3=D0=C9=D3=CF=CB =D0=D2=C5=C4=CF=D3=D4=C1=D7= =CC=D1=C5=CD=D9=C8 =D3=C9=CD=D7=CF=CC=CF=D7 =CE=C1 =D7=D3=A3=CD =D2=C5=D0=CF=DA=C9=D4=C1=D2=C9= =C9; =D7=CD=C5=D3=D4=CF =D0=CF=CC=CE=CF=C7=CF =D3=D0=C9=D3=CB=C1 (60M) =CD= =CF=D6=CE=CF =D3=C4=C5=CC=C1=D4=D8 bloom filter (2M), =CE=CF =D0=D2=CF=C2=CC=C5=CD=C1 =D0=CF =D3=D5=DD=C5=D3= =D4=D7=D5 =CF=D3=D4=C1=C5=D4=D3=D1. --S1BNGpv0yoYahz37 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=verify_elfsym Content-Transfer-Encoding: quoted-printable #!/bin/sh -ef =2E /usr/lib/rpm/functions [ -z "$RPM_BUILD_ROOT" ] || ValidateBuildRoot RTLD=3D/lib/ld-linux.so.2 RTLD_libpath=3D/lib:/usr/lib:/usr/X11R6/lib elf1_libpath() { local elf=3D"$1" libpath=3D"$RTLD_libpath" [ -z "$LD_LIBRARY_PATH" ] || libpath=3D"$LD_LIBRARY_PATH:$libpath" [ -z "$RPM_FINDPROV_LIB_PATH" ] || libpath=3D"$RPM_FINDPROV_LIB_PATH:$libpath" local info=3D rpath=3D info=3D"$(objdump -p "$elf")" || return rpath=3D"$(echo "$info" |awk '($1=3D=3D"RPATH"){printf "%s:", $2}')" [ -z "$rpath" ] || libpath=3D"$rpath$libpath" if [ -n "$RPM_BUILD_ROOT" ]; then local BR_libpath=3D path=3D IFS=3D: for path in $libpath; do BR_libpath=3D"$BR_libpath:$RPM_BUILD_ROOT$path" done libpath=3D"${BR_libpath#:}:$libpath" fi echo "$libpath" } elf1_ldd() { local elf=3D"$1" libpath=3D libpath=3D"$(elf1_libpath "$elf")" || return LD_TRACE_LOADED_OBJECTS=3D1 LD_WARN=3D1 LD_BIND_NOW=3D1 LD_VERBOSE=3D \ "$RTLD" --library-path "$libpath" --inhibit-rpath "$elf" "$elf" } elf1_undefined_symbols() { local elf=3D"$1" out=3D if ! out=3D"$(elf1_ldd "$elf" 2>&1)"; then echo "$PROG: $elf: ldd failed:" >&2 echo "$out" >&2 return 2 fi if [ -n "$out" -a -z "${out##* not found*}" ]; then echo "$PROG: $elf: unresolved dependencies:" >&2 echo "$out" |grep -F ' not found' >&2 return 1 fi if [ -n "$out" -a -z "${out##*undefined symbol:*}" ]; then echo "$out" |awk '/^undefined symbol:/ { gsub("^[(]|[)]$", "", $NF) print $3 "\t" $NF }' fi } elf1_verify_strict() { local elf=3D"$1" err=3D err=3D"$(elf1_undefined_symbols "$elf")" || return 2 [ -n "$err" ] || return 0 local sym=3D obj=3D while IFS=3D$'\t' read -r sym obj; do [ "$obj" =3D "$elf" ] && echo "$PROG: $elf: undefined symbol: $sym" >&2 || echo "$PROG: $elf: undefined symbol: $sym ($obj)" >&2 done <<<"$err" return 1 } elf1_verify_relaxed() { local elf=3D"$1" symtab=3D"$2" err=3D err=3D"$(elf1_undefined_symbols "$elf")" || return 2 [ -n "$err" ] || return 0 local rc=3D0 sym=3D obj=3D while IFS=3D$'\t' read -r sym obj; do if [ "$obj" !=3D "$elf" ]; then echo "$PROG: $elf: undefined symbol: $sym ($obj)" >&2 rc=3D1 elif ! bloom -e "$sym" "$symtab"; then echo "$PROG: $elf: undefined symbol: $sym" >&2 rc=3D1 fi done <<<"$err" return $rc }=09 : ${VERIFY_ELF_SYM:=3Dnormal} case "$VERIFY_ELF_SYM" in strict|normal|relaxed) : ;; no|none|skip) exit 0 ;; *) Fatal "Unrecognized $PROG method: $VERIFY_ELF_SYM" ;; esac rc=3D0 symtab=3D"$1" shift for elf; do if ! type=3D"$(file -bL "$elf")"; then echo "$PROG: $elf: $type" >&2 rc=3D1 continue fi =09 [ -n "$type" ] || continue [ -z "${type##*ELF*dynamic*}" -o -z "${type##*ELF*shared*}" ] || continue if [ "$VERIFY_ELF_SYM" =3D strict ]; then elf1_verify_strict "$elf" || rc=3D1 elif [ "$VERIFY_ELF_SYM" =3D relaxed ]; then elf1_verify_relaxed "$elf" "$symtab" || rc=3D1 elif [ -z "${type##*ELF*executable*}" ]; then elf1_verify_strict "$elf" || rc=3D1 elif [ -z "${type##*ELF*shared*}" -a -z "${elf##*/lib/lib*.so*}" ]; then elf1_verify_strict "$elf" || rc=3D1 else elf1_verify_relaxed "$elf" "$symtab" || rc=3D1 fi=09 done exit $rc --S1BNGpv0yoYahz37-- --RYJh/3oyKhIjGcML Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQFDOAikfBKgtDjnu0YRApXUAJ9Pl3p6jwy1Nq+zUW0KwUgtY16ISQCg20fQ tdjoFsEm0T8+to1gn4mYKXw= =k/Dz -----END PGP SIGNATURE----- --RYJh/3oyKhIjGcML--