Skip to content

Commit

Permalink
nodejs: Work around getentropy issue on SunOS.
Browse files Browse the repository at this point in the history
Noticed by Stefan Husch in #203.
  • Loading branch information
jperkin authored and Jonathan Perkin committed Jul 2, 2019
1 parent 7ec4336 commit 19b02a7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lang/nodejs/distinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$NetBSD: distinfo,v 1.149 2019/05/31 20:52:00 adam Exp $
$NetBSD: distinfo,v 1.150 2019/07/02 17:09:25 jperkin Exp $

SHA1 (node-v10.16.0.tar.gz) = 7e228646ef32c7eb4e509c220201366d6e86cc36
RMD160 (node-v10.16.0.tar.gz) = 7a5610db052012bff785a16a522703c458f725d5
Expand All @@ -18,6 +18,7 @@ SHA1 (patch-deps_openssl_openssl-cl__no__asm.gypi) = 73368f336dbe500e45f0ba6bbb7
SHA1 (patch-deps_openssl_openssl__asm.gypi) = b85e1f5a9f862d469afcb36ff6e1ad202bea704a
SHA1 (patch-deps_openssl_openssl__no__asm.gypi) = b549ea34f51e26669a41a64da0db10e92f0d0a99
SHA1 (patch-deps_openssl_openssl_crypto_init.c) = e544fb218fd927a6d7097df3718c145750198555
SHA1 (patch-deps_openssl_openssl_crypto_rand_rand__unix.c) = ba8d4602c3386801ad8d3c33c757c69ad3d25a34
SHA1 (patch-deps_uv_common.gypi) = d38a9c8d9e3522f15812aec2f5b1e1e636d4bab3
SHA1 (patch-deps_uv_src_unix_netbsd.c) = 76b27ae86aa80582554ee824146ee7c42c33883b
SHA1 (patch-deps_v8_src_arm_assembler-arm-inl.h) = 56a5d6539d31e19673ef61cc91f003109c69dc29
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
$NetBSD: patch-deps_openssl_openssl_crypto_rand_rand__unix.c,v 1.1 2019/07/02 17:09:25 jperkin Exp $

Don't try to automatically call getentropy(3C) on SunOS, it fails if
built on a platform that doesn't have it.

--- deps/openssl/openssl/crypto/rand/rand_unix.c.orig 2019-05-28 21:32:16.000000000 +0000
+++ deps/openssl/openssl/crypto/rand/rand_unix.c
@@ -301,7 +301,7 @@ static ssize_t syscall_random(void *buf,
* - Linux since 3.17 with glibc 2.25
* - FreeBSD since 12.0 (1200061)
*/
-# if defined(__GNUC__) && __GNUC__>=2 && defined(__ELF__) && !defined(__hpux)
+# if defined(__GNUC__) && __GNUC__>=2 && defined(__ELF__) && !defined(__hpux) && !defined(__sun)
extern int getentropy(void *buffer, size_t length) __attribute__((weak));

if (getentropy != NULL)

0 comments on commit 19b02a7

Please sign in to comment.