Disable bootstrapping. Also use error() in place of warning() in the gcc plugin.

Resolves: RHEL-95704
This commit is contained in:
Nick Clifton 2025-06-10 11:22:46 +01:00
parent 45335de2bc
commit a261af5ece
4 changed files with 44 additions and 4 deletions

View File

@ -1,2 +0,0 @@
# Package Not Available
This package is not available on CentOS Stream 10.

View File

@ -0,0 +1,32 @@
--- annobin-12.93.orig/gcc-plugin/annobin.cc 2025-06-10 10:06:03.168778925 +0100
+++ annobin-12.93/gcc-plugin/annobin.cc 2025-06-10 10:59:10.724745093 +0100
@@ -2456,11 +2456,18 @@ annobin_active_check (const char * messa
if (ends_with (annobin_input_filename, ".f"))
return;
+#if 0 /* RHEL-95704 : GCC 14's version of warning() is different from GCC 15's.
+ Whilst bootstrapping GTS-15 we build with GCC 14 but want to run with GGC 15.
+ So we cannot safely use the warning() function. */
+
if (annobin_active_checks == 1)
// FIXME: We should find an OPT_ value to use here so
// that users can disable these warnings if they need to.
warning (0, "%s", message);
else if (annobin_active_checks == 2)
+#else
+ if (annobin_active_checks >= 1)
+#endif
error ("%s", message);
else
ice ("unexpected value for annobin_active_checks");
--- annobin-12.93.orig/tests/active-checks-test 2025-06-10 10:06:03.169970481 +0100
+++ annobin-12.93/tests/active-checks-test 2025-06-10 11:13:27.075942964 +0100
@@ -20,7 +20,7 @@ GCC_OPTS="-D__FORTIFY_SOURCE=2 -DGLIBCXX
start_test
$GCC -fplugin=$PLUGIN $PLUGIN_OPTS -c $srcdir/hello.c $GCC_OPTS > gcc.out 2>&1
-if [ $? != 0 ];
+if [ $? != 1 ];
then
echo "$TEST_NAME: FAIL: could not compile test file"
echo "$TEST_NAME: gcc command line: $GCC -fplugin=$PLUGIN $PLUGIN_OPTS -c $srcdir/hello.c $GCC_OPTS"

View File

@ -9,7 +9,7 @@ BuildRequires: scl-utils-build
Name: %{?scl_prefix}annobin
Summary: Annotate and examine compiled binary files
Version: 12.93
Release: 2%{?dist}
Release: 3%{?dist}
License: GPL-3.0-or-later AND LGPL-2.0-or-later AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (LGPL-2.0-or-later WITH GCC-exception-2.0) AND GFDL-1.3-or-later
URL: https://sourceware.org/annobin/
# Maintainer: nickc@redhat.com
@ -74,7 +74,7 @@ URL: https://sourceware.org/annobin/
# Bootstrapping: Set this to 1 to build annobin with the system gcc.
# Then once GTS-gcc is built and in the buildroot, reset this variable
# to 0, bump the NVR and rebuild GTS-annobin.
%define bootstrapping 1
%define bootstrapping 0
# # FIXME: Temporary - use this to get the annobin plugin into the buildroot.
%undefine _annotated_build
@ -90,6 +90,13 @@ Patch02: annobin-tmp-default-to-using-group-attach.patch
%if %{bootstrapping}
Patch03: annobin-gcc-plugin-ignore-major-version-diffs.patch
%endif
# FIXME: TEMPORARY: This patch changes the GCC plugin so that will call error()
# instead of warning() when generating warning messages. This is because the
# prototype for warning() changes between GCC 14 and GCC 15. So a plugin built
# by GCC 14 cannot be run by GCC 15. Once gcc-toolset-15-gcc in the buildroot
# is at version 15, this patch should be discarded.
# For more details see RHEL-95704.
Patch04: annobin-GCC-PLUGIN-WARNING.patch
# This is where a copy of the sources will be installed.
%global annobin_source_dir %{?_scl_root}/%{_usrsrc}/annobin
@ -635,6 +642,9 @@ make check GCC=%gcc_for_annobin CC=%gcc_for_annobin
#---------------------------------------------------------------------------------
%changelog
* Tue Jun 10 2025 Nick Clifton <nickc@redhat.com> - 12.93-3
- Disable bootstrapping. Also use error() in place of warning() in the gcc plugin. (RHEL-95704)
* Tue Apr 01 2025 Nick Clifton <nickc@redhat.com> - 12.93-2
- NVR bump in order to allow rebuilding with correct GTS-15 tags. (RHEL-81744)

View File