annobin/annobin-plugin-callback.patch

56 lines
2.3 KiB
Diff
Raw Normal View History

#--- annobin.orig/gcc-plugin/annobin.cc 2025-01-22 10:16:43.228689446 +0000
+++ annobin-12.82/gcc-plugin/annobin.cc 2025-01-22 10:17:28.453873506 +0000
@@ -3249,6 +3249,7 @@ multiple_annobin_plugins_present (const
return false;
}
+#if GCCPLUGIN_VERSION_MAJOR > 11
/* We used to call plugins_active_p() here but this only lets us know if
there are other active plugins. It does not tell us if they are
different versions of the annobin plugin. So instead we iterate
@@ -3271,16 +3272,16 @@ multiple_annobin_plugins_present (const
return false;
}
- // We have only found one annobin plugin, which must be ourselves.
- // But there is a possibility that there are other, older versions of the
- // annobin plugin installed. We have no reliable way of detecting them,
- // but we assume that if the version string in the plugin's
- // plugin_name_arrgs structure is not filled in then it *might* be an
- // annobin plugin. So we count that as a positive result.
- //
- // If this turns out to be incorrect then the only recourse is for the user
- // to place the annobin plugin earlier on the gcc command line than the
- // plugin(s) that are not setting their version strings.
+ /* We have only found one annobin plugin, which must be ourselves.
+ But there is a possibility that there are other, older versions of the
+ annobin plugin installed. We have no reliable way of detecting them,
+ but we assume that if the version string in the plugin's
+ plugin_name_args structure is not filled in then it *might* be an
+ annobin plugin. So we count that as a positive result.
+
+ If this turns out to be incorrect then the only recourse is for the user
+ to place the annobin plugin earlier on the gcc command line than the
+ plugin(s) that are not setting their version strings. */
if (cbd.num_with_no_version > 0)
{
if (verbose_level >= INFORM_VERBOSE)
@@ -3288,7 +3289,16 @@ multiple_annobin_plugins_present (const
name, cbd.num_with_no_version);
return true;
}
-
+#else
+ if (plugins_active_p ())
+ {
+ if (verbose_level >= INFORM_VERBOSE)
+ fprintf (stderr, "%s: other plugin(s) found. Assuming that they are old versions of the annobin plugin",
+ name);
+ return true;
+ }
+#endif
+
return false;
}