--- /dev/null
+From 6ae279e724e76da015eab1d76a06620e6d5d923e Mon Sep 17 00:00:00 2001
+From: Nick Clifton <nickc@redhat.com>
+Date: Tue, 27 Feb 2024 14:13:53 +0000
+Subject: [PATCH] 12.41: GCC Plugin: Add MIPS backend. Clang Plugin: Add
+ support for clang v18.
+
+---
+ clang-plugin/annobin.cpp | 10 +++++--
+ configure | 2 +-
+ configure.ac | 2 +-
+ gcc-plugin/Makefile.am | 2 +-
+ gcc-plugin/Makefile.in | 2 +-
+ gcc-plugin/configure | 3 ++
+ gcc-plugin/configure.ac | 3 ++
+ gcc-plugin/mips.annobin.cc | 56 ++++++++++++++++++++++++++++++++++++++
+ meson.build | 2 +-
+ 9 files changed, 75 insertions(+), 7 deletions(-)
+ create mode 100644 gcc-plugin/mips.annobin.cc
+
+diff --git a/clang-plugin/annobin.cpp b/clang-plugin/annobin.cpp
+index c6eea64..5426d22 100644
+--- a/clang-plugin/annobin.cpp
++++ b/clang-plugin/annobin.cpp
+@@ -204,7 +204,9 @@ private:
+ (Context,
+ TU,
+ clang::StringLiteral::Create (Context, text,
+-#if CLANG_VERSION_MAJOR > 14
++#if CLANG_VERSION_MAJOR > 17
++ clang::StringLiteralKind::Ordinary,
++#elif CLANG_VERSION_MAJOR > 14
+ clang::StringLiteral::Ordinary,
+ #else
+ clang::StringLiteral::Ascii,
+@@ -214,8 +216,12 @@ private:
+ llvm::APInt (32, text.size () + 1),
+ #if CLANG_VERSION_MAJOR > 8
+ nullptr,
+-#endif
++#endif
++#if CLANG_VERSION_MAJOR > 17
++ clang::ArraySizeModifier::Normal,
++#else
+ clang::ArrayType::Normal,
++#endif
+ /*IndexTypeQuals*/ 0),
+ SourceLocation ()),
+ {},
+diff --git a/configure b/configure
+index 476540c..6fde8cf 100755
+--- a/configure
++++ b/configure
+@@ -2692,7 +2692,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
+
+ # NB/ When updating the ANNOBIN_VERSION below, remember to
+ # also update VERSION in the PROJECT section of meson.build.
+-ANNOBIN_VERSION=12.40
++ANNOBIN_VERSION=12.41
+
+
+ # Make sure we can run config.sub.
+diff --git a/configure.ac b/configure.ac
+index 33d8d2e..24210c2 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -9,7 +9,7 @@ AC_CONFIG_SRCDIR([annobin-global.h.in])
+
+ # NB/ When updating the ANNOBIN_VERSION below, remember to
+ # also update VERSION in the PROJECT section of meson.build.
+-ANNOBIN_VERSION=12.40
++ANNOBIN_VERSION=12.41
+ AC_SUBST(ANNOBIN_VERSION)
+
+ AC_CANONICAL_SYSTEM
+diff --git a/gcc-plugin/Makefile.am b/gcc-plugin/Makefile.am
+index 08d4882..eca5e10 100644
+--- a/gcc-plugin/Makefile.am
++++ b/gcc-plugin/Makefile.am
+@@ -9,7 +9,7 @@ AM_CPPFLAGS = -I'$(top_builddir)' -I'$(top_srcdir)'
+ AUTOMAKE_OPTIONS = no-dependencies
+
+ annobin_la_SOURCES = annobin.cc
+-EXTRA_annobin_la_SOURCES = aarch64.annobin.cc arm.annobin.cc dummy.annobin.cc powerpc.annobin.cc s390.annobin.cc x86_64.annobin.cc i686.annobin.cc riscv.annobin.cc
++EXTRA_annobin_la_SOURCES = aarch64.annobin.cc arm.annobin.cc dummy.annobin.cc powerpc.annobin.cc s390.annobin.cc x86_64.annobin.cc i686.annobin.cc riscv.annobin.cc mips.annobin.cc
+ annobin_la_LIBADD = @target_plugin@
+ annobin_la_DEPENDENCIES = @target_plugin@
+
+diff --git a/gcc-plugin/Makefile.in b/gcc-plugin/Makefile.in
+index 04dd937..d5604cc 100644
+--- a/gcc-plugin/Makefile.in
++++ b/gcc-plugin/Makefile.in
+@@ -348,7 +348,7 @@ plugin_LTLIBRARIES = annobin.la
+ AM_CPPFLAGS = -I'$(top_builddir)' -I'$(top_srcdir)'
+ AUTOMAKE_OPTIONS = no-dependencies
+ annobin_la_SOURCES = annobin.cc
+-EXTRA_annobin_la_SOURCES = aarch64.annobin.cc arm.annobin.cc dummy.annobin.cc powerpc.annobin.cc s390.annobin.cc x86_64.annobin.cc i686.annobin.cc riscv.annobin.cc
++EXTRA_annobin_la_SOURCES = aarch64.annobin.cc arm.annobin.cc dummy.annobin.cc powerpc.annobin.cc s390.annobin.cc x86_64.annobin.cc i686.annobin.cc riscv.annobin.cc mips.annobin.cc
+ annobin_la_LIBADD = @target_plugin@
+ annobin_la_DEPENDENCIES = @target_plugin@
+ annobin_la_LDFLAGS = -module
+diff --git a/gcc-plugin/configure b/gcc-plugin/configure
+index a5fe7a0..66eb11d 100755
+--- a/gcc-plugin/configure
++++ b/gcc-plugin/configure
+@@ -5170,6 +5170,9 @@ case ${target} in
+ x86_64-*-*)
+ target_plugin="x86_64.annobin.lo"
+ ;;
++ mips*-*-*)
++ target_plugin="mips.annobin.lo"
++ ;;
+ *)
+ target_plugin="dummy.annobin.lo"
+ ;;
+diff --git a/gcc-plugin/configure.ac b/gcc-plugin/configure.ac
+index 2393c4a..ff1966f 100644
+--- a/gcc-plugin/configure.ac
++++ b/gcc-plugin/configure.ac
+@@ -78,6 +78,9 @@ case ${target} in
+ x86_64-*-*)
+ target_plugin="x86_64.annobin.lo"
+ ;;
++ mips*-*-*)
++ target_plugin="mips.annobin.lo"
++ ;;
+ *)
+ target_plugin="dummy.annobin.lo"
+ ;;
+diff --git a/gcc-plugin/mips.annobin.cc b/gcc-plugin/mips.annobin.cc
+new file mode 100644
+index 0000000..cad9dba
+--- /dev/null
++++ b/gcc-plugin/mips.annobin.cc
+@@ -0,0 +1,56 @@
++/* mips.annobin - Empty target specific parts of the annobin plugin.
++ Copyright (c) 2024 Red Hat.
++ Created by Nick Clifton.
++
++ This is free software; you can redistribute it and/or modify it
++ under the terms of the GNU General Public License as published
++ by the Free Software Foundation; either version 3, or (at your
++ option) any later version.
++
++ It is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ GNU General Public License for more details. */
++
++#include "annobin-global.h"
++#include "annobin.h"
++
++/* The target specific part of the plugin must prodive the
++ following four functions:
++
++ annobin_save_target_specific_information - Called during plugin_init()
++ annobin_target_start_symbol_bias - Called during plugin_init()
++ annobin_record_global_target_notes - Called during PLUGIN_START_UNIT
++ annobin_get_target_pointer_size - Called during PLUGIN_START_UNIT
++ annobin_target_specific_function_notes - Called during PLUGIN_ALL_PASSES_START
++ annobin_target_specific_loader_notes - Called during PLUGIN_FINISH_UNIT. */
++
++signed int
++annobin_target_start_symbol_bias (void)
++{
++ return 0;
++}
++
++unsigned int
++annobin_get_target_pointer_size (void)
++{
++ // FIXME: Testing POINTER_SIZE may not be reliable.
++ return POINTER_SIZE;
++}
++
++int
++annobin_save_target_specific_information (void)
++{
++ return 0;
++}
++
++void
++annobin_record_global_target_notes (annobin_function_info * info ATTRIBUTE_UNUSED)
++{
++}
++
++void
++annobin_target_specific_function_notes (annobin_function_info * info ATTRIBUTE_UNUSED,
++ bool force ATTRIBUTE_UNUSED)
++{
++}
+diff --git a/meson.build b/meson.build
+index c8b4fd6..0208f8e 100644
+--- a/meson.build
++++ b/meson.build
+@@ -7,7 +7,7 @@
+ project(
+ 'annobin',
+ ['c', 'cpp'],
+- version: '12.40',
++ version: '12.41',
+ meson_version: '>=0.59'
+ )
+
+--
+2.45.2
+