]> sourceware.org Git - libabigail.git/commitdiff
Bug 19272 - abipkgdiff doesn't report arch change
authorOndrej Oprala <ondrej.oprala@gmail.com>
Fri, 9 Dec 2016 22:01:58 +0000 (23:01 +0100)
committerDodji Seketeli <dodji@redhat.com>
Mon, 12 Dec 2016 18:55:23 +0000 (19:55 +0100)
Previously, architecture change wasn't included in the incompatible
changes check.

This patch makes corpus_diff::has_incompatible_changes take
architecture change into account.

It turns out corpus_diff::has_net_changes wasn't taking architecture
or soname change into account either.  This patch fixes that as well.

The patch also updates abicompat.cc to make it use
corpus_diff::has_net_changes() and
corpus_diff::has_incompatible_changes(), instead of open-coding these
member functions.

* src/abg-comparison.cc (corpus_diff::has_incompatible_changes):
The architecture change into account.
(corpus_diff::has_net_changes): Take architecture and soname
changes into account.
* tools/abicompat.cc (perform_compat_check_in_normal_mode): Use
corpus_diff::{has_net_changes, has_incompatible_changes}.
* tests/data/test-diff-pkg/dbus-glib-0.104-3.fc23.armv7hl.rpm: New
test input.
* tests/data/test-diff-pkg/dbus-glib-0.104-3.fc23.x86_64--dbus-glib-0.104-3.fc23.armv7hl-report-0.txt:
New test reference output.
  * tests/data/Makefile.am: Add the new test material above to
source distribution.
* tests/test-diff-pkg.cc (in_out_spec): Compare the new package
above against an x86_64 one.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
src/abg-comparison.cc
tests/data/Makefile.am
tests/data/test-diff-pkg/dbus-glib-0.104-3.fc23.armv7hl.rpm [new file with mode: 0644]
tests/data/test-diff-pkg/dbus-glib-0.104-3.fc23.x86_64--dbus-glib-0.104-3.fc23.armv7hl-report-0.txt [new file with mode: 0644]
tests/test-diff-pkg.cc
tools/abicompat.cc

index b57e7f0d8e4532e86bd93f72a4819e93a6105af3..8656bc3c071a334b589de996c4fc35042a712e6a 100644 (file)
@@ -11953,7 +11953,7 @@ corpus_diff::has_incompatible_changes() const
   const diff_stats& stats = const_cast<corpus_diff*>(this)->
     apply_filters_and_suppressions_before_reporting();
 
