Only check major version numbers when verifying gcc builder and runner. (#16329224)

This commit is contained in:
Nick Clifton 2018-10-15 12:13:25 +01:00
commit bde5ff11df
2 changed files with 28 additions and 1 deletions

View file

@ -0,0 +1,20 @@
diff -rup annobin.orig/plugin/annobin.cc annobin-5.7/plugin/annobin.cc
--- annobin.orig/plugin/annobin.cc 2018-10-15 11:57:59.263140156 +0100
+++ annobin-5.7/plugin/annobin.cc 2018-10-15 12:00:17.358170612 +0100
@@ -1158,10 +1158,14 @@ plugin_init (struct plugin_name_args *
{
bool fail = false;
- if (strcmp (version->basever, gcc_version.basever))
+ /* plugin_default_version_check is very strict and requires that the
+ major, minor and revision numbers all match. Since annobin only
+ lightly touches gcc we assume that major number compatibility will
+ be sufficient... */
+ if (strncmp (version->basever, gcc_version.basever, strchr (version->basever, '.') - version->basever))
{
annobin_inform (0, _("Error: plugin built for compiler version (%s) but run with compiler version (%s)"),
- version->basever, gcc_version.basever);
+ gcc_version.basever, version->basever);
fail = true;
}

View file

@ -12,7 +12,7 @@
Name: annobin
Summary: Binary annotation plugin for GCC
Version: 5.7
Release: 2%{?dist}
Release: 3%{?dist}
License: GPLv3+
URL: https://fedoraproject.org/wiki/Toolchain/Watermark
@ -35,6 +35,10 @@ Source: https://nickc.fedorapeople.org/annobin-%{version}.tar.xz
# the --generate-missing-build-notes=yes commmand line option.
Patch01: annobin-skip-assembler-test.patch
# Only test that the major version of gcc used to build the annobin plugin
# matches with the major version of gcc used to run the plugin.
Patch02: annobin-skip-minor-version-check.patch
Requires(post): /sbin/install-info
Requires(preun): /sbin/install-info
@ -195,6 +199,9 @@ exit 0
#---------------------------------------------------------------------------------
%changelog
* Mon Oct 10 2018 Nick Clifton <nickc@redhat.com> - 5.7-3
- Only check major version numbers when verifying gcc builder and runner. (#16329224)
* Thu May 10 2018 Nick Clifton <nickc@redhat.com> - 5.7-2
- Version bump in order to allow a rebuild with the latest version of gcc.