diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9e6a89e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +abicheck-1.2.tar.gz diff --git a/abicheck-1.2-bindings-fc4.patch b/abicheck-1.2-bindings-fc4.patch new file mode 100644 index 0000000..83a5a76 --- /dev/null +++ b/abicheck-1.2-bindings-fc4.patch @@ -0,0 +1,12 @@ +diff -Nur abicheck-1.2-orig/abicheck.pl abicheck-1.2/abicheck.pl +--- abicheck-1.2-orig/abicheck.pl 2003-08-26 21:57:51.000000000 +0200 ++++ abicheck-1.2/abicheck.pl 2005-04-11 12:59:04.000000000 +0200 +@@ -1584,7 +1584,7 @@ + $ld_debug_match = q/^\s*\d+:/; + $lddstub_match = ''; + $binding_match = +- q/binding file (.*) to (.*): .*symbol `(\w+)'(.*)$/; ++ q/binding file (.*) \[.*\] to (.*) \[.*\]: .*symbol `(\w+)'(.*)$/; + $filter_match = + q/file=(.*); filtered by (.*)$/; # XXX not checked + $unbound_match = diff --git a/abicheck-1.2-fc3.patch b/abicheck-1.2-fc3.patch new file mode 100644 index 0000000..e376064 --- /dev/null +++ b/abicheck-1.2-fc3.patch @@ -0,0 +1,12 @@ +diff -Nur abicheck-1.2-orig/abicheck.pl abicheck-1.2/abicheck.pl +--- abicheck-1.2-orig/abicheck.pl 2003-08-26 21:57:51.000000000 +0200 ++++ abicheck-1.2/abicheck.pl 2004-12-13 13:00:40.321321296 +0100 +@@ -1592,7 +1592,7 @@ + $dtneeded_match = + q/^\s*(\S+)\s+=>\s+(not found|\S+)/; + $file_match = +- q/^(\s*\d+:).*needed by (.*)$/; ++ q/^(\s*\d+:).*needed by (.*) (\[\d+\])*$/; + # + # n.b. there is a PID mismatch in the GNU linker output if + # we watch for the more sensible: diff --git a/abicheck-1.2-fortify-source-fc6.patch b/abicheck-1.2-fortify-source-fc6.patch new file mode 100644 index 0000000..3c46d57 --- /dev/null +++ b/abicheck-1.2-fortify-source-fc6.patch @@ -0,0 +1,84 @@ +diff -Nur abicheck-1.2-orig/abicheck.pl abicheck-1.2/abicheck.pl +--- abicheck-1.2-orig/abicheck.pl 2003-08-26 21:57:51.000000000 +0200 ++++ abicheck-1.2/abicheck.pl 2006-08-28 12:28:14.000000000 +0200 +@@ -3538,5 +3538,80 @@ + libnsl.so.1:readColdStartFile + libnsl.so.1:writeColdStartFile + ); ++ ++ # ++ # These are _FORTIFY_SOURCE symbols. ++ # ++ push(@{$public}, qw( ++ libc.so.6:__chk_fail ++ libc.so.6:__confstr_chk ++ libc.so.6:__fgets_chk ++ libc.so.6:__fgets_unlocked_chk ++ libc.so.6:__fgetws_chk ++ libc.so.6:__fgetws_unlocked_chk ++ libc.so.6:__fprintf_chk ++ libc.so.6:__fwprintf_chk ++ libc.so.6:__getcwd_chk ++ libc.so.6:__getdomainname_chk ++ libc.so.6:__getgroups_chk ++ libc.so.6:__gethostname_chk ++ libc.so.6:__getlogin_r_chk ++ libc.so.6:__gets_chk ++ libc.so.6:__getwd_chk ++ libc.so.6:__mbsnrtowcs_chk ++ libc.so.6:__mbsrtowcs_chk ++ libc.so.6:__mbstowcs_chk ++ libc.so.6:__memcpy_chk ++ libc.so.6:__memmove_chk ++ libc.so.6:__mempcpy_chk ++ libc.so.6:__memset_chk ++ libc.so.6:__pread64_chk ++ libc.so.6:__pread_chk ++ libc.so.6:__printf_chk ++ libc.so.6:__ptsname_r_chk ++ libc.so.6:__read_chk ++ libc.so.6:__readlinkat_chk ++ libc.so.6:__readlink_chk ++ libc.so.6:__realpath_chk ++ libc.so.6:__recv_chk ++ libc.so.6:__recvfrom_chk ++ libc.so.6:__snprintf_chk ++ libc.so.6:__sprintf_chk ++ libc.so.6:__stack_chk_fail ++ libc.so.6:__stpcpy_chk ++ libc.so.6:__stpncpy_chk ++ libc.so.6:__strcat_chk ++ libc.so.6:__strcpy_chk ++ libc.so.6:__strncat_chk ++ libc.so.6:__strncpy_chk ++ libc.so.6:__swprintf_chk ++ libc.so.6:__syslog_chk ++ libc.so.6:__ttyname_r_chk ++ libc.so.6:__vfprintf_chk ++ libc.so.6:__vfwprintf_chk ++ libc.so.6:__vprintf_chk ++ libc.so.6:__vsnprintf_chk ++ libc.so.6:__vsprintf_chk ++ libc.so.6:__vswprintf_chk ++ libc.so.6:__vsyslog_chk ++ libc.so.6:__vwprintf_chk ++ libc.so.6:__wcpcpy_chk ++ libc.so.6:__wcpncpy_chk ++ libc.so.6:__wcrtomb_chk ++ libc.so.6:__wcscat_chk ++ libc.so.6:__wcscpy_chk ++ libc.so.6:__wcsncat_chk ++ libc.so.6:__wcsncpy_chk ++ libc.so.6:__wcsnrtombs_chk ++ libc.so.6:__wcsrtombs_chk ++ libc.so.6:__wcstombs_chk ++ libc.so.6:__wctomb_chk ++ libc.so.6:__wmemcpy_chk ++ libc.so.6:__wmemmove_chk ++ libc.so.6:__wmempcpy_chk ++ libc.so.6:__wmemset_chk ++ libc.so.6:__wprintf_chk ++ ) ++ ); + } + } diff --git a/abicheck-1.2-ldlinux.patch b/abicheck-1.2-ldlinux.patch new file mode 100644 index 0000000..10b0e53 --- /dev/null +++ b/abicheck-1.2-ldlinux.patch @@ -0,0 +1,53 @@ +diff -Nur abicheck-1.2-orig/abicheck.pl abicheck-1.2/abicheck.pl +--- abicheck-1.2-orig/abicheck.pl 2003-08-26 21:57:51.000000000 +0200 ++++ abicheck-1.2/abicheck.pl 2005-08-16 22:49:06.000000000 +0200 +@@ -496,7 +496,7 @@ + + if ( ! $pid ) { + # child here, go run ldd -r with debug env: +- exec_ldd($file); ++ exec_ldd($file,$file0); + exit 1; + } + +@@ -1241,7 +1241,7 @@ + # will read command output. + # + sub exec_ldd { +- my ($file) = @_; ++ my ($file,$file0) = @_; + + open(STDERR, ">&STDOUT"); + # need to close stdin on linux for some suid programs e.g. chsh (!) +@@ -1251,10 +1251,27 @@ + $ENV{LD_LIBRARY_PATH} = $ld_path; + } + +- # currently, no difference between OSs +- $ENV{LD_DEBUG} = "files,bindings"; +- exec 'ldd', '-r', $file; +- exit 1; # exec failed ++ my $ldlinux = ''; ++ open(DLFIND,"ldd $file0 |") or die "open: ldd: $!"; ++ while () { ++ /(ld(-linux)*.so.\d+)/ and /(\S+)/ and $ldlinux = $1; ++ } ++ close(DLFIND); ++ if ( $ldlinux =~ /^$/ ) { ++ # currently, no difference between OSs ++ $ENV{LD_DEBUG} = "files,bindings"; ++ exec 'ldd', '-r', $file; ++ exit 1; # exec failed ++ } ++ else { ++ $ENV{LD_DEBUG} = "files,bindings"; ++ $ENV{LD_VERBOSE} = "yes"; ++ $ENV{LD_WARN} = "yes"; ++ $ENV{LD_BIND_NOW} = "yes"; ++ $ENV{LD_TRACE_LOADED_OBJECTS} = "1"; ++ exec $ldlinux, $file0; ++ exit 1; # exec failed ++ } + } + + # diff --git a/abicheck-1.2-libgcc.patch b/abicheck-1.2-libgcc.patch new file mode 100644 index 0000000..f0e4585 --- /dev/null +++ b/abicheck-1.2-libgcc.patch @@ -0,0 +1,23 @@ +diff -Nur abicheck-1.2-orig/abicheck.pl abicheck-1.2/abicheck.pl +--- abicheck-1.2-orig/abicheck.pl 2003-08-26 21:57:51.000000000 +0200 ++++ abicheck-1.2/abicheck.pl 2005-08-15 21:10:15.000000000 +0200 +@@ -3498,6 +3498,19 @@ + libc.so.6:__ctype_b_loc + libc.so.6:__ctype_tolower_loc + libc.so.6:__ctype_toupper_loc ++ ++ libgcc_s.so.1:__divdi3 ++ libgcc_s.so.1:__register_frame ++ libgcc_s.so.1:__frame_state_for ++ libgcc_s.so.1:__umoddi3 ++ libgcc_s.so.1:__udivdi3 ++ libgcc_s.so.1:__register_frame_table ++ libgcc_s.so.1:__deregister_frame_info ++ libgcc_s.so.1:__deregister_frame ++ libgcc_s.so.1:__cxa_finalize ++ libgcc_s.so.1:__moddi3 ++ libgcc_s.so.1:__register_frame_info_table ++ libgcc_s.so.1:__register_frame_info + ); + + @{$private} = qw( diff --git a/abicheck-1.2-tests.patch b/abicheck-1.2-tests.patch new file mode 100644 index 0000000..03da8d9 --- /dev/null +++ b/abicheck-1.2-tests.patch @@ -0,0 +1,70 @@ +diff -Nur abicheck-1.2-orig/test/Makefile abicheck-1.2/test/Makefile +--- abicheck-1.2-orig/test/Makefile 2003-08-26 21:57:51.000000000 +0200 ++++ abicheck-1.2/test/Makefile 2004-12-13 13:01:19.827315472 +0100 +@@ -9,7 +9,7 @@ + # /usr/bin/ld: BFD 2.11.93.0.2 20020207 assertion fail elf-strtab.c:262 + # but it still creates the binary properly. + libc_a: libc_a.c +- cc -o libc_a libc_a.c -lm /usr/lib/libc.a ++ cc -o libc_a libc_a.c -static -lm /usr/lib/libc.a + + private1: private1.c + cc -D`uname` -o private1 private1.c +diff -Nur abicheck-1.2-orig/test/libc_a.c abicheck-1.2/test/libc_a.c +--- abicheck-1.2-orig/test/libc_a.c 2003-08-26 21:57:51.000000000 +0200 ++++ abicheck-1.2/test/libc_a.c 2007-05-24 11:11:20.000000000 +0200 +@@ -5,6 +5,7 @@ + + /* This is used to catch libc.a linking. See Makefile & run_tests */ + ++#include + #include + #include + +diff -Nur abicheck-1.2-orig/test/private1.c abicheck-1.2/test/private1.c +--- abicheck-1.2-orig/test/private1.c 2002-06-18 20:16:07.000000000 +0200 ++++ abicheck-1.2/test/private1.c 2007-05-24 11:40:25.000000000 +0200 +@@ -6,6 +6,7 @@ + /* This is for simple catching of some private symbol usage. See run_tests */ + + #include ++#include + + #if defined(SunOS) + #define OS "Solaris" +diff -Nur abicheck-1.2-orig/test/run_tests abicheck-1.2/test/run_tests +--- abicheck-1.2-orig/test/run_tests 2002-02-07 15:40:20.000000000 +0100 ++++ abicheck-1.2/test/run_tests 2007-05-24 11:40:52.000000000 +0200 +@@ -19,7 +19,7 @@ + # libc_a: + + name="libc.a static link test on libc_a" +-if abicheck ./libc_a 2>/dev/null | grep 'STATIC_LINK:.*libc' > /dev/null; then ++if abicheck ./libc_a 2>/dev/null | grep 'STATIC_LINK:.*\(libc\|completely statically linked\)' > /dev/null; then + pass + else + fail +diff -Nur abicheck-1.2-orig/test/run_tests abicheck-1.2/test/run_tests +--- abicheck-1.2-orig/test/run_tests 2002-02-07 15:40:20.000000000 +0100 ++++ abicheck-1.2/test/run_tests 2007-05-24 12:33:02.000000000 +0200 +@@ -39,7 +39,7 @@ + # private1: + + name="private1: calls private sym in libc" +-if abicheck ./private1 2>/dev/null | egrep 'PRIVATE:.*libc.*(__open|__nanosleep)' > /dev/null; then ++if abicheck ./private1 2>/dev/null | grep 'PRIVATE:.*libc.*\(__open\|__nanosleep\)' > /dev/null; then + pass + else + fail +diff -Nur abicheck-1.2-orig/test/run_tests abicheck-1.2/test/run_tests +--- abicheck-1.2-orig/test/run_tests 2002-02-07 15:40:20.000000000 +0100 ++++ abicheck-1.2/test/run_tests 2007-05-24 13:00:58.000000000 +0200 +@@ -29,7 +29,7 @@ + # public1: + + name="public1: only calls public syms" +-if [ "`abicheck ./public1 2>/dev/null`" = "./public1: OK" ]; then ++if [ "`abicheck ./public1 2>/dev/null`" == "./public1: OK" ]; then + pass + else + fail diff --git a/abicheck.spec b/abicheck.spec new file mode 100644 index 0000000..c5801ca --- /dev/null +++ b/abicheck.spec @@ -0,0 +1,116 @@ +%define debug_package %{nil} + +Summary: ABI checking tool +Name: abicheck +Version: 1.2 +Release: 11.6 +License: LGPLv2 +Group: Applications/File +URL: http://abicheck.sourceforge.net/ +Source0: http://dl.sf.net/abicheck/%{name}-%{version}.tar.gz +Patch0: abicheck-1.2-fc3.patch +Patch1: abicheck-1.2-tests.patch +Patch2: abicheck-1.2-bindings-fc4.patch +Patch3: abicheck-1.2-libgcc.patch +Patch4: abicheck-1.2-fortify-source-fc6.patch +Patch5: abicheck-1.2-ldlinux.patch +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot-%(%{__id_u} -n) +Requires: binutils perl + + +%description +abicheck is a tool that checks application binary executables and +shared libraries for conformance to the (or an) ABI (Application +Binary Interface). + + +%prep +%setup -q +%patch -p1 -b .fc3 +%patch1 -p1 -b .tests +%patch2 -p1 -b .bindings-fc4 +%patch3 -p1 -b .libgcc +%patch4 -p1 -b .fortify-source-fc5 +%patch5 -p1 -b .ldlinux +sed -i -e 's!/usr/lib/!%{_libdir}/!g' test/Makefile + + +%build +make + + +%install +rm -rf $RPM_BUILD_ROOT +mkdir -p $RPM_BUILD_ROOT%{_bindir} $RPM_BUILD_ROOT%{_mandir}/man1 +install -p -m 0755 abicheck $RPM_BUILD_ROOT%{_bindir} +install -p -m 0644 abicheck.1 $RPM_BUILD_ROOT%{_mandir}/man1 + + +%check +make test + + +%clean +rm -rf $RPM_BUILD_ROOT + + +%files +%defattr(-,root,root,-) +%doc COPYING ChangeLog INTRO README +%{_bindir}/abicheck +%{_mandir}/man1/abicheck.1* + + +%changelog +* Fri Oct 5 2007 Michael Schwendt - 1.2-11.6 +- Sync with rawhide: clarify licence (LGPLv2), update tests patch + +* Mon Aug 28 2006 Michael Schwendt - 1.2-11 +- Rebuild and update fortify-source patch. + +* Thu Mar 2 2006 Michael Schwendt - 1.2-10 +- rebuilt for FC5 only to run the %%check section + +* Tue Aug 16 2005 Michael Schwendt - 1.2-9 +- Patch abicheck to run dynamic linker directly instead of + using ldd and receiving its intermixed lines. + +* Mon Aug 15 2005 Michael Schwendt - 1.2-8 +- Add libgcc symbols. +- Add more _FORTIFY_SOURCE symbols. +- Override symbol classification by default. + +* Thu Aug 11 2005 Michael Schwendt - 1.2-7 +- Add an override file in %%doc which can be specified with + option -O to modify the symbol classification for binaries + built with _FORTIFY_SOURCE. + +* Mon May 9 2005 Michael Schwendt - 1.2-6 +- Disable debuginfo package. + +* Thu Apr 14 2005 Michael Schwendt - 1.2-5 +- Replace /usr/lib/ with %%_libdir/ in %%prep. + +* Mon Apr 11 2005 Michael Schwendt - 1.2-4 +- Add patch to catch up with bindings related changes in ldd output. + +* Fri Apr 7 2005 Michael Schwendt +- rebuilt + +* Mon Dec 13 2004 Michael Schwendt - 1.2-3 +- Add patch to catch up with changes in ldd output. +- Fix static linking test. +- Drop Epoch 0. + +* Wed Aug 27 2003 Dams 0:1.2-0.fdr.2 +- Added missing Requires + +* Wed Aug 27 2003 Dams 0:1.2-0.fdr.1 +- Updated to 1.2 +- Dropped patch (applied upstream) + +* Sat Aug 23 2003 Dams 0:1.1-0.fdr.2 +- Aplied patch from Michael Schwendt (bug #605 comment #1) + +* Sat Aug 16 2003 Dams +- Initial build. diff --git a/dead.package b/dead.package deleted file mode 100644 index 05c3952..0000000 --- a/dead.package +++ /dev/null @@ -1,2 +0,0 @@ -No upstream development or maintenance at all since several years, not -even merging patches. diff --git a/sources b/sources new file mode 100644 index 0000000..9c95f74 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +57097ed1f8c20d974b0b1a9850e61f08 abicheck-1.2.tar.gz