From bde5ff11dfc84542ef354292c2edf7fad6398449 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Mon, 15 Oct 2018 12:13:25 +0100 Subject: [PATCH] Only check major version numbers when verifying gcc builder and runner. (#16329224) --- annobin-skip-minor-version-check.patch | 20 ++++++++++++++++++++ annobin.spec | 9 ++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 annobin-skip-minor-version-check.patch diff --git a/annobin-skip-minor-version-check.patch b/annobin-skip-minor-version-check.patch new file mode 100644 index 0000000..6b81d38 --- /dev/null +++ b/annobin-skip-minor-version-check.patch @@ -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; + } + diff --git a/annobin.spec b/annobin.spec index 7a324e1..a45ec22 100644 --- a/annobin.spec +++ b/annobin.spec @@ -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 - 5.7-3 +- Only check major version numbers when verifying gcc builder and runner. (#16329224) + * Thu May 10 2018 Nick Clifton - 5.7-2 - Version bump in order to allow a rebuild with the latest version of gcc.