Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 gcl (2.6.13-5) unstable; urgency=medium
 .
   * Version_2_6_14pre4
Author: Camm Maguire <camm@debian.org>

---
The information above should follow the Patch Tagging Guidelines, please
checkout https://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: (upstream|backport|vendor|other), (<patch-url>|commit:<commit-id>)
Bug: <upstream-bugtracker-url>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: (no|not-needed|<patch-forwarded-url>)
Applied-Upstream: <version>, (<commit-url>|commit:<commid-id>)
Reviewed-By: <name and email of someone who approved/reviewed the patch>
Last-Update: 2022-12-25

--- gcl-2.6.13.orig/configure
+++ gcl-2.6.13/configure
@@ -4888,6 +4888,17 @@ if test "$FOMITF" != "" ; then
     TO3FLAGS="$TO3FLAGS $FOMITF"
 fi
 
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking gcc version 12" >&5
+printf %s "checking gcc version 12... " >&6; }
+if $CC -v 2>&1|grep gcc |grep -q 'version 12'; then
+   { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
+   assert_arg_to_cflags -fno-tree-vrp #Bug workaround
+else
+   { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
 # Step 1: set the variable "system" to hold the name and version number
 # for the system.  This can usually be done via the "uname" command, but
 # there are a few systems, like Next, where this doesn't work.
--- gcl-2.6.13.orig/configure.in
+++ gcl-2.6.13/configure.in
@@ -491,6 +491,14 @@ if test "$FOMITF" != "" ; then
     TO3FLAGS="$TO3FLAGS $FOMITF"
 fi
 
+AC_MSG_CHECKING([gcc version 12])
+if $CC -v 2>&1|grep gcc |grep -q 'version 12'; then
+   AC_MSG_RESULT([yes])
+   assert_arg_to_cflags -fno-tree-vrp #Bug workaround
+else
+   AC_MSG_RESULT([no])
+fi
+
 # Step 1: set the variable "system" to hold the name and version number
 # for the system.  This can usually be done via the "uname" command, but
 # there are a few systems, like Next, where this doesn't work.
--- gcl-2.6.13.orig/git.tag
+++ gcl-2.6.13/git.tag
@@ -1,2 +1,2 @@
-"Version_2_6_14pre3"
+"Version_2_6_14pre4"
 
--- gcl-2.6.13.orig/h/elf64_riscv64_reloc.h
+++ gcl-2.6.13/h/elf64_riscv64_reloc.h
@@ -13,6 +13,7 @@
       store_val(where,MASK(7)<<25,(s+a)<<20);
       break;
     case R_RISCV_CALL:
+    case R_RISCV_CALL_PLT:
       store_val(where,MASK(20)<<12,riscv_high(s+a-p));
       store_val((void *)where+4,MASK(12)<<20,(s+a-p)<<20);
       break;
