diff options
author | schmonz <schmonz@pkgsrc.org> | 2020-08-24 12:58:52 +0000 |
---|---|---|
committer | schmonz <schmonz@pkgsrc.org> | 2020-08-24 12:58:52 +0000 |
commit | 939ef59f0f7f580477935b7c4b940ca68a4961f5 (patch) | |
tree | 3d3dcb6c663291b8ef61acdb95f03d3fc5ef4fb7 /misc/rhash | |
parent | f337cf937403dfeb8f02dd0b41713f3c1eaa4fad (diff) | |
download | pkgsrc-939ef59f0f7f580477935b7c4b940ca68a4961f5.tar.gz |
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 (limited to 'misc/rhash')
-rw-r--r-- | misc/rhash/distinfo | 4 | ||||
-rw-r--r-- | misc/rhash/patches/patch-configure | 24 | ||||
-rw-r--r-- | misc/rhash/patches/patch-librhash_util.h | 16 |
3 files changed, 43 insertions, 1 deletions
diff --git a/misc/rhash/distinfo b/misc/rhash/distinfo index a9e79661815..e2a54bd4da1 100644 --- a/misc/rhash/distinfo +++ b/misc/rhash/distinfo @@ -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 --git a/misc/rhash/patches/patch-configure b/misc/rhash/patches/patch-configure new file mode 100644 index 00000000000..6a0db15f3dc --- /dev/null +++ b/misc/rhash/patches/patch-configure @@ -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 --git a/misc/rhash/patches/patch-librhash_util.h b/misc/rhash/patches/patch-librhash_util.h new file mode 100644 index 00000000000..804848209fd --- /dev/null +++ b/misc/rhash/patches/patch-librhash_util.h @@ -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> |