From 9c8e9466c61a24096b6d4e6bf3f2121ea8dad3f7 Mon Sep 17 00:00:00 2001 From: jiangheng Date: Mon, 7 Mar 2022 21:24:49 +0800 Subject: [PATCH] remove chose_dlsym_handle function (cherry picked from commit 615ffd6bbe09cf7ea41c981498b9f775e78c489e) --- ...ym_handle-function-set-handle-to-RTL.patch | 63 +++++++++++++++++++ lwip.spec | 6 +- 2 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 0020-remove-chose_dlsym_handle-function-set-handle-to-RTL.patch diff --git a/0020-remove-chose_dlsym_handle-function-set-handle-to-RTL.patch b/0020-remove-chose_dlsym_handle-function-set-handle-to-RTL.patch new file mode 100644 index 0000000..54243bc --- /dev/null +++ b/0020-remove-chose_dlsym_handle-function-set-handle-to-RTL.patch @@ -0,0 +1,63 @@ +From 970d9d6fd15c433af20bbbd7418c5e9773d58471 Mon Sep 17 00:00:00 2001 +From: jiangheng +Date: Mon, 7 Mar 2022 21:08:13 +0800 +Subject: [PATCH] remove chose_dlsym_handle function, set handle to RTLD_NEXT + +--- + src/api/posix_api.c | 33 +-------------------------------- + 1 file changed, 1 insertion(+), 32 deletions(-) + +diff --git a/src/api/posix_api.c b/src/api/posix_api.c +index eff9f46..bce07f5 100644 +--- a/src/api/posix_api.c ++++ b/src/api/posix_api.c +@@ -64,33 +64,6 @@ void posix_api_fork(void) + posix_api->get_socket = chld_get_socket; + } + +-static int chose_dlsym_handle(void *__restrict* khandle) +-{ +- void *dlhandle; +- int (*gazelle_epoll_create)(int size); +- dlhandle = dlopen ("liblstack.so", RTLD_LAZY); +- if (dlhandle == NULL) { +- return ERR_IF; +- } +- +- gazelle_epoll_create = dlsym(dlhandle, "epoll_create"); +- if (gazelle_epoll_create == NULL) { +- return ERR_MEM; +- } +- +- dlclose(dlhandle); +- +- *khandle = RTLD_NEXT; +- if (dlsym(*khandle, "epoll_create") == gazelle_epoll_create) { +- RTE_LOG(ERR, EAL, "posix api use RTLD_DEFAULT\n"); +- *khandle = RTLD_DEFAULT; +- } else { +- RTE_LOG(ERR, EAL, "posix api use RTLD_NEXT\n"); +- } +- +- return ERR_OK; +-} +- + int posix_api_init(void) + { + /* the symbol we use here won't be NULL, so we don't need dlerror() +@@ -102,11 +75,7 @@ int posix_api_init(void) + + posix_api = &posix_api_val; + +- void *__restrict handle; +- int ret = chose_dlsym_handle(&handle); +- if (ret != ERR_OK) { +- return ret; +- } ++ void *__restrict handle = RTLD_NEXT; + + /* glibc standard api */ + CHECK_DLSYM_RET_RETURN(posix_api->socket_fn = dlsym(handle, "socket")); +-- +1.8.3.1 + diff --git a/lwip.spec b/lwip.spec index 4a47cd2..a3b51cf 100644 --- a/lwip.spec +++ b/lwip.spec @@ -4,7 +4,7 @@ Summary: lwip is a small independent implementation of the TCP/IP protocol suite Name: lwip Version: 2.1.3 -Release: 6 +Release: 7 License: BSD URL: http://savannah.nongnu.org/projects/lwip/ Source0: http://download.savannah.nongnu.org/releases/lwip/%{name}-%{version}.tar.gz @@ -28,6 +28,7 @@ Patch9015: 0016-lstack-support-mysql-mode.patch Patch9016: 0017-support-REUSEPOR-option.patch Patch9017: 0018-exec-gazelle_init_sock-before-read-event.patch Patch9018: 0019-gazelle-reduce-copy-in-send.patch +Patch9019: 0020-remove-chose_dlsym_handle-function-set-handle-to-RTL.patch BuildRequires: gcc-c++ dos2unix dpdk-devel @@ -56,6 +57,9 @@ cd %{_builddir}/%{name}-%{version}/src %{_libdir}/liblwip.a %changelog +* Mon Mar 07 2022 jiangheng - 2.1.3-7 +- remove chose_dlsym_handle function as it is redundant + * Mon Mar 07 2022 wu-changsheng - 2.1.3-6 - gazelle reduce copy in send -- Gitee