1 [PATCH] pr_fnmatch.c: use mempcpy, not __mempcpy to fix linker issue with uClibc
3 The standard name (as checked for by configure) for the function is mempcpy,
4 not __mempcpy, so use that instead.
6 The existing code happens to work on glibc, as that provides an __mempcpy
7 alias, but other C libraries (E.G. uClibc) don't:
9 ./host/usr/bin/arm-linux-nm -D ./staging/lib/libuClibc-0.9.33.2.so | grep mempcpy
15 ./host/usr/bin/arm-none-linux-gnueabi-nm -D staging/lib/libc-2.18.so | grep mempcpy
18 000e15f0 T __mempcpy_chk
19 00081828 T __mempcpy_small
21 000e4e3c T __wmempcpy_chk
23 Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
25 lib/pr_fnmatch.c | 2 +-
26 lib/pr_fnmatch_loop.c | 2 +-
27 2 files changed, 2 insertions(+), 2 deletions(-)
29 Index: proftpd-1.3.4d/lib/pr_fnmatch.c
30 ===================================================================
31 --- proftpd-1.3.4d.orig/lib/pr_fnmatch.c
32 +++ proftpd-1.3.4d/lib/pr_fnmatch.c
35 # define STRLEN(S) strlen (S)
36 # define STRCAT(D, S) strcat (D, S)
37 -# define MEMPCPY(D, S, N) __mempcpy (D, S, N)
38 +# define MEMPCPY(D, S, N) mempcpy (D, S, N)
39 # define MEMCHR(S, C, N) memchr (S, C, N)
40 # define STRCOLL(S1, S2) strcoll (S1, S2)
41 # include "pr_fnmatch_loop.c"
42 Index: proftpd-1.3.4d/lib/pr_fnmatch_loop.c
43 ===================================================================
44 --- proftpd-1.3.4d.orig/lib/pr_fnmatch_loop.c
45 +++ proftpd-1.3.4d/lib/pr_fnmatch_loop.c
47 /* Copy N bytes of SRC to DEST, return pointer to bytes after the
50 -__mempcpy (void *dest, const void *src, size_t n)
51 +mempcpy (void *dest, const void *src, size_t n)
53 return (char *) memcpy (dest, src, n) + n;