Source-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/misc/rhash Avoid choosing aligned_alloc() when it's no...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/2cb8855d74d4
branches:  trunk
changeset: 437490:2cb8855d74d4
user:      schmonz <schmonz%pkgsrc.org@localhost>
date:      Mon Aug 24 12:58:52 2020 +0000

description:
Avoid choosing aligned_alloc() when it's not present. Fixes build on
CentOS 6 with lang/gcc7. Verified noop for CentOS 7 with gcc7, Ubuntu
16/18/19, macOS Catalina, NetBSD 9, FreeBSD 12.1, OpenBSD 6.7,
Tribblix m22.

diffstat:

 misc/rhash/distinfo                      |   4 +++-
 misc/rhash/patches/patch-configure       |  24 ++++++++++++++++++++++++
 misc/rhash/patches/patch-librhash_util.h |  16 ++++++++++++++++
 3 files changed, 43 insertions(+), 1 deletions(-)

diffs (61 lines):

diff -r 588a3aaa65c6 -r 2cb8855d74d4 misc/rhash/distinfo
--- a/misc/rhash/distinfo       Mon Aug 24 12:46:34 2020 +0000
+++ b/misc/rhash/distinfo       Mon Aug 24 12:58:52 2020 +0000
@@ -1,6 +1,8 @@
-$NetBSD: distinfo,v 1.14 2020/07/15 07:15:39 adam Exp $
+$NetBSD: distinfo,v 1.15 2020/08/24 12:58:52 schmonz Exp $
 
 SHA1 (rhash-1.4.0.tar.gz) = 3db1e87a31c77ca2fa5507db7932ef92e9eb5148
 RMD160 (rhash-1.4.0.tar.gz) = 2174ab3edda6f84b75bce52a8a9fca1a65109d08
 SHA512 (rhash-1.4.0.tar.gz) = 2f02487fffe8d1bc70c4454829bbd250a15fbd09db5ef85c54d3e8ad1008e84616ea54483292deae45047a27964e27b26d9b3da8447e7c37dac1e2ce18a63a07
 Size (rhash-1.4.0.tar.gz) = 406433 bytes
+SHA1 (patch-configure) = ed8e4fc7106cd59f0e25f807ad588a219a798e92
+SHA1 (patch-librhash_util.h) = 78d34ff14a7d03069915de0ade14f3d0faff2d69
diff -r 588a3aaa65c6 -r 2cb8855d74d4 misc/rhash/patches/patch-configure
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/rhash/patches/patch-configure        Mon Aug 24 12:58:52 2020 +0000
@@ -0,0 +1,24 @@
+$NetBSD: patch-configure,v 1.1 2020/08/24 12:58:52 schmonz Exp $
+
+Avoid choosing aligned_alloc() when it's not present, such as CentOS 6
+with lang/gcc7.
+
+--- configure.orig     2020-07-14 19:35:11.000000000 +0000
++++ configure
+@@ -655,6 +655,16 @@ elif test "$OPT_OPENSSL" = "auto" || tes
+   finish_check "$ALLOW_RUNTIME_LINKING"
+ fi
+ 
++start_check "libc provides aligned_alloc"
++HAS_STDC_ALIGNED_ALLOC=no
++if cc_check_statement "stdlib.h" 'aligned_alloc(256, 1024);' "-Werror -Wno-unused-result"; then
++  HAS_STDC_ALIGNED_ALLOC=yes
++fi
++if test "$HAS_STDC_ALIGNED_ALLOC" = "no"; then
++  BUILD_EXTRA_CFLAGS=$(join_params $BUILD_EXTRA_CFLAGS -DNOPE_DOES_NOT_HAS_STDC_ALIGNED_ALLOC)
++fi
++finish_check "$HAS_STDC_ALIGNED_ALLOC"
++
+ SHARED_VSCRIPT=
+ if ! darwin; then
+   start_check "linker support for --version-script"
diff -r 588a3aaa65c6 -r 2cb8855d74d4 misc/rhash/patches/patch-librhash_util.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/rhash/patches/patch-librhash_util.h  Mon Aug 24 12:58:52 2020 +0000
@@ -0,0 +1,16 @@
+$NetBSD: patch-librhash_util.h,v 1.1 2020/08/24 12:58:52 schmonz Exp $
+
+Avoid choosing aligned_alloc() when it's not present, such as CentOS 6
+with lang/gcc7.
+
+--- librhash/util.h.orig       2020-07-14 19:35:11.000000000 +0000
++++ librhash/util.h
+@@ -39,7 +39,7 @@ extern "C" {
+ # define rhash_aligned_alloc(alignment, size) _aligned_malloc((size), (alignment))
+ # define rhash_aligned_free(ptr) _aligned_free(ptr)
+ 
+-#elif (__STDC_VERSION__ >= 201112L || defined(_ISOC11_SOURCE)) && !defined(__APPLE__)
++#elif (__STDC_VERSION__ >= 201112L || defined(_ISOC11_SOURCE)) && !defined(__APPLE__) && !defined(NOPE_DOES_NOT_HAS_STDC_ALIGNED_ALLOC)
+ 
+ # define HAS_STDC_ALIGNED_ALLOC
+ # include <stdlib.h>



Home | Main Index | Thread Index | Old Index