libevent: update to 2.1.8
[openwrt/staging/mkresin.git] / package / libs / libevent2 / patches / 0001-Do-not-check-for-ERR_remove_thread_state-do-not-link.patch
1 From f519e0f30a00393b949c4e20868952726a9c6d2e Mon Sep 17 00:00:00 2001
2 From: Pierce Lopez <pierce.lopez@gmail.com>
3 Date: Thu, 2 Mar 2017 21:09:32 -0500
4 Subject: [PATCH] Do not check for ERR_remove_thread_state() (do not link ssl
5 into every library)
6
7 This reverts commit c4e9d9bd662de7f575f2172c160795d452ebe709
8 ("sample/https-client: check for ERR_remove_thread_state() existence").
9
10 Calling AC_SEARCH_LIBS() modifies LIBS - -lcrypto incorrectly
11 ends up in LIBS, and thus linked to by libevent_core.so.
12
13 Checking for ERR_remove_thread_state should no longer be needed
14 because it was introduced in openssl 1.0.0, and the previous line
15 0.9.8 had support discontinued at the end of 2015.
16
17 Fixes: #473
18 ---
19 CMakeLists.txt | 4 ----
20 configure.ac | 4 ----
21 event-config.h.cmake | 3 ---
22 sample/https-client.c | 4 ----
23 4 files changed, 15 deletions(-)
24
25 diff --git a/CMakeLists.txt b/CMakeLists.txt
26 index b4a34f3d..28d6c22c 100644
27 --- a/CMakeLists.txt
28 +++ b/CMakeLists.txt
29 @@ -877,10 +877,6 @@ if (NOT EVENT__DISABLE_SAMPLES)
30 time-test)
31
32 if (NOT EVENT__DISABLE_OPENSSL AND OPENSSL_LIBRARIES)
33 - set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES})
34 - CHECK_FUNCTION_EXISTS_EX(ERR_remove_thread_state EVENT__HAVE_ERR_REMOVE_THREAD_STATE)
35 - set(CMAKE_REQUIRED_LIBRARIES "")
36 -
37 # Special sample with more than one file.
38 add_executable(https-client
39 sample/https-client.c
40 diff --git a/configure.ac b/configure.ac
41 index 7528d37e..3f137277 100644
42 --- a/configure.ac
43 +++ b/configure.ac
44 @@ -791,10 +791,6 @@ fi
45
46 # check if we have and should use openssl
47 AM_CONDITIONAL(OPENSSL, [test "$enable_openssl" != "no" && test "$have_openssl" = "yes"])
48 -if test "x$enable_openssl" = "xyes"; then
49 - AC_SEARCH_LIBS([ERR_remove_thread_state], [crypto eay32],
50 - [AC_DEFINE(HAVE_ERR_REMOVE_THREAD_STATE, 1, [Define to 1 if you have ERR_remove_thread_stat().])])
51 -fi
52
53 # Add some more warnings which we use in development but not in the
54 # released versions. (Some relevant gcc versions can't handle these.)
55 diff --git a/event-config.h.cmake b/event-config.h.cmake
56 index c1355be9..cb363be8 100644
57 --- a/event-config.h.cmake
58 +++ b/event-config.h.cmake
59 @@ -523,9 +523,6 @@
60
61 #cmakedefine EVENT__NEED_DLLIMPORT
62
63 -/* Define to 1 if you have ERR_remove_thread_stat(). */
64 -#cmakedefine EVENT__HAVE_ERR_REMOVE_THREAD_STATE
65 -
66 /* Define if waitpid() supports WNOWAIT */
67 #cmakedefine EVENT__HAVE_WAITPID_WITH_WNOWAIT
68
69 diff --git a/sample/https-client.c b/sample/https-client.c
70 index 74839565..2ed6fb74 100644
71 --- a/sample/https-client.c
72 +++ b/sample/https-client.c
73 @@ -484,11 +484,7 @@ cleanup:
74 EVP_cleanup();
75 ERR_free_strings();
76
77 -#ifdef EVENT__HAVE_ERR_REMOVE_THREAD_STATE
78 ERR_remove_thread_state(NULL);
79 -#else
80 - ERR_remove_state(0);
81 -#endif
82 CRYPTO_cleanup_all_ex_data();
83
84 sk_SSL_COMP_free(SSL_COMP_get_compression_methods());
85 --
86 2.17.0
87