git: 8288c59996e1 - main - math/cln: unbreak on armv7

From: Mikael Urankar <mikael_at_FreeBSD.org>
Date: Tue, 21 Dec 2021 16:24:09 UTC
The branch main has been updated by mikael:

URL: https://cgit.FreeBSD.org/ports/commit/?id=8288c59996e1635170a2866bb3b18b4f6e804cea

commit 8288c59996e1635170a2866bb3b18b4f6e804cea
Author:     Robert Clausecker <fuz@fuz.su>
AuthorDate: 2021-11-15 10:02:24 +0000
Commit:     Mikael Urankar <mikael@FreeBSD.org>
CommitDate: 2021-12-21 16:23:47 +0000

    math/cln: unbreak on armv7
    
    This patch fixes the build for math/cln on armv7 by patching some wrong declarations.
    
    It also hooks up the test suite to "make test".
    
    PR:             259854
    Approved by:    wen (maintainer timeout)
---
 math/cln/Makefile                                 |  1 +
 math/cln/files/patch-src_base_low_cl__low__div.cc | 28 +++++++++++++++++++++++
 math/cln/files/patch-src_base_low_cl__low__mul.cc | 14 ++++++++++++
 3 files changed, 43 insertions(+)

diff --git a/math/cln/Makefile b/math/cln/Makefile
index c6d28c62fd19..d66381a41000 100644
--- a/math/cln/Makefile
+++ b/math/cln/Makefile
@@ -18,6 +18,7 @@ LIB_DEPENDS=	libgmp.so:math/gmp
 GNU_CONFIGURE=	yes
 CONFIGURE_ARGS=	--with-gmp=${LOCALBASE}
 INSTALL_TARGET=	install-strip
+TEST_TARGET=	check
 USES=		compiler:c11 gmake libtool pathfix pkgconfig tar:bzip2
 USE_LDCONFIG=	yes
 
diff --git a/math/cln/files/patch-src_base_low_cl__low__div.cc b/math/cln/files/patch-src_base_low_cl__low__div.cc
index 15124551e323..a759e811a95b 100644
--- a/math/cln/files/patch-src_base_low_cl__low__div.cc
+++ b/math/cln/files/patch-src_base_low_cl__low__div.cc
@@ -1,5 +1,33 @@
 --- src/base/low/cl_low_div.cc.orig	2011-04-08 21:07:28 UTC
 +++ src/base/low/cl_low_div.cc
+@@ -10,11 +10,11 @@
+ // Implementation.
+ 
+ #ifdef NEED_VAR_divu_16_rest
+-uint16 divu_16_rest;
++extern "C" uint16 divu_16_rest;
+ #endif
+ 
+ #ifdef NEED_FUNCTION_divu_3216_1616_
+-uint16 divu_16_rest;
++extern "C" uint16 divu_16_rest = 0;
+ namespace cln {
+ #if 1
+ // Most processors have a good 32 by 32 bit division, use that.
+@@ -101,11 +101,11 @@ uint32 divu_3232_3232_(uint32 x, uint32 y)
+ #endif
+ 
+ #ifdef NEED_VAR_divu_32_rest
+-uint32 divu_32_rest;
++extern "C" uint32 divu_32_rest;
+ #endif
+ 
+ #ifdef NEED_FUNCTION_divu_6432_3232_
+-uint32 divu_32_rest;
++extern "C" uint32 divu_32_rest = 0;
+ namespace cln {
+ uint32 divu_6432_3232_(uint32 xhi, uint32 xlo, uint32 y)
+ // Methode:
 @@ -207,7 +207,7 @@ uint32 divu_6432_3232_(uint32 xhi, uint32 xlo, uint32 
  #endif
  
diff --git a/math/cln/files/patch-src_base_low_cl__low__mul.cc b/math/cln/files/patch-src_base_low_cl__low__mul.cc
index 8e8c48c4de2e..4b53103cb060 100644
--- a/math/cln/files/patch-src_base_low_cl__low__mul.cc
+++ b/math/cln/files/patch-src_base_low_cl__low__mul.cc
@@ -1,5 +1,19 @@
 --- src/base/low/cl_low_mul.cc.orig	2011-04-08 21:06:30 UTC
 +++ src/base/low/cl_low_mul.cc
+@@ -10,11 +10,11 @@
+ // Implementation.
+ 
+ #ifdef NEED_VAR_mulu32_high
+-uint32 mulu32_high;
++extern "C" uint32 mulu32_high;
+ #endif
+ 
+ #ifdef NEED_FUNCTION_mulu32_
+-uint32 mulu32_high;
++extern "C" uint32 mulu32_high = 0;
+ namespace cln {
+ uint32 mulu32_ (uint32 x, uint32 y)
+ {
 @@ -50,11 +50,11 @@ uint64 mulu32_w (uint32 arg1, uint32 arg2)