From c31bc082abb6053191ce2bbadd08573c6e151ece Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Wed, 18 Jan 2017 00:42:05 +0100 Subject: [PATCH] libcln: Fix clang build - hopefully for real --- packages/libcln/build.sh | 1 + .../libcln/src-base-low-cl_low_div.cc.patch | 43 +++++++++++++------ .../libcln/src-base-low-cl_low_mul.cc.patch | 22 ++++++++-- 3 files changed, 50 insertions(+), 16 deletions(-) diff --git a/packages/libcln/build.sh b/packages/libcln/build.sh index e9488ee54..76f9e455b 100644 --- a/packages/libcln/build.sh +++ b/packages/libcln/build.sh @@ -1,6 +1,7 @@ TERMUX_PKG_HOMEPAGE=http://www.ginac.de/CLN/ TERMUX_PKG_DESCRIPTION="CLN is a library for efficient computations with all kinds of numbers in arbitrary precision" TERMUX_PKG_VERSION=1.3.4 +TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=http://www.ginac.de/CLN/cln-${TERMUX_PKG_VERSION}.tar.bz2 TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--with-gnu-ld=no" TERMUX_PKG_DEPENDS="libgmp" diff --git a/packages/libcln/src-base-low-cl_low_div.cc.patch b/packages/libcln/src-base-low-cl_low_div.cc.patch index fff4c4964..d7c8f311c 100644 --- a/packages/libcln/src-base-low-cl_low_div.cc.patch +++ b/packages/libcln/src-base-low-cl_low_div.cc.patch @@ -1,21 +1,40 @@ -Fix error building with clang: - -base/low/cl_low_div.cc:210:8: error: declaration of 'divu_64_rest' in global scope conflicts with declaration with C language link -age -uint64 divu_64_rest; - ^ -./base/cl_low.h:982:21: note: declared with C language linkage here -extern "C" uint64 divu_64_rest; // -> Rest r - diff -u -r ../cln-1.3.4/src/base/low/cl_low_div.cc ./src/base/low/cl_low_div.cc ---- ../cln-1.3.4/src/base/low/cl_low_div.cc 2011-04-08 23:07:28.000000000 +0200 -+++ ./src/base/low/cl_low_div.cc 2017-01-15 18:37:40.666599325 +0100 +--- ../cln-1.3.4/src/base/low/cl_low_div.cc 2011-04-08 21:07:28.000000000 +0000 ++++ ./src/base/low/cl_low_div.cc 2017-01-17 23:06:55.460210789 +0000 +@@ -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; } + namespace cln { + #if 1 + // Most processors have a good 32 by 32 bit division, use that. +@@ -101,11 +101,11 @@ + #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; } + namespace cln { + uint32 divu_6432_3232_(uint32 xhi, uint32 xlo, uint32 y) + // Methode: @@ -207,7 +207,7 @@ #endif #ifdef NEED_VAR_divu_64_rest -uint64 divu_64_rest; -+extern "C" uint64 divu_64_rest; ++extern "C" { uint64 divu_64_rest; } #endif #ifdef NEED_FUNCTION_divu_6464_6464_ diff --git a/packages/libcln/src-base-low-cl_low_mul.cc.patch b/packages/libcln/src-base-low-cl_low_mul.cc.patch index 5b25a0757..223d9cc56 100644 --- a/packages/libcln/src-base-low-cl_low_mul.cc.patch +++ b/packages/libcln/src-base-low-cl_low_mul.cc.patch @@ -1,17 +1,31 @@ diff -u -r ../cln-1.3.4/src/base/low/cl_low_mul.cc ./src/base/low/cl_low_mul.cc ---- ../cln-1.3.4/src/base/low/cl_low_mul.cc 2011-04-08 23:06:30.000000000 +0200 -+++ ./src/base/low/cl_low_mul.cc 2017-01-15 18:42:11.755489083 +0100 +--- ../cln-1.3.4/src/base/low/cl_low_mul.cc 2011-04-08 21:06:30.000000000 +0000 ++++ ./src/base/low/cl_low_mul.cc 2017-01-17 23:08:39.856001383 +0000 +@@ -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; } + namespace cln { + uint32 mulu32_ (uint32 x, uint32 y) + { @@ -50,11 +50,11 @@ #ifdef NEED_VAR_mulu64_high -uint64 mulu64_high; -+extern "C" uint64 mulu64_high; ++extern "C" { uint64 mulu64_high; } #endif #ifdef NEED_FUNCTION_mulu64_ -uint64 mulu64_high; -+extern "C" uint64 mulu64_high; ++extern "C" { uint64 mulu64_high; } namespace cln { extern "C" uint64 mulu64_ (uint64 x, uint64 y); uint64 mulu64_ (uint64 x, uint64 y)