Skip to content

Commit

Permalink
math/cln: unbreak on armv7
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
clausecker authored and MikaelUrankar committed Dec 21, 2021
1 parent 7a9f4b3 commit 8288c59
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
1 change: 1 addition & 0 deletions math/cln/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
28 changes: 28 additions & 0 deletions math/cln/files/patch-src_base_low_cl__low__div.cc
Original file line number Diff line number Diff line change
@@ -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

Expand Down
14 changes: 14 additions & 0 deletions math/cln/files/patch-src_base_low_cl__low__mul.cc
Original file line number Diff line number Diff line change
@@ -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)


Expand Down

0 comments on commit 8288c59

Please sign in to comment.