-  return (soname_changed()
+  return (soname_changed() || architecture_changed()
          || stats.net_num_func_removed() != 0
          || (stats.num_func_with_virtual_offset_changes() != 0
              // If all reports about functions with sub-type changes
@@ -11995,15 +11995,18 @@ corpus_diff::has_net_changes() const
     const diff_stats& stats = const_cast<corpus_diff*>(this)->
       apply_filters_and_suppressions_before_reporting();
 
-  return (stats.net_num_func_changed()
-         || stats.net_num_vars_changed()
-         || stats.net_num_func_added()
-         || stats.net_num_added_func_syms()
-         || stats.net_num_func_removed()
-         || stats.net_num_removed_func_syms()
-         || stats.net_num_vars_added()
-         || stats.net_num_added_var_syms()
-         || stats.net_num_removed_var_syms());
+    return (architecture_changed()
+           || soname_changed()
+           || stats.net_num_func_changed()
+           || stats.net_num_vars_changed()
+           || stats.net_num_func_added()
+           || stats.net_num_added_func_syms()
+           || stats.net_num_func_removed()
+           || stats.net_num_removed_func_syms()
+           || stats.net_num_vars_added()
+           || stats.net_num_added_var_syms()
+           || stats.net_num_vars_removed()
+           || stats.net_num_removed_var_syms());
 }
 
 /// "Less than" functor to compare instances of @ref function_decl.
index c00e917d533f483a67d3d77bbc0d1699e1f72c44..eb0748e0f819d83613a50ee38c21a05fed1219a8 100644 (file)
@@ -1234,6 +1234,8 @@ test-diff-pkg/tarpkg-1-dir1.tar.gz \
 test-diff-pkg/tarpkg-1-dir2.tar.gz \
 test-diff-pkg/tarpkg-1-report-0.txt \
 test-diff-pkg/test-dbus-glib-0.80-3.fc12.x86_64-report-0.txt \
+test-diff-pkg/dbus-glib-0.104-3.fc23.armv7hl.rpm \
+test-diff-pkg/dbus-glib-0.104-3.fc23.x86_64--dbus-glib-0.104-3.fc23.armv7hl-report-0.txt \
 \
 test-fedabipkgdiff/dbus-glib-0.104-3.fc23.x86_64.rpm \
 test-fedabipkgdiff/dbus-glib-debuginfo-0.104-3.fc23.x86_64.rpm \
diff --git a/tests/data/test-diff-pkg/dbus-glib-0.104-3.fc23.armv7hl.rpm b/tests/data/test-diff-pkg/dbus-glib-0.104-3.fc23.armv7hl.rpm
new file mode 100644 (file)
index 0000000..a82618e
Binary files /dev/null and b/tests/data/test-diff-pkg/dbus-glib-0.104-3.fc23.armv7hl.rpm differ
diff --git a/tests/data/test-diff-pkg/dbus-glib-0.104-3.fc23.x86_64--dbus-glib-0.104-3.fc23.armv7hl-report-0.txt b/tests/data/test-diff-pkg/dbus-glib-0.104-3.fc23.x86_64--dbus-glib-0.104-3.fc23.armv7hl-report-0.txt
new file mode 100644 (file)
index 0000000..f56aa02
--- /dev/null
@@ -0,0 +1,33 @@
+================ changes of 'dbus-binding-tool'===============
+  ELF architecture changed
+  Functions changes summary: 0 Removed, 0 Changed, 0 Added function
+  Variables changes summary: 0 Removed, 0 Changed, 0 Added variable
+  Function symbols changes summary: 0 Removed, 5 Added function symbols not referenced by debug info
+  Variable symbols changes summary: 2 Removed, 0 Added variable symbols not referenced by debug info
+
+  architecture changed from 'elf-amd-x86_64' to 'elf-arm'
+
+  5 Added function symbols not referenced by debug info:
+
+    __libc_csu_fini
+    __libc_csu_init
+    base_info_ref
+    base_info_unref
+    main
+
+  2 Removed variable symbols not referenced by debug info:
+
+    stderr
+    stdout
+
+================ end of changes of 'dbus-binding-tool'===============
+
+================ changes of 'libdbus-glib-1.so.2.3.2'===============
+  ELF architecture changed
+  Functions changes summary: 0 Removed, 0 Changed, 0 Added function
+  Variables changes summary: 0 Removed, 0 Changed, 0 Added variable
+
+  architecture changed from 'elf-amd-x86_64' to 'elf-arm'
+
+================ end of changes of 'libdbus-glib-1.so.2.3.2'===============
+
index 0474c806e55634bae4fb4826761aa04fa63e1036..3513ec214cc63d90fd815c8f0680aba491aa5fc0 100644 (file)
@@ -414,6 +414,18 @@ static InOutSpec in_out_specs[] =
     "data/test-diff-pkg/test-dbus-glib-0.80-3.fc12.x86_64-report-0.txt",
     "output/test-diff-pkg/test-dbus-glib-0.80-3.fc12.x86_64-report-0.txt"
   },
+  {
+    "data/test-diff-pkg/dbus-glib-0.104-3.fc23.x86_64.rpm",
+    "data/test-diff-pkg/dbus-glib-0.104-3.fc23.armv7hl.rpm",
+    "--no-default-suppression",
+    "",
+    "",
+    "",
+    "",
+    "",
+    "data/test-diff-pkg/dbus-glib-0.104-3.fc23.x86_64--dbus-glib-0.104-3.fc23.armv7hl-report-0.txt",
+    "output/test-diff-pkg/dbus-glib-0.104-3.fc23.x86_64--dbus-glib-0.104-3.fc23.armv7hl-report-0.txt"
+  },
 #endif //WITH_RPM
 
 #ifdef WITH_DEB
index 9891795ec129dfea5c3bae431bbf52757a7bac19..3bbf62dee43871758215cf578aa0bcf120e2b4bf 100644 (file)
@@ -370,16 +370,7 @@ perform_compat_check_in_normal_mode(options& opts,
   // Now really do the diffing.
   corpus_diff_sptr changes = compute_diff(lib1_corpus, lib2_corpus, ctxt);
 
-  const corpus_diff::diff_stats& s =
-    changes->apply_filters_and_suppressions_before_reporting();
-
-  if (changes->soname_changed()
-      || s.num_func_removed() != 0
-      || s.num_vars_removed() != 0
-      || s.num_func_syms_removed() != 0
-      || s.num_var_syms_removed() != 0
-      || s.net_num_func_changed() != 0
-      || s.net_num_vars_changed() != 0)
+  if (changes->has_net_changes())
     {
       string app_path = opts.app_path,
        lib1_path = opts.lib1_path,
@@ -394,11 +385,7 @@ perform_compat_check_in_normal_mode(options& opts,
 
       status |= abigail::tools_utils::ABIDIFF_ABI_CHANGE;
 
-      bool abi_broke_for_sure = changes->soname_changed()
-       || s.num_vars_removed()
-       || s.num_func_removed()
-       || s.num_var_syms_removed()
-       || s.num_func_syms_removed();
+      bool abi_broke_for_sure = changes->has_incompatible_changes();
 
       cout << "ELF file '" << app_path << "'";
       if (abi_broke_for_sure)
This page took 0.052338 seconds and 5 git commands to generate.