From 03d030d3472bb4fcc6b4460b0b1da6dfec290a85 Mon Sep 17 00:00:00 2001 From: zhoulq1024 <1248471212@qq.com> Date: Fri, 15 Oct 2021 10:33:45 +0800 Subject: [PATCH] add libevent patch and src sha256 --- components/utility/libevent/origin.patch | 89 ++++++++++++++++++++++++ components/utility/libevent/patch.sha256 | 1 + components/utility/libevent/src.sha256 | 1 + 3 files changed, 91 insertions(+) create mode 100644 components/utility/libevent/origin.patch create mode 100644 components/utility/libevent/patch.sha256 create mode 100644 components/utility/libevent/src.sha256 diff --git a/components/utility/libevent/origin.patch b/components/utility/libevent/origin.patch new file mode 100644 index 0000000..a2b4ce3 --- /dev/null +++ b/components/utility/libevent/origin.patch @@ -0,0 +1,89 @@ +diff -Nur a/libevent-2.1.12/arc4random.c b/libevent-2.1.12/arc4random.c +--- a/libevent-2.1.12/arc4random.c 2020-07-05 20:02:46.000000000 +0800 ++++ b/libevent-2.1.12/arc4random.c 2021-10-14 17:19:32.372375922 +0800 +@@ -72,6 +72,13 @@ + #include + #endif + ++#include "util-internal.h" ++#include "evthread-internal.h" ++ ++#define ARC4_LOCK_() EVLOCK_LOCK(arc4rand_lock, 0) ++#define ARC4_UNLOCK_() EVLOCK_UNLOCK(arc4rand_lock, 0) ++static void *arc4rand_lock; ++ + /* Add platform entropy 32 bytes (256 bits) at a time. */ + #define ADD_ENTROPY 32 + +diff -Nur a/libevent-2.1.12/epoll_sub.c b/libevent-2.1.12/epoll_sub.c +--- a/libevent-2.1.12/epoll_sub.c 2020-07-05 20:02:46.000000000 +0800 ++++ b/libevent-2.1.12/epoll_sub.c 2021-10-14 17:19:16.922000663 +0800 +@@ -34,6 +34,10 @@ + #include + #include + ++#define __NR_epoll_create1 20 ++#define __NR_epoll_ctl 21 ++#define __NR_epoll_wait 252 ++ + int + epoll_create(int size) + { +diff -Nur a/libevent-2.1.12/evutil.c b/libevent-2.1.12/evutil.c +--- a/libevent-2.1.12/evutil.c 2020-07-05 20:02:46.000000000 +0800 ++++ b/libevent-2.1.12/evutil.c 2021-10-14 17:18:37.287728819 +0800 +@@ -202,7 +202,9 @@ + evutil_socketpair(int family, int type, int protocol, evutil_socket_t fd[2]) + { + #ifndef _WIN32 +- return socketpair(family, type, protocol, fd); ++ //return socketpair(family, type, protocol, fd); ++ printf("liteos no support socketpair.\n"); ++ return 0; + #else + return evutil_ersatz_socketpair_(family, type, protocol, fd); + #endif +diff -Nur a/libevent-2.1.12/log.c b/libevent-2.1.12/log.c +--- a/libevent-2.1.12/log.c 2020-07-05 20:02:46.000000000 +0800 ++++ b/libevent-2.1.12/log.c 2021-10-14 17:18:07.642962540 +0800 +@@ -89,6 +89,8 @@ + static void + event_exit(int errcode) + { ++ printf("liteos not support exit.\n"); ++#if 0 + if (fatal_fn) { + fatal_fn(errcode); + exit(errcode); /* should never be reached */ +@@ -96,6 +98,7 @@ + abort(); + else + exit(errcode); ++#endif + } + + void +diff -Nur a/libevent-2.1.12/log-internal.h b/libevent-2.1.12/log-internal.h +--- a/libevent-2.1.12/log-internal.h 2020-07-05 20:02:46.000000000 +0800 ++++ b/libevent-2.1.12/log-internal.h 2021-10-14 17:17:58.780374714 +0800 +@@ -33,7 +33,8 @@ + extern "C" { + #endif + +-#ifdef __GNUC__ ++//#ifdef __GNUC__ ++#ifndef __LITEOS__ + #define EV_CHECK_FMT(a,b) __attribute__((format(printf, a, b))) + #define EV_NORETURN __attribute__((noreturn)) + #else +diff -Nur a/libevent-2.1.12/WIN32-Code/nmake/event2/event-config.h b/libevent-2.1.12/WIN32-Code/nmake/event2/event-config.h +--- a/libevent-2.1.12/WIN32-Code/nmake/event2/event-config.h 2020-07-05 20:02:46.000000000 +0800 ++++ b/libevent-2.1.12/WIN32-Code/nmake/event2/event-config.h 2021-10-14 17:16:57.609661002 +0800 +@@ -345,6 +345,6 @@ + #define EVENT__socklen_t unsigned int + + /* Define to `int' if does not define. */ +-#define EVENT__ssize_t SSIZE_T ++#define EVENT__ssize_t ssize_t + + #endif diff --git a/components/utility/libevent/patch.sha256 b/components/utility/libevent/patch.sha256 new file mode 100644 index 0000000..bffe2f7 --- /dev/null +++ b/components/utility/libevent/patch.sha256 @@ -0,0 +1 @@ +24864eb8717558d3054be10b3b10e925981608949b070ea16acb8d4e9ccdde99 origin.patch diff --git a/components/utility/libevent/src.sha256 b/components/utility/libevent/src.sha256 new file mode 100644 index 0000000..4c20e0d --- /dev/null +++ b/components/utility/libevent/src.sha256 @@ -0,0 +1 @@ +8836ad722ab211de41cb82fe098911986604f6286f67d10dfb2b6787bf418f49 libevent-2.1.12.zip -- Gitee