[Debian-med-packaging] Bug#742843: altree: FTBFS with clang instead of gcc

Andreas Tille tille at debian.org
Fri Mar 28 07:23:06 UTC 2014


Hi Vincent,

it might be reasonable to include this patch into upstream.  So please
confirm if you want to care for this or just throw ENOTIME error if you
want somebody else just update the package quickly.

Kind regards

       Andreas.

On Thu, Mar 27, 2014 at 07:23:10PM -0500, Arthur Marble wrote:
> Package: altree
> Severity: minor
> Usertags: clang-ftbfs
> User: pkg-llvm-team at lists.alioth.debian.org
> Tag: patch
> 
> 
> Hello,
> 
> Using the rebuild infrastructure, your package fails to build with clang 
> (instead of gcc).
> 
> Thanks,
> Arthur

> diff -Naur altree.orig/altree-1.3.1/debian/changelog altree/altree-1.3.1/debian/changelog
> --- altree.orig/altree-1.3.1/debian/changelog	2013-12-13 16:38:21.000000000 -0600
> +++ altree/altree-1.3.1/debian/changelog	2014-03-27 19:16:36.626359549 -0500
> @@ -1,3 +1,13 @@
> +altree (1.3.1-2) unstable; urgency=low
> +
> +  * Fix FTBFS with clang:
> +    - Fixed 'Function definition is not allowed here' error
> +    - In CUtils/c_sources/rhyper.c I removed the compute function
> +      and I moved the code into the else if clause
> +    - Variable i from compute is now x and n is now i      
> +
> + -- Arthur Marble <arthur at info9.net>  Thu, 27 Mar 2014 19:16:36 -0500
> +
>  altree (1.3.1-1) unstable; urgency=low
>  
>    * New upstream release
> diff -Naur altree.orig/altree-1.3.1/debian/patches/clang-ftbfs.diff altree/altree-1.3.1/debian/patches/clang-ftbfs.diff 
> --- altree.orig/altree-1.3.1/debian/patches/clang-ftbfs.diff	1969-12-31 18:00:00.000000000 -0600
> +++ altree/altree-1.3.1/debian/patches/clang-ftbfs.diff	2014-03-27 19:18:52.698361918 -0500
> @@ -0,0 +1,67 @@
> +--- a/CUtils/c_sources/rhyper.c
> ++++ b/CUtils/c_sources/rhyper.c
> +@@ -52,6 +52,10 @@
> +  *	   If (i > 7), use Stirling's approximation, otherwise use table lookup.
> + */
> + 
> ++double compute(int n) {
> ++};
> ++
> ++
> + static double afc(int i)
> + {
> +     static int computed=10;
> +@@ -70,27 +74,6 @@ static double afc(int i)
> + 	12.8018274800814696,/*ln(9!)*/
> + 	15.1044125730755153,/*ln(10!)*/
> +     };
> +-    double compute(int n) {
> +-	static long double cur=3628800;
> +-	static int i=11;
> +-	static volatile int mutex=0;
> +-
> +-	while (__sync_lock_test_and_set(&mutex, 1)) {
> +-		/* Internal loop with only read to avoid cache line ping-pong
> +-		   on multi-processors */
> +-		while(mutex) {
> +-			/* spinlock */
> +-		}
> +-	}
> +-
> +-	for(; i<=n; i++) {
> +-		cur*=i;
> +-		al[i+1]=logl(cur);
> +-	}
> +-	computed=n;
> +-	__sync_lock_release(&mutex);
> +-	return al[i];
> +-    };
> + 
> +     double di, value;
> + 
> +@@ -100,7 +83,24 @@ static double afc(int i)
> +     } else if (i <= computed) {
> + 	value = al[i + 1];
> +     } else if (i <= 1754) {
> +-	value = compute(i);
> ++	static long double cur=3628800;
> ++	static int x=11;
> ++	static volatile int mutex=0;
> ++
> ++	while (__sync_lock_test_and_set(&mutex, 1)) {
> ++	     /* Internal loop with only read to avoid cache line ping-pong
> ++		on multi-processors */
> ++	     while(mutex) {
> ++		 /* spinlock */
> ++	     }
> ++	 }
> ++
> ++	 for(; x<=i; x++) {
> ++	     cur*=i;
> ++	     al[i+1]=logl(cur);
> ++	 }
> ++	 computed=i;
> ++         __sync_lock_release(&mutex);
> +     } else {
> + 	di = i;
> + 	value = (di + 0.5) * log(di) - di + 0.08333333333333 / di
> diff -Naur altree.orig/altree-1.3.1/debian/patches/series altree/altree-1.3.1/debian/patches/series 
> --- altree.orig/altree-1.3.1/debian/patches/series	1969-12-31 18:00:00.000000000 -0600
> +++ altree/altree-1.3.1/debian/patches/series	2014-03-27 18:50:00.978331761 -0500
> @@ -0,0 +1 @@
> +clang-ftbfs.diff

> _______________________________________________
> Debian-med-packaging mailing list
> Debian-med-packaging at lists.alioth.debian.org
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/debian-med-packaging


-- 
http://fam-tille.de



More information about the Debian-med-packaging mailing list