about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/aws-c-cal/aws-c-cal-musl-compat.patch
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/aws-c-cal/aws-c-cal-musl-compat.patch')
-rw-r--r--nixpkgs/pkgs/development/libraries/aws-c-cal/aws-c-cal-musl-compat.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/aws-c-cal/aws-c-cal-musl-compat.patch b/nixpkgs/pkgs/development/libraries/aws-c-cal/aws-c-cal-musl-compat.patch
new file mode 100644
index 000000000000..2cf1d4e81e0b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/aws-c-cal/aws-c-cal-musl-compat.patch
@@ -0,0 +1,33 @@
+From: Emil Lerch <emil@lerch.org>
+Date: Wed, 28 Apr 2021 17:46:24 -0700
+Subject: [PATCH] Allow dlopen to fail on musl systems
+
+Now that references are forced when linking statically, the assertion is
+no longer necessary. See https://github.com/awslabs/aws-c-cal/pull/54
+---
+ source/unix/openssl_platform_init.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/source/unix/openssl_platform_init.c b/source/unix/openssl_platform_init.c
+index 5266ecc1..99f210bd 100644
+--- a/source/unix/openssl_platform_init.c
++++ b/source/unix/openssl_platform_init.c
+@@ -496,7 +502,6 @@ static enum aws_libcrypto_version s_resolve_libcrypto(void) {
+     /* Try to auto-resolve against what's linked in/process space */
+     FLOGF("searching process and loaded modules");
+     void *process = dlopen(NULL, RTLD_NOW);
+-    AWS_FATAL_ASSERT(process && "Unable to load symbols from process space");
+     enum aws_libcrypto_version result = s_resolve_libcrypto_symbols(AWS_LIBCRYPTO_LC, process);
+     if (result == AWS_LIBCRYPTO_NONE) {
+         result = s_resolve_libcrypto_symbols(AWS_LIBCRYPTO_1_0_2, process);
+@@ -504,7 +509,9 @@ static enum aws_libcrypto_version s_resolve_libcrypto(void) {
+     if (result == AWS_LIBCRYPTO_NONE) {
+         result = s_resolve_libcrypto_symbols(AWS_LIBCRYPTO_1_1_1, process);
+     }
+-    dlclose(process);
++    if (process) {
++        dlclose(process);
++    }
+ 
+     if (result == AWS_LIBCRYPTO_NONE) {
+         FLOGF("libcrypto symbols were not statically linked, searching for shared libraries");