summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Janda <felix.janda@posteo.de>2016-10-11 19:43:45 -0400
committerAnthony G. Basile <blueness@gentoo.org>2016-10-13 05:03:56 -0400
commit26ab0d26a3447e795e3766c08a599b41d974d81b (patch)
tree71aa96e5a7cd084c79a17e9e4f9b60dbeee805b5 /net-proxy/torsocks/files
parentdev-util/plan9port: remove unused patch (diff)
downloadgentoo-26ab0d26a3447e795e3766c08a599b41d974d81b.tar.gz
gentoo-26ab0d26a3447e795e3766c08a599b41d974d81b.tar.bz2
gentoo-26ab0d26a3447e795e3766c08a599b41d974d81b.zip
net-proxy/torsocks: fix build with musl libc, bump eapi
Gentoo-Bug: https://bugs.gentoo.org/583730 Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'net-proxy/torsocks/files')
-rw-r--r--net-proxy/torsocks/files/torsocks-2.1.0-musl.patch121
1 files changed, 121 insertions, 0 deletions
diff --git a/net-proxy/torsocks/files/torsocks-2.1.0-musl.patch b/net-proxy/torsocks/files/torsocks-2.1.0-musl.patch
new file mode 100644
index 000000000000..c11cf6915506
--- /dev/null
+++ b/net-proxy/torsocks/files/torsocks-2.1.0-musl.patch
@@ -0,0 +1,121 @@
+From 3e793e9eac05ad926cc016da5129e95986d105f2 Mon Sep 17 00:00:00 2001
+From: David Goulet <dgoulet@ev0ke.net>
+Date: Mon, 13 Jun 2016 14:39:53 -0400
+Subject: [PATCH] Add support for musl-libc
+
+Musl library does not have a specific define so use __linux__ instead.
+
+Signed-off-by: David Goulet <dgoulet@ev0ke.net>
+---
+ src/common/compat.c | 5 +++--
+ src/common/compat.h | 5 +++--
+ src/common/ref.h | 5 +++--
+ src/lib/torsocks.h | 9 +++++----
+ 4 files changed, 14 insertions(+), 10 deletions(-)
+
+diff --git a/src/common/compat.c b/src/common/compat.c
+index a861b3d..323f2ed 100644
+--- a/src/common/compat.c
++++ b/src/common/compat.c
+@@ -19,7 +19,8 @@
+
+ #include "compat.h"
+
+-#if (defined(__GLIBC__) || defined(__FreeBSD__) || defined(__darwin__) || defined(__NetBSD__))
++#if (defined(__linux__) || defined(__GLIBC__) || defined(__FreeBSD__) || \
++ defined(__darwin__) || defined(__NetBSD__))
+
+ /*
+ * Initialize a pthread mutex. This never fails.
+@@ -96,4 +97,4 @@ void tsocks_once(tsocks_once_t *o, void (*init_routine)(void))
+ tsocks_mutex_unlock(&o->mutex);
+ }
+
+-#endif /* __GLIBC__, __darwin__, __FreeBSD__, __NetBSD__ */
++#endif /* __linux__, __GLIBC__, __darwin__, __FreeBSD__, __NetBSD__ */
+diff --git a/src/common/compat.h b/src/common/compat.h
+index ce47129..6c8ce32 100644
+--- a/src/common/compat.h
++++ b/src/common/compat.h
+@@ -22,7 +22,8 @@
+ #define __darwin__ 1
+ #endif
+
+-#if (defined(__GLIBC__) || defined(__FreeBSD__) || defined(__darwin__) || defined(__NetBSD__))
++#if (defined(__linux__) || defined(__GLIBC__) || defined(__FreeBSD__) || \
++ defined(__darwin__) || defined(__NetBSD__))
+
+ #define RTLD_NEXT ((void *) -1)
+
+@@ -55,7 +56,7 @@ void tsocks_once(tsocks_once_t *o, void (*init_routine)(void));
+
+ #else
+ #error "OS not supported."
+-#endif /* __GLIBC__, __darwin__, __FreeBSD__, __NetBSD__ */
++#endif /* __linux__, __GLIBC__, __darwin__, __FreeBSD__, __NetBSD__ */
+
+ #if defined(__linux__)
+ #include <unistd.h>
+diff --git a/src/common/ref.h b/src/common/ref.h
+index 88aec2e..d9b9df8 100644
+--- a/src/common/ref.h
++++ b/src/common/ref.h
+@@ -26,7 +26,8 @@ struct ref {
+ long count;
+ };
+
+-#if (defined(__GLIBC__) || defined(__FreeBSD__) || defined(__darwin__) || defined(__NetBSD__))
++#if (defined(__linux__) || defined(__GLIBC__) || defined(__FreeBSD__) || \
++ defined(__darwin__) || defined(__NetBSD__))
+
+ /*
+ * Get a reference by incrementing the refcount.
+@@ -57,6 +58,6 @@ static inline void ref_put(struct ref *r,
+
+ #else
+ #error "OS not supported"
+-#endif /* __GLIBC__, __FreeBSD__, __darwin__ */
++#endif /* __linux__, __GLIBC__, __FreeBSD__, __darwin__, __NetBSD__ */
+
+ #endif /* TORSOCKS_REF_H */
+diff --git a/src/lib/torsocks.h b/src/lib/torsocks.h
+index 076f3a5..0eeef2a 100644
+--- a/src/lib/torsocks.h
++++ b/src/lib/torsocks.h
+@@ -33,7 +33,8 @@
+ #define TSOCKS_DECL(name, type, sig) \
+ extern type tsocks_##name(sig);
+
+-#if (defined(__GLIBC__) || defined(__FreeBSD__) || defined(__darwin__) || defined(__NetBSD__))
++#if (defined(__linux__) || defined(__GLIBC__) || defined(__FreeBSD__) || \
++ defined(__darwin__) || defined(__NetBSD__))
+
+ /* connect(2) */
+ #include <sys/types.h>
+@@ -207,7 +208,7 @@ struct hostent **result, int *h_errnop
+
+ #else
+ #error "OS not supported."
+-#endif /* __GLIBC__ , __FreeBSD__, __darwin__, __NetBSD__ */
++#endif /* __linux__, __GLIBC__ , __FreeBSD__, __darwin__, __NetBSD__ */
+
+ #if (defined(__linux__))
+
+@@ -241,7 +242,7 @@ struct hostent **result, int *h_errnop
+
+ #endif /* __FreeBSD__, __darwin__, __NetBSD__ */
+
+-#if defined(__GLIBC__) && defined(__FreeBSD_kernel__)
++#if (defined(__linux__) || defined(__GLIBC__)) && defined(__FreeBSD_kernel__)
+
+ /* syscall(2) */
+ #define LIBC_SYSCALL_NAME syscall
+@@ -250,7 +251,7 @@ struct hostent **result, int *h_errnop
+ #define LIBC_SYSCALL_SIG long int number, ...
+ #define LIBC_SYSCALL_ARGS number
+
+-#endif /* __GLIBC__ && __FreeBSD_kernel__ */
++#endif /* (__linux__ || __GLIBC__) && __FreeBSD_kernel__ */
+
+ /* __syscall(2) */
+ #if defined(__FreeBSD__)