Skip to content

Commit 2e02f00

Browse files
committed
librdmacm/preload.c: fix duplicate symbol definitions on armhf
85f9747 introduces the preload of fcntl64 and it fails to build on armhf: Assembler messages: Error: symbol `__fcntl_time64' is already defined Error: symbol `sendfile64' is already defined On armhf, glibc defines both fcntl64 and fcntl as alias to __fcntl_time64. As a consequence, in preload.c, 2 function definitions of fcntl64 and fcntl are preprocessed to become the same function __fcntl_time64 definition, that cause the double symbol error. Only define and intercept these functions if they are not already defined. This fixes the issue both for sendfile64 and fcntl64. Signed-off-by: Hector Cao <hector.cao@canonical.com>
1 parent 1c73934 commit 2e02f00

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

librdmacm/preload.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1185,7 +1185,7 @@ int fcntl(int socket, int cmd, ... /* arg */)
11851185
return ret;
11861186
}
11871187

1188-
#if RDMA_PRELOAD_WRAP_LFS64
1188+
#if RDMA_PRELOAD_WRAP_LFS64 && !defined(fcntl64)
11891189
int fcntl64(int socket, int cmd, ... /* arg */)
11901190
{
11911191
va_list args;
@@ -1310,7 +1310,7 @@ ssize_t sendfile(int out_fd, int in_fd, off_t *offset, size_t count)
13101310
return ret;
13111311
}
13121312

1313-
#if RDMA_PRELOAD_WRAP_LFS64
1313+
#if RDMA_PRELOAD_WRAP_LFS64 && !defined(sendfile64)
13141314
ssize_t sendfile64(int out_fd, int in_fd, off64_t *offset64, size_t count)
13151315
{
13161316
void *file_addr;

0 commit comments

Comments
 (0)