From 119834ee84b492d47beb76e375398cdd7d0bb34a Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 15 Jan 2020 20:28:52 -0800 Subject: rdma-core: Use overloadable attribute with clang This ensures that clang is not fussy about overloading recvfrom() Signed-off-by: Khem Raj --- ...001-Use-overloadable-attribute-with-clang.patch | 42 ++++++++++++++++++++++ .../recipes-support/rdma-core/rdma-core_27.0.bb | 1 + 2 files changed, 43 insertions(+) create mode 100644 meta-networking/recipes-support/rdma-core/rdma-core/0001-Use-overloadable-attribute-with-clang.patch (limited to 'meta-networking/recipes-support') diff --git a/meta-networking/recipes-support/rdma-core/rdma-core/0001-Use-overloadable-attribute-with-clang.patch b/meta-networking/recipes-support/rdma-core/rdma-core/0001-Use-overloadable-attribute-with-clang.patch new file mode 100644 index 0000000000..1ba6847d2f --- /dev/null +++ b/meta-networking/recipes-support/rdma-core/rdma-core/0001-Use-overloadable-attribute-with-clang.patch @@ -0,0 +1,42 @@ +From 42976ed0a0160864b41680604ea9cdb3c175cb94 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 15 Jan 2020 17:48:28 -0800 +Subject: [PATCH] Use overloadable attribute with clang + +This is overriding the libc implementation + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + librdmacm/preload.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/librdmacm/preload.c b/librdmacm/preload.c +index d46beb1b..b451de50 100644 +--- a/librdmacm/preload.c ++++ b/librdmacm/preload.c +@@ -59,6 +59,12 @@ + #include "cma.h" + #include "indexer.h" + ++#ifdef __clang__ ++#define OVERLOAD __attribute__((overloadable)) ++#else ++#define OVERLOAD ++#endif ++ + struct socket_calls { + int (*socket)(int domain, int type, int protocol); + int (*bind)(int socket, const struct sockaddr *addr, socklen_t addrlen); +@@ -793,7 +799,7 @@ ssize_t recv(int socket, void *buf, size_t len, int flags) + rrecv(fd, buf, len, flags) : real.recv(fd, buf, len, flags); + } + +-ssize_t recvfrom(int socket, void *buf, size_t len, int flags, ++ssize_t OVERLOAD recvfrom(int socket, void *buf, size_t len, int flags, + struct sockaddr *src_addr, socklen_t *addrlen) + { + int fd; +-- +2.25.0 + diff --git a/meta-networking/recipes-support/rdma-core/rdma-core_27.0.bb b/meta-networking/recipes-support/rdma-core/rdma-core_27.0.bb index 361d69b337..417979dc33 100644 --- a/meta-networking/recipes-support/rdma-core/rdma-core_27.0.bb +++ b/meta-networking/recipes-support/rdma-core/rdma-core_27.0.bb @@ -9,6 +9,7 @@ BRANCH = "stable-v${@d.getVar('PV').split('.')[0]}" SRC_URI = "git://github.com/linux-rdma/rdma-core.git;branch=${BRANCH} \ file://0001-Remove-man-files-which-cant-be-built.patch \ file://0001-librdmacm-Use-sched_yield-instead-of-pthread_yield.patch \ + file://0001-Use-overloadable-attribute-with-clang.patch \ " SRCREV = "84caf035ae6123e2296b72006cd2cf698c65eb46" S = "${WORKDIR}/git" -- cgit 1.2.3-korg