pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkg/52599



The following reply was made to PR pkg/52599; it has been noted by GNATS.

From: Matthias Petermann <mp%petermann-it.de@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: ben@pocket.services
Subject: Re: pkg/52599
Date: Fri, 13 Apr 2018 20:05:39 +0200

 Hello,
 
 the cause of this problem is that in NetBSD versions less than 7.99.71, 
 the llroundl function is missing in the libm. Hereby, I submit a patch 
 that emulates the missing function on these systems by casting the 
 return value of the existing function roundl to long long int.
 
 A comparable implementation is also found in the libgfortran of gcc, for 
 example:
 
 https://github.com/gcc-mirror/gcc/blob/4910e96964a257b8414783a70675b1ca1c141834/libgfortran/intrinsics/c99_functions.c#L718
 
 I have tested the patch on NetBSD 7.1.2. The Redis test suite runs 
 without any complaints (make test).
 
 I'd be happy if one of the committers could review and commit to HEAD 
 and the 2018Q1 branch.
 
 Kind regards,
 Matthias
 
 Patch:
 --------->8---------------------------------------------------------------------------------
 
 diff -ruN redis.orig/Makefile redis/Makefile
 --- redis.orig/Makefile	2018-04-13 16:27:37.000000000 +0000
 +++ redis/Makefile	2018-04-13 16:29:05.000000000 +0000
 @@ -1,6 +1,7 @@
   # $NetBSD: Makefile,v 1.36 2018/02/04 17:13:05 fhajny Exp $
 
   DISTNAME=	redis-4.0.8
 +PKGREVISION=	1
   CATEGORIES=	databases
   MASTER_SITES=	http://download.redis.io/releases/
 
 diff -ruN redis.orig/distinfo redis/distinfo
 --- redis.orig/distinfo	2018-04-13 16:27:37.000000000 +0000
 +++ redis/distinfo	2018-04-13 16:37:04.000000000 +0000
 @@ -6,4 +6,5 @@
   Size (redis-4.0.8.tar.gz) = 1729973 bytes
   SHA1 (patch-ab) = f8d2d20a5ae49ecd49a452b6e260f5a37b0d52e0
   SHA1 (patch-ac) = 1d848860a39af7a93a06eb8f3001fe89cb1bb3ad
 +SHA1 (patch-src_hyperloglog.c) = 57ca74b5a63c5bafb10f6b850f672eedf193fb11
   SHA1 (patch-src_object.c) = 30ffaec9c7e6135e3a5576cd1a35d7bcec668299
 diff -ruN redis.orig/patches/patch-src_hyperloglog.c 
 redis/patches/patch-src_hyperloglog.c
 --- redis.orig/patches/patch-src_hyperloglog.c	1970-01-01 
 00:00:00.000000000 +0000
 +++ redis/patches/patch-src_hyperloglog.c	2018-04-13 16:36:06.000000000 
 +0000
 @@ -0,0 +1,21 @@
 +$NetBSD$
 +
 +--- src/hyperloglog.c.orig	2018-04-13 16:30:09.000000000 +0000
 ++++ src/hyperloglog.c
 +@@ -34,6 +34,16 @@
 + #include <stdint.h>
 + #include <math.h>
 +
 ++#ifdef __NetBSD__
 ++#include <sys/param.h>
 ++#if __NetBSD_Version__ < 799007200
 ++/* llroundl not present in NetBSD libm before 7.99.71 */
 ++long long int llroundl (long double x) {
 ++    return (long long int) roundl (x);
 ++}
 ++#endif
 ++#endif
 ++
 + /* The Redis HyperLogLog implementation is based on the following ideas:
 +  *
 +  * * The use of a 64 bit hash function as proposed in [1], in order to 
 don't
 
 --------->8---------------------------------------------------------------------------------
 
 
 -- 
 Matthias Petermann <matthias%petermann-it.de@localhost> | www.petermann-it.de
 GnuPG: 0x5C3E6D75 | 5930 86EF 7965 2BBA 6572  C3D7 7B1D A3C3 5C3E 6D75
 


Home | Main Index | Thread Index | Old Index