libabigail/configure.ac

1047 lines
32 KiB
Plaintext
Raw Normal View History

Re-license the project to Apache v2 With LLVM Exception Thanks to the previous work done, changing the license is just a matter of changing the SPDX identifer from "LGPL-3.0-or-later" to "Apache-2.0 WITH LLVM-exception". Note that for the abigail.m4, tests/test-dot.cc and tests/test-svg.cc the change was from "GPL-3.0-or-later WITH GCC-exception-3.1" to "Apache-2.0 WITH LLVM-exception". include/abg-cxx-compat.h was changed from "LGPL-2.0-or-later" to "Apache-2.0 WITH LLVM-exception". Source code of programs (as opposed to source code of the library) where generally licensed under GPL-3.0-or-later; they are also now licensed "Apache-2.0 WITH LLVM-exception". This is what this patch does. * abigail.m4: Change the SPDX identifier from "GPL-3.0-or-later WITH GCC-exception-3.1" to "Apache-2.0 WITH LLVM-exception" * include/abg-cxx-compat.h: Change the SPDX identifier from "LGPL-2.0-or-later" to "Apache-2.0 WITH LLVM-exception". * .clang-format: Change the SPDX identifier from "LGPL-3.0-or-later" to "Apache-2.0 WITH LLVM-exception". * Makefile.am: Likewise. * bash-completion/Makefile.am: Likewise. * bash-completion/abicompat: Likewise. * bash-completion/abidiff: Likewise. * bash-completion/abidw: Likewise. * bash-completion/abilint: Likewise. * bash-completion/abinilint: Likewise. * bash-completion/abipkgdiff: Likewise. * bash-completion/abisym: Likewise. * bash-completion/fedabipkgdiff: Likewise. * configure.ac: Likewise. * default.abignore: Likewise. * doc/Makefile.am: Likewise. * doc/api/libabigail.doxy: Likewise. * doc/manuals/Makefile.am: Likewise. * doc/website/libabigail-website.doxy: Likewise. * include/Makefile.am: Likewise. * include/abg-comp-filter.h: Likewise. * include/abg-comparison.h: Likewise. * include/abg-config.h: Likewise. * include/abg-corpus.h: Likewise. * include/abg-diff-utils.h: Likewise. * include/abg-dwarf-reader.h: Likewise. * include/abg-fwd.h: Likewise. * include/abg-hash.h: Likewise. * include/abg-ini.h: Likewise. * include/abg-interned-str.h: Likewise. * include/abg-ir.h: Likewise. * include/abg-libxml-utils.h: Likewise. * include/abg-libzip-utils.h: Likewise. * include/abg-reader.h: Likewise. * include/abg-regex.h: Likewise. * include/abg-reporter.h: Likewise. * include/abg-sptr-utils.h: Likewise. * include/abg-suppression.h: Likewise. * include/abg-tools-utils.h: Likewise. * include/abg-traverse.h: Likewise. * include/abg-version.h.in: Likewise. * include/abg-viz-common.h: Likewise. * include/abg-viz-dot.h: Likewise. * include/abg-viz-svg.h: Likewise. * include/abg-workers.h: Likewise. * include/abg-writer.h: Likewise. * scripts/dot_to_png.sh: Likewise. * scripts/dot_to_svg.sh: Likewise. * scripts/make-verbose.sh: Likewise. * scripts/svg_to_plain_svg.sh: Likewise. * scripts/svg_to_png_and_pdf.sh: Likewise. * src/Makefile.am: Likewise. * src/abg-comp-filter.cc: Likewise. * src/abg-comparison-priv.h: Likewise. * src/abg-comparison.cc: Likewise. * src/abg-config.cc: Likewise. * src/abg-corpus-priv.h: Likewise. * src/abg-corpus.cc: Likewise. * src/abg-default-reporter.cc: Likewise. * src/abg-diff-utils.cc: Likewise. * src/abg-dwarf-reader.cc: Likewise. * src/abg-elf-helpers.cc: Likewise. * src/abg-elf-helpers.h: Likewise. * src/abg-hash.cc: Likewise. * src/abg-ini.cc: Likewise. * src/abg-internal.h: Likewise. * src/abg-ir-priv.h: Likewise. * src/abg-ir.cc: Likewise. * src/abg-leaf-reporter.cc: Likewise. * src/abg-libxml-utils.cc: Likewise. * src/abg-libzip-utils.cc: Likewise. * src/abg-reader.cc: Likewise. * src/abg-regex.cc: Likewise. * src/abg-reporter-priv.cc: Likewise. * src/abg-reporter-priv.h: Likewise. * src/abg-suppression-priv.h: Likewise. * src/abg-suppression.cc: Likewise. * src/abg-tools-utils.cc: Likewise. * src/abg-traverse.cc: Likewise. * src/abg-viz-common.cc: Likewise. * src/abg-viz-dot.cc: Likewise. * src/abg-viz-svg.cc: Likewise. * src/abg-workers.cc: Likewise. * src/abg-writer.cc: Likewise. * tests/Makefile.am: Likewise. * tests/data/Makefile.am: Likewise. * tests/lib/catch.cc: Likewise. * tests/mockfedabipkgdiff.in: Likewise. * tests/print-diff-tree.cc: Likewise. * tests/runtestcanonicalizetypes.sh.in: Likewise. * tests/runtestdefaultsupprs.py.in: Likewise. * tests/runtestdefaultsupprspy3.sh.in: Likewise. * tests/runtestfedabipkgdiff.py.in: Likewise. * tests/runtestfedabipkgdiffpy3.sh.in: Likewise. * tests/test-abicompat.cc: Likewise. * tests/test-abidiff-exit.cc: Likewise. * tests/test-abidiff.cc: Likewise. * tests/test-alt-dwarf-file.cc: Likewise. * tests/test-annotate.cc: Likewise. * tests/test-core-diff.cc: Likewise. * tests/test-cxx-compat.cc: Likewise. * tests/test-diff-dwarf-abixml.cc: Likewise. * tests/test-diff-dwarf.cc: Likewise. * tests/test-diff-filter.cc: Likewise. * tests/test-diff-pkg.cc: Likewise. * tests/test-diff-suppr.cc: Likewise. * tests/test-diff2.cc: Likewise. * tests/test-dot.cc: Change the SPDX identifier from "GPL-3.0-or-later WITH GCC-exception-3.1" to "Apache-2.0 WITH LLVM-exception" * tests/test-elf-helpers.cc: Change the SPDX identifier from "LGPL-3.0-or-later" to "Apache-2.0 WITH LLVM-exception" * tests/test-ini.cc: Likewise. * tests/test-ir-walker.cc: Likewise. * tests/test-kmi-whitelist.cc: Likewise. * tests/test-lookup-syms.cc: Likewise. * tests/test-read-dwarf.cc: Likewise. * tests/test-read-write.cc: Likewise. * tests/test-svg.cc: Change the SPDX identifier from "GPL-3.0-or-later WITH GCC-exception-3.1" to "Apache-2.0 WITH LLVM-exception". * tests/test-symtab.cc: Change the SPDX identifier from "LGPL-3.0-or-later" to "Apache-2.0 WITH LLVM-exception" * tests/test-tools-utils.cc: Likewise. * tests/test-types-stability.cc: Likewise. * tests/test-utils.cc: Likewise. * tests/test-utils.h: Likewise. * tests/test-write-read-archive.cc: Likewise. * tests/update-test-output.py: Likewise. * tools/Makefile.am: Likewise. * tools/abiar.cc: Likewise. * tools/abicompat.cc: Likewise. * tools/abidiff.cc: Likewise. * tools/abidw.cc: Likewise. * tools/abilint.cc: Likewise. * tools/abipkgdiff.cc: Likewise. * tools/abisym.cc: Likewise. * tools/binilint.cc: Likewise. * tools/fedabipkgdiff: Likewise. * tools/kmidiff.cc: Likewise. * update-copyright.sh: Likewise. Signed-off-by: Benjamin De Kosnik <bkoz@gnu.org> Signed-off-by: Ben Woodard <woodard@redhat.com> Signed-off-by: Chenxiong Qi <cqi@redhat.com> Signed-off-by: Dodji Seketeli <dodji@redhat.com> Signed-off-by: Giuliano Procida <gprocida@google.com> Signed-off-by: Jan Engelhardt <jengelh@inai.de> Signed-off-by: Jessica Yu <jeyu@kernel.org> Signed-off-by: Jonathan Wakely <jwakely@redhat.com> Signed-off-by: Mark Wielaard <mark@klomp.org> Signed-off-by: Matthias Klose <doko@ubuntu.com> Signed-off-by: Matthias Maennich <maennich@google.com> Signed-off-by: Ondrej Oprala <ondrej.oprala@gmail.com> Signed-off-by: Roland McGrath <roland@hack.frob.com> Signed-off-by: Sinny Kumari <ksinny@gmail.com> Signed-off-by: Slava Barinov <v.barinov@samsung.com>
2020-05-29 14:26:04 +00:00
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
m4_define([version_major], [2])
m4_define([version_minor], [1])
AC_INIT([libabigail],
[version_major.version_minor],
[http://sourceware.org/bugzilla],
[libabigail],
[http://sourceware.org/libabigail])
AC_PREREQ([2.63])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_SRCDIR([README])
AC_CONFIG_MACRO_DIR([m4])
Bug 19428 - New fedabipkgdiff utility fedabipkgdiff is a convenient way to compare the ABI of Fedora packages easily. The first version of fedabipkgdiff introduced by this patch lets users perform operations like: fedabipkgdiff --from fc23 foo-0.1-1.fc23.x86_64.rpm fedabipkgdiff --from fc23 --to fc24 foo fedabipkgdiff foo-0.1-1.fc23 foo-0.1-1.fc24 fedabipkgdiff foo-0.1-1.fc23.i686 foo-0.1-1.fc24.i686 fedabipkgdiff --all-subpackages foo-0.1-1.fc23 foo-0.1-1.fc24 * autoconf-archive/ax_compare_version.m4: New file copied from the autoconf-archive project. * autoconf-archive/ax_prog_python_version.m4: Likewise. * autoconf-archive/ax_python_module.m4: Likewise. * Makefile.am: Add the new files above to the source distribution. * configure.ac: Include the new m4 macros from the autoconf archive. Add a new --enable-fedabipkgdiff option. Update the report at the end of the configure process to show the status of the fedabipkgdiff feature. Add check for prerequisite python modules argparse, glob, logging, os, re, shlex, subprocess, sys, itertools, urlparse, itertools, shutil, unittest, xdg, koji and mock. These are necessary for the unit test of fedabipkgdiff. Generate tests/runtestfedabipkgdiff.py into the build directory, from the tests/runtestfedabipkgdiff.py.in input file. * tools/Makefile.am: Include the fedabipkgdiff to the source distribution and install it if the "fedabipkgdiff" feature is enabled. * tests/Makefile.am: Rename runtestfedabipkgdiff.sh into runtestfedabipkgdiff.py. Add the new runtestfedabipkgdiff.py.in autoconf template file in here. * tests/runtestfedabipkgdiff.py.in: New unit test file. * tools/fedabipkgdiff: New fedabipkgdiff tool. * doc/manuals/fedabipkgdiff.rst: New manual. Signed-off-by: Chenxiong Qi <cqi@redhat.com> Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-02-09 10:05:33 +00:00
dnl Include some autoconf macros to check for python modules.
dnl
dnl These macros are coming from the autoconf archive at
dnl http://www.gnu.org/software/autoconf-archive
dnl This one is for the AX_CHECK_PYTHON_MODULES() macro.
m4_include([autoconf-archive/ax_check_python_modules.m4])
Bug 19428 - New fedabipkgdiff utility fedabipkgdiff is a convenient way to compare the ABI of Fedora packages easily. The first version of fedabipkgdiff introduced by this patch lets users perform operations like: fedabipkgdiff --from fc23 foo-0.1-1.fc23.x86_64.rpm fedabipkgdiff --from fc23 --to fc24 foo fedabipkgdiff foo-0.1-1.fc23 foo-0.1-1.fc24 fedabipkgdiff foo-0.1-1.fc23.i686 foo-0.1-1.fc24.i686 fedabipkgdiff --all-subpackages foo-0.1-1.fc23 foo-0.1-1.fc24 * autoconf-archive/ax_compare_version.m4: New file copied from the autoconf-archive project. * autoconf-archive/ax_prog_python_version.m4: Likewise. * autoconf-archive/ax_python_module.m4: Likewise. * Makefile.am: Add the new files above to the source distribution. * configure.ac: Include the new m4 macros from the autoconf archive. Add a new --enable-fedabipkgdiff option. Update the report at the end of the configure process to show the status of the fedabipkgdiff feature. Add check for prerequisite python modules argparse, glob, logging, os, re, shlex, subprocess, sys, itertools, urlparse, itertools, shutil, unittest, xdg, koji and mock. These are necessary for the unit test of fedabipkgdiff. Generate tests/runtestfedabipkgdiff.py into the build directory, from the tests/runtestfedabipkgdiff.py.in input file. * tools/Makefile.am: Include the fedabipkgdiff to the source distribution and install it if the "fedabipkgdiff" feature is enabled. * tests/Makefile.am: Rename runtestfedabipkgdiff.sh into runtestfedabipkgdiff.py. Add the new runtestfedabipkgdiff.py.in autoconf template file in here. * tests/runtestfedabipkgdiff.py.in: New unit test file. * tools/fedabipkgdiff: New fedabipkgdiff tool. * doc/manuals/fedabipkgdiff.rst: New manual. Signed-off-by: Chenxiong Qi <cqi@redhat.com> Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-02-09 10:05:33 +00:00
dnl These two below are for the AX_PROG_PYTHON_VERSION() module.
m4_include([autoconf-archive/ax_compare_version.m4])
m4_include([autoconf-archive/ax_prog_python_version.m4])
dnl This one is to be able to run "make check-valgrind"
dnl and have unit tests run under der Valgrind.
m4_include([autoconf-archive/ax_valgrind_check.m4])
AM_INIT_AUTOMAKE([1.11.1 foreign subdir-objects tar-ustar parallel-tests])
AM_MAINTAINER_MODE([enable])
AM_SILENT_RULES([yes])
VERSION_MAJOR=version_major
VERSION_MINOR=version_minor
VERSION_REVISION=0
ABIXML_VERSION_MAJOR=2
ABIXML_VERSION_MINOR=1
AC_SUBST(VERSION_MAJOR)
AC_SUBST(VERSION_MINOR)
AC_SUBST(VERSION_REVISION)
AC_SUBST(ABIXML_VERSION_MAJOR)
AC_SUBST(ABIXML_VERSION_MINOR)
dnl This VERSION_SUFFIX environment variable is to allow appending
dnl arbitrary text to the libabigail version string representation.
dnl That is useful to identify custom versions of the library
dnl (e.g. development versions or versions of a particular origin).
dnl
dnl The feature can be enabled by passing VERSION_SUFFIX to `configure`,
dnl e.g.
dnl
dnl $ configure VERSION_SUFFIX="-dev"
AC_SUBST(VERSION_SUFFIX)
Make the support of RPM and DEB package formats conditional If at configure time the libabigail source tarball detects that rpm2cpio and cpio are present then it enables the support for rpm files. Users can explicitly enable or disable that support by passing --enable-rpm or --disable-rpm to configure. Similarly if it detects that dpkg is present at configure time then it enables the support for deb files. Users can explicitly enable or disable that support by passing --enable-deb or --disable-deb to configure. * config.h.in: Define WITH_DEB and WITH_RPM pre-processor macros. * configure.ac: Add --enable-{rpm,deb} switches. Check for rpm2cpio and cpio programs, unless --disable-rpm was provided. If they are found and if --enable-rpm=auto was provided, then consider that --enable-rpm=yes was provided. In that case, set the WITH_RPM macro to 1. Otherwise, undefine that macro. Similarly, check for dpkg unless --disable-deb was provided. If it's found and if --enable-deb=auto was provided, consider that --enable-deb=yes was provided. In that case, set the WITH_DEB macro to 1. Otherwise, undefine that macro. Define the ENABLE_RPM and ENABLE_DEB conditional automake variables, if the rpm resp. deb support is enabled. Emit a notice about the rpm and deb features being enabled or not, at the end of the configure process. * tests/test-diff-pkg.cc: Include the config.h header. (in_out_spec): Guard rpm tests by the WITH_RPM macro. Similarly, guard deb tests by the WITH_DEB macro. * tools/abipkgdiff.cc: Include the config.h header. (extract_rpm): Guard this function definition with the WITH_RPM macro. (extract_deb): Guard this function definition with the WITH_DEB macro. (extract_package): Guard the handling of rpm packages with the WITH_RPM macro and the handling of deb package with the WITH_DEB macro. If a package not-support package format is encountered, emit an appropriate error message and error out. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-08-14 10:49:57 +00:00
AC_ARG_ENABLE(rpm,
AS_HELP_STRING([--enable-rpm=yes|no|auto],
[enable the support of rpm in abipkgdiff (default is auto)]),
Make the support of RPM and DEB package formats conditional If at configure time the libabigail source tarball detects that rpm2cpio and cpio are present then it enables the support for rpm files. Users can explicitly enable or disable that support by passing --enable-rpm or --disable-rpm to configure. Similarly if it detects that dpkg is present at configure time then it enables the support for deb files. Users can explicitly enable or disable that support by passing --enable-deb or --disable-deb to configure. * config.h.in: Define WITH_DEB and WITH_RPM pre-processor macros. * configure.ac: Add --enable-{rpm,deb} switches. Check for rpm2cpio and cpio programs, unless --disable-rpm was provided. If they are found and if --enable-rpm=auto was provided, then consider that --enable-rpm=yes was provided. In that case, set the WITH_RPM macro to 1. Otherwise, undefine that macro. Similarly, check for dpkg unless --disable-deb was provided. If it's found and if --enable-deb=auto was provided, consider that --enable-deb=yes was provided. In that case, set the WITH_DEB macro to 1. Otherwise, undefine that macro. Define the ENABLE_RPM and ENABLE_DEB conditional automake variables, if the rpm resp. deb support is enabled. Emit a notice about the rpm and deb features being enabled or not, at the end of the configure process. * tests/test-diff-pkg.cc: Include the config.h header. (in_out_spec): Guard rpm tests by the WITH_RPM macro. Similarly, guard deb tests by the WITH_DEB macro. * tools/abipkgdiff.cc: Include the config.h header. (extract_rpm): Guard this function definition with the WITH_RPM macro. (extract_deb): Guard this function definition with the WITH_DEB macro. (extract_package): Guard the handling of rpm packages with the WITH_RPM macro and the handling of deb package with the WITH_DEB macro. If a package not-support package format is encountered, emit an appropriate error message and error out. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-08-14 10:49:57 +00:00
ENABLE_RPM=$enableval,
ENABLE_RPM=auto)
configure: Instead of for rpm 4.15+ version, test actual rpm/zstd support If no 'rpm' is available, we currently get: [...] checking for rpm... no ../git/configure: line 13119: rpm: command not found configure: detected rpm version: configure: rpm support in abipkgdiff is disabled [...] Here is the configuration of the package: [...] Enable rpm support in abipkgdiff : no Enable rpm 4.15 support in abipkgdiff tests : no [...] Notice intermixed error output: 'rpm: command not found'. If Ubuntu focal 'rpm' 4.14.2.1+dfsg1-1build2 is available, we currently get: [...] checking for rpm... yes configure: detected rpm version: 4.14.2.1 configure: rpm support in abipkgdiff is enabled configure: rpm 4.15 support in abipkgdiff tests is enabled [...] Here is the configuration of the package: [...] Enable rpm support in abipkgdiff : yes Enable rpm 4.15 support in abipkgdiff tests : yes [...] Notice wrong 4.15+ version detection (due to '[[ "$rpmversion" > "4.14.0" ]]'), which is satisfied by '4.14.2.1'. (Comparing versions with shell '[[' generally is fragile; instead use 'autoconf-archive/ax_compare_version.m4' or similar?) Also, 'configure'ing with '--disable-rpm415' doesn't work; same output as before. That's due to commit 26c41c060bf30750fe2cded87edaf1ae47027523 "Fix thinko in configure.ac", where either there was no thinko in fact (the original idea, I suppose, was only if 'test x$ENABLE_RPM = xyes' to do the 4.15+ 'auto' checking?), and/or a typo: instead of 'test x$ENABLE_RPM = xyes', the first conditional should 'test x$ENABLE_RPM415 = xyes'? And, 'configure'ing with '--enable-rpm415' doesn't raise a hard error if 'rpm' actually isn't 4.15+. But all that said, we don't actually need to check for rpm 4.15+ version, but instead may simply check for the rpm/zstd support that we need: 'rpm2cpio'. * configure.ac: Instead of for rpm 4.15+ version, test actual rpm/zstd support. * tests/test-diff-pkg.cc: Adjust. Signed-off-by: Thomas Schwinge <thomas@codesourcery.com>
2021-12-10 16:52:46 +00:00
# '--enable-rpm415' option name preserved for backwards compatibility.
AC_ARG_ENABLE(rpm415,
AS_HELP_STRING([--enable-rpm415=yes|no|auto],
configure: Instead of for rpm 4.15+ version, test actual rpm/zstd support If no 'rpm' is available, we currently get: [...] checking for rpm... no ../git/configure: line 13119: rpm: command not found configure: detected rpm version: configure: rpm support in abipkgdiff is disabled [...] Here is the configuration of the package: [...] Enable rpm support in abipkgdiff : no Enable rpm 4.15 support in abipkgdiff tests : no [...] Notice intermixed error output: 'rpm: command not found'. If Ubuntu focal 'rpm' 4.14.2.1+dfsg1-1build2 is available, we currently get: [...] checking for rpm... yes configure: detected rpm version: 4.14.2.1 configure: rpm support in abipkgdiff is enabled configure: rpm 4.15 support in abipkgdiff tests is enabled [...] Here is the configuration of the package: [...] Enable rpm support in abipkgdiff : yes Enable rpm 4.15 support in abipkgdiff tests : yes [...] Notice wrong 4.15+ version detection (due to '[[ "$rpmversion" > "4.14.0" ]]'), which is satisfied by '4.14.2.1'. (Comparing versions with shell '[[' generally is fragile; instead use 'autoconf-archive/ax_compare_version.m4' or similar?) Also, 'configure'ing with '--disable-rpm415' doesn't work; same output as before. That's due to commit 26c41c060bf30750fe2cded87edaf1ae47027523 "Fix thinko in configure.ac", where either there was no thinko in fact (the original idea, I suppose, was only if 'test x$ENABLE_RPM = xyes' to do the 4.15+ 'auto' checking?), and/or a typo: instead of 'test x$ENABLE_RPM = xyes', the first conditional should 'test x$ENABLE_RPM415 = xyes'? And, 'configure'ing with '--enable-rpm415' doesn't raise a hard error if 'rpm' actually isn't 4.15+. But all that said, we don't actually need to check for rpm 4.15+ version, but instead may simply check for the rpm/zstd support that we need: 'rpm2cpio'. * configure.ac: Instead of for rpm 4.15+ version, test actual rpm/zstd support. * tests/test-diff-pkg.cc: Adjust. Signed-off-by: Thomas Schwinge <thomas@codesourcery.com>
2021-12-10 16:52:46 +00:00
[enable rpm/zstd in abipkgdiff testing (default is auto)]),
ENABLE_RPM_ZSTD=$enableval,
ENABLE_RPM_ZSTD=auto)
Detect failed self comparison in type canonicalization of abixml During the self comparison triggered by "abidw --abidiff <binary>", some comparison errors can happen when canonicalizing types that are "de-serialized" from the abixml that was serialized from the input binary. This patch adds some debugging checks and messaging to emit a message when a type from the abixml appears to not "match" the original type from the initial corpus it originated from. This is the more detailed description: Let's consider a type T coming from the corpus of the input binary. That input corpus is serialized into abixml and de-serialized again into a second corpus that we shall name the abixml corpus. From that second corpus, let's consider the type T' that is the result of serializing T into abixml and de-serializing it again. T is said to be the original type of T'. If T is a canonical type, then T' should equal T. Otherwise, if T is not a canonical type, its canonical type should equal the canonical type of T'. For the sake of simplicity, let's consider that T is a canonical type. During the canonicalization of T', T' should equal T. Each and every canonical type coming from the abixml corpus should be equal to its original type from the binary corpus. If a T' is different from its original type T, then there is an "equality problem" between T and T'. In other words, there is a mismatch between T and T'. We want to be notified of that problem so that we can debug it further and fix it. So this patch introduces the option "abidw --debug-abidiff <binary>" to trigger the "debug self comparison mode". At canonicalization time, we detect that we are in that debug self comparison mode and during canonicalization of types from the abixml corpus, it detects when they compare different from their counterpart from the original corpus. This debugging capability can be enabled at configure time with a new --enable-debug-self-comparison configure option. That option defines a new WITH_DEBUG_SELF_COMPARISON compile time macro that is used to conditionally compile the implementation of this debugging feature. So, one example of this might look like this: abidw --debug-abidiff bin: error: problem detected with type 'typedef Vmalloc_t' from second corpus error: problem detected with type 'Vmalloc_t*' from second corpus [...] So that means the "typedef Vmalloc_t" read from the abixml compares different from its original type where it should not. So armed with this new insight, I know I need to debug that comparison in particular to see why it wrongly results in two different types. * doc/manuals/abidw.rst: Add documentation for the --debug-abidiff option. * include/abg-ir.h (environment::{set_self_comparison_debug_input, get_self_comparison_debug_inputs, self_comparison_debug_is_on}): Declare new methods. * configure.ac: Define a new --enable-debug-self-comparison option that is disabled by default. That option defines a new WITH_DEBUG_SELF_COMPARISON preprocessor macro. * src/abg-ir.cc (environment::priv::{first_self_comparison_corpus_, second_self_comparison_corpus_, self_comparison_debug_on_}): New data members. Also, re-indent the data members. (environment::{set_self_comparison_debug_input, get_self_comparison_debug_inputs, self_comparison_debug_is_on}): Define new method. (type_base::get_canonical_type_for): In the "debug self comparison mode", if a type coming from the second corpus compares different from its counterpart coming from the first corpus then log a debug message. * src/abg-dwarf-reader.cc (read_debug_info_into_corpus): When loading the first corpus, if the debug self comparison mode is on, then save that corpus on the side in the environment. * src/abg-reader.cc (read_corpus_from_input): When loading the second corpus, if the debug self comparison mode is on, then save that corpus on the side in the environment. * tools/abidw.cc: Include the config.h file for preprocessor macros defined at configure (options::debug_abidiff): New data member. (parse_command_line): Parse the --debug-abidiff option. (load_corpus_and_write_abixml): Switch the self debug mode on when the --debug-abidiff option is provided. Use a read_context for the abixml loading. That is going to be useful for subsequent patches. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2021-05-18 08:29:38 +00:00
AC_ARG_ENABLE(debug-self-comparison,
AS_HELP_STRING([--enable-debug-self-comparison=yes|no],
[enable debugging of self comparison with 'abidw --debug-abidiff'(default is no)]),
ENABLE_DEBUG_SELF_COMPARISON=$enableval,
ENABLE_DEBUG_SELF_COMPARISON=no)
Add --enable-debug-type-canonicalization to configure This configure option adds the possibility to debug the type canonicalization process specifically. When this new configure option is turned on, in ir::get_canonical_type_for, when the type T, candidate for canonicalization is compared to a given canonical type C, the comparison is done twice; once using structural equality and once using canonical equality whenever it's possible. For all the sub-types of T and C, structural equality and canonical equality must yield the same result. Otherwise, an error message is emitted and the process aborts. This all happens when using the abidw program with the --enable-tc or --enable-type-canonicalization option. This has proven to be very helpful to detect type canonicalization issues. For instance, here is a trace of canonicalization issue that was detected thanks to this patch: $ build/tools/abidw --debug-tc /usr/lib64/libwiretap.so.11.0.8 structural & canonical equality different for type: function type void (wtap*) in compare_types_during_canonicalization at: /home/dodji/git/libabigail/PR28364/src/abg-ir.cc:13575: execution should not have reached this point! Abandon (core dumped) This means that right after canonicalizing the type "void (wtap*)", structural and canonical equality yield different results. So it means there is a problem with that type specifically that makes its canonicalization "go wrong". This requires further debugging to understand, but at least, we are super close to the root cause of the canonicalization problem. * configure.ac: Support the new --enable-debug-type-canonicalization option. Define macro WITH_DEBUG_TYPE_CANONICALIZATION accordingly. * doc/manuals/abidw.rst: Update documentation. * include/abg-ir.h (environment::debug_type_canonicalization_is_on): Declare new member function if WITH_DEBUG_TYPE_CANONICALIZATION is defined. * src/abg-ir-priv.h (environment::priv::{use_canonical_type_comparison_, debug_type_canonicalization_}): Define new data members if WITH_DEBUG_TYPE_CANONICALIZATION is defined. (environment::priv::priv): Initialize them. * src/abg-ir.cc (try_canonical_compare): When WITH_DEBUG_TYPE_CANONICALIZATION is defined, perform comparison using either structural or canonical equality depending on the environment::priv::use_canonical_type_comparison_ flag. (environment::debug_type_canonicalization_is_on): Define member function when WITH_DEBUG_TYPE_CANONICALIZATION is defined. (compare_types_during_canonicalization): Define new function. (type_base::get_canonical_type_for): Use the new function compare_types_during_canonicalization. * tools/abidw.cc (options::debug_type_canonicalization): Define new data member. (option::option): Initialize it. (display_usage): Add help string for --debug-tc. (parse_command_line): Support new option --debug-tc or --debug-type-canonicalization. (load_corpus_and_write_abixml): Turn type canonicalization debugging on if --enable-tc is provided. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2021-10-14 10:12:01 +00:00
AC_ARG_ENABLE(debug-type-canonicalization,
AS_HELP_STRING([--enable-debug-type-canonicalization=yes|no],
[enable debugging of type canonicalization 'abidw --debug-tc'(default is no)]),
ENABLE_DEBUG_TYPE_CANONICALIZATION=$enableval,
ENABLE_DEBUG_TYPE_CANONICALIZATION=no)
abilint: add the --show-type-use option "abilint --show-type-use <type-id> <abixml-file>" is a facility that shows how a type defined in an abixml file is used. That is, it emits a textual representation of how the use a type is used up until the function or global variable that constitutes an entry point in the API corpus. Here is an example of its use: test-read-write$ abilint --noout --show-type-use type-id-5 test17.xml Type ID 'type-id-5' is for type 'enum E' The usage graph for that type is: | -> enum E -> E S::m2 -> class S -> S* -> method void S::S() | -> enum E -> E S::m2 -> class S -> S* -> method void S::__base_ctor () | -> enum E -> E S::m2 -> class S -> S* -> method void S::__comp_ctor () | -> enum E -> E S::m2 -> class S -> S* -> method void S::S(S&) | -> enum E -> E S::m2 -> class S -> S* -> S& -> method void S::S(S&) | -> enum E -> E S::m2 -> class S -> S* -> S& -> S var | -> enum E -> E S::m2 -> class S -> S* -> S& -> E S::m2 -> class S -> S* -> method void S::S() | -> enum E -> E S::m2 -> class S -> S* -> S& -> E S::m2 -> class S -> S* -> method void S::__base_ctor () | -> enum E -> E S::m2 -> class S -> S* -> S& -> E S::m2 -> class S -> S* -> method void S::__comp_ctor () | -> enum E -> E S::m2 -> class S -> S* -> S& -> E S::m2 -> class S -> S* -> method void S::S(S&) | -> enum E -> E S::m2 -> class S -> S* -> S& -> E S::m2 -> class S -> S* -> S& -> method void S::S(S&) | -> enum E -> E S::m2 -> class S -> S* -> S& -> E S::m2 -> class S -> S* -> S& -> S var $ The screenshot above should be self explanatory. This facility is useful to analyse type usage and find potential issues in how libabigail represents some types. To activate this feature, one needs to configure the package with the configure option "--enable-show-type-use-in-abilint". * configure.ac: Define the --enable-show-type-use-in-abilint configure option. It defines the WITH_SHOW_TYPE_USE_IN_ABILINT macro. * include/abg-reader.h (read_translation_unit): Add an overload that takes the read context. (get_types_from_type_id, get_artifact_used_by_relation_map): Declare new functions. * src/abg-reader.cc (get_types_from_type_id) (get_artifact_used_by_relation_map): Declare these functions as friend of the read_context type. (read_context::m_artifact_used_by_map): (read_context::key_type_decl): Replace the shared_ptr<type_base> type of the first parm by the equivalent type_base_sptr type. (read_context::{record_artifact_as_used_by, record_artifacts_as_used_in_fn_decl, record_artifacts_as_used_in_fn_type}): Add new methods guarded by the WITH_SHOW_TYPE_USE_IN_ABILINT macro. (get_types_from_type_id, get_artifact_used_by_relation_map): Define new functions guarded by the WITH_SHOW_TYPE_USE_IN_ABILINT macro. (read_translation_unit): Define new overload. (RECORD_ARTIFACT_AS_USED_BY, RECORD_ARTIFACTS_AS_USED_IN_FN_DECL) (RECORD_ARTIFACTS_AS_USED_IN_FN_TYPE): Define new macros. (build_function_decl, build_var_decl, build_qualified_type_decl) (build_pointer_type_def, build_reference_type_def) (build_function_type, build_array_type_def, build_enum_type_decl) (build_typedef_decl, build_class_decl, build_union_decl): Use the macros above to mark the relevant sub-types as used by the artifact being built. * tools/abilint.cc (struct artifact_use_relation_tree): Define new type, guarded by the WITH_SHOW_TYPE_USE_IN_ABILINT macro. (fill_artifact_use_tree, build_type_use_tree, emit_trace) (emit_artifact_use_trace, emit_artifact_use_trace) (show_how_type_is_used): Define static functions guarded by the WITH_SHOW_TYPE_USE_IN_ABILINT macro. (display_usage): Add doc string for the --show-type-use option, guarded by the WITH_SHOW_TYPE_USE_IN_ABILINT macro. (parse_command_line): Parse the --show-type-use option, guarded by the WITH_SHOW_TYPE_USE_IN_ABILINT macro. (main): Slight re-organisation to make the abixml file reading use a read_context. That read context is then used to analyze how a given type is used whenever the --show-type-use option is used. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2022-02-17 11:22:25 +00:00
AC_ARG_ENABLE(show-type-use-in-abilint,
AS_HELP_STRING([--enable-show-type-use-in-abilint=yes|no],
['enable abilint --show-type-use'(default is no)]),
ENABLE_SHOW_TYPE_USE_IN_ABILINT=$enableval,
ENABLE_SHOW_TYPE_USE_IN_ABILINT=no)
Make the support of RPM and DEB package formats conditional If at configure time the libabigail source tarball detects that rpm2cpio and cpio are present then it enables the support for rpm files. Users can explicitly enable or disable that support by passing --enable-rpm or --disable-rpm to configure. Similarly if it detects that dpkg is present at configure time then it enables the support for deb files. Users can explicitly enable or disable that support by passing --enable-deb or --disable-deb to configure. * config.h.in: Define WITH_DEB and WITH_RPM pre-processor macros. * configure.ac: Add --enable-{rpm,deb} switches. Check for rpm2cpio and cpio programs, unless --disable-rpm was provided. If they are found and if --enable-rpm=auto was provided, then consider that --enable-rpm=yes was provided. In that case, set the WITH_RPM macro to 1. Otherwise, undefine that macro. Similarly, check for dpkg unless --disable-deb was provided. If it's found and if --enable-deb=auto was provided, consider that --enable-deb=yes was provided. In that case, set the WITH_DEB macro to 1. Otherwise, undefine that macro. Define the ENABLE_RPM and ENABLE_DEB conditional automake variables, if the rpm resp. deb support is enabled. Emit a notice about the rpm and deb features being enabled or not, at the end of the configure process. * tests/test-diff-pkg.cc: Include the config.h header. (in_out_spec): Guard rpm tests by the WITH_RPM macro. Similarly, guard deb tests by the WITH_DEB macro. * tools/abipkgdiff.cc: Include the config.h header. (extract_rpm): Guard this function definition with the WITH_RPM macro. (extract_deb): Guard this function definition with the WITH_DEB macro. (extract_package): Guard the handling of rpm packages with the WITH_RPM macro and the handling of deb package with the WITH_DEB macro. If a package not-support package format is encountered, emit an appropriate error message and error out. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-08-14 10:49:57 +00:00
AC_ARG_ENABLE(deb,
AS_HELP_STRING([--enable-deb=yes|no|auto],
[enable the support of deb in abipkgdiff (default is auto)]),
Make the support of RPM and DEB package formats conditional If at configure time the libabigail source tarball detects that rpm2cpio and cpio are present then it enables the support for rpm files. Users can explicitly enable or disable that support by passing --enable-rpm or --disable-rpm to configure. Similarly if it detects that dpkg is present at configure time then it enables the support for deb files. Users can explicitly enable or disable that support by passing --enable-deb or --disable-deb to configure. * config.h.in: Define WITH_DEB and WITH_RPM pre-processor macros. * configure.ac: Add --enable-{rpm,deb} switches. Check for rpm2cpio and cpio programs, unless --disable-rpm was provided. If they are found and if --enable-rpm=auto was provided, then consider that --enable-rpm=yes was provided. In that case, set the WITH_RPM macro to 1. Otherwise, undefine that macro. Similarly, check for dpkg unless --disable-deb was provided. If it's found and if --enable-deb=auto was provided, consider that --enable-deb=yes was provided. In that case, set the WITH_DEB macro to 1. Otherwise, undefine that macro. Define the ENABLE_RPM and ENABLE_DEB conditional automake variables, if the rpm resp. deb support is enabled. Emit a notice about the rpm and deb features being enabled or not, at the end of the configure process. * tests/test-diff-pkg.cc: Include the config.h header. (in_out_spec): Guard rpm tests by the WITH_RPM macro. Similarly, guard deb tests by the WITH_DEB macro. * tools/abipkgdiff.cc: Include the config.h header. (extract_rpm): Guard this function definition with the WITH_RPM macro. (extract_deb): Guard this function definition with the WITH_DEB macro. (extract_package): Guard the handling of rpm packages with the WITH_RPM macro and the handling of deb package with the WITH_DEB macro. If a package not-support package format is encountered, emit an appropriate error message and error out. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-08-14 10:49:57 +00:00
ENABLE_DEB=$enableval,
ENABLE_DEB=auto)
Make abipkgdiff compare tar archives containing binaries This patch adds support for comparing the ABI of binaries contained in a tar archive. If the archive is compressed with gzip, bzip2, lzip, lzma or xz, then abipkgdiff recognizes the usual relevant file extensions and lets the GNU tar program handle the decompression. If the archive is not compressed, abipkgdiff recognizes the UStar (Uniform Standard Tape ARchive) format, even if the archive file name doesn't end with the .tar extension, and lets the GNU tar program handle the extraction. If the file ends up with the .tar extension anyway (even if it's not in the UStar format, abipkgdiff lets the GNU tar program handle its extraction. * config.h.in (WITH_TAR): New configuration preprocessor macro. * configure.ac: Add a new --enable-tar option. It's turned on automatically if the tar program is found in the PATH. Adjust the build configuration report to add the tar archive support. * include/abg-tools-utils.h (string_ends_with): Declare new function. (enum file_type): Add a new FILE_TYPE_TAR enumerator. * src/abg-tools-utils.cc (string_ends_with): Define new function. (operator<<(ostream&, file_type)): Serialize the new FILE_TYPE_TAR enumerator. (guess_file_type): Detect UStar format file by reading its magic number. Detect compressed tar files based on the file path extension. * tools/abipkgdiff.cc (extract_tar): Define new function. (extract_package): Handle tar packages. (main): Handle tar archives. * tools/abidiff.cc (main): Handle the new FILE_TYPE_TAR enumerator. * tools/abilint.cc (main): Likewise. * tests/data/test-diff-pkg/tarpkg-0-dir{1,2}.ta{,r,.bz2, gz}: New test input tarballs. * tests/data/test-diff-pkg/tarpkg-0-report-0.txt: New test output reference. * tests/data/Makefile.am: Add the new test data file above to source distribution. * tests/test-diff-pkg.cc (in_out_specs): Add new tests cases. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-08-22 11:59:18 +00:00
AC_ARG_ENABLE(tar,
AS_HELP_STRING([--enable-tar=yes|no|auto],
[enable the support of GNU tar archives in abipkgdiff (default is auto)]),
ENABLE_TAR=$enableval,
ENABLE_TAR=auto)
AC_ARG_ENABLE(apidoc,
AS_HELP_STRING([--enable-apidoc=yes|no|auto],
[enable generation of the apidoc in html]),
ENABLE_APIDOC=$enableval,
ENABLE_APIDOC=auto)
AC_ARG_ENABLE(manual,
AS_HELP_STRING([--enable-manual=yes|no|auto],
[enable generation of the manual in html]),
ENABLE_MANUAL=$enableval,
ENABLE_MANUAL=auto)
AC_ARG_ENABLE([bash-completion],
AS_HELP_STRING([--enable-bash-completion=yes|no|auto],
[enable using completion files for tools]),
ENABLE_BASH_COMPLETION=$enableval,
ENABLE_BASH_COMPLETION=auto)
Bug 19428 - New fedabipkgdiff utility fedabipkgdiff is a convenient way to compare the ABI of Fedora packages easily. The first version of fedabipkgdiff introduced by this patch lets users perform operations like: fedabipkgdiff --from fc23 foo-0.1-1.fc23.x86_64.rpm fedabipkgdiff --from fc23 --to fc24 foo fedabipkgdiff foo-0.1-1.fc23 foo-0.1-1.fc24 fedabipkgdiff foo-0.1-1.fc23.i686 foo-0.1-1.fc24.i686 fedabipkgdiff --all-subpackages foo-0.1-1.fc23 foo-0.1-1.fc24 * autoconf-archive/ax_compare_version.m4: New file copied from the autoconf-archive project. * autoconf-archive/ax_prog_python_version.m4: Likewise. * autoconf-archive/ax_python_module.m4: Likewise. * Makefile.am: Add the new files above to the source distribution. * configure.ac: Include the new m4 macros from the autoconf archive. Add a new --enable-fedabipkgdiff option. Update the report at the end of the configure process to show the status of the fedabipkgdiff feature. Add check for prerequisite python modules argparse, glob, logging, os, re, shlex, subprocess, sys, itertools, urlparse, itertools, shutil, unittest, xdg, koji and mock. These are necessary for the unit test of fedabipkgdiff. Generate tests/runtestfedabipkgdiff.py into the build directory, from the tests/runtestfedabipkgdiff.py.in input file. * tools/Makefile.am: Include the fedabipkgdiff to the source distribution and install it if the "fedabipkgdiff" feature is enabled. * tests/Makefile.am: Rename runtestfedabipkgdiff.sh into runtestfedabipkgdiff.py. Add the new runtestfedabipkgdiff.py.in autoconf template file in here. * tests/runtestfedabipkgdiff.py.in: New unit test file. * tools/fedabipkgdiff: New fedabipkgdiff tool. * doc/manuals/fedabipkgdiff.rst: New manual. Signed-off-by: Chenxiong Qi <cqi@redhat.com> Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-02-09 10:05:33 +00:00
AC_ARG_ENABLE([fedabipkgdiff],
AS_HELP_STRING([--enable-fedabipkgdiff=yes|no|auto],
[enable the fedabipkgdiff tool]),
ENABLE_FEDABIPKGDIFF=$enableval,
ENABLE_FEDABIPKGDIFF=auto)
Bug 22722 - Make fedabipkgdiff and its tests support both python 3 and 2 This patch makes fedabipkgdiff Python 3 compatible. All tests written in Python are updated and compatible with Python 3 as well. The patch looks for a Python 3 interperter. If it finds one then it runs the tests using that interpreter. Otherwise it just tries to use the Python 2 interpreter. This behaviour can be disabled by the new --disable-python3 option. * configure.ac: Add new option --enable-python3. Add new test runner file tests/runtestdefaultsupprs-py3 and tests/runtestfedabipkgdiffpy3.sh. Add required six Python module. * tests/Makefile.am: Add new test files tests/runtestdefaultsupprspy3.sh and tests/runtestfedabipkgdiffpy3.sh accordingly. * tests/mockfedabipkgdiff.in: Convert print statement to six.print_. Replace call to function filter with list comprehension. Replace basestring with six.string_types. * tests/runtestdefaultsupprspy3.sh.in: New shell script to run test runtestdefaultsupprs with Python 3. * tests/runtestdefaultsupprs.py.in: Repalce a few tabs with proper number of spaces which is detected by Python 3 interpreter. * tests/runtestfedabipkgdiffpy3.sh.in: New shell script to run test runtestfedabipkgdiff with Python 3. * tests/runtestfedabipkgdiff.py.in: Use python from env in shebang instead of a fixed path to a Python interpreter. * tools/fedabipkgdiff: Globally replace print statement with a function call to print which is available by importing print_function from __future__ module. Use six.print_ to output string to stderr instead. Convert function call to map to for-loop. (cmp_nvr): Change argument to handle a Koji build mapping instead of only the nvr. (Brew.listBuilds): use the new cmp_nvr to sort builds. Signed-off-by: Chenxiong Qi <cqi@redhat.com> Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2018-03-25 07:34:59 +00:00
AC_ARG_ENABLE([python3],
AS_HELP_STRING([--enable-python3=yes|no|auto],
[enable running abigail tools with python3 (default is auto)]),
ENABLE_PYTHON3=$enableval,
ENABLE_PYTHON3=auto)
AC_ARG_ENABLE(asan,
AS_HELP_STRING([--enable-asan=yes|no],
[enable the support of building with -fsanitize=address)]),
ENABLE_ASAN=$enableval,
ENABLE_ASAN=no)
AC_ARG_ENABLE(msan,
AS_HELP_STRING([--enable-msan=yes|no],
[enable the support of building with -fsanitize=memory)]),
ENABLE_MSAN=$enableval,
ENABLE_MSAN=no)
AC_ARG_ENABLE(tsan,
AS_HELP_STRING([--enable-tsan=yes|no],
[enable the support of building with -fsanitize=thread)]),
ENABLE_TSAN=$enableval,
ENABLE_TSAN=no)
AC_ARG_ENABLE(ubsan,
AS_HELP_STRING([--enable-ubsan=yes|no],
[enable the support of building with -fsanitize=undefined)]),
ENABLE_UBSAN=$enableval,
ENABLE_UBSAN=no)
Add support for the CTF debug format to libabigail. CTF (C Type Format) is a lightweight debugging format that provides information about C types and the association between functions and data symbols and types. It is designed to be very compact and simple. More can be learned about it at https://ctfstd.org. This patch introduces support in libabigail to extract ABI information from CTF stored in ELF files. A few notes on this implementation: - The implementation is complete in terms of CTF support. Every CTF feature is processed and handled to generate libabigail IR. This includes basic types, typedefs, pointer, array and struct types. The CTF record of data objects (variables) and functions are also used in order to generate the corresponding libabigail IR artifacts. - The decoding of CTF data is done using the libctf library which is part of binutils. In order to link with it, binutils shall be built with --enable-shared for libctf.so to become available. - This initial implementation is aimed to simplicity. We have not tried to resolve any and every corner case that may require special handling. We have observed that the DWARF front-end (which is naturally way more complex as the scope is way bigger) is plagued with hacks to handle such situations. However, for the CTF support we prefer to proceed in a simpler and more modest way: we will handle these problems if/when we find them. The fact that CTF only supports C (currently) certainly helps there. - Likewise, in this basic support we are not handling symbol suppressions or other goodies that libabigail provides. We are new to libabigail and ABI analysis, and at this point we simply don't have a clear picture about what is most useful/relevant to support or not. With the maintainer's blesssing, we will tackle that functionaly after this basic support is applied upstream. - The implementation in abg-ctf-reader.{cc,h} is pretty much self-contained. As a result there is some duplication in terms of ELF handling with the DWARF reader, but since that logic is very simple and can be easily implemented, we don't consider this to be a big deal (for now.) Hopefully the maintainers agree. - The libabigail tools assume that ELF means to always use DWARF to generate the ABI IR. We added a new command-line option --ctf to the tools in order to make them to use the CTF debug info instead. We are definitely not sure whether this is the best user interface. In fact I would be suprised if it was ;) - We added support for --ctf to both abilint and abidiff. We are not sure whether it would make sense to add support for CTF to the other tools. Feedback welcome. - We are pondering about what to do in terms of testing. We have cursory tested this implementation using abilint and abidiff. We know we are generating IR corpus that seem to be ok. It would be good however to be able to run the libabigail testsuites using CTF. However the testsuites may need some non-trivial changes in order to make this possible. Let's talk about that :) * configure.ac: Check for libctf. * src/abg-ctf-reader.cc: New file. * include/abg-ctf-reader.h: Likewise. * src/Makefile.am (libabigail_la_SOURCES): Add abg-ctf-reader.cc conditionally. * include/Makefile.am (pkginclude_HEADERS): Add abg-ctf-reader.h conditionally. * tools/abilint.cc (struct options): New option `use_ctf'. (display_usage): Documentation for --ctf. (parse_command_line): Handle --ctf. (main): Honour --ctf. * tools/abidiff.cc (struct options): New option `use_ctf'. (display_usage): Documentation for --ctf. (parse_command_line): Handle --ctf. (main): Honour --ctf. * doc/manuals/abidiff.rst: Document --ctf. * doc/manuals/abilint.rst: Likewise. Signed-off-by: Jose E. Marchesi <jose.marchesi@oracle.com> Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2021-10-28 22:51:32 +00:00
dnl check if user has enabled CTF code
AC_ARG_ENABLE(ctf,
AS_HELP_STRING([--enable-ctf=yes|no],
[disable support of ctf files)]),
ENABLE_CTF=$enableval,
ENABLE_CTF=no)
dnl *************************************************
dnl check for dependencies
dnl *************************************************
AC_PROG_CXX
AC_CANONICAL_HOST
AC_USE_SYSTEM_EXTENSIONS
AC_PROG_INSTALL
LT_PREREQ([2.2])
LT_INIT
AC_LANG([C++])
AC_LANG_COMPILER_REQUIRE
Use C++11 for the code base As the Enterprise Linux 6 platform has now essentially reached it's end of life for what it's worth (the Fedora EPEL6 distribution is not maintained anymore) nothing ties us to using C++03 only anymore. So, I think it makes sense to move the code base to the C++11 standard. Why C++11 and not, say, C++14 or more? Well, the more direct reason I see is that we need to support long life cycle platforms, the older one being Enterprise Linux 7 currently. This is the Fedora EPEL7 distribution, in concrete terms. And in that distribution, the compiler is GCC 4.8.x. And it supports C++11. In practise, nothing changes in the code that is already there. The new code however can use C++11 constructs just fine. I have updated the CONTRIBUTING file to write down some of the unwritten cultural biases of the current code base. Hopefully these few lines will help to shed some light on the choices made so far. The update to that file also enacts the use of C++11 and sets some limits to what we expects in terms of what the code base would look like. configure.ac is modified to unconditionally pass -std=c++11 to the compiler and express that in the configuration text displayed at the end of the configuration stage. Some Makefile.am files are updated accordingly. * CONTRIBUTING: Enact use of c++11. Also, we favor those who read/debug/maintain the code as opposed to those who write it ;-) * configure.ac: Switch to c++11 unconditionally. * src/Makefile.am: Adjust. * tests/Makefile.am: Adjust. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2020-12-03 09:53:08 +00:00
dnl
dnl We use C++11
dnl
CXX_STANDARD=c++11
dnl
dnl check if the c++ compiler has support __attribute__((visibility("hidden")))
dnl
AC_MSG_NOTICE([checking for GCC visibility attribute support ...])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
struct __attribute__((visibility("hidden"))) Foo
{
int m0;
Foo()
: m0()
{}
};
]])],
[SUPPORTS_GCC_VISIBILITY_ATTRIBUTE=yes],
[SUPPORTS_GCC_VISIBILITY_ATTRIBUTE=no]
)
if test x$SUPPORTS_GCC_VISIBILITY_ATTRIBUTE = xyes; then
AC_MSG_NOTICE([GCC visibility attribute is supported])
AC_DEFINE([HAS_GCC_VISIBILITY_ATTRIBUTE], 1,
[Defined if the compiler supports the attribution visibility syntax __attribute__((visibility("hidden")))])
Control symbols exported from libabigail.so Symbols of pretty much all member functions of types that are meant to be "private" to translation units that contribute to libabigail.so were exported because we didn't do much to prevent that. This patch starts controlling the set of symbols that are exported. By default, symbols of any entity declared in a translation unit that contributes to libabigail.so are hidden by default. Only symbols of entities declared in public headers (headers in include/*.h) are exported. There are many ways to achieve that. This patch chooses to avoid cluttering declarations of entities in the public header by adding __attribute__((visibility="default")) to every declared type of function in there. Rather, the patch uses "#pragma GCC visibility push(default)" before entities declared on those headers. By doing so, all those entities have their symbol marked as "visible" by the compiler. Once the header are #included, the #pragma GCC visibility pop" is used, so that anything else has its symbol be hidden from that point on. Note that for ease of maintenance the patch uses the macros ABG_BEGIN_EXPORT_DECLARATIONS and ABG_END_EXPORT_DECLARATIONS rather than using the pragma directive directly. I believe this is a more elegant way of handling visibility, compared to cluttering every single declaration in public headers with a "__attribute__((visibility=("default")))" or with a macro which expands to it. This reduces the the set of symbols exported by libabigail.so from 20000+ to less than 5000. * VISIBILITY: New documentation about this visiblity business. * CONTRIBUTING: Update the "contributing guide" to refer to symbol visibility issues. * configure.ac: Define a variable VISIBILITY_FLAGS that is set to the -fvisibility=hidden flag to pass to GCC, when its available. * src/Makefile.am: Add VISIBILITY to source distribution. Also add COMPILING and COMMIT-LOG-GUIDELINES that were missing. * src/Makefile.am: Use the new $(VISIBILITY_FLAGS) when buiding the library. * tests/Makefile.am: Use the new $(VISIBILITY_FLAGS) when buiding tests. * tools/Makefile.am: Use the new $(VISIBILITY_FLAGS) when buiding tools. * src/abg-comp-filter.cc: Enclose inclusion of public headers in ABG_BEGIN_EXPORT_DECLARATIONS and ABG_END_EXPORT_DECLARATIONS to export the symbols of entities declared in there. * src/abg-comparison.cc: Likewise. * src/abg-config.cc: Likewise. * src/abg-corpus.cc: Likewise. * src/abg-diff-utils.cc: Likewise. * src/abg-dwarf-reader.cc: Likewise. * src/abg-hash.cc: Likewise. * src/abg-ini.cc: Likewise. * src/abg-ir.cc: Likewise. * src/abg-libxml-utils.cc: Likewise. * src/abg-libzip-utils.cc: Likewise. * src/abg-reader.cc: Likewise. * src/abg-suppression.cc: Likewise. * src/abg-tools-utils.cc: Likewise. * src/abg-traverse.cc: Likewise. * src/abg-viz-common.cc: Likewise. * src/abg-viz-dot.cc: Likewise. * src/abg-viz-svg.cc: Likewise. * src/abg-workers.cc: Likewise. * src/abg-writer.cc: Likewise. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-07-27 10:18:58 +00:00
VISIBILITY_FLAGS="-fvisibility=hidden"
else
AC_MSG_NOTICE([GCC visibility attribute is not supported])
Control symbols exported from libabigail.so Symbols of pretty much all member functions of types that are meant to be "private" to translation units that contribute to libabigail.so were exported because we didn't do much to prevent that. This patch starts controlling the set of symbols that are exported. By default, symbols of any entity declared in a translation unit that contributes to libabigail.so are hidden by default. Only symbols of entities declared in public headers (headers in include/*.h) are exported. There are many ways to achieve that. This patch chooses to avoid cluttering declarations of entities in the public header by adding __attribute__((visibility="default")) to every declared type of function in there. Rather, the patch uses "#pragma GCC visibility push(default)" before entities declared on those headers. By doing so, all those entities have their symbol marked as "visible" by the compiler. Once the header are #included, the #pragma GCC visibility pop" is used, so that anything else has its symbol be hidden from that point on. Note that for ease of maintenance the patch uses the macros ABG_BEGIN_EXPORT_DECLARATIONS and ABG_END_EXPORT_DECLARATIONS rather than using the pragma directive directly. I believe this is a more elegant way of handling visibility, compared to cluttering every single declaration in public headers with a "__attribute__((visibility=("default")))" or with a macro which expands to it. This reduces the the set of symbols exported by libabigail.so from 20000+ to less than 5000. * VISIBILITY: New documentation about this visiblity business. * CONTRIBUTING: Update the "contributing guide" to refer to symbol visibility issues. * configure.ac: Define a variable VISIBILITY_FLAGS that is set to the -fvisibility=hidden flag to pass to GCC, when its available. * src/Makefile.am: Add VISIBILITY to source distribution. Also add COMPILING and COMMIT-LOG-GUIDELINES that were missing. * src/Makefile.am: Use the new $(VISIBILITY_FLAGS) when buiding the library. * tests/Makefile.am: Use the new $(VISIBILITY_FLAGS) when buiding tests. * tools/Makefile.am: Use the new $(VISIBILITY_FLAGS) when buiding tools. * src/abg-comp-filter.cc: Enclose inclusion of public headers in ABG_BEGIN_EXPORT_DECLARATIONS and ABG_END_EXPORT_DECLARATIONS to export the symbols of entities declared in there. * src/abg-comparison.cc: Likewise. * src/abg-config.cc: Likewise. * src/abg-corpus.cc: Likewise. * src/abg-diff-utils.cc: Likewise. * src/abg-dwarf-reader.cc: Likewise. * src/abg-hash.cc: Likewise. * src/abg-ini.cc: Likewise. * src/abg-ir.cc: Likewise. * src/abg-libxml-utils.cc: Likewise. * src/abg-libzip-utils.cc: Likewise. * src/abg-reader.cc: Likewise. * src/abg-suppression.cc: Likewise. * src/abg-tools-utils.cc: Likewise. * src/abg-traverse.cc: Likewise. * src/abg-viz-common.cc: Likewise. * src/abg-viz-dot.cc: Likewise. * src/abg-viz-svg.cc: Likewise. * src/abg-workers.cc: Likewise. * src/abg-writer.cc: Likewise. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-07-27 10:18:58 +00:00
VISIBILITY_FLAGS=
fi
Control symbols exported from libabigail.so Symbols of pretty much all member functions of types that are meant to be "private" to translation units that contribute to libabigail.so were exported because we didn't do much to prevent that. This patch starts controlling the set of symbols that are exported. By default, symbols of any entity declared in a translation unit that contributes to libabigail.so are hidden by default. Only symbols of entities declared in public headers (headers in include/*.h) are exported. There are many ways to achieve that. This patch chooses to avoid cluttering declarations of entities in the public header by adding __attribute__((visibility="default")) to every declared type of function in there. Rather, the patch uses "#pragma GCC visibility push(default)" before entities declared on those headers. By doing so, all those entities have their symbol marked as "visible" by the compiler. Once the header are #included, the #pragma GCC visibility pop" is used, so that anything else has its symbol be hidden from that point on. Note that for ease of maintenance the patch uses the macros ABG_BEGIN_EXPORT_DECLARATIONS and ABG_END_EXPORT_DECLARATIONS rather than using the pragma directive directly. I believe this is a more elegant way of handling visibility, compared to cluttering every single declaration in public headers with a "__attribute__((visibility=("default")))" or with a macro which expands to it. This reduces the the set of symbols exported by libabigail.so from 20000+ to less than 5000. * VISIBILITY: New documentation about this visiblity business. * CONTRIBUTING: Update the "contributing guide" to refer to symbol visibility issues. * configure.ac: Define a variable VISIBILITY_FLAGS that is set to the -fvisibility=hidden flag to pass to GCC, when its available. * src/Makefile.am: Add VISIBILITY to source distribution. Also add COMPILING and COMMIT-LOG-GUIDELINES that were missing. * src/Makefile.am: Use the new $(VISIBILITY_FLAGS) when buiding the library. * tests/Makefile.am: Use the new $(VISIBILITY_FLAGS) when buiding tests. * tools/Makefile.am: Use the new $(VISIBILITY_FLAGS) when buiding tools. * src/abg-comp-filter.cc: Enclose inclusion of public headers in ABG_BEGIN_EXPORT_DECLARATIONS and ABG_END_EXPORT_DECLARATIONS to export the symbols of entities declared in there. * src/abg-comparison.cc: Likewise. * src/abg-config.cc: Likewise. * src/abg-corpus.cc: Likewise. * src/abg-diff-utils.cc: Likewise. * src/abg-dwarf-reader.cc: Likewise. * src/abg-hash.cc: Likewise. * src/abg-ini.cc: Likewise. * src/abg-ir.cc: Likewise. * src/abg-libxml-utils.cc: Likewise. * src/abg-libzip-utils.cc: Likewise. * src/abg-reader.cc: Likewise. * src/abg-suppression.cc: Likewise. * src/abg-tools-utils.cc: Likewise. * src/abg-traverse.cc: Likewise. * src/abg-viz-common.cc: Likewise. * src/abg-viz-dot.cc: Likewise. * src/abg-viz-svg.cc: Likewise. * src/abg-workers.cc: Likewise. * src/abg-writer.cc: Likewise. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-07-27 10:18:58 +00:00
AC_SUBST(VISIBILITY_FLAGS)
dnl Older glibc had a broken fts that didn't work with Large File Systems.
dnl We want the version that can handler LFS, but include workaround if we
dnl get a bad one. Add define to CFLAGS (not AC_DEFINE it) since we need to
dnl check it before including config.h (which might define _FILE_OFFSET_BITS).
AC_CACHE_CHECK([whether including fts.h with _FILE_OFFSET_BITS set breaks], ac_cv_bad_fts,
[AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#define _FILE_OFFSET_BITS 64
#include <fts.h>
]])],
ac_cv_bad_fts=no, ac_cv_bad_fts=yes)])
AS_IF([test "x$ac_cv_bad_fts" = "xyes"],
[CFLAGS="$CFLAGS -DBAD_FTS=1",
CXXFLAGS="$CXXFLAGS -DBAD_FTS=1"])
dnl On musl, we need to find fts-standalone
AS_CASE(
[${host_os}], [*-musl*], [
PKG_CHECK_MODULES([FTS], [fts-standalone])
])
Detect and report changes in ELF architecture Libabigail does not take in account the architecture of the ELF file it reads. This patch changes that to represent the ELF architecture as a string, detect when that architecture changes accross two corpora being compared and emit a report about that change. * configure.ac: Detect the presence of libebl.a and add it to the list of library we depend on to build libabigail. Report when libelf.so is not found. * include/abg-comparison.h: (diff_context::show_architecture_change): Declare new accessors. (corpus_diff::architecture_changed): Declare new method. * include/abg-corpus.h (corpus::{get,set}_architecture_name): Declare new accessors. * src/abg-comparison.cc (diff_context::priv::show_architecture_change_): New data member. (diff_context::priv::priv): Initialize it. (diff_context::show_architecture_change): Define new accessors. (function_decl_diff::report): Report when the size/alignment of the function address changes. (corpus_diff::priv::architectures_equal_): New data member. (corpus_diff::priv::priv): Initialize it. (corpus_diff::priv::emit_diff_stats): Take in account changes of architecture. (corpus_diff::architecture_changed): Define new method. (corpus_diff::length): Take in account changes of architecture. (corpus_diff::report): Report about changes of architecture. (compute_diff): In the overload for corpus_diff_sptr, detect changes fo architecture. * src/abg-corpus.cc (corpus_priv::architecture_name): Define new data member. (corpus::{get,set}_architecture_name): Define new method. * src/abg-dwarf-reader.cc: Include elfutils/libebl.h to use ebl_openbackend() and ebl_backend_name() (read_context::elf_architecture_): Define new data member. (read_context::elf_architecture): Define new accessor. (read_context::{load_elf_architecture, load_remaining_elf_data}): Define new methods. (read_corpus_from_elf): Use ctxt.load_remaining_elf_data() in lieu of ctxt.load_dt_soname_and_needed. Stick the architecture into the corpus. * src/abg-reader.cc (read_corpus_from_input): Read the 'architecture' XML property. * src/abg-writer.cc (write_corpus_to_native_xml): Write the 'architecture' XML property. * tests/data/test-diff-dwarf/libtest-23-diff-arch-v0-32.so: New test input file. * tests/data/test-diff-dwarf/libtest-23-diff-arch-v0-64.so: Likewise. * tests/data/test-diff-dwarf/test-23-diff-arch-report-0.txt: Likewise. * tests/data/test-diff-dwarf/test-23-diff-arch-v0.cc: Source code for the binary test input files above. * tests/data/Makefile.am: Add the new test input files to the source distribution. * tests/test-diff-dwarf.cc (in_out_specs): Add the new test input data to the set of input data to run this test harness over. * tests/test-read-dwarf.cc (main): Do not take the architecture in account during comparisons. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-01-07 12:45:53 +00:00
dnl Check for dependency: libelf, libdw, libebl (elfutils)
dnl Note that we need to use at least elfutils 0.159 but
dnl at that time elfutils didnt have pkgconfig capabilities
dnl to easily query for its version.
Detect and report changes in ELF architecture Libabigail does not take in account the architecture of the ELF file it reads. This patch changes that to represent the ELF architecture as a string, detect when that architecture changes accross two corpora being compared and emit a report about that change. * configure.ac: Detect the presence of libebl.a and add it to the list of library we depend on to build libabigail. Report when libelf.so is not found. * include/abg-comparison.h: (diff_context::show_architecture_change): Declare new accessors. (corpus_diff::architecture_changed): Declare new method. * include/abg-corpus.h (corpus::{get,set}_architecture_name): Declare new accessors. * src/abg-comparison.cc (diff_context::priv::show_architecture_change_): New data member. (diff_context::priv::priv): Initialize it. (diff_context::show_architecture_change): Define new accessors. (function_decl_diff::report): Report when the size/alignment of the function address changes. (corpus_diff::priv::architectures_equal_): New data member. (corpus_diff::priv::priv): Initialize it. (corpus_diff::priv::emit_diff_stats): Take in account changes of architecture. (corpus_diff::architecture_changed): Define new method. (corpus_diff::length): Take in account changes of architecture. (corpus_diff::report): Report about changes of architecture. (compute_diff): In the overload for corpus_diff_sptr, detect changes fo architecture. * src/abg-corpus.cc (corpus_priv::architecture_name): Define new data member. (corpus::{get,set}_architecture_name): Define new method. * src/abg-dwarf-reader.cc: Include elfutils/libebl.h to use ebl_openbackend() and ebl_backend_name() (read_context::elf_architecture_): Define new data member. (read_context::elf_architecture): Define new accessor. (read_context::{load_elf_architecture, load_remaining_elf_data}): Define new methods. (read_corpus_from_elf): Use ctxt.load_remaining_elf_data() in lieu of ctxt.load_dt_soname_and_needed. Stick the architecture into the corpus. * src/abg-reader.cc (read_corpus_from_input): Read the 'architecture' XML property. * src/abg-writer.cc (write_corpus_to_native_xml): Write the 'architecture' XML property. * tests/data/test-diff-dwarf/libtest-23-diff-arch-v0-32.so: New test input file. * tests/data/test-diff-dwarf/libtest-23-diff-arch-v0-64.so: Likewise. * tests/data/test-diff-dwarf/test-23-diff-arch-report-0.txt: Likewise. * tests/data/test-diff-dwarf/test-23-diff-arch-v0.cc: Source code for the binary test input files above. * tests/data/Makefile.am: Add the new test input files to the source distribution. * tests/test-diff-dwarf.cc (in_out_specs): Add the new test input data to the set of input data to run this test harness over. * tests/test-read-dwarf.cc (main): Do not take the architecture in account during comparisons. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-01-07 12:45:53 +00:00
ELF_LIBS=
AC_CHECK_LIB([elf], [elf_end], [ELF_LIBS="-lelf"])
AC_CHECK_HEADER([libelf.h],
[],
[AC_MSG_ERROR([could not find libelf.h])])
DW_LIBS=
AC_CHECK_LIB(dw, dwfl_begin, [DW_LIBS=-ldw])
Plug leak of debug info handles On recent elfutils where the libdw's function dwarf_getalt exists, we don't need to try and find the alternate debug info file ourselves by using the function dwfl_standard_find_debuginfo. Furthermore, when we use that function on those recent elfutils versions, we leak the elf resources allocated in the debug info resources; we also leak the file descriptor to access the alternate debug info sections. More generally, we also leak debug info handles used to access debug info when using get_soname_of_elf_file and get_type_of_elf_file. This patch plugs those leaks. In the first case, if the function dwarf_getalt exists, the patch just uses it to get the alternate debug info. Otherwise, the patch uses the dwfl_standard_find_debuginfo function like we used to, but then it tries hard to free the file descriptor and debuginfo memory of the alternate debug info. * configure.ac: Check the presence of dwarf_getalt in libdw. If it's present, define the preprocessor macro LIBDW_HAS_DWARF_GETALT. Update the autoconf configuration summary. * src/abg-dwarf-reader.cc: Add config.h. (find_alt_debug_info_location): Factorize this out of ... (find_alt_debug_info): ... this function. Use dwarf_getalt if present, otherwise, keep using dwfl_standard_find_debuginfo. In the later case, return the file descriptor opened to access the alternate debug info, by parameter, so that the caller can fclose it. (read_context::alt_fd_): New data member. (read_context::read_context): Initialize the new alt_fd_ data member. (read_context::load_debug_info): Store the file descriptor used to access the alternate debug info into the new alt_fd_ data member. (read_context::~read_context): New desctructor. (get_soname_of_elf_file, get_type_of_elf_file): Free the elf handle. (read_context::load_debug_info): Be paranoid in making sure we never override alt_dwarf_. * tests/data/test-alt-dwarf-file/test0-report.txt: Adjust. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-05-22 09:39:33 +00:00
AC_CHECK_LIB(dw, dwarf_getalt,
[FOUND_DWARF_GETALT_IN_LIBDW=yes],
[FOUND_DWARF_GETALT_IN_LIBDW=no])
AC_CHECK_HEADER(elfutils/libdwfl.h,
[],
[AC_MSG_ERROR([could not find elfutils/libdwfl.h installed])])
Detect and report changes in ELF architecture Libabigail does not take in account the architecture of the ELF file it reads. This patch changes that to represent the ELF architecture as a string, detect when that architecture changes accross two corpora being compared and emit a report about that change. * configure.ac: Detect the presence of libebl.a and add it to the list of library we depend on to build libabigail. Report when libelf.so is not found. * include/abg-comparison.h: (diff_context::show_architecture_change): Declare new accessors. (corpus_diff::architecture_changed): Declare new method. * include/abg-corpus.h (corpus::{get,set}_architecture_name): Declare new accessors. * src/abg-comparison.cc (diff_context::priv::show_architecture_change_): New data member. (diff_context::priv::priv): Initialize it. (diff_context::show_architecture_change): Define new accessors. (function_decl_diff::report): Report when the size/alignment of the function address changes. (corpus_diff::priv::architectures_equal_): New data member. (corpus_diff::priv::priv): Initialize it. (corpus_diff::priv::emit_diff_stats): Take in account changes of architecture. (corpus_diff::architecture_changed): Define new method. (corpus_diff::length): Take in account changes of architecture. (corpus_diff::report): Report about changes of architecture. (compute_diff): In the overload for corpus_diff_sptr, detect changes fo architecture. * src/abg-corpus.cc (corpus_priv::architecture_name): Define new data member. (corpus::{get,set}_architecture_name): Define new method. * src/abg-dwarf-reader.cc: Include elfutils/libebl.h to use ebl_openbackend() and ebl_backend_name() (read_context::elf_architecture_): Define new data member. (read_context::elf_architecture): Define new accessor. (read_context::{load_elf_architecture, load_remaining_elf_data}): Define new methods. (read_corpus_from_elf): Use ctxt.load_remaining_elf_data() in lieu of ctxt.load_dt_soname_and_needed. Stick the architecture into the corpus. * src/abg-reader.cc (read_corpus_from_input): Read the 'architecture' XML property. * src/abg-writer.cc (write_corpus_to_native_xml): Write the 'architecture' XML property. * tests/data/test-diff-dwarf/libtest-23-diff-arch-v0-32.so: New test input file. * tests/data/test-diff-dwarf/libtest-23-diff-arch-v0-64.so: Likewise. * tests/data/test-diff-dwarf/test-23-diff-arch-report-0.txt: Likewise. * tests/data/test-diff-dwarf/test-23-diff-arch-v0.cc: Source code for the binary test input files above. * tests/data/Makefile.am: Add the new test input files to the source distribution. * tests/test-diff-dwarf.cc (in_out_specs): Add the new test input data to the set of input data to run this test harness over. * tests/test-read-dwarf.cc (main): Do not take the architecture in account during comparisons. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-01-07 12:45:53 +00:00
dnl Allow users to compile with the NDEBUG macro defined,
dnl meaning they are compiling in a mode where the
dnl assert call does nothing. With the directive below,
dnl users just need to pass the --disable-assert
dnl option to configure.
AC_HEADER_ASSERT
Detect and report changes in ELF architecture Libabigail does not take in account the architecture of the ELF file it reads. This patch changes that to represent the ELF architecture as a string, detect when that architecture changes accross two corpora being compared and emit a report about that change. * configure.ac: Detect the presence of libebl.a and add it to the list of library we depend on to build libabigail. Report when libelf.so is not found. * include/abg-comparison.h: (diff_context::show_architecture_change): Declare new accessors. (corpus_diff::architecture_changed): Declare new method. * include/abg-corpus.h (corpus::{get,set}_architecture_name): Declare new accessors. * src/abg-comparison.cc (diff_context::priv::show_architecture_change_): New data member. (diff_context::priv::priv): Initialize it. (diff_context::show_architecture_change): Define new accessors. (function_decl_diff::report): Report when the size/alignment of the function address changes. (corpus_diff::priv::architectures_equal_): New data member. (corpus_diff::priv::priv): Initialize it. (corpus_diff::priv::emit_diff_stats): Take in account changes of architecture. (corpus_diff::architecture_changed): Define new method. (corpus_diff::length): Take in account changes of architecture. (corpus_diff::report): Report about changes of architecture. (compute_diff): In the overload for corpus_diff_sptr, detect changes fo architecture. * src/abg-corpus.cc (corpus_priv::architecture_name): Define new data member. (corpus::{get,set}_architecture_name): Define new method. * src/abg-dwarf-reader.cc: Include elfutils/libebl.h to use ebl_openbackend() and ebl_backend_name() (read_context::elf_architecture_): Define new data member. (read_context::elf_architecture): Define new accessor. (read_context::{load_elf_architecture, load_remaining_elf_data}): Define new methods. (read_corpus_from_elf): Use ctxt.load_remaining_elf_data() in lieu of ctxt.load_dt_soname_and_needed. Stick the architecture into the corpus. * src/abg-reader.cc (read_corpus_from_input): Read the 'architecture' XML property. * src/abg-writer.cc (write_corpus_to_native_xml): Write the 'architecture' XML property. * tests/data/test-diff-dwarf/libtest-23-diff-arch-v0-32.so: New test input file. * tests/data/test-diff-dwarf/libtest-23-diff-arch-v0-64.so: Likewise. * tests/data/test-diff-dwarf/test-23-diff-arch-report-0.txt: Likewise. * tests/data/test-diff-dwarf/test-23-diff-arch-v0.cc: Source code for the binary test input files above. * tests/data/Makefile.am: Add the new test input files to the source distribution. * tests/test-diff-dwarf.cc (in_out_specs): Add the new test input data to the set of input data to run this test harness over. * tests/test-read-dwarf.cc (main): Do not take the architecture in account during comparisons. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-01-07 12:45:53 +00:00
if test x$ELF_LIBS = x; then
AC_MSG_ERROR([could not find elfutils elf library installed])
fi
if test x$DW_LIBS = x; then
AC_MSG_ERROR([could not find elfutils dwarf library installed])
fi
if test x$FOUND_DWARF_GETALT_IN_LIBDW = xyes; then
Plug leak of debug info handles On recent elfutils where the libdw's function dwarf_getalt exists, we don't need to try and find the alternate debug info file ourselves by using the function dwfl_standard_find_debuginfo. Furthermore, when we use that function on those recent elfutils versions, we leak the elf resources allocated in the debug info resources; we also leak the file descriptor to access the alternate debug info sections. More generally, we also leak debug info handles used to access debug info when using get_soname_of_elf_file and get_type_of_elf_file. This patch plugs those leaks. In the first case, if the function dwarf_getalt exists, the patch just uses it to get the alternate debug info. Otherwise, the patch uses the dwfl_standard_find_debuginfo function like we used to, but then it tries hard to free the file descriptor and debuginfo memory of the alternate debug info. * configure.ac: Check the presence of dwarf_getalt in libdw. If it's present, define the preprocessor macro LIBDW_HAS_DWARF_GETALT. Update the autoconf configuration summary. * src/abg-dwarf-reader.cc: Add config.h. (find_alt_debug_info_location): Factorize this out of ... (find_alt_debug_info): ... this function. Use dwarf_getalt if present, otherwise, keep using dwfl_standard_find_debuginfo. In the later case, return the file descriptor opened to access the alternate debug info, by parameter, so that the caller can fclose it. (read_context::alt_fd_): New data member. (read_context::read_context): Initialize the new alt_fd_ data member. (read_context::load_debug_info): Store the file descriptor used to access the alternate debug info into the new alt_fd_ data member. (read_context::~read_context): New desctructor. (get_soname_of_elf_file, get_type_of_elf_file): Free the elf handle. (read_context::load_debug_info): Be paranoid in making sure we never override alt_dwarf_. * tests/data/test-alt-dwarf-file/test0-report.txt: Adjust. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-05-22 09:39:33 +00:00
AC_DEFINE([LIBDW_HAS_DWARF_GETALT], 1,
[Defined if libdw has the function dwarf_getalt])
fi
AC_SUBST(DW_LIBS)
AC_SUBST([ELF_LIBS])
Add support for the CTF debug format to libabigail. CTF (C Type Format) is a lightweight debugging format that provides information about C types and the association between functions and data symbols and types. It is designed to be very compact and simple. More can be learned about it at https://ctfstd.org. This patch introduces support in libabigail to extract ABI information from CTF stored in ELF files. A few notes on this implementation: - The implementation is complete in terms of CTF support. Every CTF feature is processed and handled to generate libabigail IR. This includes basic types, typedefs, pointer, array and struct types. The CTF record of data objects (variables) and functions are also used in order to generate the corresponding libabigail IR artifacts. - The decoding of CTF data is done using the libctf library which is part of binutils. In order to link with it, binutils shall be built with --enable-shared for libctf.so to become available. - This initial implementation is aimed to simplicity. We have not tried to resolve any and every corner case that may require special handling. We have observed that the DWARF front-end (which is naturally way more complex as the scope is way bigger) is plagued with hacks to handle such situations. However, for the CTF support we prefer to proceed in a simpler and more modest way: we will handle these problems if/when we find them. The fact that CTF only supports C (currently) certainly helps there. - Likewise, in this basic support we are not handling symbol suppressions or other goodies that libabigail provides. We are new to libabigail and ABI analysis, and at this point we simply don't have a clear picture about what is most useful/relevant to support or not. With the maintainer's blesssing, we will tackle that functionaly after this basic support is applied upstream. - The implementation in abg-ctf-reader.{cc,h} is pretty much self-contained. As a result there is some duplication in terms of ELF handling with the DWARF reader, but since that logic is very simple and can be easily implemented, we don't consider this to be a big deal (for now.) Hopefully the maintainers agree. - The libabigail tools assume that ELF means to always use DWARF to generate the ABI IR. We added a new command-line option --ctf to the tools in order to make them to use the CTF debug info instead. We are definitely not sure whether this is the best user interface. In fact I would be suprised if it was ;) - We added support for --ctf to both abilint and abidiff. We are not sure whether it would make sense to add support for CTF to the other tools. Feedback welcome. - We are pondering about what to do in terms of testing. We have cursory tested this implementation using abilint and abidiff. We know we are generating IR corpus that seem to be ok. It would be good however to be able to run the libabigail testsuites using CTF. However the testsuites may need some non-trivial changes in order to make this possible. Let's talk about that :) * configure.ac: Check for libctf. * src/abg-ctf-reader.cc: New file. * include/abg-ctf-reader.h: Likewise. * src/Makefile.am (libabigail_la_SOURCES): Add abg-ctf-reader.cc conditionally. * include/Makefile.am (pkginclude_HEADERS): Add abg-ctf-reader.h conditionally. * tools/abilint.cc (struct options): New option `use_ctf'. (display_usage): Documentation for --ctf. (parse_command_line): Handle --ctf. (main): Honour --ctf. * tools/abidiff.cc (struct options): New option `use_ctf'. (display_usage): Documentation for --ctf. (parse_command_line): Handle --ctf. (main): Honour --ctf. * doc/manuals/abidiff.rst: Document --ctf. * doc/manuals/abilint.rst: Likewise. Signed-off-by: Jose E. Marchesi <jose.marchesi@oracle.com> Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2021-10-28 22:51:32 +00:00
dnl check for libctf presence if CTF code has been enabled by command line
dnl argument, and then define CTF flag (to build CTF file code) if libctf is
dnl found on the system
CTF_LIBS=
if test x$ENABLE_CTF = xyes; then
LIBCTF=
AC_CHECK_LIB(ctf, ctf_open, [LIBCTF=yes], [LIBCTF=no])
if test x$LIBCTF = xyes; then
AC_MSG_NOTICE([activating CTF code])
AC_DEFINE([WITH_CTF], 1,
[Defined if user enables and system has the libctf library])
CTF_LIBS=-lctf
else
AC_MSG_NOTICE([CTF enabled but no libctf found])
ENABLE_CTF=no
fi
fi
dnl Check for dependency: libxml
LIBXML2_VERSION=2.6.22
PKG_CHECK_MODULES(XML, libxml-2.0 >= $LIBXML2_VERSION)
AC_SUBST(LIBXML2_VERSION)
AC_SUBST(XML_LIBS)
AC_SUBST(XML_CFLAGS)
dnl Check for some programs like rm, mkdir, etc ...
AC_CHECK_PROG(HAS_RM, rm, yes, no)
if test x$HAS_RM = xno; then
AC_MSG_ERROR([could not find the program 'rm' installed])
fi
AC_CHECK_PROG(HAS_MKDIR, mkdir, yes, no)
if test x$HAS_MKDIR = xno; then
AC_MSG_ERROR([could not find the program 'mkdir' installed])
fi
Make the support of RPM and DEB package formats conditional If at configure time the libabigail source tarball detects that rpm2cpio and cpio are present then it enables the support for rpm files. Users can explicitly enable or disable that support by passing --enable-rpm or --disable-rpm to configure. Similarly if it detects that dpkg is present at configure time then it enables the support for deb files. Users can explicitly enable or disable that support by passing --enable-deb or --disable-deb to configure. * config.h.in: Define WITH_DEB and WITH_RPM pre-processor macros. * configure.ac: Add --enable-{rpm,deb} switches. Check for rpm2cpio and cpio programs, unless --disable-rpm was provided. If they are found and if --enable-rpm=auto was provided, then consider that --enable-rpm=yes was provided. In that case, set the WITH_RPM macro to 1. Otherwise, undefine that macro. Similarly, check for dpkg unless --disable-deb was provided. If it's found and if --enable-deb=auto was provided, consider that --enable-deb=yes was provided. In that case, set the WITH_DEB macro to 1. Otherwise, undefine that macro. Define the ENABLE_RPM and ENABLE_DEB conditional automake variables, if the rpm resp. deb support is enabled. Emit a notice about the rpm and deb features being enabled or not, at the end of the configure process. * tests/test-diff-pkg.cc: Include the config.h header. (in_out_spec): Guard rpm tests by the WITH_RPM macro. Similarly, guard deb tests by the WITH_DEB macro. * tools/abipkgdiff.cc: Include the config.h header. (extract_rpm): Guard this function definition with the WITH_RPM macro. (extract_deb): Guard this function definition with the WITH_DEB macro. (extract_package): Guard the handling of rpm packages with the WITH_RPM macro and the handling of deb package with the WITH_DEB macro. If a package not-support package format is encountered, emit an appropriate error message and error out. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-08-14 10:49:57 +00:00
dnl Check for the rpm2cpio and cpio programs
if test x$ENABLE_RPM = xyes -o x$ENABLE_RPM = xauto; then
AC_CHECK_PROG(HAS_RPM2CPIO, rpm2cpio, yes, no)
AC_CHECK_PROG(HAS_CPIO, cpio, yes, no)
AC_CHECK_PROG(HAS_RPM, rpm, yes, no)
if test x$HAS_RPM2CPIO = xyes -a x$HAS_CPIO = xyes -a x$HAS_RPM = xyes; then
ENABLE_RPM=yes
else
if test x$ENABLE_RPM = xyes; then
AC_MSG_ERROR([rpm support in abipkgdiff needs 'rpm2cpio', 'cpio' and 'rpm' programs to be installed])
Make the support of RPM and DEB package formats conditional If at configure time the libabigail source tarball detects that rpm2cpio and cpio are present then it enables the support for rpm files. Users can explicitly enable or disable that support by passing --enable-rpm or --disable-rpm to configure. Similarly if it detects that dpkg is present at configure time then it enables the support for deb files. Users can explicitly enable or disable that support by passing --enable-deb or --disable-deb to configure. * config.h.in: Define WITH_DEB and WITH_RPM pre-processor macros. * configure.ac: Add --enable-{rpm,deb} switches. Check for rpm2cpio and cpio programs, unless --disable-rpm was provided. If they are found and if --enable-rpm=auto was provided, then consider that --enable-rpm=yes was provided. In that case, set the WITH_RPM macro to 1. Otherwise, undefine that macro. Similarly, check for dpkg unless --disable-deb was provided. If it's found and if --enable-deb=auto was provided, consider that --enable-deb=yes was provided. In that case, set the WITH_DEB macro to 1. Otherwise, undefine that macro. Define the ENABLE_RPM and ENABLE_DEB conditional automake variables, if the rpm resp. deb support is enabled. Emit a notice about the rpm and deb features being enabled or not, at the end of the configure process. * tests/test-diff-pkg.cc: Include the config.h header. (in_out_spec): Guard rpm tests by the WITH_RPM macro. Similarly, guard deb tests by the WITH_DEB macro. * tools/abipkgdiff.cc: Include the config.h header. (extract_rpm): Guard this function definition with the WITH_RPM macro. (extract_deb): Guard this function definition with the WITH_DEB macro. (extract_package): Guard the handling of rpm packages with the WITH_RPM macro and the handling of deb package with the WITH_DEB macro. If a package not-support package format is encountered, emit an appropriate error message and error out. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-08-14 10:49:57 +00:00
fi
ENABLE_RPM=no
Make the support of RPM and DEB package formats conditional If at configure time the libabigail source tarball detects that rpm2cpio and cpio are present then it enables the support for rpm files. Users can explicitly enable or disable that support by passing --enable-rpm or --disable-rpm to configure. Similarly if it detects that dpkg is present at configure time then it enables the support for deb files. Users can explicitly enable or disable that support by passing --enable-deb or --disable-deb to configure. * config.h.in: Define WITH_DEB and WITH_RPM pre-processor macros. * configure.ac: Add --enable-{rpm,deb} switches. Check for rpm2cpio and cpio programs, unless --disable-rpm was provided. If they are found and if --enable-rpm=auto was provided, then consider that --enable-rpm=yes was provided. In that case, set the WITH_RPM macro to 1. Otherwise, undefine that macro. Similarly, check for dpkg unless --disable-deb was provided. If it's found and if --enable-deb=auto was provided, consider that --enable-deb=yes was provided. In that case, set the WITH_DEB macro to 1. Otherwise, undefine that macro. Define the ENABLE_RPM and ENABLE_DEB conditional automake variables, if the rpm resp. deb support is enabled. Emit a notice about the rpm and deb features being enabled or not, at the end of the configure process. * tests/test-diff-pkg.cc: Include the config.h header. (in_out_spec): Guard rpm tests by the WITH_RPM macro. Similarly, guard deb tests by the WITH_DEB macro. * tools/abipkgdiff.cc: Include the config.h header. (extract_rpm): Guard this function definition with the WITH_RPM macro. (extract_deb): Guard this function definition with the WITH_DEB macro. (extract_package): Guard the handling of rpm packages with the WITH_RPM macro and the handling of deb package with the WITH_DEB macro. If a package not-support package format is encountered, emit an appropriate error message and error out. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-08-14 10:49:57 +00:00
fi
fi
configure: Instead of for rpm 4.15+ version, test actual rpm/zstd support If no 'rpm' is available, we currently get: [...] checking for rpm... no ../git/configure: line 13119: rpm: command not found configure: detected rpm version: configure: rpm support in abipkgdiff is disabled [...] Here is the configuration of the package: [...] Enable rpm support in abipkgdiff : no Enable rpm 4.15 support in abipkgdiff tests : no [...] Notice intermixed error output: 'rpm: command not found'. If Ubuntu focal 'rpm' 4.14.2.1+dfsg1-1build2 is available, we currently get: [...] checking for rpm... yes configure: detected rpm version: 4.14.2.1 configure: rpm support in abipkgdiff is enabled configure: rpm 4.15 support in abipkgdiff tests is enabled [...] Here is the configuration of the package: [...] Enable rpm support in abipkgdiff : yes Enable rpm 4.15 support in abipkgdiff tests : yes [...] Notice wrong 4.15+ version detection (due to '[[ "$rpmversion" > "4.14.0" ]]'), which is satisfied by '4.14.2.1'. (Comparing versions with shell '[[' generally is fragile; instead use 'autoconf-archive/ax_compare_version.m4' or similar?) Also, 'configure'ing with '--disable-rpm415' doesn't work; same output as before. That's due to commit 26c41c060bf30750fe2cded87edaf1ae47027523 "Fix thinko in configure.ac", where either there was no thinko in fact (the original idea, I suppose, was only if 'test x$ENABLE_RPM = xyes' to do the 4.15+ 'auto' checking?), and/or a typo: instead of 'test x$ENABLE_RPM = xyes', the first conditional should 'test x$ENABLE_RPM415 = xyes'? And, 'configure'ing with '--enable-rpm415' doesn't raise a hard error if 'rpm' actually isn't 4.15+. But all that said, we don't actually need to check for rpm 4.15+ version, but instead may simply check for the rpm/zstd support that we need: 'rpm2cpio'. * configure.ac: Instead of for rpm 4.15+ version, test actual rpm/zstd support. * tests/test-diff-pkg.cc: Adjust. Signed-off-by: Thomas Schwinge <thomas@codesourcery.com>
2021-12-10 16:52:46 +00:00
dnl Point to a rpm/zstd file, that is:
dnl $ rpm -qp --qf '%{PAYLOADCOMPRESSOR}\n' [rpm_zstd_file]
dnl zstd
m4_define([rpm_zstd_file], [tests/data/test-diff-pkg/mesa-libGLU-9.0.1-3.fc33.x86_64.rpm])
AC_CONFIG_SRCDIR([rpm_zstd_file])
if test x$ENABLE_RPM_ZSTD = xyes -o x$ENABLE_RPM_ZSTD = xauto; then
if test x$ENABLE_RPM = xno; then
if test x$ENABLE_RPM_ZSTD = xyes; then
AC_MSG_ERROR([rpm/zstd support needs rpm support])
fi
ENABLE_RPM_ZSTD=n/a
else
AC_MSG_CHECKING([for rpm/zstd support])
rpm2cpio > /dev/null 2>&AS_MESSAGE_LOG_FD "$srcdir"/rpm_zstd_file
if test $? -eq 0; then
enable_rpm_zstd=yes
else
enable_rpm_zstd=no
fi
AC_MSG_RESULT([$enable_rpm_zstd])
if test x$ENABLE_RPM_ZSTD:$enable_rpm_zstd = xyes:no; then
AC_MSG_ERROR([rpm/zstd support not available])
fi
ENABLE_RPM_ZSTD=$enable_rpm_zstd
fi
dwarf-reader: support artificially generated translation units When GCC 10 artificially generates a translation unit, the path/name of the translation unit as given by the DW_AT_name attribute of the translation unit DIE is the string "<artificial>". Libabigail expects that translation units have unique file paths so having several artificially generated translation units like this one with the same name makes hell break loose down the road. This patch suffixes the name of artificial DIE with their die offset number to have a unique path name for artificially generated translation units. * configure.ac: Detect if we are running on RPM >= 4.15. If yes, then define the preprocessor macro RPM_4_15. If that macro is defined then test-diff-pkg.cc can support RPMs from Fedora >= 31 as those are compressed with zstd. Earlier RPM versions don't support that compression scheme. * src/abg-dwarf-reader.cc (build_translation_unit_and_add_to_ir): Suffix the offset of the translation unit to its name when that name is "<artificial>". * tests/data/test-diff-pkg/mesa-libGLU-9.0.1-3.fc33.x86_64.rpm: New binary test input. * tests/data/test-diff-pkg/mesa-libGLU-debuginfo-9.0.1-3.fc33.x86_64.rpm: Likewise. * tests/data/test-diff-pkg/mesa-libGLU-9.0.1-3.fc33.x86_64.self-check-report-0.txt: New reference output for the binary test input above. * tests/data/Makefile.am: Add the new test inputs above to source distribution. * tests/test-diff-pkg.cc (in_out_specs): Add the binary test inputs above to source distribution if we are running on an RPM version >= 4.15. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2020-11-23 09:48:01 +00:00
fi
Make the support of RPM and DEB package formats conditional If at configure time the libabigail source tarball detects that rpm2cpio and cpio are present then it enables the support for rpm files. Users can explicitly enable or disable that support by passing --enable-rpm or --disable-rpm to configure. Similarly if it detects that dpkg is present at configure time then it enables the support for deb files. Users can explicitly enable or disable that support by passing --enable-deb or --disable-deb to configure. * config.h.in: Define WITH_DEB and WITH_RPM pre-processor macros. * configure.ac: Add --enable-{rpm,deb} switches. Check for rpm2cpio and cpio programs, unless --disable-rpm was provided. If they are found and if --enable-rpm=auto was provided, then consider that --enable-rpm=yes was provided. In that case, set the WITH_RPM macro to 1. Otherwise, undefine that macro. Similarly, check for dpkg unless --disable-deb was provided. If it's found and if --enable-deb=auto was provided, consider that --enable-deb=yes was provided. In that case, set the WITH_DEB macro to 1. Otherwise, undefine that macro. Define the ENABLE_RPM and ENABLE_DEB conditional automake variables, if the rpm resp. deb support is enabled. Emit a notice about the rpm and deb features being enabled or not, at the end of the configure process. * tests/test-diff-pkg.cc: Include the config.h header. (in_out_spec): Guard rpm tests by the WITH_RPM macro. Similarly, guard deb tests by the WITH_DEB macro. * tools/abipkgdiff.cc: Include the config.h header. (extract_rpm): Guard this function definition with the WITH_RPM macro. (extract_deb): Guard this function definition with the WITH_DEB macro. (extract_package): Guard the handling of rpm packages with the WITH_RPM macro and the handling of deb package with the WITH_DEB macro. If a package not-support package format is encountered, emit an appropriate error message and error out. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-08-14 10:49:57 +00:00
if test x$ENABLE_RPM = xyes; then
AC_DEFINE([WITH_RPM], 1, [compile the rpm package support in abipkgdiff])
dwarf-reader: support artificially generated translation units When GCC 10 artificially generates a translation unit, the path/name of the translation unit as given by the DW_AT_name attribute of the translation unit DIE is the string "<artificial>". Libabigail expects that translation units have unique file paths so having several artificially generated translation units like this one with the same name makes hell break loose down the road. This patch suffixes the name of artificial DIE with their die offset number to have a unique path name for artificially generated translation units. * configure.ac: Detect if we are running on RPM >= 4.15. If yes, then define the preprocessor macro RPM_4_15. If that macro is defined then test-diff-pkg.cc can support RPMs from Fedora >= 31 as those are compressed with zstd. Earlier RPM versions don't support that compression scheme. * src/abg-dwarf-reader.cc (build_translation_unit_and_add_to_ir): Suffix the offset of the translation unit to its name when that name is "<artificial>". * tests/data/test-diff-pkg/mesa-libGLU-9.0.1-3.fc33.x86_64.rpm: New binary test input. * tests/data/test-diff-pkg/mesa-libGLU-debuginfo-9.0.1-3.fc33.x86_64.rpm: Likewise. * tests/data/test-diff-pkg/mesa-libGLU-9.0.1-3.fc33.x86_64.self-check-report-0.txt: New reference output for the binary test input above. * tests/data/Makefile.am: Add the new test inputs above to source distribution. * tests/test-diff-pkg.cc (in_out_specs): Add the binary test inputs above to source distribution if we are running on an RPM version >= 4.15. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2020-11-23 09:48:01 +00:00
AC_MSG_NOTICE([rpm support in abipkgdiff is enabled]);
configure: Instead of for rpm 4.15+ version, test actual rpm/zstd support If no 'rpm' is available, we currently get: [...] checking for rpm... no ../git/configure: line 13119: rpm: command not found configure: detected rpm version: configure: rpm support in abipkgdiff is disabled [...] Here is the configuration of the package: [...] Enable rpm support in abipkgdiff : no Enable rpm 4.15 support in abipkgdiff tests : no [...] Notice intermixed error output: 'rpm: command not found'. If Ubuntu focal 'rpm' 4.14.2.1+dfsg1-1build2 is available, we currently get: [...] checking for rpm... yes configure: detected rpm version: 4.14.2.1 configure: rpm support in abipkgdiff is enabled configure: rpm 4.15 support in abipkgdiff tests is enabled [...] Here is the configuration of the package: [...] Enable rpm support in abipkgdiff : yes Enable rpm 4.15 support in abipkgdiff tests : yes [...] Notice wrong 4.15+ version detection (due to '[[ "$rpmversion" > "4.14.0" ]]'), which is satisfied by '4.14.2.1'. (Comparing versions with shell '[[' generally is fragile; instead use 'autoconf-archive/ax_compare_version.m4' or similar?) Also, 'configure'ing with '--disable-rpm415' doesn't work; same output as before. That's due to commit 26c41c060bf30750fe2cded87edaf1ae47027523 "Fix thinko in configure.ac", where either there was no thinko in fact (the original idea, I suppose, was only if 'test x$ENABLE_RPM = xyes' to do the 4.15+ 'auto' checking?), and/or a typo: instead of 'test x$ENABLE_RPM = xyes', the first conditional should 'test x$ENABLE_RPM415 = xyes'? And, 'configure'ing with '--enable-rpm415' doesn't raise a hard error if 'rpm' actually isn't 4.15+. But all that said, we don't actually need to check for rpm 4.15+ version, but instead may simply check for the rpm/zstd support that we need: 'rpm2cpio'. * configure.ac: Instead of for rpm 4.15+ version, test actual rpm/zstd support. * tests/test-diff-pkg.cc: Adjust. Signed-off-by: Thomas Schwinge <thomas@codesourcery.com>
2021-12-10 16:52:46 +00:00
if test x$ENABLE_RPM_ZSTD = xyes; then
AC_DEFINE([WITH_RPM_ZSTD], 1, [has rpm/zstd support])
AC_MSG_NOTICE([rpm/zstd in abipkgdiff testing is enabled])
dwarf-reader: support artificially generated translation units When GCC 10 artificially generates a translation unit, the path/name of the translation unit as given by the DW_AT_name attribute of the translation unit DIE is the string "<artificial>". Libabigail expects that translation units have unique file paths so having several artificially generated translation units like this one with the same name makes hell break loose down the road. This patch suffixes the name of artificial DIE with their die offset number to have a unique path name for artificially generated translation units. * configure.ac: Detect if we are running on RPM >= 4.15. If yes, then define the preprocessor macro RPM_4_15. If that macro is defined then test-diff-pkg.cc can support RPMs from Fedora >= 31 as those are compressed with zstd. Earlier RPM versions don't support that compression scheme. * src/abg-dwarf-reader.cc (build_translation_unit_and_add_to_ir): Suffix the offset of the translation unit to its name when that name is "<artificial>". * tests/data/test-diff-pkg/mesa-libGLU-9.0.1-3.fc33.x86_64.rpm: New binary test input. * tests/data/test-diff-pkg/mesa-libGLU-debuginfo-9.0.1-3.fc33.x86_64.rpm: Likewise. * tests/data/test-diff-pkg/mesa-libGLU-9.0.1-3.fc33.x86_64.self-check-report-0.txt: New reference output for the binary test input above. * tests/data/Makefile.am: Add the new test inputs above to source distribution. * tests/test-diff-pkg.cc (in_out_specs): Add the binary test inputs above to source distribution if we are running on an RPM version >= 4.15. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2020-11-23 09:48:01 +00:00
fi
Make the support of RPM and DEB package formats conditional If at configure time the libabigail source tarball detects that rpm2cpio and cpio are present then it enables the support for rpm files. Users can explicitly enable or disable that support by passing --enable-rpm or --disable-rpm to configure. Similarly if it detects that dpkg is present at configure time then it enables the support for deb files. Users can explicitly enable or disable that support by passing --enable-deb or --disable-deb to configure. * config.h.in: Define WITH_DEB and WITH_RPM pre-processor macros. * configure.ac: Add --enable-{rpm,deb} switches. Check for rpm2cpio and cpio programs, unless --disable-rpm was provided. If they are found and if --enable-rpm=auto was provided, then consider that --enable-rpm=yes was provided. In that case, set the WITH_RPM macro to 1. Otherwise, undefine that macro. Similarly, check for dpkg unless --disable-deb was provided. If it's found and if --enable-deb=auto was provided, consider that --enable-deb=yes was provided. In that case, set the WITH_DEB macro to 1. Otherwise, undefine that macro. Define the ENABLE_RPM and ENABLE_DEB conditional automake variables, if the rpm resp. deb support is enabled. Emit a notice about the rpm and deb features being enabled or not, at the end of the configure process. * tests/test-diff-pkg.cc: Include the config.h header. (in_out_spec): Guard rpm tests by the WITH_RPM macro. Similarly, guard deb tests by the WITH_DEB macro. * tools/abipkgdiff.cc: Include the config.h header. (extract_rpm): Guard this function definition with the WITH_RPM macro. (extract_deb): Guard this function definition with the WITH_DEB macro. (extract_package): Guard the handling of rpm packages with the WITH_RPM macro and the handling of deb package with the WITH_DEB macro. If a package not-support package format is encountered, emit an appropriate error message and error out. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-08-14 10:49:57 +00:00
else
dwarf-reader: support artificially generated translation units When GCC 10 artificially generates a translation unit, the path/name of the translation unit as given by the DW_AT_name attribute of the translation unit DIE is the string "<artificial>". Libabigail expects that translation units have unique file paths so having several artificially generated translation units like this one with the same name makes hell break loose down the road. This patch suffixes the name of artificial DIE with their die offset number to have a unique path name for artificially generated translation units. * configure.ac: Detect if we are running on RPM >= 4.15. If yes, then define the preprocessor macro RPM_4_15. If that macro is defined then test-diff-pkg.cc can support RPMs from Fedora >= 31 as those are compressed with zstd. Earlier RPM versions don't support that compression scheme. * src/abg-dwarf-reader.cc (build_translation_unit_and_add_to_ir): Suffix the offset of the translation unit to its name when that name is "<artificial>". * tests/data/test-diff-pkg/mesa-libGLU-9.0.1-3.fc33.x86_64.rpm: New binary test input. * tests/data/test-diff-pkg/mesa-libGLU-debuginfo-9.0.1-3.fc33.x86_64.rpm: Likewise. * tests/data/test-diff-pkg/mesa-libGLU-9.0.1-3.fc33.x86_64.self-check-report-0.txt: New reference output for the binary test input above. * tests/data/Makefile.am: Add the new test inputs above to source distribution. * tests/test-diff-pkg.cc (in_out_specs): Add the binary test inputs above to source distribution if we are running on an RPM version >= 4.15. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2020-11-23 09:48:01 +00:00
AC_MSG_NOTICE([rpm support in abipkgdiff is disabled]);
Make the support of RPM and DEB package formats conditional If at configure time the libabigail source tarball detects that rpm2cpio and cpio are present then it enables the support for rpm files. Users can explicitly enable or disable that support by passing --enable-rpm or --disable-rpm to configure. Similarly if it detects that dpkg is present at configure time then it enables the support for deb files. Users can explicitly enable or disable that support by passing --enable-deb or --disable-deb to configure. * config.h.in: Define WITH_DEB and WITH_RPM pre-processor macros. * configure.ac: Add --enable-{rpm,deb} switches. Check for rpm2cpio and cpio programs, unless --disable-rpm was provided. If they are found and if --enable-rpm=auto was provided, then consider that --enable-rpm=yes was provided. In that case, set the WITH_RPM macro to 1. Otherwise, undefine that macro. Similarly, check for dpkg unless --disable-deb was provided. If it's found and if --enable-deb=auto was provided, consider that --enable-deb=yes was provided. In that case, set the WITH_DEB macro to 1. Otherwise, undefine that macro. Define the ENABLE_RPM and ENABLE_DEB conditional automake variables, if the rpm resp. deb support is enabled. Emit a notice about the rpm and deb features being enabled or not, at the end of the configure process. * tests/test-diff-pkg.cc: Include the config.h header. (in_out_spec): Guard rpm tests by the WITH_RPM macro. Similarly, guard deb tests by the WITH_DEB macro. * tools/abipkgdiff.cc: Include the config.h header. (extract_rpm): Guard this function definition with the WITH_RPM macro. (extract_deb): Guard this function definition with the WITH_DEB macro. (extract_package): Guard the handling of rpm packages with the WITH_RPM macro and the handling of deb package with the WITH_DEB macro. If a package not-support package format is encountered, emit an appropriate error message and error out. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-08-14 10:49:57 +00:00
fi
AM_CONDITIONAL(ENABLE_RPM, test x$ENABLE_RPM = xyes)
Detect failed self comparison in type canonicalization of abixml During the self comparison triggered by "abidw --abidiff <binary>", some comparison errors can happen when canonicalizing types that are "de-serialized" from the abixml that was serialized from the input binary. This patch adds some debugging checks and messaging to emit a message when a type from the abixml appears to not "match" the original type from the initial corpus it originated from. This is the more detailed description: Let's consider a type T coming from the corpus of the input binary. That input corpus is serialized into abixml and de-serialized again into a second corpus that we shall name the abixml corpus. From that second corpus, let's consider the type T' that is the result of serializing T into abixml and de-serializing it again. T is said to be the original type of T'. If T is a canonical type, then T' should equal T. Otherwise, if T is not a canonical type, its canonical type should equal the canonical type of T'. For the sake of simplicity, let's consider that T is a canonical type. During the canonicalization of T', T' should equal T. Each and every canonical type coming from the abixml corpus should be equal to its original type from the binary corpus. If a T' is different from its original type T, then there is an "equality problem" between T and T'. In other words, there is a mismatch between T and T'. We want to be notified of that problem so that we can debug it further and fix it. So this patch introduces the option "abidw --debug-abidiff <binary>" to trigger the "debug self comparison mode". At canonicalization time, we detect that we are in that debug self comparison mode and during canonicalization of types from the abixml corpus, it detects when they compare different from their counterpart from the original corpus. This debugging capability can be enabled at configure time with a new --enable-debug-self-comparison configure option. That option defines a new WITH_DEBUG_SELF_COMPARISON compile time macro that is used to conditionally compile the implementation of this debugging feature. So, one example of this might look like this: abidw --debug-abidiff bin: error: problem detected with type 'typedef Vmalloc_t' from second corpus error: problem detected with type 'Vmalloc_t*' from second corpus [...] So that means the "typedef Vmalloc_t" read from the abixml compares different from its original type where it should not. So armed with this new insight, I know I need to debug that comparison in particular to see why it wrongly results in two different types. * doc/manuals/abidw.rst: Add documentation for the --debug-abidiff option. * include/abg-ir.h (environment::{set_self_comparison_debug_input, get_self_comparison_debug_inputs, self_comparison_debug_is_on}): Declare new methods. * configure.ac: Define a new --enable-debug-self-comparison option that is disabled by default. That option defines a new WITH_DEBUG_SELF_COMPARISON preprocessor macro. * src/abg-ir.cc (environment::priv::{first_self_comparison_corpus_, second_self_comparison_corpus_, self_comparison_debug_on_}): New data members. Also, re-indent the data members. (environment::{set_self_comparison_debug_input, get_self_comparison_debug_inputs, self_comparison_debug_is_on}): Define new method. (type_base::get_canonical_type_for): In the "debug self comparison mode", if a type coming from the second corpus compares different from its counterpart coming from the first corpus then log a debug message. * src/abg-dwarf-reader.cc (read_debug_info_into_corpus): When loading the first corpus, if the debug self comparison mode is on, then save that corpus on the side in the environment. * src/abg-reader.cc (read_corpus_from_input): When loading the second corpus, if the debug self comparison mode is on, then save that corpus on the side in the environment. * tools/abidw.cc: Include the config.h file for preprocessor macros defined at configure (options::debug_abidiff): New data member. (parse_command_line): Parse the --debug-abidiff option. (load_corpus_and_write_abixml): Switch the self debug mode on when the --debug-abidiff option is provided. Use a read_context for the abixml loading. That is going to be useful for subsequent patches. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2021-05-18 08:29:38 +00:00
dnl enable the debugging of self comparison when doing abidw --debug-abidiff <binary>
if test x$ENABLE_DEBUG_SELF_COMPARISON = xyes; then
AC_DEFINE([WITH_DEBUG_SELF_COMPARISON], 1, [compile support of debugging abidw --abidiff])
AC_MSG_NOTICE([support of debugging self comparison is enabled])
else
AC_MSG_NOTICE([support of debugging self comparison is disabled])
fi
AM_CONDITIONAL(ENABLE_DEBUG_SELF_COMPARISON, test x$ENABLE_DEBUG_SELF_COMPARISON = xyes)
abilint: add the --show-type-use option "abilint --show-type-use <type-id> <abixml-file>" is a facility that shows how a type defined in an abixml file is used. That is, it emits a textual representation of how the use a type is used up until the function or global variable that constitutes an entry point in the API corpus. Here is an example of its use: test-read-write$ abilint --noout --show-type-use type-id-5 test17.xml Type ID 'type-id-5' is for type 'enum E' The usage graph for that type is: | -> enum E -> E S::m2 -> class S -> S* -> method void S::S() | -> enum E -> E S::m2 -> class S -> S* -> method void S::__base_ctor () | -> enum E -> E S::m2 -> class S -> S* -> method void S::__comp_ctor () | -> enum E -> E S::m2 -> class S -> S* -> method void S::S(S&) | -> enum E -> E S::m2 -> class S -> S* -> S& -> method void S::S(S&) | -> enum E -> E S::m2 -> class S -> S* -> S& -> S var | -> enum E -> E S::m2 -> class S -> S* -> S& -> E S::m2 -> class S -> S* -> method void S::S() | -> enum E -> E S::m2 -> class S -> S* -> S& -> E S::m2 -> class S -> S* -> method void S::__base_ctor () | -> enum E -> E S::m2 -> class S -> S* -> S& -> E S::m2 -> class S -> S* -> method void S::__comp_ctor () | -> enum E -> E S::m2 -> class S -> S* -> S& -> E S::m2 -> class S -> S* -> method void S::S(S&) | -> enum E -> E S::m2 -> class S -> S* -> S& -> E S::m2 -> class S -> S* -> S& -> method void S::S(S&) | -> enum E -> E S::m2 -> class S -> S* -> S& -> E S::m2 -> class S -> S* -> S& -> S var $ The screenshot above should be self explanatory. This facility is useful to analyse type usage and find potential issues in how libabigail represents some types. To activate this feature, one needs to configure the package with the configure option "--enable-show-type-use-in-abilint". * configure.ac: Define the --enable-show-type-use-in-abilint configure option. It defines the WITH_SHOW_TYPE_USE_IN_ABILINT macro. * include/abg-reader.h (read_translation_unit): Add an overload that takes the read context. (get_types_from_type_id, get_artifact_used_by_relation_map): Declare new functions. * src/abg-reader.cc (get_types_from_type_id) (get_artifact_used_by_relation_map): Declare these functions as friend of the read_context type. (read_context::m_artifact_used_by_map): (read_context::key_type_decl): Replace the shared_ptr<type_base> type of the first parm by the equivalent type_base_sptr type. (read_context::{record_artifact_as_used_by, record_artifacts_as_used_in_fn_decl, record_artifacts_as_used_in_fn_type}): Add new methods guarded by the WITH_SHOW_TYPE_USE_IN_ABILINT macro. (get_types_from_type_id, get_artifact_used_by_relation_map): Define new functions guarded by the WITH_SHOW_TYPE_USE_IN_ABILINT macro. (read_translation_unit): Define new overload. (RECORD_ARTIFACT_AS_USED_BY, RECORD_ARTIFACTS_AS_USED_IN_FN_DECL) (RECORD_ARTIFACTS_AS_USED_IN_FN_TYPE): Define new macros. (build_function_decl, build_var_decl, build_qualified_type_decl) (build_pointer_type_def, build_reference_type_def) (build_function_type, build_array_type_def, build_enum_type_decl) (build_typedef_decl, build_class_decl, build_union_decl): Use the macros above to mark the relevant sub-types as used by the artifact being built. * tools/abilint.cc (struct artifact_use_relation_tree): Define new type, guarded by the WITH_SHOW_TYPE_USE_IN_ABILINT macro. (fill_artifact_use_tree, build_type_use_tree, emit_trace) (emit_artifact_use_trace, emit_artifact_use_trace) (show_how_type_is_used): Define static functions guarded by the WITH_SHOW_TYPE_USE_IN_ABILINT macro. (display_usage): Add doc string for the --show-type-use option, guarded by the WITH_SHOW_TYPE_USE_IN_ABILINT macro. (parse_command_line): Parse the --show-type-use option, guarded by the WITH_SHOW_TYPE_USE_IN_ABILINT macro. (main): Slight re-organisation to make the abixml file reading use a read_context. That read context is then used to analyze how a given type is used whenever the --show-type-use option is used. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2022-02-17 11:22:25 +00:00
dnl enable support of abilint --show-type-use <type-id>
if test x$ENABLE_SHOW_TYPE_USE_IN_ABILINT = xyes; then
AC_DEFINE([WITH_SHOW_TYPE_USE_IN_ABILINT], 1, [compile support of abilint --show-type-use])
AC_MSG_NOTICE([support of abilint --show-type-use <type-id> is enabled])
else
AC_MSG_NOTICE([support of abilint --show-type-use <type-id> is disabled])
fi
AM_CONDITIONAL(ENABLE_SHOW_TYPE_USE_IN_ABILINT, test x$ENABLE_SHOW_TYPE_USE_IN_ABILINT = xyes)
Add --enable-debug-type-canonicalization to configure This configure option adds the possibility to debug the type canonicalization process specifically. When this new configure option is turned on, in ir::get_canonical_type_for, when the type T, candidate for canonicalization is compared to a given canonical type C, the comparison is done twice; once using structural equality and once using canonical equality whenever it's possible. For all the sub-types of T and C, structural equality and canonical equality must yield the same result. Otherwise, an error message is emitted and the process aborts. This all happens when using the abidw program with the --enable-tc or --enable-type-canonicalization option. This has proven to be very helpful to detect type canonicalization issues. For instance, here is a trace of canonicalization issue that was detected thanks to this patch: $ build/tools/abidw --debug-tc /usr/lib64/libwiretap.so.11.0.8 structural & canonical equality different for type: function type void (wtap*) in compare_types_during_canonicalization at: /home/dodji/git/libabigail/PR28364/src/abg-ir.cc:13575: execution should not have reached this point! Abandon (core dumped) This means that right after canonicalizing the type "void (wtap*)", structural and canonical equality yield different results. So it means there is a problem with that type specifically that makes its canonicalization "go wrong". This requires further debugging to understand, but at least, we are super close to the root cause of the canonicalization problem. * configure.ac: Support the new --enable-debug-type-canonicalization option. Define macro WITH_DEBUG_TYPE_CANONICALIZATION accordingly. * doc/manuals/abidw.rst: Update documentation. * include/abg-ir.h (environment::debug_type_canonicalization_is_on): Declare new member function if WITH_DEBUG_TYPE_CANONICALIZATION is defined. * src/abg-ir-priv.h (environment::priv::{use_canonical_type_comparison_, debug_type_canonicalization_}): Define new data members if WITH_DEBUG_TYPE_CANONICALIZATION is defined. (environment::priv::priv): Initialize them. * src/abg-ir.cc (try_canonical_compare): When WITH_DEBUG_TYPE_CANONICALIZATION is defined, perform comparison using either structural or canonical equality depending on the environment::priv::use_canonical_type_comparison_ flag. (environment::debug_type_canonicalization_is_on): Define member function when WITH_DEBUG_TYPE_CANONICALIZATION is defined. (compare_types_during_canonicalization): Define new function. (type_base::get_canonical_type_for): Use the new function compare_types_during_canonicalization. * tools/abidw.cc (options::debug_type_canonicalization): Define new data member. (option::option): Initialize it. (display_usage): Add help string for --debug-tc. (parse_command_line): Support new option --debug-tc or --debug-type-canonicalization. (load_corpus_and_write_abixml): Turn type canonicalization debugging on if --enable-tc is provided. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2021-10-14 10:12:01 +00:00
dnl enable the debugging of type canonicalization when doing abidw --debug-tc <binary>
if test x$ENABLE_DEBUG_TYPE_CANONICALIZATION = xyes; then
AC_DEFINE([WITH_DEBUG_TYPE_CANONICALIZATION],
1,
[compile support of debugging type canonicalization while using abidw --debug-tc])
AC_MSG_NOTICE([support of debugging type canonicalization is enabled])
else
AC_MSG_NOTICE([support of debugging type canonicalization is disabled])
fi
AM_CONDITIONAL(ENABLE_DEBUG_TYPE_CANONICALIZATION, test x$ENABLE_DEBUG_TYPE_CANONICALIZATION = xyes)
Make the support of RPM and DEB package formats conditional If at configure time the libabigail source tarball detects that rpm2cpio and cpio are present then it enables the support for rpm files. Users can explicitly enable or disable that support by passing --enable-rpm or --disable-rpm to configure. Similarly if it detects that dpkg is present at configure time then it enables the support for deb files. Users can explicitly enable or disable that support by passing --enable-deb or --disable-deb to configure. * config.h.in: Define WITH_DEB and WITH_RPM pre-processor macros. * configure.ac: Add --enable-{rpm,deb} switches. Check for rpm2cpio and cpio programs, unless --disable-rpm was provided. If they are found and if --enable-rpm=auto was provided, then consider that --enable-rpm=yes was provided. In that case, set the WITH_RPM macro to 1. Otherwise, undefine that macro. Similarly, check for dpkg unless --disable-deb was provided. If it's found and if --enable-deb=auto was provided, consider that --enable-deb=yes was provided. In that case, set the WITH_DEB macro to 1. Otherwise, undefine that macro. Define the ENABLE_RPM and ENABLE_DEB conditional automake variables, if the rpm resp. deb support is enabled. Emit a notice about the rpm and deb features being enabled or not, at the end of the configure process. * tests/test-diff-pkg.cc: Include the config.h header. (in_out_spec): Guard rpm tests by the WITH_RPM macro. Similarly, guard deb tests by the WITH_DEB macro. * tools/abipkgdiff.cc: Include the config.h header. (extract_rpm): Guard this function definition with the WITH_RPM macro. (extract_deb): Guard this function definition with the WITH_DEB macro. (extract_package): Guard the handling of rpm packages with the WITH_RPM macro and the handling of deb package with the WITH_DEB macro. If a package not-support package format is encountered, emit an appropriate error message and error out. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-08-14 10:49:57 +00:00
dnl Check for the dpkg program
if test x$ENABLE_DEB = xauto -o x$ENABLE_DEB = xyes; then
AC_CHECK_PROG(HAS_DPKG, dpkg, yes, no)
if test x$ENABLE_DEB = xauto; then
if test x$HAS_DPKG = xyes; then
ENABLE_DEB=yes
else
ENABLE_DEB=no
Make the support of RPM and DEB package formats conditional If at configure time the libabigail source tarball detects that rpm2cpio and cpio are present then it enables the support for rpm files. Users can explicitly enable or disable that support by passing --enable-rpm or --disable-rpm to configure. Similarly if it detects that dpkg is present at configure time then it enables the support for deb files. Users can explicitly enable or disable that support by passing --enable-deb or --disable-deb to configure. * config.h.in: Define WITH_DEB and WITH_RPM pre-processor macros. * configure.ac: Add --enable-{rpm,deb} switches. Check for rpm2cpio and cpio programs, unless --disable-rpm was provided. If they are found and if --enable-rpm=auto was provided, then consider that --enable-rpm=yes was provided. In that case, set the WITH_RPM macro to 1. Otherwise, undefine that macro. Similarly, check for dpkg unless --disable-deb was provided. If it's found and if --enable-deb=auto was provided, consider that --enable-deb=yes was provided. In that case, set the WITH_DEB macro to 1. Otherwise, undefine that macro. Define the ENABLE_RPM and ENABLE_DEB conditional automake variables, if the rpm resp. deb support is enabled. Emit a notice about the rpm and deb features being enabled or not, at the end of the configure process. * tests/test-diff-pkg.cc: Include the config.h header. (in_out_spec): Guard rpm tests by the WITH_RPM macro. Similarly, guard deb tests by the WITH_DEB macro. * tools/abipkgdiff.cc: Include the config.h header. (extract_rpm): Guard this function definition with the WITH_RPM macro. (extract_deb): Guard this function definition with the WITH_DEB macro. (extract_package): Guard the handling of rpm packages with the WITH_RPM macro and the handling of deb package with the WITH_DEB macro. If a package not-support package format is encountered, emit an appropriate error message and error out. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-08-14 10:49:57 +00:00
fi
fi
fi
if test x$ENABLE_DEB = xyes; then
AC_DEFINE([WITH_DEB], 1, [compile the deb package support in abipkgdiff])
AC_MSG_NOTICE(deb support in abipkgdiff is enabled);
else
AC_MSG_NOTICE(deb support in abipkgdiff is disabled);
fi
AM_CONDITIONAL(ENABLE_DEB, test x$ENABLE_DEB = xyes)
Make abipkgdiff compare tar archives containing binaries This patch adds support for comparing the ABI of binaries contained in a tar archive. If the archive is compressed with gzip, bzip2, lzip, lzma or xz, then abipkgdiff recognizes the usual relevant file extensions and lets the GNU tar program handle the decompression. If the archive is not compressed, abipkgdiff recognizes the UStar (Uniform Standard Tape ARchive) format, even if the archive file name doesn't end with the .tar extension, and lets the GNU tar program handle the extraction. If the file ends up with the .tar extension anyway (even if it's not in the UStar format, abipkgdiff lets the GNU tar program handle its extraction. * config.h.in (WITH_TAR): New configuration preprocessor macro. * configure.ac: Add a new --enable-tar option. It's turned on automatically if the tar program is found in the PATH. Adjust the build configuration report to add the tar archive support. * include/abg-tools-utils.h (string_ends_with): Declare new function. (enum file_type): Add a new FILE_TYPE_TAR enumerator. * src/abg-tools-utils.cc (string_ends_with): Define new function. (operator<<(ostream&, file_type)): Serialize the new FILE_TYPE_TAR enumerator. (guess_file_type): Detect UStar format file by reading its magic number. Detect compressed tar files based on the file path extension. * tools/abipkgdiff.cc (extract_tar): Define new function. (extract_package): Handle tar packages. (main): Handle tar archives. * tools/abidiff.cc (main): Handle the new FILE_TYPE_TAR enumerator. * tools/abilint.cc (main): Likewise. * tests/data/test-diff-pkg/tarpkg-0-dir{1,2}.ta{,r,.bz2, gz}: New test input tarballs. * tests/data/test-diff-pkg/tarpkg-0-report-0.txt: New test output reference. * tests/data/Makefile.am: Add the new test data file above to source distribution. * tests/test-diff-pkg.cc (in_out_specs): Add new tests cases. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-08-22 11:59:18 +00:00
dnl Check for the tar program
if test x$ENABLE_TAR = xauto -o x$ENABLE_TAR = xyes; then
AC_CHECK_PROG(HAS_TAR, tar, yes, no)
if test x$ENABLE_TAR = xauto; then
if test x$HAS_TAR = xyes; then
ENABLE_TAR=yes
fi
fi
fi
if test x$ENABLE_TAR = xyes; then
AC_DEFINE([WITH_TAR], 1, [compile the GNU tar archive support in abipkgdiff])
AC_MSG_NOTICE(GNU tar support in abipkgdiff is enabled);
else
AC_MSG_NOTICE(GNU tar support in abipkgdiff is disabled);
fi
AM_CONDITIONAL(ENABLE_TAR, test x$ENABLE_TAR = xyes)
dnl Check for the bash-completion package
if test x$ENABLE_BASH_COMPLETION = xauto -o x$ENABLE_BASH_COMPLETION = xyes; then
AC_CHECK_PROG(HAS_BASH_COMPLETION, bash-completion, yes, no)
if test x$ENABLE_BASH_COMPLETION = xauto; then
if test x$HAS_BASH_COMPLETION = xyes; then
ENABLE_BASH_COMPLETION=yes
else
ENABLE_BASH_COMPLETION=no
fi
fi
fi
if test x$ENABLE_BASH_COMPLETION = xyes; then
AC_MSG_NOTICE(bash-completion support in libabigail is enabled);
else
AC_MSG_NOTICE(bash-completion support in libabigail is disabled);
fi
AM_CONDITIONAL(ENABLE_BASH_COMPLETION, test x$ENABLE_BASH_COMPLETION = xyes)
# The minimal python 2 version we want to support is 2.6.6 because EL6
# distributions have that version installed.
MINIMAL_PYTHON2_VERSION="2.6.6"
AC_PATH_PROG(PYTHON, python, no)
AX_PROG_PYTHON_VERSION($MINIMAL_PYTHON2_VERSION,
[MINIMAL_PYTHON_VERSION_FOUND=yes],
[MINIMAL_PYTHON_VERSION_FOUND=no])
# The minimal python 3 version we want to support is 3.5, which is
# available in Fedora releases and in EL7.
if test x$ENABLE_PYTHON3 != xno; then
AC_CHECK_PROGS(PYTHON3_INTERPRETER, [python3 python3.5 python3.6 python3.7], no)
else
PYTHON3_INTERPRETER=no
fi
if test x$ENABLE_PYTHON3 = xauto; then
if test x$PYTHON3_INTERPRETER != xno; then
ENABLE_PYTHON3=yes
else
# When enabling python3 is auto, tests only run if the
# python3 interpreter was found on the system. Otherwise,
# just ignore it.
ENABLE_PYTHON3=no
AC_MSG_NOTICE([Python 3 was not found. Skip running tests with Python 3.])
fi
fi
if test x$ENABLE_PYTHON3 = xyes; then
if test x$PYTHON3_INTERPRETER != xno; then
# We were asked to enable python3 implicitely (auto and
# python3 was found) or explicitly. So enable running tests
# using python3 then.
RUN_TESTS_WITH_PY3=yes
else
AC_MSG_ERROR([Python 3 was not found])
fi
fi
if test x$PYTHON3_INTERPRETER = xyes; then
MINIMAL_PYTHON_VERSION_FOUND=yes
fi
if test x$MINIMAL_PYTHON_VERSION_FOUND = xno; then
AC_MSG_NOTICE([no minimal version of python found])
if test x$PYTHON = xno; then
AC_MSG_NOTICE([python binary wasn't found])
if test x$PYTHON3_INTERPRETER != xno; then
AC_MSG_NOTICE([using $PYTHON3_INTERPRETER instead])
PYTHON=$PYTHON3_INTERPRETER
MINIMAL_PYTHON_VERSION_FOUND=yes
MISSING_FEDABIPKGDIFF_DEP=no
fi
fi
else
AC_MSG_NOTICE([a minimal version of python was found ...])
if test x$PYTHON3_INTERPRETER != xno; then
# We were instructed to use python3 and it's present on the
# system. Let's update the PYTHON variable that points to the
# actual python interpreter we are going to be using
AC_MSG_NOTICE([... and it was $PYTHON3_INTERPRETER])
PYTHON=$PYTHON3_INTERPRETER
fi
fi
Bug 19428 - New fedabipkgdiff utility fedabipkgdiff is a convenient way to compare the ABI of Fedora packages easily. The first version of fedabipkgdiff introduced by this patch lets users perform operations like: fedabipkgdiff --from fc23 foo-0.1-1.fc23.x86_64.rpm fedabipkgdiff --from fc23 --to fc24 foo fedabipkgdiff foo-0.1-1.fc23 foo-0.1-1.fc24 fedabipkgdiff foo-0.1-1.fc23.i686 foo-0.1-1.fc24.i686 fedabipkgdiff --all-subpackages foo-0.1-1.fc23 foo-0.1-1.fc24 * autoconf-archive/ax_compare_version.m4: New file copied from the autoconf-archive project. * autoconf-archive/ax_prog_python_version.m4: Likewise. * autoconf-archive/ax_python_module.m4: Likewise. * Makefile.am: Add the new files above to the source distribution. * configure.ac: Include the new m4 macros from the autoconf archive. Add a new --enable-fedabipkgdiff option. Update the report at the end of the configure process to show the status of the fedabipkgdiff feature. Add check for prerequisite python modules argparse, glob, logging, os, re, shlex, subprocess, sys, itertools, urlparse, itertools, shutil, unittest, xdg, koji and mock. These are necessary for the unit test of fedabipkgdiff. Generate tests/runtestfedabipkgdiff.py into the build directory, from the tests/runtestfedabipkgdiff.py.in input file. * tools/Makefile.am: Include the fedabipkgdiff to the source distribution and install it if the "fedabipkgdiff" feature is enabled. * tests/Makefile.am: Rename runtestfedabipkgdiff.sh into runtestfedabipkgdiff.py. Add the new runtestfedabipkgdiff.py.in autoconf template file in here. * tests/runtestfedabipkgdiff.py.in: New unit test file. * tools/fedabipkgdiff: New fedabipkgdiff tool. * doc/manuals/fedabipkgdiff.rst: New manual. Signed-off-by: Chenxiong Qi <cqi@redhat.com> Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-02-09 10:05:33 +00:00
dnl if --enable-fedabipkgdiff has the 'auto' value, then check for the required
dnl python modules. If they are present, then enable the fedabipkgdiff program.
dnl If they are not then disable the program.
dnl
dnl If --enable-fedabipkgdiff has the 'yes' value, then check for the required
dnl python modules and whatever dependency fedabipkgdiff needs. If they are
dnl not present then the configure script will error out.
if test x$ENABLE_FEDABIPKGDIFF = xauto -o x$ENABLE_FEDABIPKGDIFF = xyes; then
CHECK_DEPS_FOR_FEDABIPKGDIFF=yes
else
CHECK_DEPS_FOR_FEDABIPKGDIFF=no
fi
if test x$CHECK_DEPS_FOR_FEDABIPKGDIFF = xyes; then
MISSING_FEDABIPKGDIFF_DEP=no
Bug 19428 - New fedabipkgdiff utility fedabipkgdiff is a convenient way to compare the ABI of Fedora packages easily. The first version of fedabipkgdiff introduced by this patch lets users perform operations like: fedabipkgdiff --from fc23 foo-0.1-1.fc23.x86_64.rpm fedabipkgdiff --from fc23 --to fc24 foo fedabipkgdiff foo-0.1-1.fc23 foo-0.1-1.fc24 fedabipkgdiff foo-0.1-1.fc23.i686 foo-0.1-1.fc24.i686 fedabipkgdiff --all-subpackages foo-0.1-1.fc23 foo-0.1-1.fc24 * autoconf-archive/ax_compare_version.m4: New file copied from the autoconf-archive project. * autoconf-archive/ax_prog_python_version.m4: Likewise. * autoconf-archive/ax_python_module.m4: Likewise. * Makefile.am: Add the new files above to the source distribution. * configure.ac: Include the new m4 macros from the autoconf archive. Add a new --enable-fedabipkgdiff option. Update the report at the end of the configure process to show the status of the fedabipkgdiff feature. Add check for prerequisite python modules argparse, glob, logging, os, re, shlex, subprocess, sys, itertools, urlparse, itertools, shutil, unittest, xdg, koji and mock. These are necessary for the unit test of fedabipkgdiff. Generate tests/runtestfedabipkgdiff.py into the build directory, from the tests/runtestfedabipkgdiff.py.in input file. * tools/Makefile.am: Include the fedabipkgdiff to the source distribution and install it if the "fedabipkgdiff" feature is enabled. * tests/Makefile.am: Rename runtestfedabipkgdiff.sh into runtestfedabipkgdiff.py. Add the new runtestfedabipkgdiff.py.in autoconf template file in here. * tests/runtestfedabipkgdiff.py.in: New unit test file. * tools/fedabipkgdiff: New fedabipkgdiff tool. * doc/manuals/fedabipkgdiff.rst: New manual. Signed-off-by: Chenxiong Qi <cqi@redhat.com> Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-02-09 10:05:33 +00:00
if test x$ENABLE_FEDABIPKGDIFF = xyes; then
MISSING_FEDABIPKGDIFF_DEP_FATAL=yes
else
MISSING_FEDABIPKGDIFF_DEP_FATAL=no
Bug 19428 - New fedabipkgdiff utility fedabipkgdiff is a convenient way to compare the ABI of Fedora packages easily. The first version of fedabipkgdiff introduced by this patch lets users perform operations like: fedabipkgdiff --from fc23 foo-0.1-1.fc23.x86_64.rpm fedabipkgdiff --from fc23 --to fc24 foo fedabipkgdiff foo-0.1-1.fc23 foo-0.1-1.fc24 fedabipkgdiff foo-0.1-1.fc23.i686 foo-0.1-1.fc24.i686 fedabipkgdiff --all-subpackages foo-0.1-1.fc23 foo-0.1-1.fc24 * autoconf-archive/ax_compare_version.m4: New file copied from the autoconf-archive project. * autoconf-archive/ax_prog_python_version.m4: Likewise. * autoconf-archive/ax_python_module.m4: Likewise. * Makefile.am: Add the new files above to the source distribution. * configure.ac: Include the new m4 macros from the autoconf archive. Add a new --enable-fedabipkgdiff option. Update the report at the end of the configure process to show the status of the fedabipkgdiff feature. Add check for prerequisite python modules argparse, glob, logging, os, re, shlex, subprocess, sys, itertools, urlparse, itertools, shutil, unittest, xdg, koji and mock. These are necessary for the unit test of fedabipkgdiff. Generate tests/runtestfedabipkgdiff.py into the build directory, from the tests/runtestfedabipkgdiff.py.in input file. * tools/Makefile.am: Include the fedabipkgdiff to the source distribution and install it if the "fedabipkgdiff" feature is enabled. * tests/Makefile.am: Rename runtestfedabipkgdiff.sh into runtestfedabipkgdiff.py. Add the new runtestfedabipkgdiff.py.in autoconf template file in here. * tests/runtestfedabipkgdiff.py.in: New unit test file. * tools/fedabipkgdiff: New fedabipkgdiff tool. * doc/manuals/fedabipkgdiff.rst: New manual. Signed-off-by: Chenxiong Qi <cqi@redhat.com> Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-02-09 10:05:33 +00:00
fi
AC_PATH_PROG(WGET, wget, no)
if test x$WGET = xno; then
configure: Tune fedabipkgdiff dependencies detection If 'configure' finds some Python koji module, but it's "insufficient" per the testing once added in commit 90d236a03343d75ea504d53c73270e50b9000e75 "Bug 22076 - Disable fedabipkgdiff for old koji clients", we currently get, for example: [...] checking python3 module: koji... yes [...] checking checking if koji client is recent enough ...... Traceback (most recent call last): File "<string>", line 3, in <module> File "[...]/koji/__init__.py", line 2016, in read_config raise ConfigurationError("no configuration for profile name: %s" koji.ConfigurationError: no configuration for profile name: koji no, disabling fedpkgdiff [...] Here is the configuration of the package: [...] Enable fedabipkgdiff : auto [...] Note repeated 'checking' and '...', intermixed error output, 'fedpkgdiff' typo, final 'auto' result. Changing that to: [...] checking if koji client is recent enough... no configure: WARNING: disabling fedabipkgdiff [...] Here is the configuration of the package: [...] Enable fedabipkgdiff : no [...] ... with 'config.log': [...] configure:13774: checking if koji client is recent enough configure:13784: result: no Traceback (most recent call last): File "<string>", line 3, in <module> File "[...]/koji/__init__.py", line 2016, in read_config raise ConfigurationError("no configuration for profile name: %s" koji.ConfigurationError: no configuration for profile name: koji configure:13792: WARNING: disabling fedabipkgdiff [...] Similarly, with explicit '--enable-fedabipkgdiff', we currently get: [...] checking checking if koji client is recent enough ...... Traceback (most recent call last): File "<string>", line 3, in <module> File "[...]/koji/__init__.py", line 2016, in read_config raise ConfigurationError("no configuration for profile name: %s" koji.ConfigurationError: no configuration for profile name: koji no, disabling fedpkgdiff [...] Here is the configuration of the package: [...] Enable fedabipkgdiff : yes [...] ... instead of a fatal error. Changing that to: [...] checking if koji client is recent enough... no configure: error: unsuitable koji client * configure.ac: Tune fedabipkgdiff dependencies detection. Signed-off-by: Thomas Schwinge <thomas@codesourcery.com>
2021-12-11 18:18:52 +00:00
MISSING_FEDABIPKGDIFF_DEP=yes
if test x$MISSING_FEDABIPKGDIFF_DEP_FATAL = xyes; then
AC_MSG_ERROR(could not find the wget program)
else
AC_MSG_NOTICE([could not find the wget program])
AC_MSG_NOTICE([disabling fedabipkgdiff as a result])
fi
Bug 19428 - New fedabipkgdiff utility fedabipkgdiff is a convenient way to compare the ABI of Fedora packages easily. The first version of fedabipkgdiff introduced by this patch lets users perform operations like: fedabipkgdiff --from fc23 foo-0.1-1.fc23.x86_64.rpm fedabipkgdiff --from fc23 --to fc24 foo fedabipkgdiff foo-0.1-1.fc23 foo-0.1-1.fc24 fedabipkgdiff foo-0.1-1.fc23.i686 foo-0.1-1.fc24.i686 fedabipkgdiff --all-subpackages foo-0.1-1.fc23 foo-0.1-1.fc24 * autoconf-archive/ax_compare_version.m4: New file copied from the autoconf-archive project. * autoconf-archive/ax_prog_python_version.m4: Likewise. * autoconf-archive/ax_python_module.m4: Likewise. * Makefile.am: Add the new files above to the source distribution. * configure.ac: Include the new m4 macros from the autoconf archive. Add a new --enable-fedabipkgdiff option. Update the report at the end of the configure process to show the status of the fedabipkgdiff feature. Add check for prerequisite python modules argparse, glob, logging, os, re, shlex, subprocess, sys, itertools, urlparse, itertools, shutil, unittest, xdg, koji and mock. These are necessary for the unit test of fedabipkgdiff. Generate tests/runtestfedabipkgdiff.py into the build directory, from the tests/runtestfedabipkgdiff.py.in input file. * tools/Makefile.am: Include the fedabipkgdiff to the source distribution and install it if the "fedabipkgdiff" feature is enabled. * tests/Makefile.am: Rename runtestfedabipkgdiff.sh into runtestfedabipkgdiff.py. Add the new runtestfedabipkgdiff.py.in autoconf template file in here. * tests/runtestfedabipkgdiff.py.in: New unit test file. * tools/fedabipkgdiff: New fedabipkgdiff tool. * doc/manuals/fedabipkgdiff.rst: New manual. Signed-off-by: Chenxiong Qi <cqi@redhat.com> Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-02-09 10:05:33 +00:00
fi
if test x$MINIMAL_PYTHON_VERSION_FOUND = xno; then
MISSING_FEDABIPKGDIFF_DEP=yes
if test x$MISSING_FEDABIPKGDIFF_DEP_FATAL = xyes; then
Bug 22722 - Make fedabipkgdiff and its tests support both python 3 and 2 This patch makes fedabipkgdiff Python 3 compatible. All tests written in Python are updated and compatible with Python 3 as well. The patch looks for a Python 3 interperter. If it finds one then it runs the tests using that interpreter. Otherwise it just tries to use the Python 2 interpreter. This behaviour can be disabled by the new --disable-python3 option. * configure.ac: Add new option --enable-python3. Add new test runner file tests/runtestdefaultsupprs-py3 and tests/runtestfedabipkgdiffpy3.sh. Add required six Python module. * tests/Makefile.am: Add new test files tests/runtestdefaultsupprspy3.sh and tests/runtestfedabipkgdiffpy3.sh accordingly. * tests/mockfedabipkgdiff.in: Convert print statement to six.print_. Replace call to function filter with list comprehension. Replace basestring with six.string_types. * tests/runtestdefaultsupprspy3.sh.in: New shell script to run test runtestdefaultsupprs with Python 3. * tests/runtestdefaultsupprs.py.in: Repalce a few tabs with proper number of spaces which is detected by Python 3 interpreter. * tests/runtestfedabipkgdiffpy3.sh.in: New shell script to run test runtestfedabipkgdiff with Python 3. * tests/runtestfedabipkgdiff.py.in: Use python from env in shebang instead of a fixed path to a Python interpreter. * tools/fedabipkgdiff: Globally replace print statement with a function call to print which is available by importing print_function from __future__ module. Use six.print_ to output string to stderr instead. Convert function call to map to for-loop. (cmp_nvr): Change argument to handle a Koji build mapping instead of only the nvr. (Brew.listBuilds): use the new cmp_nvr to sort builds. Signed-off-by: Chenxiong Qi <cqi@redhat.com> Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2018-03-25 07:34:59 +00:00
AC_MSG_ERROR([could not find a python program of version at least $MINIMAL_PYTHON2_VERSION])
fi
Bug 19428 - New fedabipkgdiff utility fedabipkgdiff is a convenient way to compare the ABI of Fedora packages easily. The first version of fedabipkgdiff introduced by this patch lets users perform operations like: fedabipkgdiff --from fc23 foo-0.1-1.fc23.x86_64.rpm fedabipkgdiff --from fc23 --to fc24 foo fedabipkgdiff foo-0.1-1.fc23 foo-0.1-1.fc24 fedabipkgdiff foo-0.1-1.fc23.i686 foo-0.1-1.fc24.i686 fedabipkgdiff --all-subpackages foo-0.1-1.fc23 foo-0.1-1.fc24 * autoconf-archive/ax_compare_version.m4: New file copied from the autoconf-archive project. * autoconf-archive/ax_prog_python_version.m4: Likewise. * autoconf-archive/ax_python_module.m4: Likewise. * Makefile.am: Add the new files above to the source distribution. * configure.ac: Include the new m4 macros from the autoconf archive. Add a new --enable-fedabipkgdiff option. Update the report at the end of the configure process to show the status of the fedabipkgdiff feature. Add check for prerequisite python modules argparse, glob, logging, os, re, shlex, subprocess, sys, itertools, urlparse, itertools, shutil, unittest, xdg, koji and mock. These are necessary for the unit test of fedabipkgdiff. Generate tests/runtestfedabipkgdiff.py into the build directory, from the tests/runtestfedabipkgdiff.py.in input file. * tools/Makefile.am: Include the fedabipkgdiff to the source distribution and install it if the "fedabipkgdiff" feature is enabled. * tests/Makefile.am: Rename runtestfedabipkgdiff.sh into runtestfedabipkgdiff.py. Add the new runtestfedabipkgdiff.py.in autoconf template file in here. * tests/runtestfedabipkgdiff.py.in: New unit test file. * tools/fedabipkgdiff: New fedabipkgdiff tool. * doc/manuals/fedabipkgdiff.rst: New manual. Signed-off-by: Chenxiong Qi <cqi@redhat.com> Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-02-09 10:05:33 +00:00
fi
Bug 22722 - Make fedabipkgdiff and its tests support both python 3 and 2 This patch makes fedabipkgdiff Python 3 compatible. All tests written in Python are updated and compatible with Python 3 as well. The patch looks for a Python 3 interperter. If it finds one then it runs the tests using that interpreter. Otherwise it just tries to use the Python 2 interpreter. This behaviour can be disabled by the new --disable-python3 option. * configure.ac: Add new option --enable-python3. Add new test runner file tests/runtestdefaultsupprs-py3 and tests/runtestfedabipkgdiffpy3.sh. Add required six Python module. * tests/Makefile.am: Add new test files tests/runtestdefaultsupprspy3.sh and tests/runtestfedabipkgdiffpy3.sh accordingly. * tests/mockfedabipkgdiff.in: Convert print statement to six.print_. Replace call to function filter with list comprehension. Replace basestring with six.string_types. * tests/runtestdefaultsupprspy3.sh.in: New shell script to run test runtestdefaultsupprs with Python 3. * tests/runtestdefaultsupprs.py.in: Repalce a few tabs with proper number of spaces which is detected by Python 3 interpreter. * tests/runtestfedabipkgdiffpy3.sh.in: New shell script to run test runtestfedabipkgdiff with Python 3. * tests/runtestfedabipkgdiff.py.in: Use python from env in shebang instead of a fixed path to a Python interpreter. * tools/fedabipkgdiff: Globally replace print statement with a function call to print which is available by importing print_function from __future__ module. Use six.print_ to output string to stderr instead. Convert function call to map to for-loop. (cmp_nvr): Change argument to handle a Koji build mapping instead of only the nvr. (Brew.listBuilds): use the new cmp_nvr to sort builds. Signed-off-by: Chenxiong Qi <cqi@redhat.com> Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2018-03-25 07:34:59 +00:00
###################################################################
# Now we are going to check the presence of the required python
# modules using either python2 or python3 as required until now.
###################################################################
# Grrr, the urlparse python2 module got renamed in python3 as
# urllib.parse. Oh well.
if test x$PYTHON = xpython3; then
URLPARSE_MODULE=urllib.parse
else
URLPARSE_MODULE=urlparse
fi
REQUIRED_PYTHON_MODULES_FOR_FEDABIPKGDIFF="\
Bug 22722 - Make fedabipkgdiff and its tests support both python 3 and 2 This patch makes fedabipkgdiff Python 3 compatible. All tests written in Python are updated and compatible with Python 3 as well. The patch looks for a Python 3 interperter. If it finds one then it runs the tests using that interpreter. Otherwise it just tries to use the Python 2 interpreter. This behaviour can be disabled by the new --disable-python3 option. * configure.ac: Add new option --enable-python3. Add new test runner file tests/runtestdefaultsupprs-py3 and tests/runtestfedabipkgdiffpy3.sh. Add required six Python module. * tests/Makefile.am: Add new test files tests/runtestdefaultsupprspy3.sh and tests/runtestfedabipkgdiffpy3.sh accordingly. * tests/mockfedabipkgdiff.in: Convert print statement to six.print_. Replace call to function filter with list comprehension. Replace basestring with six.string_types. * tests/runtestdefaultsupprspy3.sh.in: New shell script to run test runtestdefaultsupprs with Python 3. * tests/runtestdefaultsupprs.py.in: Repalce a few tabs with proper number of spaces which is detected by Python 3 interpreter. * tests/runtestfedabipkgdiffpy3.sh.in: New shell script to run test runtestfedabipkgdiff with Python 3. * tests/runtestfedabipkgdiff.py.in: Use python from env in shebang instead of a fixed path to a Python interpreter. * tools/fedabipkgdiff: Globally replace print statement with a function call to print which is available by importing print_function from __future__ module. Use six.print_ to output string to stderr instead. Convert function call to map to for-loop. (cmp_nvr): Change argument to handle a Koji build mapping instead of only the nvr. (Brew.listBuilds): use the new cmp_nvr to sort builds. Signed-off-by: Chenxiong Qi <cqi@redhat.com> Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2018-03-25 07:34:59 +00:00
argparse logging os re subprocess sys $URLPARSE_MODULE \
xdg koji mock rpm imp tempfile mimetypes shutil six"
configure: Tune fedabipkgdiff dependencies detection If 'configure' finds some Python koji module, but it's "insufficient" per the testing once added in commit 90d236a03343d75ea504d53c73270e50b9000e75 "Bug 22076 - Disable fedabipkgdiff for old koji clients", we currently get, for example: [...] checking python3 module: koji... yes [...] checking checking if koji client is recent enough ...... Traceback (most recent call last): File "<string>", line 3, in <module> File "[...]/koji/__init__.py", line 2016, in read_config raise ConfigurationError("no configuration for profile name: %s" koji.ConfigurationError: no configuration for profile name: koji no, disabling fedpkgdiff [...] Here is the configuration of the package: [...] Enable fedabipkgdiff : auto [...] Note repeated 'checking' and '...', intermixed error output, 'fedpkgdiff' typo, final 'auto' result. Changing that to: [...] checking if koji client is recent enough... no configure: WARNING: disabling fedabipkgdiff [...] Here is the configuration of the package: [...] Enable fedabipkgdiff : no [...] ... with 'config.log': [...] configure:13774: checking if koji client is recent enough configure:13784: result: no Traceback (most recent call last): File "<string>", line 3, in <module> File "[...]/koji/__init__.py", line 2016, in read_config raise ConfigurationError("no configuration for profile name: %s" koji.ConfigurationError: no configuration for profile name: koji configure:13792: WARNING: disabling fedabipkgdiff [...] Similarly, with explicit '--enable-fedabipkgdiff', we currently get: [...] checking checking if koji client is recent enough ...... Traceback (most recent call last): File "<string>", line 3, in <module> File "[...]/koji/__init__.py", line 2016, in read_config raise ConfigurationError("no configuration for profile name: %s" koji.ConfigurationError: no configuration for profile name: koji no, disabling fedpkgdiff [...] Here is the configuration of the package: [...] Enable fedabipkgdiff : yes [...] ... instead of a fatal error. Changing that to: [...] checking if koji client is recent enough... no configure: error: unsuitable koji client * configure.ac: Tune fedabipkgdiff dependencies detection. Signed-off-by: Thomas Schwinge <thomas@codesourcery.com>
2021-12-11 18:18:52 +00:00
AX_CHECK_PYTHON_MODULES([$REQUIRED_PYTHON_MODULES_FOR_FEDABIPKGDIFF],
[$PYTHON],
[FOUND_ALL_PYTHON_MODULES=yes],
[FOUND_ALL_PYTHON_MODULES=no])
if test x$FOUND_ALL_PYTHON_MODULES = xno; then
MISSING_FEDABIPKGDIFF_DEP=yes
if test x$MISSING_FEDABIPKGDIFF_DEP_FATAL = xyes; then
AC_MSG_ERROR([missing python modules: $MISSING_PYTHON_MODULES]);
else
configure: Tune fedabipkgdiff dependencies detection If 'configure' finds some Python koji module, but it's "insufficient" per the testing once added in commit 90d236a03343d75ea504d53c73270e50b9000e75 "Bug 22076 - Disable fedabipkgdiff for old koji clients", we currently get, for example: [...] checking python3 module: koji... yes [...] checking checking if koji client is recent enough ...... Traceback (most recent call last): File "<string>", line 3, in <module> File "[...]/koji/__init__.py", line 2016, in read_config raise ConfigurationError("no configuration for profile name: %s" koji.ConfigurationError: no configuration for profile name: koji no, disabling fedpkgdiff [...] Here is the configuration of the package: [...] Enable fedabipkgdiff : auto [...] Note repeated 'checking' and '...', intermixed error output, 'fedpkgdiff' typo, final 'auto' result. Changing that to: [...] checking if koji client is recent enough... no configure: WARNING: disabling fedabipkgdiff [...] Here is the configuration of the package: [...] Enable fedabipkgdiff : no [...] ... with 'config.log': [...] configure:13774: checking if koji client is recent enough configure:13784: result: no Traceback (most recent call last): File "<string>", line 3, in <module> File "[...]/koji/__init__.py", line 2016, in read_config raise ConfigurationError("no configuration for profile name: %s" koji.ConfigurationError: no configuration for profile name: koji configure:13792: WARNING: disabling fedabipkgdiff [...] Similarly, with explicit '--enable-fedabipkgdiff', we currently get: [...] checking checking if koji client is recent enough ...... Traceback (most recent call last): File "<string>", line 3, in <module> File "[...]/koji/__init__.py", line 2016, in read_config raise ConfigurationError("no configuration for profile name: %s" koji.ConfigurationError: no configuration for profile name: koji no, disabling fedpkgdiff [...] Here is the configuration of the package: [...] Enable fedabipkgdiff : yes [...] ... instead of a fatal error. Changing that to: [...] checking if koji client is recent enough... no configure: error: unsuitable koji client * configure.ac: Tune fedabipkgdiff dependencies detection. Signed-off-by: Thomas Schwinge <thomas@codesourcery.com>
2021-12-11 18:18:52 +00:00
AC_MSG_NOTICE([missing python modules: $MISSING_PYTHON_MODULES])
AC_MSG_NOTICE([disabling fedabipkgdiff as a result])
fi
else
# On some old platforms, the koji client object doesn't have
# the required .read_config method. Alas, that module doesn't
# have any __version__ string either. So we do as well as we
# can to try and detect that case and disable fedabipkgdiff if
# necessary.
AC_MSG_CHECKING([if koji client is recent enough])
$PYTHON 2>&AS_MESSAGE_LOG_FD -c "
import koji
try:
koji.read_config('koji')
except koji.ConfigurationError:
# See 'tools/fedabipkgdiff'.
pass"
configure: Tune fedabipkgdiff dependencies detection If 'configure' finds some Python koji module, but it's "insufficient" per the testing once added in commit 90d236a03343d75ea504d53c73270e50b9000e75 "Bug 22076 - Disable fedabipkgdiff for old koji clients", we currently get, for example: [...] checking python3 module: koji... yes [...] checking checking if koji client is recent enough ...... Traceback (most recent call last): File "<string>", line 3, in <module> File "[...]/koji/__init__.py", line 2016, in read_config raise ConfigurationError("no configuration for profile name: %s" koji.ConfigurationError: no configuration for profile name: koji no, disabling fedpkgdiff [...] Here is the configuration of the package: [...] Enable fedabipkgdiff : auto [...] Note repeated 'checking' and '...', intermixed error output, 'fedpkgdiff' typo, final 'auto' result. Changing that to: [...] checking if koji client is recent enough... no configure: WARNING: disabling fedabipkgdiff [...] Here is the configuration of the package: [...] Enable fedabipkgdiff : no [...] ... with 'config.log': [...] configure:13774: checking if koji client is recent enough configure:13784: result: no Traceback (most recent call last): File "<string>", line 3, in <module> File "[...]/koji/__init__.py", line 2016, in read_config raise ConfigurationError("no configuration for profile name: %s" koji.ConfigurationError: no configuration for profile name: koji configure:13792: WARNING: disabling fedabipkgdiff [...] Similarly, with explicit '--enable-fedabipkgdiff', we currently get: [...] checking checking if koji client is recent enough ...... Traceback (most recent call last): File "<string>", line 3, in <module> File "[...]/koji/__init__.py", line 2016, in read_config raise ConfigurationError("no configuration for profile name: %s" koji.ConfigurationError: no configuration for profile name: koji no, disabling fedpkgdiff [...] Here is the configuration of the package: [...] Enable fedabipkgdiff : yes [...] ... instead of a fatal error. Changing that to: [...] checking if koji client is recent enough... no configure: error: unsuitable koji client * configure.ac: Tune fedabipkgdiff dependencies detection. Signed-off-by: Thomas Schwinge <thomas@codesourcery.com>
2021-12-11 18:18:52 +00:00
if test $? -eq 0; then
koji_version_check_ok=yes
else
koji_version_check_ok=no
fi
AC_MSG_RESULT([$koji_version_check_ok])
if test x$koji_version_check_ok = xno; then
MISSING_FEDABIPKGDIFF_DEP=yes
if test x$MISSING_FEDABIPKGDIFF_DEP_FATAL = xyes; then
AC_MSG_ERROR([unsuitable koji client])
else
AC_MSG_WARN([disabling fedabipkgdiff])
fi
fi
Bug 19428 - New fedabipkgdiff utility fedabipkgdiff is a convenient way to compare the ABI of Fedora packages easily. The first version of fedabipkgdiff introduced by this patch lets users perform operations like: fedabipkgdiff --from fc23 foo-0.1-1.fc23.x86_64.rpm fedabipkgdiff --from fc23 --to fc24 foo fedabipkgdiff foo-0.1-1.fc23 foo-0.1-1.fc24 fedabipkgdiff foo-0.1-1.fc23.i686 foo-0.1-1.fc24.i686 fedabipkgdiff --all-subpackages foo-0.1-1.fc23 foo-0.1-1.fc24 * autoconf-archive/ax_compare_version.m4: New file copied from the autoconf-archive project. * autoconf-archive/ax_prog_python_version.m4: Likewise. * autoconf-archive/ax_python_module.m4: Likewise. * Makefile.am: Add the new files above to the source distribution. * configure.ac: Include the new m4 macros from the autoconf archive. Add a new --enable-fedabipkgdiff option. Update the report at the end of the configure process to show the status of the fedabipkgdiff feature. Add check for prerequisite python modules argparse, glob, logging, os, re, shlex, subprocess, sys, itertools, urlparse, itertools, shutil, unittest, xdg, koji and mock. These are necessary for the unit test of fedabipkgdiff. Generate tests/runtestfedabipkgdiff.py into the build directory, from the tests/runtestfedabipkgdiff.py.in input file. * tools/Makefile.am: Include the fedabipkgdiff to the source distribution and install it if the "fedabipkgdiff" feature is enabled. * tests/Makefile.am: Rename runtestfedabipkgdiff.sh into runtestfedabipkgdiff.py. Add the new runtestfedabipkgdiff.py.in autoconf template file in here. * tests/runtestfedabipkgdiff.py.in: New unit test file. * tools/fedabipkgdiff: New fedabipkgdiff tool. * doc/manuals/fedabipkgdiff.rst: New manual. Signed-off-by: Chenxiong Qi <cqi@redhat.com> Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-02-09 10:05:33 +00:00
fi
configure: Tune fedabipkgdiff dependencies detection If 'configure' finds some Python koji module, but it's "insufficient" per the testing once added in commit 90d236a03343d75ea504d53c73270e50b9000e75 "Bug 22076 - Disable fedabipkgdiff for old koji clients", we currently get, for example: [...] checking python3 module: koji... yes [...] checking checking if koji client is recent enough ...... Traceback (most recent call last): File "<string>", line 3, in <module> File "[...]/koji/__init__.py", line 2016, in read_config raise ConfigurationError("no configuration for profile name: %s" koji.ConfigurationError: no configuration for profile name: koji no, disabling fedpkgdiff [...] Here is the configuration of the package: [...] Enable fedabipkgdiff : auto [...] Note repeated 'checking' and '...', intermixed error output, 'fedpkgdiff' typo, final 'auto' result. Changing that to: [...] checking if koji client is recent enough... no configure: WARNING: disabling fedabipkgdiff [...] Here is the configuration of the package: [...] Enable fedabipkgdiff : no [...] ... with 'config.log': [...] configure:13774: checking if koji client is recent enough configure:13784: result: no Traceback (most recent call last): File "<string>", line 3, in <module> File "[...]/koji/__init__.py", line 2016, in read_config raise ConfigurationError("no configuration for profile name: %s" koji.ConfigurationError: no configuration for profile name: koji configure:13792: WARNING: disabling fedabipkgdiff [...] Similarly, with explicit '--enable-fedabipkgdiff', we currently get: [...] checking checking if koji client is recent enough ...... Traceback (most recent call last): File "<string>", line 3, in <module> File "[...]/koji/__init__.py", line 2016, in read_config raise ConfigurationError("no configuration for profile name: %s" koji.ConfigurationError: no configuration for profile name: koji no, disabling fedpkgdiff [...] Here is the configuration of the package: [...] Enable fedabipkgdiff : yes [...] ... instead of a fatal error. Changing that to: [...] checking if koji client is recent enough... no configure: error: unsuitable koji client * configure.ac: Tune fedabipkgdiff dependencies detection. Signed-off-by: Thomas Schwinge <thomas@codesourcery.com>
2021-12-11 18:18:52 +00:00
if test x$MISSING_FEDABIPKGDIFF_DEP = xno; then
ENABLE_FEDABIPKGDIFF=yes
else
ENABLE_FEDABIPKGDIFF=no
fi
Bug 19428 - New fedabipkgdiff utility fedabipkgdiff is a convenient way to compare the ABI of Fedora packages easily. The first version of fedabipkgdiff introduced by this patch lets users perform operations like: fedabipkgdiff --from fc23 foo-0.1-1.fc23.x86_64.rpm fedabipkgdiff --from fc23 --to fc24 foo fedabipkgdiff foo-0.1-1.fc23 foo-0.1-1.fc24 fedabipkgdiff foo-0.1-1.fc23.i686 foo-0.1-1.fc24.i686 fedabipkgdiff --all-subpackages foo-0.1-1.fc23 foo-0.1-1.fc24 * autoconf-archive/ax_compare_version.m4: New file copied from the autoconf-archive project. * autoconf-archive/ax_prog_python_version.m4: Likewise. * autoconf-archive/ax_python_module.m4: Likewise. * Makefile.am: Add the new files above to the source distribution. * configure.ac: Include the new m4 macros from the autoconf archive. Add a new --enable-fedabipkgdiff option. Update the report at the end of the configure process to show the status of the fedabipkgdiff feature. Add check for prerequisite python modules argparse, glob, logging, os, re, shlex, subprocess, sys, itertools, urlparse, itertools, shutil, unittest, xdg, koji and mock. These are necessary for the unit test of fedabipkgdiff. Generate tests/runtestfedabipkgdiff.py into the build directory, from the tests/runtestfedabipkgdiff.py.in input file. * tools/Makefile.am: Include the fedabipkgdiff to the source distribution and install it if the "fedabipkgdiff" feature is enabled. * tests/Makefile.am: Rename runtestfedabipkgdiff.sh into runtestfedabipkgdiff.py. Add the new runtestfedabipkgdiff.py.in autoconf template file in here. * tests/runtestfedabipkgdiff.py.in: New unit test file. * tools/fedabipkgdiff: New fedabipkgdiff tool. * doc/manuals/fedabipkgdiff.rst: New manual. Signed-off-by: Chenxiong Qi <cqi@redhat.com> Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-02-09 10:05:33 +00:00
fi
AM_CONDITIONAL(ENABLE_FEDABIPKGDIFF, test x$ENABLE_FEDABIPKGDIFF = xyes)
Bug 22722 - Make fedabipkgdiff and its tests support both python 3 and 2 This patch makes fedabipkgdiff Python 3 compatible. All tests written in Python are updated and compatible with Python 3 as well. The patch looks for a Python 3 interperter. If it finds one then it runs the tests using that interpreter. Otherwise it just tries to use the Python 2 interpreter. This behaviour can be disabled by the new --disable-python3 option. * configure.ac: Add new option --enable-python3. Add new test runner file tests/runtestdefaultsupprs-py3 and tests/runtestfedabipkgdiffpy3.sh. Add required six Python module. * tests/Makefile.am: Add new test files tests/runtestdefaultsupprspy3.sh and tests/runtestfedabipkgdiffpy3.sh accordingly. * tests/mockfedabipkgdiff.in: Convert print statement to six.print_. Replace call to function filter with list comprehension. Replace basestring with six.string_types. * tests/runtestdefaultsupprspy3.sh.in: New shell script to run test runtestdefaultsupprs with Python 3. * tests/runtestdefaultsupprs.py.in: Repalce a few tabs with proper number of spaces which is detected by Python 3 interpreter. * tests/runtestfedabipkgdiffpy3.sh.in: New shell script to run test runtestfedabipkgdiff with Python 3. * tests/runtestfedabipkgdiff.py.in: Use python from env in shebang instead of a fixed path to a Python interpreter. * tools/fedabipkgdiff: Globally replace print statement with a function call to print which is available by importing print_function from __future__ module. Use six.print_ to output string to stderr instead. Convert function call to map to for-loop. (cmp_nvr): Change argument to handle a Koji build mapping instead of only the nvr. (Brew.listBuilds): use the new cmp_nvr to sort builds. Signed-off-by: Chenxiong Qi <cqi@redhat.com> Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2018-03-25 07:34:59 +00:00
AM_CONDITIONAL(ENABLE_RUNNING_TESTS_WITH_PY3, test x$RUN_TESTS_WITH_PY3 = xyes)
AM_CONDITIONAL(ENABLE_PYTHON3_INTERPRETER, test x$PYTHON3_INTERPRETER != xno)
AC_SUBST(PYTHON)
Bug 19428 - New fedabipkgdiff utility fedabipkgdiff is a convenient way to compare the ABI of Fedora packages easily. The first version of fedabipkgdiff introduced by this patch lets users perform operations like: fedabipkgdiff --from fc23 foo-0.1-1.fc23.x86_64.rpm fedabipkgdiff --from fc23 --to fc24 foo fedabipkgdiff foo-0.1-1.fc23 foo-0.1-1.fc24 fedabipkgdiff foo-0.1-1.fc23.i686 foo-0.1-1.fc24.i686 fedabipkgdiff --all-subpackages foo-0.1-1.fc23 foo-0.1-1.fc24 * autoconf-archive/ax_compare_version.m4: New file copied from the autoconf-archive project. * autoconf-archive/ax_prog_python_version.m4: Likewise. * autoconf-archive/ax_python_module.m4: Likewise. * Makefile.am: Add the new files above to the source distribution. * configure.ac: Include the new m4 macros from the autoconf archive. Add a new --enable-fedabipkgdiff option. Update the report at the end of the configure process to show the status of the fedabipkgdiff feature. Add check for prerequisite python modules argparse, glob, logging, os, re, shlex, subprocess, sys, itertools, urlparse, itertools, shutil, unittest, xdg, koji and mock. These are necessary for the unit test of fedabipkgdiff. Generate tests/runtestfedabipkgdiff.py into the build directory, from the tests/runtestfedabipkgdiff.py.in input file. * tools/Makefile.am: Include the fedabipkgdiff to the source distribution and install it if the "fedabipkgdiff" feature is enabled. * tests/Makefile.am: Rename runtestfedabipkgdiff.sh into runtestfedabipkgdiff.py. Add the new runtestfedabipkgdiff.py.in autoconf template file in here. * tests/runtestfedabipkgdiff.py.in: New unit test file. * tools/fedabipkgdiff: New fedabipkgdiff tool. * doc/manuals/fedabipkgdiff.rst: New manual. Signed-off-by: Chenxiong Qi <cqi@redhat.com> Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-02-09 10:05:33 +00:00
Bug 27512 - Remove broken zip-archive support The optional zip archive feature was broken when the concept of environment was introduced by commit b2e5366d3 back in 2015. Since it wouldn't even compile and nobody noticed, we are fairly sure nobody uses that feature. Therefore, we decided to remove it rather than fix it. * configure.ac: remove --enable-zip-archive option and logic associated with it. * include/abg-libzip-utils.h: Remove. * src/abg-libzip-utils.cc: Likewise. * include/Makefile.am: remove reference to include/abg-libzip-utils.h that no longer exists. * src/Makefile.am: remove reference to src/abg-libzip-utils.cc that no longer exists. * relicensing-scripts/file-licenses.orig.txt: remove references to files that no longer exist. * relicensing-scripts/files-with-lgplv3.txt: remove references to files that no longer exist. * tests/test-write-read-archive.cc: Remove because it tests code that no longer exists. * tests/Makefile.am: remove reference to tests that no longer exist. * include/abg-reader.h: remove conditionally compiled code for zip archives. * include/abg-tools-utils.h: remove conditionally compiled code for zip archives. * src/abg-corpus.cc: remove conditionally compiled code for zip archives. * src/abg-reader.cc: remove conditionally compiled code for zip archives. * src/abg-tools-utils.cc: remove conditionally compiled code for zip archives. * src/abg-writer.cc: remove conditionally compiled code for zip archives. * tools/abidiff.cc: remove conditionally compiled code for zip archives. * tools/abilint.cc: remove conditionally compiled code for zip archives. * tools/abiar.c: Remove. * tools/Makefile.am: remove references to abiar a utility that no longer has a reason for existing. Signed-off-by: Ben Woodard <woodard@redhat.com> Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2021-03-12 19:42:41 +00:00
DEPS_CPPFLAGS="$XML_CFLAGS"
Initial writing/reading of an ABI corpus to an archive * configure.ac: Support detection of libzip dependency. Define new DEPS_CFLAGS and DEPS_LIBS variables for use in Makefile.am to refer to the dependency headers and libraries. * doc/website/mainpage.txt: Update this to talk about the new libzip dependency. * include/Makefile.am: Add abg-libzip-utils.h to the build system. * include/abg-corpus.h (corps): Hide abigail::corpus's private behind a pimpl idiom. (corpus::{drop_translation_units, get_file_path, set_file_path, write, read}): New methods. * include/abg-libxml-utils.h (new_reader_from_buffer): Declare new function. * include/abg-libzip-utils.h: New file. * src/Makefile.am: Add abg-corpus.cc and abg-libzip-utils.cc to the build system. Refer to the library and headers dependencies via the new DEPS_LIBS and DEPS_CFLAGS variables. * src/abg-corpus.cc: New file. * src/abg-ir.cc (translation::set_path): New method. * src/abg-libxml-utils.cc (new_reader_from_buffer): Define new function. * src/abg-libzip-utils.cc: New file. * src/abg-reader.cc (translation_unit::read): New overload. * src/abg-writer.cc: Inject the names from the std namespace into the abigail namespace, rather than into abigail::writer. (abigail::translation_unit::write): New overload. This can now use ofstream and the other stuff from std that are injected in the abigail:: namespace. * tests/Makefile.am: Add tests/test-write-read-archive.cc to the build system; use that to build runtestwritereadarchive. Also add the input test data from tests/data/test-write-read-archive/test[0-4].xml. * /tests/data/test-write-read-archive/test[0-4].xml: New test input data files. * tests/test-write-read-archive.cc: New test for this archive write/read support. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2013-08-27 13:18:59 +00:00
AC_SUBST(DEPS_CPPFLAGS)
dnl Check for the presence of doxygen program
if test x$ENABLE_APIDOC != xno; then
AC_CHECK_PROG(FOUND_DOXYGEN, doxygen, yes, no)
if test x$ENABLE_APIDOC = xauto; then
if test x$FOUND_DOXYGEN = xyes; then
ENABLE_APIDOC=yes
else
ENABLE_APIDOC=no
fi
fi
fi
AM_CONDITIONAL(ENABLE_APIDOC, test x$ENABLE_APIDOC = xyes)
dnl Check for the presence of the sphinx-build program
if test x$ENABLE_MANUAL != xno; then
AC_CHECK_PROG(FOUND_SPHINX_BUILD, sphinx-build, yes, no)
if test x$ENABLE_MANUAL = xauto; then
if test x$FOUND_SPHINX_BUILD = xyes; then
ENABLE_MANUAL=yes
else
ENABLE_MANUAL=no
fi
fi
fi
AM_CONDITIONAL(ENABLE_MANUAL, test x$ENABLE_MANUAL = xyes)
dnl Check for the presence of Valgrind and do the plumbing to allow
dnl the running of "make check-valgrind".
AX_VALGRIND_DFLT(memcheck, on)
AX_VALGRIND_DFLT(helgrind, on)
AX_VALGRIND_DFLT(drd, off)
AX_VALGRIND_DFLT(sgcheck, off)
AX_VALGRIND_CHECK
dnl Set the list of libraries libabigail depends on
Add support for the CTF debug format to libabigail. CTF (C Type Format) is a lightweight debugging format that provides information about C types and the association between functions and data symbols and types. It is designed to be very compact and simple. More can be learned about it at https://ctfstd.org. This patch introduces support in libabigail to extract ABI information from CTF stored in ELF files. A few notes on this implementation: - The implementation is complete in terms of CTF support. Every CTF feature is processed and handled to generate libabigail IR. This includes basic types, typedefs, pointer, array and struct types. The CTF record of data objects (variables) and functions are also used in order to generate the corresponding libabigail IR artifacts. - The decoding of CTF data is done using the libctf library which is part of binutils. In order to link with it, binutils shall be built with --enable-shared for libctf.so to become available. - This initial implementation is aimed to simplicity. We have not tried to resolve any and every corner case that may require special handling. We have observed that the DWARF front-end (which is naturally way more complex as the scope is way bigger) is plagued with hacks to handle such situations. However, for the CTF support we prefer to proceed in a simpler and more modest way: we will handle these problems if/when we find them. The fact that CTF only supports C (currently) certainly helps there. - Likewise, in this basic support we are not handling symbol suppressions or other goodies that libabigail provides. We are new to libabigail and ABI analysis, and at this point we simply don't have a clear picture about what is most useful/relevant to support or not. With the maintainer's blesssing, we will tackle that functionaly after this basic support is applied upstream. - The implementation in abg-ctf-reader.{cc,h} is pretty much self-contained. As a result there is some duplication in terms of ELF handling with the DWARF reader, but since that logic is very simple and can be easily implemented, we don't consider this to be a big deal (for now.) Hopefully the maintainers agree. - The libabigail tools assume that ELF means to always use DWARF to generate the ABI IR. We added a new command-line option --ctf to the tools in order to make them to use the CTF debug info instead. We are definitely not sure whether this is the best user interface. In fact I would be suprised if it was ;) - We added support for --ctf to both abilint and abidiff. We are not sure whether it would make sense to add support for CTF to the other tools. Feedback welcome. - We are pondering about what to do in terms of testing. We have cursory tested this implementation using abilint and abidiff. We know we are generating IR corpus that seem to be ok. It would be good however to be able to run the libabigail testsuites using CTF. However the testsuites may need some non-trivial changes in order to make this possible. Let's talk about that :) * configure.ac: Check for libctf. * src/abg-ctf-reader.cc: New file. * include/abg-ctf-reader.h: Likewise. * src/Makefile.am (libabigail_la_SOURCES): Add abg-ctf-reader.cc conditionally. * include/Makefile.am (pkginclude_HEADERS): Add abg-ctf-reader.h conditionally. * tools/abilint.cc (struct options): New option `use_ctf'. (display_usage): Documentation for --ctf. (parse_command_line): Handle --ctf. (main): Honour --ctf. * tools/abidiff.cc (struct options): New option `use_ctf'. (display_usage): Documentation for --ctf. (parse_command_line): Handle --ctf. (main): Honour --ctf. * doc/manuals/abidiff.rst: Document --ctf. * doc/manuals/abilint.rst: Likewise. Signed-off-by: Jose E. Marchesi <jose.marchesi@oracle.com> Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2021-10-28 22:51:32 +00:00
DEPS_LIBS="$XML_LIBS $ELF_LIBS $DW_LIBS $CTF_LIBS"
Initial writing/reading of an ABI corpus to an archive * configure.ac: Support detection of libzip dependency. Define new DEPS_CFLAGS and DEPS_LIBS variables for use in Makefile.am to refer to the dependency headers and libraries. * doc/website/mainpage.txt: Update this to talk about the new libzip dependency. * include/Makefile.am: Add abg-libzip-utils.h to the build system. * include/abg-corpus.h (corps): Hide abigail::corpus's private behind a pimpl idiom. (corpus::{drop_translation_units, get_file_path, set_file_path, write, read}): New methods. * include/abg-libxml-utils.h (new_reader_from_buffer): Declare new function. * include/abg-libzip-utils.h: New file. * src/Makefile.am: Add abg-corpus.cc and abg-libzip-utils.cc to the build system. Refer to the library and headers dependencies via the new DEPS_LIBS and DEPS_CFLAGS variables. * src/abg-corpus.cc: New file. * src/abg-ir.cc (translation::set_path): New method. * src/abg-libxml-utils.cc (new_reader_from_buffer): Define new function. * src/abg-libzip-utils.cc: New file. * src/abg-reader.cc (translation_unit::read): New overload. * src/abg-writer.cc: Inject the names from the std namespace into the abigail namespace, rather than into abigail::writer. (abigail::translation_unit::write): New overload. This can now use ofstream and the other stuff from std that are injected in the abigail:: namespace. * tests/Makefile.am: Add tests/test-write-read-archive.cc to the build system; use that to build runtestwritereadarchive. Also add the input test data from tests/data/test-write-read-archive/test[0-4].xml. * /tests/data/test-write-read-archive/test[0-4].xml: New test input data files. * tests/test-write-read-archive.cc: New test for this archive write/read support. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2013-08-27 13:18:59 +00:00
AC_SUBST(DEPS_LIBS)
if test x$ABIGAIL_DEVEL != x; then
CFLAGS="-g -Og -Wall -Wextra -Werror -D_FORTIFY_SOURCE=2"
CXXFLAGS="-g -Og -Wall -Wextra -Werror -D_FORTIFY_SOURCE=2 -D_GLIBCXX_DEBUG"
fi
if test x$ABIGAIL_DEBUG != x; then
CFLAGS="$CFLAGS -Og -g3 -ggdb"
CXXFLAGS="$CXXFLAGS -Og -g3 -ggdb"
fi
if test x$ABIGAIL_NO_OPTIMIZATION_DEBUG != x; then
CFLAGS="-g -O0 -Wall -Wextra -Werror"
CXXFLAGS="-g -O0 -Wall -Wextra -Werror"
fi
if test x$ENABLE_ASAN = xyes; then
CFLAGS="$CFLAGS -fsanitize=address"
CXXFLAGS="$CXXFLAGS -fsanitize=address"
fi
if test x$ENABLE_MSAN = xyes; then
CFLAGS="$CFLAGS -fsanitize=memory -fsanitize-memory-track-origins"
CXXFLAGS="$CXXFLAGS -fsanitize=memory -fsanitize-memory-track-origins"
fi
if test x$ENABLE_TSAN = xyes; then
CFLAGS="$CFLAGS -fsanitize=thread"
CXXFLAGS="$CXXFLAGS -fsanitize=thread"
fi
if test x$ENABLE_UBSAN = xyes; then
CFLAGS="$CFLAGS -fsanitize=undefined"
CXXFLAGS="$CXXFLAGS -fsanitize=undefined"
fi
Add support for the CTF debug format to libabigail. CTF (C Type Format) is a lightweight debugging format that provides information about C types and the association between functions and data symbols and types. It is designed to be very compact and simple. More can be learned about it at https://ctfstd.org. This patch introduces support in libabigail to extract ABI information from CTF stored in ELF files. A few notes on this implementation: - The implementation is complete in terms of CTF support. Every CTF feature is processed and handled to generate libabigail IR. This includes basic types, typedefs, pointer, array and struct types. The CTF record of data objects (variables) and functions are also used in order to generate the corresponding libabigail IR artifacts. - The decoding of CTF data is done using the libctf library which is part of binutils. In order to link with it, binutils shall be built with --enable-shared for libctf.so to become available. - This initial implementation is aimed to simplicity. We have not tried to resolve any and every corner case that may require special handling. We have observed that the DWARF front-end (which is naturally way more complex as the scope is way bigger) is plagued with hacks to handle such situations. However, for the CTF support we prefer to proceed in a simpler and more modest way: we will handle these problems if/when we find them. The fact that CTF only supports C (currently) certainly helps there. - Likewise, in this basic support we are not handling symbol suppressions or other goodies that libabigail provides. We are new to libabigail and ABI analysis, and at this point we simply don't have a clear picture about what is most useful/relevant to support or not. With the maintainer's blesssing, we will tackle that functionaly after this basic support is applied upstream. - The implementation in abg-ctf-reader.{cc,h} is pretty much self-contained. As a result there is some duplication in terms of ELF handling with the DWARF reader, but since that logic is very simple and can be easily implemented, we don't consider this to be a big deal (for now.) Hopefully the maintainers agree. - The libabigail tools assume that ELF means to always use DWARF to generate the ABI IR. We added a new command-line option --ctf to the tools in order to make them to use the CTF debug info instead. We are definitely not sure whether this is the best user interface. In fact I would be suprised if it was ;) - We added support for --ctf to both abilint and abidiff. We are not sure whether it would make sense to add support for CTF to the other tools. Feedback welcome. - We are pondering about what to do in terms of testing. We have cursory tested this implementation using abilint and abidiff. We know we are generating IR corpus that seem to be ok. It would be good however to be able to run the libabigail testsuites using CTF. However the testsuites may need some non-trivial changes in order to make this possible. Let's talk about that :) * configure.ac: Check for libctf. * src/abg-ctf-reader.cc: New file. * include/abg-ctf-reader.h: Likewise. * src/Makefile.am (libabigail_la_SOURCES): Add abg-ctf-reader.cc conditionally. * include/Makefile.am (pkginclude_HEADERS): Add abg-ctf-reader.h conditionally. * tools/abilint.cc (struct options): New option `use_ctf'. (display_usage): Documentation for --ctf. (parse_command_line): Handle --ctf. (main): Honour --ctf. * tools/abidiff.cc (struct options): New option `use_ctf'. (display_usage): Documentation for --ctf. (parse_command_line): Handle --ctf. (main): Honour --ctf. * doc/manuals/abidiff.rst: Document --ctf. * doc/manuals/abilint.rst: Likewise. Signed-off-by: Jose E. Marchesi <jose.marchesi@oracle.com> Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2021-10-28 22:51:32 +00:00
dnl Set a few Automake conditionals
AM_CONDITIONAL([CTF_READER],[test "x$ENABLE_CTF" = "xyes"])
Use C++11 for the code base As the Enterprise Linux 6 platform has now essentially reached it's end of life for what it's worth (the Fedora EPEL6 distribution is not maintained anymore) nothing ties us to using C++03 only anymore. So, I think it makes sense to move the code base to the C++11 standard. Why C++11 and not, say, C++14 or more? Well, the more direct reason I see is that we need to support long life cycle platforms, the older one being Enterprise Linux 7 currently. This is the Fedora EPEL7 distribution, in concrete terms. And in that distribution, the compiler is GCC 4.8.x. And it supports C++11. In practise, nothing changes in the code that is already there. The new code however can use C++11 constructs just fine. I have updated the CONTRIBUTING file to write down some of the unwritten cultural biases of the current code base. Hopefully these few lines will help to shed some light on the choices made so far. The update to that file also enacts the use of C++11 and sets some limits to what we expects in terms of what the code base would look like. configure.ac is modified to unconditionally pass -std=c++11 to the compiler and express that in the configuration text displayed at the end of the configuration stage. Some Makefile.am files are updated accordingly. * CONTRIBUTING: Enact use of c++11. Also, we favor those who read/debug/maintain the code as opposed to those who write it ;-) * configure.ac: Switch to c++11 unconditionally. * src/Makefile.am: Adjust. * tests/Makefile.am: Adjust. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2020-12-03 09:53:08 +00:00
dnl Set the level of C++ standard we use.
CXXFLAGS="$CXXFLAGS -std=$CXX_STANDARD"
Overhaul detection the DW_LANG_* enumerators from dwarf.h elfutils regularly adds new members to the anonymous DWARF language encodings enum which contains the DW_LANG_* enumerators, from the dwarf.h header file. If we want libabigail to keep compiling with older versions of elfutils, we need to detect the absence of a given DW_LANG_* enumerator and avoid using it in that case. Until now, we were doing #ifdef DW_LANG_* for that purpose. But then the DW_LANG_* are *enumerators*, not preprocessor macros. So that preprocessor macro. This patch detects the presence of each of the "newer" DW_LANG_* enumerator using autoconf. And for each DW_LANG_xxx enumerator that is present, autoconf defines the HAVE_DW_LANG_xxx_enumerator macro. Libabigail source code can thus do #ifdef HAVE_DW_LANG_xxx_enumerator to guard the use of DW_LANG_xxx. Tested with the Rust binaries from https://gitlab.gnome.org/federico/abi-rust. * configure.ac: Detect the presence of DW_LANG_{UPC, D, Python, Go, C11, C_plus_plus_03, C_plus_plus_11, C_plus_plus_14, Mips_Assembler, Rust} and define the corresponding HAVE_DW_LANG_*_enumerator macro accordingly. * include/abg-ir.h (LANG_C_plus_plus_03): Define this new enumerator in the translation_unit::language enum. * src/abg-dwarf-reader.cc (dwarf_language_to_tu_language): Use the new HAVE_DW_LANG_*_enumerator macros. (get_default_array_lower_bound): Support the translation_unit::LANG_C_plus_plus_03 enumerator. * src/abg-ir.cc (is_cplus_plus_language): Support the translation_unit::LANG_C_plus_plus_03 enumerator. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2019-01-18 10:21:48 +00:00
dnl Check if several decls and constant are defined in dependant
dnl libraries
HAS_EM_AARCH64=no
AC_CHECK_DECL([EM_AARCH64],
[HAS_EM_AARCH64=yes],
[HAS_EM_AARCH64=no],
[[#include <elf.h>]])
if test x$HAS_EM_AARCH64 = xyes; then
AC_DEFINE([HAVE_EM_AARCH64_MACRO],
1,
[Defined to 1 if elf.h has EM_AARCH64 macro defined])
fi
HAS_EM_TILEPRO=no
AC_CHECK_DECL([EM_TILEPRO],
[HAS_EM_TILEPRO=yes],
[HAS_EM_TILEPRO=no],
[[#include <elf.h>]])
if test x$HAS_EM_TILEPRO = xyes; then
AC_DEFINE([HAVE_EM_TILEPRO_MACRO],
1,
[Defined to 1 if elf.h has EM_TILEPR0 macro defined])
fi
HAS_EM_TILEGX=no
AC_CHECK_DECL([EM_TILEGX],
[HAS_EM_TILEGX=yes],
[HAS_EM_TILEGX=no],
[[#include <elf.h>]])
if test x$HAS_EM_TILEGX = xyes; then
AC_DEFINE([HAVE_EM_TILEGX_MACRO],
1,
[Defined to 1 if elf.h has EM_TILEGX macro defined])
fi
HAS_R_AARCH64_ABS64=no
AC_CHECK_DECL([R_AARCH64_ABS64],
[HAS_R_AARCH64_ABS64=yes],
[HAS_R_AARCH64_ABS64=no],
[[#include <elf.h>]])
if test x$HAS_R_AARCH64_ABS64 = xyes; then
AC_DEFINE([HAVE_R_AARCH64_ABS64_MACRO],
1,
[Defined to 1 if elf.h has R_AARCH64_ABS64 macro defined])
fi
HAS_R_AARCH64_PREL32=no
AC_CHECK_DECL([R_AARCH64_PREL32],
[HAS_R_AARCH64_PREL32=yes],
[HAS_R_AARCH64_PREL32=no],
[[#include <elf.h>]])
if test x$HAS_R_AARCH64_PREL32 = xyes; then
AC_DEFINE([HAVE_R_AARCH64_PREL32_MACRO],
1,
[Defined to 1 if elf.h has R_AARCH64_PREL32 macro defined])
fi
Overhaul detection the DW_LANG_* enumerators from dwarf.h elfutils regularly adds new members to the anonymous DWARF language encodings enum which contains the DW_LANG_* enumerators, from the dwarf.h header file. If we want libabigail to keep compiling with older versions of elfutils, we need to detect the absence of a given DW_LANG_* enumerator and avoid using it in that case. Until now, we were doing #ifdef DW_LANG_* for that purpose. But then the DW_LANG_* are *enumerators*, not preprocessor macros. So that preprocessor macro. This patch detects the presence of each of the "newer" DW_LANG_* enumerator using autoconf. And for each DW_LANG_xxx enumerator that is present, autoconf defines the HAVE_DW_LANG_xxx_enumerator macro. Libabigail source code can thus do #ifdef HAVE_DW_LANG_xxx_enumerator to guard the use of DW_LANG_xxx. Tested with the Rust binaries from https://gitlab.gnome.org/federico/abi-rust. * configure.ac: Detect the presence of DW_LANG_{UPC, D, Python, Go, C11, C_plus_plus_03, C_plus_plus_11, C_plus_plus_14, Mips_Assembler, Rust} and define the corresponding HAVE_DW_LANG_*_enumerator macro accordingly. * include/abg-ir.h (LANG_C_plus_plus_03): Define this new enumerator in the translation_unit::language enum. * src/abg-dwarf-reader.cc (dwarf_language_to_tu_language): Use the new HAVE_DW_LANG_*_enumerator macros. (get_default_array_lower_bound): Support the translation_unit::LANG_C_plus_plus_03 enumerator. * src/abg-ir.cc (is_cplus_plus_language): Support the translation_unit::LANG_C_plus_plus_03 enumerator. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2019-01-18 10:21:48 +00:00
HAS_DW_LANG_UPC=no
AC_CHECK_DECL([DW_LANG_UPC],
[HAS_DW_LANG_UPC=yes],
[HAS_DW_LANG_UPC=no],
[[#include <dwarf.h>]])
if test x$HAS_DW_LANG_UPC = xyes; then
AC_DEFINE([HAVE_DW_LANG_UPC_enumerator],
1,
[Define to 1 if dwarf.h has the DW_LANG_UPC enumerator])
fi
HAS_DW_LANG_D=no
AC_CHECK_DECL([DW_LANG_D],
[HAS_DW_LANG_D=yes],
[HAS_DW_LANG_D=no],
[[#include <dwarf.h>]])
if test x$HAS_DW_LANG_D = xyes; then
AC_DEFINE([HAVE_DW_LANG_D_enumerator],
1,
[Define to 1 if dwarf.h has the DW_LANG_D enumerator])
fi
HAS_DW_LANG_Python=no
AC_CHECK_DECL([DW_LANG_Python],
[HAS_DW_LANG_Python=yes],
[HAS_DW_LANG_Python=no],
[[#include <dwarf.h>]])
if test x$HAS_DW_LANG_Python = xyes; then
AC_DEFINE([HAVE_DW_LANG_Python_enumerator],
1,
[Define to 1 if dwarf.h has the DW_LANG_Python enumerator])
fi
HAS_DW_LANG_Go=no
AC_CHECK_DECL([DW_LANG_Go],
[HAS_DW_LANG_Go=yes],
[HAS_DW_LANG_Go=no],
[[#include <dwarf.h>]])
if test x$HAS_DW_LANG_Go = xyes; then
AC_DEFINE([HAVE_DW_LANG_Go_enumerator],
1,
[Define to 1 if dwarf.h has the DW_LANG_Go enumerator])
fi
HAS_DW_LANG_C11=no
AC_CHECK_DECL([DW_LANG_C11],
[HAS_DW_LANG_C11=yes],
[HAS_DW_LANG_C11=no],
[[#include <dwarf.h>]])
if test x$HAS_DW_LANG_C11 = xyes; then
AC_DEFINE([HAVE_DW_LANG_C11_enumerator],
1,
[Define to 1 if dwarf.h has the DW_LANG_C11 enumerator])
fi
HAS_DW_LANG_C_plus_plus_03=no
AC_CHECK_DECL([DW_LANG_C_plus_plus_03],
[HAS_DW_LANG_C_plus_plus_03=yes],
[HAS_DW_LANG_C_plus_plus_03=no],
[[#include <dwarf.h>]])
if test x$HAS_DW_LANG_C_plus_plus_03 = xyes; then
AC_DEFINE([HAVE_DW_LANG_C_plus_plus_03_enumerator],
1,
[Define to 1 if dwarf.h has the DW_LANG_C_plus_plus_03 enumerator])
fi
HAS_DW_LANG_C_plus_plus_11=no
AC_CHECK_DECL([DW_LANG_C_plus_plus_11],
[HAS_DW_LANG_C_plus_plus_11=yes],
[HAS_DW_LANG_C_plus_plus_11=no],
[[#include <dwarf.h>]])
if test x$HAS_DW_LANG_C_plus_plus_11 = xyes; then
AC_DEFINE([HAVE_DW_LANG_C_plus_plus_11_enumerator],
1,
[Define to 1 if dwarf.h has the DW_LANG_C_plus_plus_11 enumerator])
fi
HAS_DW_LANG_C_plus_plus_14=no
AC_CHECK_DECL([DW_LANG_C_plus_plus_14],
[HAS_DW_LANG_C_plus_plus_14=yes],
[HAS_DW_LANG_C_plus_plus_14=no],
[[#include <dwarf.h>]])
if test x$HAS_DW_LANG_C_plus_plus_14 = xyes; then
AC_DEFINE([HAVE_DW_LANG_C_plus_plus_14_enumerator],
1,
[Define to 1 if dwarf.h has the DW_LANG_C_plus_plus_14 enumerator])
fi
HAS_DW_LANG_Mips_Assembler=no
AC_CHECK_DECL([DW_LANG_Mips_Assembler],
[HAS_DW_LANG_Mips_Assembler=yes],
[HAS_DW_LANG_Mips_Assembler=no],
[[#include <dwarf.h>]])
if test x$HAS_DW_LANG_Mips_Assembler = xyes; then
AC_DEFINE([HAVE_DW_LANG_Mips_Assembler_enumerator],
1,
[Define to 1 if dwarf.h has the DW_LANG_Mips_Assembler enumerator])
fi
HAS_DW_LANG_Rust=no
AC_CHECK_DECL([DW_LANG_Rust],
[HAS_DW_LANG_Rust=yes],
[HAS_DW_LANG_Rust=no],
Overhaul detection the DW_LANG_* enumerators from dwarf.h elfutils regularly adds new members to the anonymous DWARF language encodings enum which contains the DW_LANG_* enumerators, from the dwarf.h header file. If we want libabigail to keep compiling with older versions of elfutils, we need to detect the absence of a given DW_LANG_* enumerator and avoid using it in that case. Until now, we were doing #ifdef DW_LANG_* for that purpose. But then the DW_LANG_* are *enumerators*, not preprocessor macros. So that preprocessor macro. This patch detects the presence of each of the "newer" DW_LANG_* enumerator using autoconf. And for each DW_LANG_xxx enumerator that is present, autoconf defines the HAVE_DW_LANG_xxx_enumerator macro. Libabigail source code can thus do #ifdef HAVE_DW_LANG_xxx_enumerator to guard the use of DW_LANG_xxx. Tested with the Rust binaries from https://gitlab.gnome.org/federico/abi-rust. * configure.ac: Detect the presence of DW_LANG_{UPC, D, Python, Go, C11, C_plus_plus_03, C_plus_plus_11, C_plus_plus_14, Mips_Assembler, Rust} and define the corresponding HAVE_DW_LANG_*_enumerator macro accordingly. * include/abg-ir.h (LANG_C_plus_plus_03): Define this new enumerator in the translation_unit::language enum. * src/abg-dwarf-reader.cc (dwarf_language_to_tu_language): Use the new HAVE_DW_LANG_*_enumerator macros. (get_default_array_lower_bound): Support the translation_unit::LANG_C_plus_plus_03 enumerator. * src/abg-ir.cc (is_cplus_plus_language): Support the translation_unit::LANG_C_plus_plus_03 enumerator. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2019-01-18 10:21:48 +00:00
[[#include <dwarf.h>]])
if test x$HAS_DW_LANG_Rust = xyes; then
AC_DEFINE([HAVE_DW_LANG_Rust_enumerator],
1,
[Define to 1 if dwarf.h has the DW_LANG_Rust enumerator])
fi
HAS_DW_FORM_strx1=no
HAS_DW_FORM_strx2=no
HAS_DW_FORM_strx3=no
HAS_DW_FORM_strx4=no
HAS_DW_FORM_line_strp=no
AC_CHECK_DECL([DW_FORM_strx1],
[HAS_DW_FORM_strx1=yes],
[HAS_DW_FORM_strx1=no],
[[#include <dwarf.h>]])
if test x$HAS_DW_FORM_strx1 = xyes; then
AC_DEFINE([HAVE_DW_FORM_strx1],
1,
[Define to 1 if dwarf.h has the DW_FORM_strx1 enumerator])
fi
AC_CHECK_DECL([DW_FORM_strx2],
[HAS_DW_FORM_strx2=yes],
[HAS_DW_FORM_strx2=no],
[[#include <dwarf.h>]])
if test x$HAS_DW_FORM_strx2 = xyes; then
AC_DEFINE([HAVE_DW_FORM_strx2],
1,
[Define to 1 if dwarf.h has the DW_FORM_strx2 enumerator])
fi
AC_CHECK_DECL([DW_FORM_strx3],
[HAS_DW_FORM_strx3=yes],
[HAS_DW_FORM_strx3=no],
[[#include <dwarf.h>]])
if test x$HAS_DW_FORM_strx3 = xyes; then
AC_DEFINE([HAVE_DW_FORM_strx3],
1,
[Define to 1 if dwarf.h has the DW_FORM_strx3 enumerator])
fi
AC_CHECK_DECL([DW_FORM_strx4],
[HAS_DW_FORM_strx4=yes],
[HAS_DW_FORM_strx4=no],
[[#include <dwarf.h>]])
if test x$HAS_DW_FORM_strx4 = xyes; then
AC_DEFINE([HAVE_DW_FORM_strx4],
1,
[Define to 1 if dwarf.h has the DW_FORM_strx4 enumerator])
fi
AC_CHECK_DECL([DW_FORM_line_strp],
[HAS_DW_FORM_line_strp=yes],
[HAS_DW_FORM_line_strp=no],
[[#include <dwarf.h>]])
if test x$HAS_DW_FORM_line_strp = xyes; then
AC_DEFINE([HAVE_DW_FORM_line_strp],
1,
[Define to 1 if dwarf.h has the DW_FORM_line_strp enumerator])
fi
if test x$HAS_DW_FORM_strx1 = xyes -a \
x$HAS_DW_FORM_strx2 = xyes -a \
x$HAS_DW_FORM_strx3 = xyes -a \
x$HAS_DW_FORM_strx4 = xyes ; then
AC_DEFINE([HAVE_DW_FORM_strx],
1,
[Define to 1 if dwarf.h has the DW_FORM_strx enumerators])
fi
dnl Set large files support
AC_SYS_LARGEFILE
AC_CONFIG_FILES([Makefile
libabigail.pc
include/Makefile
include/abg-version.h
doc/Makefile
doc/manuals/Makefile
src/Makefile
tools/Makefile
tests/Makefile
tests/data/Makefile
bash-completion/Makefile])
Canonicalize types either early or late after TU reading While trying to diff two identical files (abidiff foo.so foo.so) it appeared that canonicalizing types during e.g, the DWARF reading process was leading to subtle errors because it's extremely hard to know when a type is complete. That is, during the building of a class type C, a pointer to C can be built before C is complete. Worse, even after reading the DIE (from DWARF) of class C, there can be DIE seen later in the translation unit that modifies type C. In these late cases, one needs to wait -- not only until C is fully built, but also sometimes, after the translation unit is fully built -- to canonicalize C and then the pointer to C. This kind of things. So now there are two possible points in time when canonicalization of a type can happen. It can happen early, when the type is built. This is the case for basic types and composite types for which all sub-types are canonicalized already. It can happen late, right after we've finished reading the debug info for the current translation unit. So this patch fixes the IR traversal and uses that to walk the translation unit (or even types) after it's built. It does away with the first attempt to perform early canonicalizing only. The patch also handles type canonicalizing while reading xml-abi format. * include/abg-fwd.h (is_class_type) (type_has_non_canonicalized_subtype): Declare new functions. (is_member_type): Remove the overload that takes a decl_base_sptr. It's superfluous. We just need the one that takes a type_base_sptr. * include/abg-ir.h (translation_unit::{is_constructed, set_is_constructed}): Add new methods. (class_decl::has_virtual_member_functions): Likewise. (class decl_base): Makes it virtually inherit ir_traversable_base. (class type_base): Make this virtually inherit traversable_base too. (type_base::canonicalize): Renamed enable_canonical_equality into this. (type_base::traverse): Declare new virtual method. (canonicalize): Renamed enable_canonical_equality into this. (scope_type_decl::traverse): Declare new virtual method. (namespace_decl::get_pretty_representation): Declare new virtual method. (function_type::traverse): Likewise. (class_decl::base_spec::traverse): Likewise. (ir_node_visitor::visit): Remove the overloads and replace each of them with a pair of ... (ir_node_visitor::{visit_begin, visit_end}): ... of these. * include/abg-traverse.h (traversable_base::visiting): New method. (traversable_base::visiting_): New data member. (traversable_base::traversable_base): New constructor. * src/abg-ir.cc ({scope_decl, type_decl, namespace_decl, qualified_type_def, pointer_type_def, reference_type_def, array_type_def, enum_type_decl, typedef_decl, var_decl, function_decl, function_decl::parameter, class_decl, class_decl::member_function_template, class_decl::member_class_template, function_tdecl, class_tdecl}::traverse): Fix this to properly set the traversable_base::visiting_ flag and to reflect the new signatures of the ir_node_visitor methods. ({type_base, scope_type_decl, function_type, class_decl::base_spec}::traverse): New method. (type_base::get_canonical_type_for): Handle the case of the type already having a canonical type. Properly hash the type using the dynamic type hasher. Look through declaration-only classes to consider the definition of the class instead. Fix logic to have a single pointer of return, to ease debugging. (canonicalize): Renamed enable_canonical_equality into this. (namespace_decl::get_pretty_representation): Define new method. (ir_node_visitor::visit): Replace each of these overloads with a pair of visit_begin/visit_end ones. (translation_unit::priv::is_constructed_): New data member. (translation_unit::priv::priv): Initialize it. (translation_unit::{is_constructed, set_is_constructed}): Define new methods. (is_member_type(const decl_base_sptr)): Remove. (is_class_type(decl_base *d)): Define new function. (class_decl::has_virtual_member_functions): Define new method. (equals(const class_decl&, const class_decl&, change_kind*)): If the containing translation unit is not constructed yet, do not take virtual member functions in account when comparing the classes. This is because when reading from DWARF, there can be DIEs that change the number of virtual member functions after the DIE of the class. So one needs to start taking virtual members into account only after the translation unit has been constructed. (class non_canonicalized_subtype_detector): Define new type. (type_has_non_canonicalized_subtype): Define new function. * src/abg-corpus.cc (symtab_build_visitor_type::visit): Renamed this into symtab_build_visitor_type::visit_end. * src/abg-dwarf-reader.cc (die_type_map_type): New typedef. (die_class_map_type): This is now a typedef on a map of Dwarf_Off/class_decl_sptr. (read_context::{die_type_map_, alternate_die_type_map_, types_to_canonicalize_, alt_types_to_canonicalize_}): New data members. (read_context::{associate_die_to_decl, associate_die_to_decl_primary}): Make these methods public. (read_context::{associate_die_to_type, lookup_type_from_die_offset, is_wip_class_die_offset, types_to_canonicalize, schedule_type_for_canonicalization}): Define new methods. (build_type_decl, build_enum_type) (build_class_type_and_add_to_ir, build_qualified_type) (build_pointer_type_def, build_reference_type, build_array_type) (build_typedef_type, build_function_decl): Do not canonicalize types here. (maybe_canonicalize_type): Define new function. (build_ir_node_from_die): Take a new flag that says if the ir node is a member type/function or not. Early-canonicalize base types. Canonicalize composite types that have only canonicalized sub-types. Schedule the other types for late canonicalizing. For class types, early canonicalize those that are non-member types, that are fully constructed and that have only canonicalized sub-types. Adjust to the new signature of build_ir_node_from_die. (get_scope_for_die, build_namespace_decl_and_add_to_ir) (build_qualified_type, build_pointer_type_def) (build_reference_type, build_array_type, build_typedef_type) (build_var_decl, build_function_decl): Adjust for the new signature of build_ir_node_from_die. (build_translation_unit_and_add_to_ir): Likewise. Perform the late canonicalizing of the types that have been scheduled for that. (build_class_type_and_add_to_ir): Return a class_decl_sptr, not a decl_base_sptr. Adjust for the new signature of build_ir_node_from_die. Early canonicalize member types that are created and added to a given class, or schedule them for late canonicalizing. * src/abg-reader.cc (class read_context::{m_wip_classes_map, m_types_to_canonicalize}): New data members. (read_context::{clear_types_to_canonicalize, clear_wip_classes_map, mark_class_as_wip, unmark_class_as_wip, is_wip_class, maybe_canonicalize_type, schedule_type_for_late_canonicalizing, perform_late_type_canonicalizing}): Add new method definitions. (read_context::clear_per_translation_unit_data): Call read_context::clear_types_to_canonicalize(). (read_translation_unit_from_input): Call read_context::perform_late_type_canonicalizing() at the end of the function. (build_function_decl): Fix the function type canonicalizing (per translation) that was already in place. Do the canonicalizing of these only when the type is fully built. Oops. This was really brokend. Also, when the function type is constructed, consider it for type canonicalizing. (build_type_decl): Early canonicalize basic types. (build_qualified_type_decl, build_pointer_type_def) (build_pointer_type_def, build_reference_type_def) (build_array_type_def, build_enum_type_decl, build_typedef_decl): Handle the canonicalizing for these composite types: either early or late. (build_class_decl): Likewise. Also, mark this class a 'being built' until it's fully built. This helps the canonicalizing code to know that it should leave a class alone until it's fully built. * tests/test-ir-walker.cc (struct name_printing_visitor): Adjust to the visitor methods naming change. * configure.ac: Generate the tests/runtestcanonicalizetypes.sh testing script from tests/runtestcanonicalizetypes.sh.in. * tests/runtestcanonicalizetypes.sh.in: Add the template for the new runtestcanonicalizetypes.sh script that test for type canonicalizing. * tests/Makefile.am: Add the new runtestcanonicalizetypes.sh regression testing script to the build system. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-02-13 19:20:57 +00:00
dnl Some test scripts are generated by autofoo.
Bug 19428 - New fedabipkgdiff utility fedabipkgdiff is a convenient way to compare the ABI of Fedora packages easily. The first version of fedabipkgdiff introduced by this patch lets users perform operations like: fedabipkgdiff --from fc23 foo-0.1-1.fc23.x86_64.rpm fedabipkgdiff --from fc23 --to fc24 foo fedabipkgdiff foo-0.1-1.fc23 foo-0.1-1.fc24 fedabipkgdiff foo-0.1-1.fc23.i686 foo-0.1-1.fc24.i686 fedabipkgdiff --all-subpackages foo-0.1-1.fc23 foo-0.1-1.fc24 * autoconf-archive/ax_compare_version.m4: New file copied from the autoconf-archive project. * autoconf-archive/ax_prog_python_version.m4: Likewise. * autoconf-archive/ax_python_module.m4: Likewise. * Makefile.am: Add the new files above to the source distribution. * configure.ac: Include the new m4 macros from the autoconf archive. Add a new --enable-fedabipkgdiff option. Update the report at the end of the configure process to show the status of the fedabipkgdiff feature. Add check for prerequisite python modules argparse, glob, logging, os, re, shlex, subprocess, sys, itertools, urlparse, itertools, shutil, unittest, xdg, koji and mock. These are necessary for the unit test of fedabipkgdiff. Generate tests/runtestfedabipkgdiff.py into the build directory, from the tests/runtestfedabipkgdiff.py.in input file. * tools/Makefile.am: Include the fedabipkgdiff to the source distribution and install it if the "fedabipkgdiff" feature is enabled. * tests/Makefile.am: Rename runtestfedabipkgdiff.sh into runtestfedabipkgdiff.py. Add the new runtestfedabipkgdiff.py.in autoconf template file in here. * tests/runtestfedabipkgdiff.py.in: New unit test file. * tools/fedabipkgdiff: New fedabipkgdiff tool. * doc/manuals/fedabipkgdiff.rst: New manual. Signed-off-by: Chenxiong Qi <cqi@redhat.com> Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-02-09 10:05:33 +00:00
AC_CONFIG_FILES([tests/runtestcanonicalizetypes.sh],
[chmod +x tests/runtestcanonicalizetypes.sh])
Bug 26769 - Fix missing types in abixml output The symptom of the issue at hand is that sometimes there can be types missing from the abixml output. This happens when analysing some C++ code bases. The core of the issue is the following. Support we have a type "struct S" defined somewhere as: struct S // #0 { int dm1; char dm2; }; S s; Suppose that in another translation unit, we have the class 'S' being extended to add a member type to it: struct S // #1 { typedef int dm1_type; }; typedef S::dm1_type Integer; Integer something; When emitting the abixml for the codebase, the definition of the typedef S::dm1_type can be missing. Note that in location #1, struct S is considered declaration-only. It's definition is in another translation unit, in location #0. So the abixml writer emits the 'struct S' defined in location #0, but forgets to emit the 'struct S' in #1, which is indirectly used for the sole purpose of using its member type S::dm1_type. This patch emits the S::dm1_type type that is mistakenly forgotten today. Now that the "struct S" of #1 is also emitted, a tangent problem is uncovered: S in #0 can be wrongly thought to be equivalent to S in #1, for ABI purposes This is because of an ODR-based optimization that is used for C++. That is, the two struct S can be wrongly considered equivalent just because they have the same name. Note that ODR means "One Definition Rule[1]" This patch removes the ODR-based optimization and thus fixes many of the issues uncovered by the previous changes. The patch also uncovered that some non-static variables were sometimes wrongly being added to the set of exported variables, while libabigail reads corpora from abixml. The patch fixes this as well. [1]: One Definition Rule: https://en.wikipedia.org/wiki/One_Definition_Rule * include/abg-corpus.h (corpus::{record_canonical_type, lookup_canonical_type}): Remove function declarations. * src/abg-corpus-priv.h (corpus::priv::canonical_types_): Remove data member. * src/abg-corpus.cc (corpus::{record_canonical_type, lookup_canonical_type}): Remove functions. * src/abg-ir.cc (type_eligible_for_odr_based_comparison): Remove static function. (type_base::get_canonical_type_for): Don't perform the ODR-based optimization for C++ anymore. * src/abg-reader.cc (read_context&::maybe_add_var_to_exported_decls): Don't add a variable that hasn't been added to its scope. Otherwise, it means we added a variable that wasn't yet properly constructed. Also add a new overload for var_decl_sptr&. (build_var_decl): Do not add the var to its the set of exported declaration before we are sure it has been fully constructed and added to the scope it belongs. (build_class_decl): Only add *static* data members to the list of exported declarations. (handle_var_decl): A var decl seen here is a global variable declaration. Add it to the list of exported declarations. * src/abg-writer.cc (write_context::decl_only_type_is_emitted): Constify parameter. (write_translation_unit): Do not forget to emit referenced types that were maybe not canonicalized. Also, avoid using noop_deleter when it's not necessary. (write_namespace_decl): Do not forget to emit canonicalized types that are present in namespaces other than the global namespace. * tests/runtestslowselfcompare.sh.in: New test that compares libabigail.so against its own ABIXML representation. * tests/Makefile.am: Add the new test runtestslowselfcompare.sh to source distribution. This test is too slow to be run during the course of 'make check'. It takes more than 5 minutes on my slow box here. Rather, it can be run using 'make check-self-compare'. I plan to run this before releases now. * tests/data/test-annotate/libtest24-drop-fns-2.so.abi: Adjust. * tests/data/test-annotate/libtest24-drop-fns.so.abi: Likewise. * tests/data/test-annotate/test0.abi: Likewise. * tests/data/test-annotate/test13-pr18894.so.abi: Likewise. * tests/data/test-annotate/test14-pr18893.so.abi: Likewise. * tests/data/test-annotate/test15-pr18892.so.abi: Likewise. * tests/data/test-annotate/test17-pr19027.so.abi: Likewise. * tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Likewise. * tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi: Likewise. * tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi: Likewise. * tests/data/test-annotate/test21-pr19092.so.abi: Likewise. * tests/data/test-read-dwarf/PR22015-libboost_iostreams.so.abi: Likewise. * tests/data/test-read-dwarf/PR22122-libftdc.so.abi: Likewise. * tests/data/test-read-dwarf/PR25042-libgdbm-clang-dwarf5.so.6.0.0.abi: Likewise. * tests/data/test-read-dwarf/PR26261/PR26261-exe.abi: Likewise. * tests/data/test-read-dwarf/libtest24-drop-fns-2.so.abi: Likewise. * tests/data/test-read-dwarf/libtest24-drop-fns.so.abi: Likewise. * tests/data/test-read-dwarf/test-libandroid.so.abi: Likewise. * tests/data/test-read-dwarf/test0.abi: Likewise. * tests/data/test-read-dwarf/test0.hash.abi: Likewise. * tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Likewise. * tests/data/test-read-dwarf/test11-pr18828.so.abi: Likewise. * tests/data/test-read-dwarf/test12-pr18844.so.abi: Likewise. * tests/data/test-read-dwarf/test14-pr18893.so.abi: Likewise. * tests/data/test-read-dwarf/test15-pr18892.so.abi: Likewise. * tests/data/test-read-dwarf/test16-pr18904.so.abi: Likewise. * tests/data/test-read-dwarf/test17-pr19027.so.abi: Likewise. * tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Likewise. * tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi: Likewise. * tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi: Likewise. * tests/data/test-read-dwarf/test21-pr19092.so.abi: Likewise. * tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi: Likewise. * tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Likewise. * tests/data/test-read-write/test28-without-std-fns-ref.xml: Likewise. * tests/data/test-read-write/test28-without-std-vars-ref.xml: Likewise. * tests/data/test-read-write/test6.xml: Likewise. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2020-11-16 11:22:05 +00:00
AC_CONFIG_FILES([tests/runtestslowselfcompare.sh],
[chmod +x tests/runtestslowselfcompare.sh])
Make fedabipkgdiff consistent with Libabigail's other tests In the libabigail project, almost all the tests for the tools follow a similar pattern. The test contains a set of input files to compare. The result of the comparison is thus compared to a set of reference comparison result. This approach is already documented in the CONTRIBUTING file. There are several interesting properties with this scheme. First, it capture the behaviour of the tools, including what is shown to the user. Second, it eases the job of a hacker who wants to add a new test for a new behaviour of a given tool. The user just has to provide: 1/ A new reference output of the new use case of the tool (that is easily constructed by using the tool itself and saving its output) and add an entry to array of entries that describe what to compare 2/ A new set of inputs to the tool And voila. Unfortunately, fedabipkgdiff tests don't follow this scheme. That make them surprising to hackers who read the source code of the existing tests, at very least. Also, the fedabipkgdiff tests were only unit tests. They were not testing the tool as used by users in general. This patch makes the fedabipkgdiff tests follow the general approach of the tests of the other Libabigail tools. The patch first craetes a program names tests/mockfedabipkgdiff. It's a wrapper around tools/fedabipkgdiff. It overloads the Koji client of fedabipkgdiff with a fake Koji client that gets the Fedora packages locally, from tests/data/test-fedabipkgdiff/packages. In other words, mockfedabipkgdiff is fedabipkgdiff without going to the network. I believe that in the future, tests/mockfedabipkgdiff should be killed when fedabipkgdiff is able to cache a local description of a local partial view of a Koji repository, along with the build packages that were already downloaded. That way, calling fedabipkgdiff twice with the same set of option should make the tool perform correctly without going to the netword on the second invocation. We should be able to save the local partial view of the Koji repository under e.g, tests/data/test-fedabipkgdiff/local-koji and tell fedabipkgdiff to use that, instead of using the network. But we are not there yet. So for now, I am using mockfedabipkgdiff. Then, tests/runtestfedabipkdiff.py.in has been re-written to use tests/mockfedabipkgdiff and to look like what is described in CONTRIBUTING as far as how Libabigail tools' tests are organized: mockfedabipkgdiff is called to perform a comparison. The result of the comparison is then compared (using GNU diff) to a reference comparison result file. Please note that tests/runtestfedabipkdiff.py is relatively fast for the moment. But when it contains much more tests and start becoming slow, then we'll need to change the code to run several comparisons in parallel, just like we do today in tests/test-diff-filter.cc. At that point, I believe I'll just re-write this in C++, just like tests/test-diff-filter.cc because that will allow us to have true concurrent code based on the abigail:workers API. For now, I am keeping this in Python also because I think that keeps Chenxiong happy ;-) To be sure that fedabipkgdiff (and its underlying abipkgdiff) are really comparing all the packages they are supposed to compare and also all the binaries in those packages, I have added a new --show-identical-binaries to abipkgdiff and fedabipkgdiff. That option shows the name of the binaries (and packages) that are compared, *even if* the ABI of those binaries are identical. Because otherwise, today, if two binaries (or packages) have the same ABI, nothing is displayed. For instance, here is the result of comparing a package against itself, using this new --show-identical-binaries options: dodji@adjoa:patches$ ./tools/fedabipkgdiff --abipkgdiff ./build/tools/abipkgdiff --show-identical-binaries dbus-glib-0.80-3.fc12.x86_64.rpm dbus-glib-0.80-3.fc12.x86_64.rpm Comparing the ABI of binaries between dbus-glib-0.80-3.fc12.x86_64.rpm and dbus-glib-0.80-3.fc12.x86_64.rpm: ================ changes of 'dbus-binding-tool'=============== No ABI change detected ================ end of changes of 'dbus-binding-tool'=============== ================ changes of 'libdbus-glib-1.so.2.1.0'=============== No ABI change detected ================ end of changes of 'libdbus-glib-1.so.2.1.0'=============== dodji@adjoa:patches$ And here is what this command before that patch would do: dodji@adjoa:patches$ ./tools/fedabipkgdiff --abipkgdiff ../master/build/tools/abipkgdiff dbus-glib-0.80-3.fc12.x86_64.rpm dbus-glib-0.80-3.fc12.x86_64.rpm Comparing the ABI of binaries between dbus-glib-0.80-3.fc12.x86_64.rpm and dbus-glib-0.80-3.fc12.x86_64.rpm: dodji@adjoa:patches$ The rest of the patch is mostly new test inputs material and the necessary adjustments following all the changes above. * configure.ac: Do not require Python dependencies itertools, unittest and StringIO anymore as they are not used anymore. Require new module tempfile now. Generate new executable script tests/mockfedabipkgdiff from tests/mockfedabipkgdiff.in. * doc/manuals/abipkgdiff.rst: Add doc for new option --show-identical-binaries to abipkgdiff * doc/manuals/fedabipkgdiff.rst: Add doc for new options --show-identical-binaries to fedabipkgdiff. * tools/abipkgdiff.cc (options::show_identical_binaries): New data member. (options::options): Initialize new data member. (display_usage): Add a new help string for the new --show-identical-binaries option. (parse_command_line): Parse the newq --show-identical-binaries command line switch. (pthread_routine_compare): When the comparison of two binaries is empty, if --show-identical-binaries was provided, then emit some output saying the comparison did yield the empty set. * tools/fedabipkgdiff (DEFAULT_ABIPKGDIFF): Store the default path to abipkgdiff in this new global variable. Naming this default path is useful because it can then be cleanly overloaded when using mock.patch. (build_path_to_abipkgdiff): Return the new DEFAULT_ABIPKGDIFF global variable. (cmd): Parse the new --show-identical-binaries command line switch. * tests/data/test-diff-pkg/test-dbus-glib-0.80-3.fc12.x86_64-report-0.txt: New reference output. * tests/data/test-fedabipkgdiff/test0-from-fc20-to-fc23-dbus-glib-report-0.txt: Likewise. * tests/data/test-fedabipkgdiff/test1-from-fc20-to-dbus-glib-0.106-1.fc23.x86_64-report-0.txt: Likewise. * tests/data/test-fedabipkgdiff/test2-dbus-glib-0.100.2-2.fc20--dbus-glib-0.106-1.fc23-report-0.txt: Likewise. * tests/data/test-fedabipkgdiff/test3-dbus-glib-0.100.2-2.fc20.i686--dbus-glib-0.106-1.fc23.i686-report-0.txt: Likewise. * tests/mockfedabipkgdiff.in: New uninstalled script template. * tests/runtestfedabipkgdiff.py.in (counter) (temp_file_or_dir_prefix, UtilsTest, RPMTest, LocalRPMTest) (RunAbipkgdiffTest, GetPackageLatestBuildTest, DownloadRPMTest) (BrewListRPMsTest, AssertionHelper, MockGlobalConfig) (BUILT_ABIPKGDIFF, CompareABIFromCommandLineTest): Remove these classes, global variables and functions. (FEDABIPKGDIFF, TEST_SRC_DIR, TEST_BUILD_DIR, INPUT_DIR) (OUTPUT_DIR, FEDABIPKGDIFF_TEST_SPECS): New global variables. (ensure_output_dir_created, run_fedabipkgdiff_tests, main): New functions. * tests/test-diff-pkg.cc (in_out_specs): Add tests/data/test-diff-pkg/test-dbus-glib-0.80-3.fc12.x86_64-report-0.txt to the set of reference outputs to consider. * tests/Makefile.am: Add non-installed script mockfedabipkgdiff to source distribution. Also added tests/data/test-diff-pkg/test-dbus-glib-0.80-3.fc12.x86_64-report-0.txt, tests/data/test-fedabipkgdiff/test0-from-fc20-to-fc23-dbus-glib-report-0.txt, tests/data/test-fedabipkgdiff/test1-from-fc20-to-dbus-glib-0.106-1.fc23.x86_64-report-0.txt, tests/data/test-fedabipkgdiff/test2-dbus-glib-0.100.2-2.fc20--dbus-glib-0.106-1.fc23-report-0.txt and tests/data/test-fedabipkgdiff/test3-dbus-glib-0.100.2-2.fc20.i686--dbus-glib-0.106-1.fc23.i686-report-0.txt to source distribution. Signed-off-by: Chenxiong Qi <cqi@redhat.com> Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-07-06 09:51:13 +00:00
AC_CONFIG_FILES([tests/mockfedabipkgdiff],
[chmod +x tests/mockfedabipkgdiff])
Bug 19428 - New fedabipkgdiff utility fedabipkgdiff is a convenient way to compare the ABI of Fedora packages easily. The first version of fedabipkgdiff introduced by this patch lets users perform operations like: fedabipkgdiff --from fc23 foo-0.1-1.fc23.x86_64.rpm fedabipkgdiff --from fc23 --to fc24 foo fedabipkgdiff foo-0.1-1.fc23 foo-0.1-1.fc24 fedabipkgdiff foo-0.1-1.fc23.i686 foo-0.1-1.fc24.i686 fedabipkgdiff --all-subpackages foo-0.1-1.fc23 foo-0.1-1.fc24 * autoconf-archive/ax_compare_version.m4: New file copied from the autoconf-archive project. * autoconf-archive/ax_prog_python_version.m4: Likewise. * autoconf-archive/ax_python_module.m4: Likewise. * Makefile.am: Add the new files above to the source distribution. * configure.ac: Include the new m4 macros from the autoconf archive. Add a new --enable-fedabipkgdiff option. Update the report at the end of the configure process to show the status of the fedabipkgdiff feature. Add check for prerequisite python modules argparse, glob, logging, os, re, shlex, subprocess, sys, itertools, urlparse, itertools, shutil, unittest, xdg, koji and mock. These are necessary for the unit test of fedabipkgdiff. Generate tests/runtestfedabipkgdiff.py into the build directory, from the tests/runtestfedabipkgdiff.py.in input file. * tools/Makefile.am: Include the fedabipkgdiff to the source distribution and install it if the "fedabipkgdiff" feature is enabled. * tests/Makefile.am: Rename runtestfedabipkgdiff.sh into runtestfedabipkgdiff.py. Add the new runtestfedabipkgdiff.py.in autoconf template file in here. * tests/runtestfedabipkgdiff.py.in: New unit test file. * tools/fedabipkgdiff: New fedabipkgdiff tool. * doc/manuals/fedabipkgdiff.rst: New manual. Signed-off-by: Chenxiong Qi <cqi@redhat.com> Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-02-09 10:05:33 +00:00
AC_CONFIG_FILES([tests/runtestfedabipkgdiff.py],
[chmod +x tests/runtestfedabipkgdiff.py])
Bug 22722 - Make fedabipkgdiff and its tests support both python 3 and 2 This patch makes fedabipkgdiff Python 3 compatible. All tests written in Python are updated and compatible with Python 3 as well. The patch looks for a Python 3 interperter. If it finds one then it runs the tests using that interpreter. Otherwise it just tries to use the Python 2 interpreter. This behaviour can be disabled by the new --disable-python3 option. * configure.ac: Add new option --enable-python3. Add new test runner file tests/runtestdefaultsupprs-py3 and tests/runtestfedabipkgdiffpy3.sh. Add required six Python module. * tests/Makefile.am: Add new test files tests/runtestdefaultsupprspy3.sh and tests/runtestfedabipkgdiffpy3.sh accordingly. * tests/mockfedabipkgdiff.in: Convert print statement to six.print_. Replace call to function filter with list comprehension. Replace basestring with six.string_types. * tests/runtestdefaultsupprspy3.sh.in: New shell script to run test runtestdefaultsupprs with Python 3. * tests/runtestdefaultsupprs.py.in: Repalce a few tabs with proper number of spaces which is detected by Python 3 interpreter. * tests/runtestfedabipkgdiffpy3.sh.in: New shell script to run test runtestfedabipkgdiff with Python 3. * tests/runtestfedabipkgdiff.py.in: Use python from env in shebang instead of a fixed path to a Python interpreter. * tools/fedabipkgdiff: Globally replace print statement with a function call to print which is available by importing print_function from __future__ module. Use six.print_ to output string to stderr instead. Convert function call to map to for-loop. (cmp_nvr): Change argument to handle a Koji build mapping instead of only the nvr. (Brew.listBuilds): use the new cmp_nvr to sort builds. Signed-off-by: Chenxiong Qi <cqi@redhat.com> Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2018-03-25 07:34:59 +00:00
AC_CONFIG_FILES([tests/runtestfedabipkgdiffpy3.sh],
[chmod +x tests/runtestfedabipkgdiffpy3.sh])
Bug 20180 - Support system-wide suppression specifications This patch adds support for loading system and user level suppression specifications for libabigail tools. At launch time, relevant libabigail tools (abidiff, abipkgdiff fedabipkgdiff for now) read the default system suppression specification file, if it's present, from a file which path is the value of the environment variable LIBABIGAIL_DEFAULT_SYSTEM_SUPPRESSION_FILE, if set, or from the file $libdir/libabigail/default.abignore. Then it reads the user system suppression specification file, if it's present, from a file which path is the value of the environment variable LIBABIGAIL_DEFAULT_USER_SUPPRESSION_FILE, if set, or from the file $HOME/.abignore. The content of the user system suppression file is merged with the content of default system suppression file. That content is also merged with the content of the suppression specification files that might be provided by the --suppressions command line option of the invoked tools. The resulting set of all these suppression specifications is thus used to filter the ABI change reports that are emitted. abidiff, abipkgdiff and abipkgdiff gain a --no-default-suppression option to avoid loading any of these default suppression specification files. The patch also installs a default.abignore file into $(pkglibdir). Note that on x86_64, that directory is /usr/lib64/libabigail. Now we just need to think about the content of that default.abignore file. * doc/manuals/abidiff.rst: Document the default suppression scheme, its interaction with the --supprs option and the new --no-default option. * doc/manuals/abipkgdiff.rst: Likewise. * doc/manuals/fedabipkgdiff.rst: Likewise. * configure.ac: Generate the tests/runtestdefaultsupprs.py file from the new tests/runtestdefaultsupprs.py.in template. * default.abignore: New file. * Makefile.am: Add it to source distribution. * src/Makefile.am: Define the ABIGAIL_ROOT_SYSTEM_LIBDIR preprocessor macro that is set the value of the $libdir autotools macro. * include/abg-tools-utils.h: Update copyright years. (get_system_libdir, get_default_system_suppression_file_path) (get_default_user_suppression_file_path) (load_default_system_suppressions) (load_default_user_suppressions): Declare new functions * src/abg-tools-utils.cc (get_system_libdir) (get_default_system_suppression_file_path) (get_default_user_suppression_file_path) (load_default_system_suppressions) (load_default_user_suppressions): Define new functions. (is_regular_file): Amend this so that it return true for symlinks to regular files too. (is_dir): Amend this so that it returns true for symlinks to directories too. * tools/abidiff.cc (options::no_default_supprs): New data member. (options::options): Initialize the new data member. (display_usage): Display a new help string for the new --no-default-suppression command line option. (parse_command_line): Parse this new command line option. (set_diff_context_from_opts): Load the default suppression specifications, unless --no-default-suppression or --supprs was provided. * tools/abipkgdiff.cc (options::no_default_supprs): New data member. (options::options): Initialize the new data member. (parse_command_line): Parse the new --no-default-suppression command line option. (main): Load the default suppression specifications, unless --no-default-suppression or --supprs was provided. * tools/fedabipkgdiff (abipkgdiff): Add --no-default-suppression to the invocation of abipkgdiff if it was provided on the command line. (build_commandline_args_parser): Parse the new --no-default-suppression command line option. * tests/runtestdefaultsupprs.py.in: New test harness template. * tests/Makefile.am: Add the new runtestdefaultsupprs.py to the set of tests. * tests/data/test-default-supprs/test0-type-suppr-0.suppr: New test input. * tests/data/test-default-supprs/test0-type-suppr-report-0.txt: Likewise. * tests/data/test-default-supprs/test0-type-suppr-v0.o: Likewise. * tests/data/test-default-supprs/test0-type-suppr-v1.o: Likewise. * tests/data/test-default-supprs/dirpkg-1-dir-report-0.txt: Likewise. * tests/data/test-default-supprs/dirpkg-1-dir1: Likewise. * tests/data/test-default-supprs/dirpkg-1-dir2: Likewise. * tests/data/Makefile.am: Add new the new tests input above to Makefile.am. * tests/runtestcanonicalizetypes.sh.in: Pass --no-default-suppression to abidiff invocations. * tests/runtestdefaultsupprs.py.in: Likewise. * tests/test-abidiff-exit.cc: Likewise. * tests/test-diff-dwarf-abixml.cc: Likewise. * tests/test-diff-filter.cc: Likewise. * tests/test-diff-suppr.cc: Likewise. * tools/abidiff.cc: Likewise. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-05-30 08:37:48 +00:00
AC_CONFIG_FILES([tests/runtestdefaultsupprs.py],
[chmod +x tests/runtestdefaultsupprs.py])
Bug 22722 - Make fedabipkgdiff and its tests support both python 3 and 2 This patch makes fedabipkgdiff Python 3 compatible. All tests written in Python are updated and compatible with Python 3 as well. The patch looks for a Python 3 interperter. If it finds one then it runs the tests using that interpreter. Otherwise it just tries to use the Python 2 interpreter. This behaviour can be disabled by the new --disable-python3 option. * configure.ac: Add new option --enable-python3. Add new test runner file tests/runtestdefaultsupprs-py3 and tests/runtestfedabipkgdiffpy3.sh. Add required six Python module. * tests/Makefile.am: Add new test files tests/runtestdefaultsupprspy3.sh and tests/runtestfedabipkgdiffpy3.sh accordingly. * tests/mockfedabipkgdiff.in: Convert print statement to six.print_. Replace call to function filter with list comprehension. Replace basestring with six.string_types. * tests/runtestdefaultsupprspy3.sh.in: New shell script to run test runtestdefaultsupprs with Python 3. * tests/runtestdefaultsupprs.py.in: Repalce a few tabs with proper number of spaces which is detected by Python 3 interpreter. * tests/runtestfedabipkgdiffpy3.sh.in: New shell script to run test runtestfedabipkgdiff with Python 3. * tests/runtestfedabipkgdiff.py.in: Use python from env in shebang instead of a fixed path to a Python interpreter. * tools/fedabipkgdiff: Globally replace print statement with a function call to print which is available by importing print_function from __future__ module. Use six.print_ to output string to stderr instead. Convert function call to map to for-loop. (cmp_nvr): Change argument to handle a Koji build mapping instead of only the nvr. (Brew.listBuilds): use the new cmp_nvr to sort builds. Signed-off-by: Chenxiong Qi <cqi@redhat.com> Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2018-03-25 07:34:59 +00:00
AC_CONFIG_FILES([tests/runtestdefaultsupprspy3.sh],
[chmod +x tests/runtestdefaultsupprspy3.sh])
Canonicalize types either early or late after TU reading While trying to diff two identical files (abidiff foo.so foo.so) it appeared that canonicalizing types during e.g, the DWARF reading process was leading to subtle errors because it's extremely hard to know when a type is complete. That is, during the building of a class type C, a pointer to C can be built before C is complete. Worse, even after reading the DIE (from DWARF) of class C, there can be DIE seen later in the translation unit that modifies type C. In these late cases, one needs to wait -- not only until C is fully built, but also sometimes, after the translation unit is fully built -- to canonicalize C and then the pointer to C. This kind of things. So now there are two possible points in time when canonicalization of a type can happen. It can happen early, when the type is built. This is the case for basic types and composite types for which all sub-types are canonicalized already. It can happen late, right after we've finished reading the debug info for the current translation unit. So this patch fixes the IR traversal and uses that to walk the translation unit (or even types) after it's built. It does away with the first attempt to perform early canonicalizing only. The patch also handles type canonicalizing while reading xml-abi format. * include/abg-fwd.h (is_class_type) (type_has_non_canonicalized_subtype): Declare new functions. (is_member_type): Remove the overload that takes a decl_base_sptr. It's superfluous. We just need the one that takes a type_base_sptr. * include/abg-ir.h (translation_unit::{is_constructed, set_is_constructed}): Add new methods. (class_decl::has_virtual_member_functions): Likewise. (class decl_base): Makes it virtually inherit ir_traversable_base. (class type_base): Make this virtually inherit traversable_base too. (type_base::canonicalize): Renamed enable_canonical_equality into this. (type_base::traverse): Declare new virtual method. (canonicalize): Renamed enable_canonical_equality into this. (scope_type_decl::traverse): Declare new virtual method. (namespace_decl::get_pretty_representation): Declare new virtual method. (function_type::traverse): Likewise. (class_decl::base_spec::traverse): Likewise. (ir_node_visitor::visit): Remove the overloads and replace each of them with a pair of ... (ir_node_visitor::{visit_begin, visit_end}): ... of these. * include/abg-traverse.h (traversable_base::visiting): New method. (traversable_base::visiting_): New data member. (traversable_base::traversable_base): New constructor. * src/abg-ir.cc ({scope_decl, type_decl, namespace_decl, qualified_type_def, pointer_type_def, reference_type_def, array_type_def, enum_type_decl, typedef_decl, var_decl, function_decl, function_decl::parameter, class_decl, class_decl::member_function_template, class_decl::member_class_template, function_tdecl, class_tdecl}::traverse): Fix this to properly set the traversable_base::visiting_ flag and to reflect the new signatures of the ir_node_visitor methods. ({type_base, scope_type_decl, function_type, class_decl::base_spec}::traverse): New method. (type_base::get_canonical_type_for): Handle the case of the type already having a canonical type. Properly hash the type using the dynamic type hasher. Look through declaration-only classes to consider the definition of the class instead. Fix logic to have a single pointer of return, to ease debugging. (canonicalize): Renamed enable_canonical_equality into this. (namespace_decl::get_pretty_representation): Define new method. (ir_node_visitor::visit): Replace each of these overloads with a pair of visit_begin/visit_end ones. (translation_unit::priv::is_constructed_): New data member. (translation_unit::priv::priv): Initialize it. (translation_unit::{is_constructed, set_is_constructed}): Define new methods. (is_member_type(const decl_base_sptr)): Remove. (is_class_type(decl_base *d)): Define new function. (class_decl::has_virtual_member_functions): Define new method. (equals(const class_decl&, const class_decl&, change_kind*)): If the containing translation unit is not constructed yet, do not take virtual member functions in account when comparing the classes. This is because when reading from DWARF, there can be DIEs that change the number of virtual member functions after the DIE of the class. So one needs to start taking virtual members into account only after the translation unit has been constructed. (class non_canonicalized_subtype_detector): Define new type. (type_has_non_canonicalized_subtype): Define new function. * src/abg-corpus.cc (symtab_build_visitor_type::visit): Renamed this into symtab_build_visitor_type::visit_end. * src/abg-dwarf-reader.cc (die_type_map_type): New typedef. (die_class_map_type): This is now a typedef on a map of Dwarf_Off/class_decl_sptr. (read_context::{die_type_map_, alternate_die_type_map_, types_to_canonicalize_, alt_types_to_canonicalize_}): New data members. (read_context::{associate_die_to_decl, associate_die_to_decl_primary}): Make these methods public. (read_context::{associate_die_to_type, lookup_type_from_die_offset, is_wip_class_die_offset, types_to_canonicalize, schedule_type_for_canonicalization}): Define new methods. (build_type_decl, build_enum_type) (build_class_type_and_add_to_ir, build_qualified_type) (build_pointer_type_def, build_reference_type, build_array_type) (build_typedef_type, build_function_decl): Do not canonicalize types here. (maybe_canonicalize_type): Define new function. (build_ir_node_from_die): Take a new flag that says if the ir node is a member type/function or not. Early-canonicalize base types. Canonicalize composite types that have only canonicalized sub-types. Schedule the other types for late canonicalizing. For class types, early canonicalize those that are non-member types, that are fully constructed and that have only canonicalized sub-types. Adjust to the new signature of build_ir_node_from_die. (get_scope_for_die, build_namespace_decl_and_add_to_ir) (build_qualified_type, build_pointer_type_def) (build_reference_type, build_array_type, build_typedef_type) (build_var_decl, build_function_decl): Adjust for the new signature of build_ir_node_from_die. (build_translation_unit_and_add_to_ir): Likewise. Perform the late canonicalizing of the types that have been scheduled for that. (build_class_type_and_add_to_ir): Return a class_decl_sptr, not a decl_base_sptr. Adjust for the new signature of build_ir_node_from_die. Early canonicalize member types that are created and added to a given class, or schedule them for late canonicalizing. * src/abg-reader.cc (class read_context::{m_wip_classes_map, m_types_to_canonicalize}): New data members. (read_context::{clear_types_to_canonicalize, clear_wip_classes_map, mark_class_as_wip, unmark_class_as_wip, is_wip_class, maybe_canonicalize_type, schedule_type_for_late_canonicalizing, perform_late_type_canonicalizing}): Add new method definitions. (read_context::clear_per_translation_unit_data): Call read_context::clear_types_to_canonicalize(). (read_translation_unit_from_input): Call read_context::perform_late_type_canonicalizing() at the end of the function. (build_function_decl): Fix the function type canonicalizing (per translation) that was already in place. Do the canonicalizing of these only when the type is fully built. Oops. This was really brokend. Also, when the function type is constructed, consider it for type canonicalizing. (build_type_decl): Early canonicalize basic types. (build_qualified_type_decl, build_pointer_type_def) (build_pointer_type_def, build_reference_type_def) (build_array_type_def, build_enum_type_decl, build_typedef_decl): Handle the canonicalizing for these composite types: either early or late. (build_class_decl): Likewise. Also, mark this class a 'being built' until it's fully built. This helps the canonicalizing code to know that it should leave a class alone until it's fully built. * tests/test-ir-walker.cc (struct name_printing_visitor): Adjust to the visitor methods naming change. * configure.ac: Generate the tests/runtestcanonicalizetypes.sh testing script from tests/runtestcanonicalizetypes.sh.in. * tests/runtestcanonicalizetypes.sh.in: Add the template for the new runtestcanonicalizetypes.sh script that test for type canonicalizing. * tests/Makefile.am: Add the new runtestcanonicalizetypes.sh regression testing script to the build system. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-02-13 19:20:57 +00:00
AC_OUTPUT
AC_MSG_NOTICE([
=====================================================================
Libabigail: $VERSION_MAJOR.$VERSION_MINOR.$VERSION_REVISION$VERSION_SUFFIX
=====================================================================
Here is the configuration of the package:
Make abipkgdiff compare tar archives containing binaries This patch adds support for comparing the ABI of binaries contained in a tar archive. If the archive is compressed with gzip, bzip2, lzip, lzma or xz, then abipkgdiff recognizes the usual relevant file extensions and lets the GNU tar program handle the decompression. If the archive is not compressed, abipkgdiff recognizes the UStar (Uniform Standard Tape ARchive) format, even if the archive file name doesn't end with the .tar extension, and lets the GNU tar program handle the extraction. If the file ends up with the .tar extension anyway (even if it's not in the UStar format, abipkgdiff lets the GNU tar program handle its extraction. * config.h.in (WITH_TAR): New configuration preprocessor macro. * configure.ac: Add a new --enable-tar option. It's turned on automatically if the tar program is found in the PATH. Adjust the build configuration report to add the tar archive support. * include/abg-tools-utils.h (string_ends_with): Declare new function. (enum file_type): Add a new FILE_TYPE_TAR enumerator. * src/abg-tools-utils.cc (string_ends_with): Define new function. (operator<<(ostream&, file_type)): Serialize the new FILE_TYPE_TAR enumerator. (guess_file_type): Detect UStar format file by reading its magic number. Detect compressed tar files based on the file path extension. * tools/abipkgdiff.cc (extract_tar): Define new function. (extract_package): Handle tar packages. (main): Handle tar archives. * tools/abidiff.cc (main): Handle the new FILE_TYPE_TAR enumerator. * tools/abilint.cc (main): Likewise. * tests/data/test-diff-pkg/tarpkg-0-dir{1,2}.ta{,r,.bz2, gz}: New test input tarballs. * tests/data/test-diff-pkg/tarpkg-0-report-0.txt: New test output reference. * tests/data/Makefile.am: Add the new test data file above to source distribution. * tests/test-diff-pkg.cc (in_out_specs): Add new tests cases. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-08-22 11:59:18 +00:00
Prefix : ${prefix}
Source code location : ${srcdir}
C Compiler : ${CC}
C++ Compiler : ${CXX}
GCC visibility attribute supported : ${SUPPORTS_GCC_VISIBILITY_ATTRIBUTE}
Use C++11 for the code base As the Enterprise Linux 6 platform has now essentially reached it's end of life for what it's worth (the Fedora EPEL6 distribution is not maintained anymore) nothing ties us to using C++03 only anymore. So, I think it makes sense to move the code base to the C++11 standard. Why C++11 and not, say, C++14 or more? Well, the more direct reason I see is that we need to support long life cycle platforms, the older one being Enterprise Linux 7 currently. This is the Fedora EPEL7 distribution, in concrete terms. And in that distribution, the compiler is GCC 4.8.x. And it supports C++11. In practise, nothing changes in the code that is already there. The new code however can use C++11 constructs just fine. I have updated the CONTRIBUTING file to write down some of the unwritten cultural biases of the current code base. Hopefully these few lines will help to shed some light on the choices made so far. The update to that file also enacts the use of C++11 and sets some limits to what we expects in terms of what the code base would look like. configure.ac is modified to unconditionally pass -std=c++11 to the compiler and express that in the configuration text displayed at the end of the configuration stage. Some Makefile.am files are updated accordingly. * CONTRIBUTING: Enact use of c++11. Also, we favor those who read/debug/maintain the code as opposed to those who write it ;-) * configure.ac: Switch to c++11 unconditionally. * src/Makefile.am: Adjust. * tests/Makefile.am: Adjust. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2020-12-03 09:53:08 +00:00
CXXFLAGS : ${CXXFLAGS}
Bug 22722 - Make fedabipkgdiff and its tests support both python 3 and 2 This patch makes fedabipkgdiff Python 3 compatible. All tests written in Python are updated and compatible with Python 3 as well. The patch looks for a Python 3 interperter. If it finds one then it runs the tests using that interpreter. Otherwise it just tries to use the Python 2 interpreter. This behaviour can be disabled by the new --disable-python3 option. * configure.ac: Add new option --enable-python3. Add new test runner file tests/runtestdefaultsupprs-py3 and tests/runtestfedabipkgdiffpy3.sh. Add required six Python module. * tests/Makefile.am: Add new test files tests/runtestdefaultsupprspy3.sh and tests/runtestfedabipkgdiffpy3.sh accordingly. * tests/mockfedabipkgdiff.in: Convert print statement to six.print_. Replace call to function filter with list comprehension. Replace basestring with six.string_types. * tests/runtestdefaultsupprspy3.sh.in: New shell script to run test runtestdefaultsupprs with Python 3. * tests/runtestdefaultsupprs.py.in: Repalce a few tabs with proper number of spaces which is detected by Python 3 interpreter. * tests/runtestfedabipkgdiffpy3.sh.in: New shell script to run test runtestfedabipkgdiff with Python 3. * tests/runtestfedabipkgdiff.py.in: Use python from env in shebang instead of a fixed path to a Python interpreter. * tools/fedabipkgdiff: Globally replace print statement with a function call to print which is available by importing print_function from __future__ module. Use six.print_ to output string to stderr instead. Convert function call to map to for-loop. (cmp_nvr): Change argument to handle a Koji build mapping instead of only the nvr. (Brew.listBuilds): use the new cmp_nvr to sort builds. Signed-off-by: Chenxiong Qi <cqi@redhat.com> Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2018-03-25 07:34:59 +00:00
Python : ${PYTHON}
OPTIONAL FEATURES:
Use C++11 for the code base As the Enterprise Linux 6 platform has now essentially reached it's end of life for what it's worth (the Fedora EPEL6 distribution is not maintained anymore) nothing ties us to using C++03 only anymore. So, I think it makes sense to move the code base to the C++11 standard. Why C++11 and not, say, C++14 or more? Well, the more direct reason I see is that we need to support long life cycle platforms, the older one being Enterprise Linux 7 currently. This is the Fedora EPEL7 distribution, in concrete terms. And in that distribution, the compiler is GCC 4.8.x. And it supports C++11. In practise, nothing changes in the code that is already there. The new code however can use C++11 constructs just fine. I have updated the CONTRIBUTING file to write down some of the unwritten cultural biases of the current code base. Hopefully these few lines will help to shed some light on the choices made so far. The update to that file also enacts the use of C++11 and sets some limits to what we expects in terms of what the code base would look like. configure.ac is modified to unconditionally pass -std=c++11 to the compiler and express that in the configuration text displayed at the end of the configuration stage. Some Makefile.am files are updated accordingly. * CONTRIBUTING: Enact use of c++11. Also, we favor those who read/debug/maintain the code as opposed to those who write it ;-) * configure.ac: Switch to c++11 unconditionally. * src/Makefile.am: Adjust. * tests/Makefile.am: Adjust. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2020-12-03 09:53:08 +00:00
C++ standard level : ${CXX_STANDARD}
Plug leak of debug info handles On recent elfutils where the libdw's function dwarf_getalt exists, we don't need to try and find the alternate debug info file ourselves by using the function dwfl_standard_find_debuginfo. Furthermore, when we use that function on those recent elfutils versions, we leak the elf resources allocated in the debug info resources; we also leak the file descriptor to access the alternate debug info sections. More generally, we also leak debug info handles used to access debug info when using get_soname_of_elf_file and get_type_of_elf_file. This patch plugs those leaks. In the first case, if the function dwarf_getalt exists, the patch just uses it to get the alternate debug info. Otherwise, the patch uses the dwfl_standard_find_debuginfo function like we used to, but then it tries hard to free the file descriptor and debuginfo memory of the alternate debug info. * configure.ac: Check the presence of dwarf_getalt in libdw. If it's present, define the preprocessor macro LIBDW_HAS_DWARF_GETALT. Update the autoconf configuration summary. * src/abg-dwarf-reader.cc: Add config.h. (find_alt_debug_info_location): Factorize this out of ... (find_alt_debug_info): ... this function. Use dwarf_getalt if present, otherwise, keep using dwfl_standard_find_debuginfo. In the later case, return the file descriptor opened to access the alternate debug info, by parameter, so that the caller can fclose it. (read_context::alt_fd_): New data member. (read_context::read_context): Initialize the new alt_fd_ data member. (read_context::load_debug_info): Store the file descriptor used to access the alternate debug info into the new alt_fd_ data member. (read_context::~read_context): New desctructor. (get_soname_of_elf_file, get_type_of_elf_file): Free the elf handle. (read_context::load_debug_info): Be paranoid in making sure we never override alt_dwarf_. * tests/data/test-alt-dwarf-file/test0-report.txt: Adjust. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-05-22 09:39:33 +00:00
libdw has the dwarf_getalt function : ${FOUND_DWARF_GETALT_IN_LIBDW}
Make abipkgdiff compare tar archives containing binaries This patch adds support for comparing the ABI of binaries contained in a tar archive. If the archive is compressed with gzip, bzip2, lzip, lzma or xz, then abipkgdiff recognizes the usual relevant file extensions and lets the GNU tar program handle the decompression. If the archive is not compressed, abipkgdiff recognizes the UStar (Uniform Standard Tape ARchive) format, even if the archive file name doesn't end with the .tar extension, and lets the GNU tar program handle the extraction. If the file ends up with the .tar extension anyway (even if it's not in the UStar format, abipkgdiff lets the GNU tar program handle its extraction. * config.h.in (WITH_TAR): New configuration preprocessor macro. * configure.ac: Add a new --enable-tar option. It's turned on automatically if the tar program is found in the PATH. Adjust the build configuration report to add the tar archive support. * include/abg-tools-utils.h (string_ends_with): Declare new function. (enum file_type): Add a new FILE_TYPE_TAR enumerator. * src/abg-tools-utils.cc (string_ends_with): Define new function. (operator<<(ostream&, file_type)): Serialize the new FILE_TYPE_TAR enumerator. (guess_file_type): Detect UStar format file by reading its magic number. Detect compressed tar files based on the file path extension. * tools/abipkgdiff.cc (extract_tar): Define new function. (extract_package): Handle tar packages. (main): Handle tar archives. * tools/abidiff.cc (main): Handle the new FILE_TYPE_TAR enumerator. * tools/abilint.cc (main): Likewise. * tests/data/test-diff-pkg/tarpkg-0-dir{1,2}.ta{,r,.bz2, gz}: New test input tarballs. * tests/data/test-diff-pkg/tarpkg-0-report-0.txt: New test output reference. * tests/data/Makefile.am: Add the new test data file above to source distribution. * tests/test-diff-pkg.cc (in_out_specs): Add new tests cases. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-08-22 11:59:18 +00:00
Enable rpm support in abipkgdiff : ${ENABLE_RPM}
configure: Instead of for rpm 4.15+ version, test actual rpm/zstd support If no 'rpm' is available, we currently get: [...] checking for rpm... no ../git/configure: line 13119: rpm: command not found configure: detected rpm version: configure: rpm support in abipkgdiff is disabled [...] Here is the configuration of the package: [...] Enable rpm support in abipkgdiff : no Enable rpm 4.15 support in abipkgdiff tests : no [...] Notice intermixed error output: 'rpm: command not found'. If Ubuntu focal 'rpm' 4.14.2.1+dfsg1-1build2 is available, we currently get: [...] checking for rpm... yes configure: detected rpm version: 4.14.2.1 configure: rpm support in abipkgdiff is enabled configure: rpm 4.15 support in abipkgdiff tests is enabled [...] Here is the configuration of the package: [...] Enable rpm support in abipkgdiff : yes Enable rpm 4.15 support in abipkgdiff tests : yes [...] Notice wrong 4.15+ version detection (due to '[[ "$rpmversion" > "4.14.0" ]]'), which is satisfied by '4.14.2.1'. (Comparing versions with shell '[[' generally is fragile; instead use 'autoconf-archive/ax_compare_version.m4' or similar?) Also, 'configure'ing with '--disable-rpm415' doesn't work; same output as before. That's due to commit 26c41c060bf30750fe2cded87edaf1ae47027523 "Fix thinko in configure.ac", where either there was no thinko in fact (the original idea, I suppose, was only if 'test x$ENABLE_RPM = xyes' to do the 4.15+ 'auto' checking?), and/or a typo: instead of 'test x$ENABLE_RPM = xyes', the first conditional should 'test x$ENABLE_RPM415 = xyes'? And, 'configure'ing with '--enable-rpm415' doesn't raise a hard error if 'rpm' actually isn't 4.15+. But all that said, we don't actually need to check for rpm 4.15+ version, but instead may simply check for the rpm/zstd support that we need: 'rpm2cpio'. * configure.ac: Instead of for rpm 4.15+ version, test actual rpm/zstd support. * tests/test-diff-pkg.cc: Adjust. Signed-off-by: Thomas Schwinge <thomas@codesourcery.com>
2021-12-10 16:52:46 +00:00
Enable rpm/zstd in abipkgdiff testing : ${ENABLE_RPM_ZSTD}
abilint: add the --show-type-use option "abilint --show-type-use <type-id> <abixml-file>" is a facility that shows how a type defined in an abixml file is used. That is, it emits a textual representation of how the use a type is used up until the function or global variable that constitutes an entry point in the API corpus. Here is an example of its use: test-read-write$ abilint --noout --show-type-use type-id-5 test17.xml Type ID 'type-id-5' is for type 'enum E' The usage graph for that type is: | -> enum E -> E S::m2 -> class S -> S* -> method void S::S() | -> enum E -> E S::m2 -> class S -> S* -> method void S::__base_ctor () | -> enum E -> E S::m2 -> class S -> S* -> method void S::__comp_ctor () | -> enum E -> E S::m2 -> class S -> S* -> method void S::S(S&) | -> enum E -> E S::m2 -> class S -> S* -> S& -> method void S::S(S&) | -> enum E -> E S::m2 -> class S -> S* -> S& -> S var | -> enum E -> E S::m2 -> class S -> S* -> S& -> E S::m2 -> class S -> S* -> method void S::S() | -> enum E -> E S::m2 -> class S -> S* -> S& -> E S::m2 -> class S -> S* -> method void S::__base_ctor () | -> enum E -> E S::m2 -> class S -> S* -> S& -> E S::m2 -> class S -> S* -> method void S::__comp_ctor () | -> enum E -> E S::m2 -> class S -> S* -> S& -> E S::m2 -> class S -> S* -> method void S::S(S&) | -> enum E -> E S::m2 -> class S -> S* -> S& -> E S::m2 -> class S -> S* -> S& -> method void S::S(S&) | -> enum E -> E S::m2 -> class S -> S* -> S& -> E S::m2 -> class S -> S* -> S& -> S var $ The screenshot above should be self explanatory. This facility is useful to analyse type usage and find potential issues in how libabigail represents some types. To activate this feature, one needs to configure the package with the configure option "--enable-show-type-use-in-abilint". * configure.ac: Define the --enable-show-type-use-in-abilint configure option. It defines the WITH_SHOW_TYPE_USE_IN_ABILINT macro. * include/abg-reader.h (read_translation_unit): Add an overload that takes the read context. (get_types_from_type_id, get_artifact_used_by_relation_map): Declare new functions. * src/abg-reader.cc (get_types_from_type_id) (get_artifact_used_by_relation_map): Declare these functions as friend of the read_context type. (read_context::m_artifact_used_by_map): (read_context::key_type_decl): Replace the shared_ptr<type_base> type of the first parm by the equivalent type_base_sptr type. (read_context::{record_artifact_as_used_by, record_artifacts_as_used_in_fn_decl, record_artifacts_as_used_in_fn_type}): Add new methods guarded by the WITH_SHOW_TYPE_USE_IN_ABILINT macro. (get_types_from_type_id, get_artifact_used_by_relation_map): Define new functions guarded by the WITH_SHOW_TYPE_USE_IN_ABILINT macro. (read_translation_unit): Define new overload. (RECORD_ARTIFACT_AS_USED_BY, RECORD_ARTIFACTS_AS_USED_IN_FN_DECL) (RECORD_ARTIFACTS_AS_USED_IN_FN_TYPE): Define new macros. (build_function_decl, build_var_decl, build_qualified_type_decl) (build_pointer_type_def, build_reference_type_def) (build_function_type, build_array_type_def, build_enum_type_decl) (build_typedef_decl, build_class_decl, build_union_decl): Use the macros above to mark the relevant sub-types as used by the artifact being built. * tools/abilint.cc (struct artifact_use_relation_tree): Define new type, guarded by the WITH_SHOW_TYPE_USE_IN_ABILINT macro. (fill_artifact_use_tree, build_type_use_tree, emit_trace) (emit_artifact_use_trace, emit_artifact_use_trace) (show_how_type_is_used): Define static functions guarded by the WITH_SHOW_TYPE_USE_IN_ABILINT macro. (display_usage): Add doc string for the --show-type-use option, guarded by the WITH_SHOW_TYPE_USE_IN_ABILINT macro. (parse_command_line): Parse the --show-type-use option, guarded by the WITH_SHOW_TYPE_USE_IN_ABILINT macro. (main): Slight re-organisation to make the abixml file reading use a read_context. That read context is then used to analyze how a given type is used whenever the --show-type-use option is used. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2022-02-17 11:22:25 +00:00
Enable abilint --show-type-use <type-id> : ${ENABLE_SHOW_TYPE_USE_IN_ABILINT}
Detect failed self comparison in type canonicalization of abixml During the self comparison triggered by "abidw --abidiff <binary>", some comparison errors can happen when canonicalizing types that are "de-serialized" from the abixml that was serialized from the input binary. This patch adds some debugging checks and messaging to emit a message when a type from the abixml appears to not "match" the original type from the initial corpus it originated from. This is the more detailed description: Let's consider a type T coming from the corpus of the input binary. That input corpus is serialized into abixml and de-serialized again into a second corpus that we shall name the abixml corpus. From that second corpus, let's consider the type T' that is the result of serializing T into abixml and de-serializing it again. T is said to be the original type of T'. If T is a canonical type, then T' should equal T. Otherwise, if T is not a canonical type, its canonical type should equal the canonical type of T'. For the sake of simplicity, let's consider that T is a canonical type. During the canonicalization of T', T' should equal T. Each and every canonical type coming from the abixml corpus should be equal to its original type from the binary corpus. If a T' is different from its original type T, then there is an "equality problem" between T and T'. In other words, there is a mismatch between T and T'. We want to be notified of that problem so that we can debug it further and fix it. So this patch introduces the option "abidw --debug-abidiff <binary>" to trigger the "debug self comparison mode". At canonicalization time, we detect that we are in that debug self comparison mode and during canonicalization of types from the abixml corpus, it detects when they compare different from their counterpart from the original corpus. This debugging capability can be enabled at configure time with a new --enable-debug-self-comparison configure option. That option defines a new WITH_DEBUG_SELF_COMPARISON compile time macro that is used to conditionally compile the implementation of this debugging feature. So, one example of this might look like this: abidw --debug-abidiff bin: error: problem detected with type 'typedef Vmalloc_t' from second corpus error: problem detected with type 'Vmalloc_t*' from second corpus [...] So that means the "typedef Vmalloc_t" read from the abixml compares different from its original type where it should not. So armed with this new insight, I know I need to debug that comparison in particular to see why it wrongly results in two different types. * doc/manuals/abidw.rst: Add documentation for the --debug-abidiff option. * include/abg-ir.h (environment::{set_self_comparison_debug_input, get_self_comparison_debug_inputs, self_comparison_debug_is_on}): Declare new methods. * configure.ac: Define a new --enable-debug-self-comparison option that is disabled by default. That option defines a new WITH_DEBUG_SELF_COMPARISON preprocessor macro. * src/abg-ir.cc (environment::priv::{first_self_comparison_corpus_, second_self_comparison_corpus_, self_comparison_debug_on_}): New data members. Also, re-indent the data members. (environment::{set_self_comparison_debug_input, get_self_comparison_debug_inputs, self_comparison_debug_is_on}): Define new method. (type_base::get_canonical_type_for): In the "debug self comparison mode", if a type coming from the second corpus compares different from its counterpart coming from the first corpus then log a debug message. * src/abg-dwarf-reader.cc (read_debug_info_into_corpus): When loading the first corpus, if the debug self comparison mode is on, then save that corpus on the side in the environment. * src/abg-reader.cc (read_corpus_from_input): When loading the second corpus, if the debug self comparison mode is on, then save that corpus on the side in the environment. * tools/abidw.cc: Include the config.h file for preprocessor macros defined at configure (options::debug_abidiff): New data member. (parse_command_line): Parse the --debug-abidiff option. (load_corpus_and_write_abixml): Switch the self debug mode on when the --debug-abidiff option is provided. Use a read_context for the abixml loading. That is going to be useful for subsequent patches. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2021-05-18 08:29:38 +00:00
Enable self comparison debugging : ${ENABLE_DEBUG_SELF_COMPARISON}
Add --enable-debug-type-canonicalization to configure This configure option adds the possibility to debug the type canonicalization process specifically. When this new configure option is turned on, in ir::get_canonical_type_for, when the type T, candidate for canonicalization is compared to a given canonical type C, the comparison is done twice; once using structural equality and once using canonical equality whenever it's possible. For all the sub-types of T and C, structural equality and canonical equality must yield the same result. Otherwise, an error message is emitted and the process aborts. This all happens when using the abidw program with the --enable-tc or --enable-type-canonicalization option. This has proven to be very helpful to detect type canonicalization issues. For instance, here is a trace of canonicalization issue that was detected thanks to this patch: $ build/tools/abidw --debug-tc /usr/lib64/libwiretap.so.11.0.8 structural & canonical equality different for type: function type void (wtap*) in compare_types_during_canonicalization at: /home/dodji/git/libabigail/PR28364/src/abg-ir.cc:13575: execution should not have reached this point! Abandon (core dumped) This means that right after canonicalizing the type "void (wtap*)", structural and canonical equality yield different results. So it means there is a problem with that type specifically that makes its canonicalization "go wrong". This requires further debugging to understand, but at least, we are super close to the root cause of the canonicalization problem. * configure.ac: Support the new --enable-debug-type-canonicalization option. Define macro WITH_DEBUG_TYPE_CANONICALIZATION accordingly. * doc/manuals/abidw.rst: Update documentation. * include/abg-ir.h (environment::debug_type_canonicalization_is_on): Declare new member function if WITH_DEBUG_TYPE_CANONICALIZATION is defined. * src/abg-ir-priv.h (environment::priv::{use_canonical_type_comparison_, debug_type_canonicalization_}): Define new data members if WITH_DEBUG_TYPE_CANONICALIZATION is defined. (environment::priv::priv): Initialize them. * src/abg-ir.cc (try_canonical_compare): When WITH_DEBUG_TYPE_CANONICALIZATION is defined, perform comparison using either structural or canonical equality depending on the environment::priv::use_canonical_type_comparison_ flag. (environment::debug_type_canonicalization_is_on): Define member function when WITH_DEBUG_TYPE_CANONICALIZATION is defined. (compare_types_during_canonicalization): Define new function. (type_base::get_canonical_type_for): Use the new function compare_types_during_canonicalization. * tools/abidw.cc (options::debug_type_canonicalization): Define new data member. (option::option): Initialize it. (display_usage): Add help string for --debug-tc. (parse_command_line): Support new option --debug-tc or --debug-type-canonicalization. (load_corpus_and_write_abixml): Turn type canonicalization debugging on if --enable-tc is provided. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2021-10-14 10:12:01 +00:00
Enable type canonicalization debugging : ${ENABLE_DEBUG_TYPE_CANONICALIZATION}
Make abipkgdiff compare tar archives containing binaries This patch adds support for comparing the ABI of binaries contained in a tar archive. If the archive is compressed with gzip, bzip2, lzip, lzma or xz, then abipkgdiff recognizes the usual relevant file extensions and lets the GNU tar program handle the decompression. If the archive is not compressed, abipkgdiff recognizes the UStar (Uniform Standard Tape ARchive) format, even if the archive file name doesn't end with the .tar extension, and lets the GNU tar program handle the extraction. If the file ends up with the .tar extension anyway (even if it's not in the UStar format, abipkgdiff lets the GNU tar program handle its extraction. * config.h.in (WITH_TAR): New configuration preprocessor macro. * configure.ac: Add a new --enable-tar option. It's turned on automatically if the tar program is found in the PATH. Adjust the build configuration report to add the tar archive support. * include/abg-tools-utils.h (string_ends_with): Declare new function. (enum file_type): Add a new FILE_TYPE_TAR enumerator. * src/abg-tools-utils.cc (string_ends_with): Define new function. (operator<<(ostream&, file_type)): Serialize the new FILE_TYPE_TAR enumerator. (guess_file_type): Detect UStar format file by reading its magic number. Detect compressed tar files based on the file path extension. * tools/abipkgdiff.cc (extract_tar): Define new function. (extract_package): Handle tar packages. (main): Handle tar archives. * tools/abidiff.cc (main): Handle the new FILE_TYPE_TAR enumerator. * tools/abilint.cc (main): Likewise. * tests/data/test-diff-pkg/tarpkg-0-dir{1,2}.ta{,r,.bz2, gz}: New test input tarballs. * tests/data/test-diff-pkg/tarpkg-0-report-0.txt: New test output reference. * tests/data/Makefile.am: Add the new test data file above to source distribution. * tests/test-diff-pkg.cc (in_out_specs): Add new tests cases. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-08-22 11:59:18 +00:00
Enable deb support in abipkgdiff : ${ENABLE_DEB}
Enable GNU tar archive support in abipkgdiff : ${ENABLE_TAR}
Enable bash completion : ${ENABLE_BASH_COMPLETION}
Enable fedabipkgdiff : ${ENABLE_FEDABIPKGDIFF}
Bug 22722 - Make fedabipkgdiff and its tests support both python 3 and 2 This patch makes fedabipkgdiff Python 3 compatible. All tests written in Python are updated and compatible with Python 3 as well. The patch looks for a Python 3 interperter. If it finds one then it runs the tests using that interpreter. Otherwise it just tries to use the Python 2 interpreter. This behaviour can be disabled by the new --disable-python3 option. * configure.ac: Add new option --enable-python3. Add new test runner file tests/runtestdefaultsupprs-py3 and tests/runtestfedabipkgdiffpy3.sh. Add required six Python module. * tests/Makefile.am: Add new test files tests/runtestdefaultsupprspy3.sh and tests/runtestfedabipkgdiffpy3.sh accordingly. * tests/mockfedabipkgdiff.in: Convert print statement to six.print_. Replace call to function filter with list comprehension. Replace basestring with six.string_types. * tests/runtestdefaultsupprspy3.sh.in: New shell script to run test runtestdefaultsupprs with Python 3. * tests/runtestdefaultsupprs.py.in: Repalce a few tabs with proper number of spaces which is detected by Python 3 interpreter. * tests/runtestfedabipkgdiffpy3.sh.in: New shell script to run test runtestfedabipkgdiff with Python 3. * tests/runtestfedabipkgdiff.py.in: Use python from env in shebang instead of a fixed path to a Python interpreter. * tools/fedabipkgdiff: Globally replace print statement with a function call to print which is available by importing print_function from __future__ module. Use six.print_ to output string to stderr instead. Convert function call to map to for-loop. (cmp_nvr): Change argument to handle a Koji build mapping instead of only the nvr. (Brew.listBuilds): use the new cmp_nvr to sort builds. Signed-off-by: Chenxiong Qi <cqi@redhat.com> Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2018-03-25 07:34:59 +00:00
Enable python 3 : ${ENABLE_PYTHON3}
Add support for the CTF debug format to libabigail. CTF (C Type Format) is a lightweight debugging format that provides information about C types and the association between functions and data symbols and types. It is designed to be very compact and simple. More can be learned about it at https://ctfstd.org. This patch introduces support in libabigail to extract ABI information from CTF stored in ELF files. A few notes on this implementation: - The implementation is complete in terms of CTF support. Every CTF feature is processed and handled to generate libabigail IR. This includes basic types, typedefs, pointer, array and struct types. The CTF record of data objects (variables) and functions are also used in order to generate the corresponding libabigail IR artifacts. - The decoding of CTF data is done using the libctf library which is part of binutils. In order to link with it, binutils shall be built with --enable-shared for libctf.so to become available. - This initial implementation is aimed to simplicity. We have not tried to resolve any and every corner case that may require special handling. We have observed that the DWARF front-end (which is naturally way more complex as the scope is way bigger) is plagued with hacks to handle such situations. However, for the CTF support we prefer to proceed in a simpler and more modest way: we will handle these problems if/when we find them. The fact that CTF only supports C (currently) certainly helps there. - Likewise, in this basic support we are not handling symbol suppressions or other goodies that libabigail provides. We are new to libabigail and ABI analysis, and at this point we simply don't have a clear picture about what is most useful/relevant to support or not. With the maintainer's blesssing, we will tackle that functionaly after this basic support is applied upstream. - The implementation in abg-ctf-reader.{cc,h} is pretty much self-contained. As a result there is some duplication in terms of ELF handling with the DWARF reader, but since that logic is very simple and can be easily implemented, we don't consider this to be a big deal (for now.) Hopefully the maintainers agree. - The libabigail tools assume that ELF means to always use DWARF to generate the ABI IR. We added a new command-line option --ctf to the tools in order to make them to use the CTF debug info instead. We are definitely not sure whether this is the best user interface. In fact I would be suprised if it was ;) - We added support for --ctf to both abilint and abidiff. We are not sure whether it would make sense to add support for CTF to the other tools. Feedback welcome. - We are pondering about what to do in terms of testing. We have cursory tested this implementation using abilint and abidiff. We know we are generating IR corpus that seem to be ok. It would be good however to be able to run the libabigail testsuites using CTF. However the testsuites may need some non-trivial changes in order to make this possible. Let's talk about that :) * configure.ac: Check for libctf. * src/abg-ctf-reader.cc: New file. * include/abg-ctf-reader.h: Likewise. * src/Makefile.am (libabigail_la_SOURCES): Add abg-ctf-reader.cc conditionally. * include/Makefile.am (pkginclude_HEADERS): Add abg-ctf-reader.h conditionally. * tools/abilint.cc (struct options): New option `use_ctf'. (display_usage): Documentation for --ctf. (parse_command_line): Handle --ctf. (main): Honour --ctf. * tools/abidiff.cc (struct options): New option `use_ctf'. (display_usage): Documentation for --ctf. (parse_command_line): Handle --ctf. (main): Honour --ctf. * doc/manuals/abidiff.rst: Document --ctf. * doc/manuals/abilint.rst: Likewise. Signed-off-by: Jose E. Marchesi <jose.marchesi@oracle.com> Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2021-10-28 22:51:32 +00:00
Enable CTF front-end : ${ENABLE_CTF}
Enable running tests under Valgrind : ${enable_valgrind}
Enable build with -fsanitize=address : ${ENABLE_ASAN}
Enable build with -fsanitize=memory : ${ENABLE_MSAN}
Enable build with -fsanitize=thread : ${ENABLE_TSAN}
Enable build with -fsanitize=undefined : ${ENABLE_UBSAN}
Make abipkgdiff compare tar archives containing binaries This patch adds support for comparing the ABI of binaries contained in a tar archive. If the archive is compressed with gzip, bzip2, lzip, lzma or xz, then abipkgdiff recognizes the usual relevant file extensions and lets the GNU tar program handle the decompression. If the archive is not compressed, abipkgdiff recognizes the UStar (Uniform Standard Tape ARchive) format, even if the archive file name doesn't end with the .tar extension, and lets the GNU tar program handle the extraction. If the file ends up with the .tar extension anyway (even if it's not in the UStar format, abipkgdiff lets the GNU tar program handle its extraction. * config.h.in (WITH_TAR): New configuration preprocessor macro. * configure.ac: Add a new --enable-tar option. It's turned on automatically if the tar program is found in the PATH. Adjust the build configuration report to add the tar archive support. * include/abg-tools-utils.h (string_ends_with): Declare new function. (enum file_type): Add a new FILE_TYPE_TAR enumerator. * src/abg-tools-utils.cc (string_ends_with): Define new function. (operator<<(ostream&, file_type)): Serialize the new FILE_TYPE_TAR enumerator. (guess_file_type): Detect UStar format file by reading its magic number. Detect compressed tar files based on the file path extension. * tools/abipkgdiff.cc (extract_tar): Define new function. (extract_package): Handle tar packages. (main): Handle tar archives. * tools/abidiff.cc (main): Handle the new FILE_TYPE_TAR enumerator. * tools/abilint.cc (main): Likewise. * tests/data/test-diff-pkg/tarpkg-0-dir{1,2}.ta{,r,.bz2, gz}: New test input tarballs. * tests/data/test-diff-pkg/tarpkg-0-report-0.txt: New test output reference. * tests/data/Makefile.am: Add the new test data file above to source distribution. * tests/test-diff-pkg.cc (in_out_specs): Add new tests cases. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-08-22 11:59:18 +00:00
Generate html apidoc : ${ENABLE_APIDOC}
Generate html manual : ${ENABLE_MANUAL}
])