lkml.org 
[lkml]   [2010]   [Aug]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH 1/2] perf: add test for strlcpy()
Em Sat, Aug 21, 2010 at 03:38:20AM +0300, Kirill A. Shutemov escreveu:
> Some Linux distributions like ALT Linux provides patched glibc with
> contains strlcpy(). It's confilcts with strlcpy() from perf.
>
> Let's add check for strlcpy().

It doesn't work on !ALT Linux ;-\

LINK /home/acme/git/build/perf//perf
/home/acme/git/build/perf//libperf.a(path.o): In function `perf_vsnpath':
/home/acme/git/linux/tools/perf/util/path.c:74: undefined reference to `strlcpy'
/home/acme/git/build/perf//libperf.a(abspath.o): In function `get_pwd_cwd':
/home/acme/git/linux/tools/perf/util/abspath.c:16: undefined reference to `strlcpy'
/home/acme/git/build/perf//libperf.a(abspath.o): In function `make_nonrelative_path':
/home/acme/git/linux/tools/perf/util/abspath.c:27: undefined reference to `strlcpy'
collect2: ld returned 1 exit status
make: *** [/home/acme/git/build/perf//perf] Error 1
make: Leaving directory `/home/acme/git/linux/tools/perf'
[acme@emilia linux]$

See below why:

> Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
> ---
> tools/perf/Makefile | 8 ++++++++
> tools/perf/feature-tests.mak | 11 +++++++++++
> tools/perf/util/cache.h | 2 ++
> tools/perf/util/path.c | 3 ++-
> 4 files changed, 23 insertions(+), 1 deletions(-)
>
> diff --git a/tools/perf/Makefile b/tools/perf/Makefile
> index 4f1fa77..496a0d6 100644
> --- a/tools/perf/Makefile
> +++ b/tools/perf/Makefile
> @@ -653,6 +653,14 @@ else
> diff --git a/tools/perf/util/path.c b/tools/perf/util/path.c
> index 58a470d..029661c 100644
> --- a/tools/perf/util/path.c
> +++ b/tools/perf/util/path.c
> @@ -22,6 +22,7 @@ static const char *get_perf_dir(void)
> return ".";
> }
>
> +#ifdef STRLCPY

Should be:

+#ifdef NO_STRLCPY

I'm fixing it up.

> size_t strlcpy(char *dest, const char *src, size_t size)
> {
> size_t ret = strlen(src);
> @@ -33,7 +34,7 @@ size_t strlcpy(char *dest, const char *src, size_t size)
> }
> return ret;
> }


\
 
 \ /
  Last update: 2010-08-21 19:19    [W:0.050 / U:0.924 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site