--- /dev/null
+From 5c8737c5c3170358024a4a969e1386cea15932f3 Mon Sep 17 00:00:00 2001
+From: Michael Orlitzky <michael@orlitzky.com>
+Date: Sun, 26 Apr 2020 09:56:34 -0400
+Subject: [PATCH 1/1] src/tunetoom.c: delete duplicate definition of rp.
+
+The "make tune-toom" command has started failing with gcc-10.x because
+of its new default -fno-common behavior,
+
+ * https://gcc.gnu.org/gcc-10/porting_to.html
+ * https://wiki.gentoo.org/wiki/Gcc_10_porting_notes/fno_common
+
+This leads to an error involving the FILE pointer "rp" that is declared
+in global scope in both src/tunetoom.c and src/tuning-common.c. In this
+case, the declaration in src/tunetoom.c is simply redundant: that file
+includes src/tuning-common.h which already declares "rp" as extern.
+
+Deleting the redeclaration in src/tunetoom.c makes the build succeed.
+---
+ src/tunetoom.c | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/src/tunetoom.c b/src/tunetoom.c
+index 7553e0c..1140606 100644
+--- a/src/tunetoom.c
++++ b/src/tunetoom.c
+@@ -111,8 +111,6 @@ const char * gf2x_utoom_select_string[] = {
+ [GF2X_SELECT_UNB_TC3U] = "TC3U",
+ };
+
+-FILE *rp;
+-
+ void tunetoom(long tablesz)
+ {
+ long high, n;
+--
+2.24.1
+
--- /dev/null
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools
+
+DESCRIPTION="C/C++ routines for fast arithmetic in GF(2)[x]"
+HOMEPAGE="https://gitlab.inria.fr/thome/gf2x/ http://gforge.inria.fr/projects/gf2x/"
+# The Gitlab release is missing the autotools files.
+SRC_URI="https://gforge.inria.fr/frs/download.php/38243/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0/3" # soname major version, defined in configure.ac
+KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
+IUSE="fft static-libs custom-tune"
+IUSE_CPU_FLAGS=" pclmul sse2 sse3 sse4_1 ssse3"
+IUSE+=" ${IUSE_CPU_FLAGS// / cpu_flags_x86_}"
+
+PATCHES=( "${FILESDIR}/fno-common.patch" )
+
+src_prepare() {
+ default
+ # fix for cross-compiling, avoid ABI detection
+ sed -e 's/VERIFY_WORDSIZE(\[$ABI\].*/echo "skipping ABI check"/' \
+ -e 's/AC_MSG_ERROR(\[already_t.*/echo "skipping ABI check"/' \
+ -i configure.ac || die
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_enable cpu_flags_x86_sse2 sse2) \
+ $(use_enable cpu_flags_x86_sse3 sse3) \
+ $(use_enable cpu_flags_x86_ssse3 ssse3) \
+ $(use_enable cpu_flags_x86_sse4_1 sse41) \
+ $(use_enable cpu_flags_x86_pclmul pclmul) \
+ $(use_enable fft fft-interface) \
+ $(use_enable static-libs static)
+}
+
+src_compile() {
+ emake
+ if use custom-tune; then
+ einfo "Starting tuning"
+ emake tune-lowlevel
+ emake tune-toom
+ use fft && emake tune-fft
+ fi
+}
+
+src_install() {
+ default
+ if ! use static-libs; then
+ find "${ED}" -name '*.la' -delete || die
+ fi
+}