lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 8 Sep 2012 12:09:54 +0300
From:	Pekka Enberg <penberg@...nel.org>
To:	Irina Tirdea <irina.tirdea@...il.com>
Cc:	mingo@...hat.com, acme@...stprotocols.net, a.p.zijlstra@...llo.nl,
	rostedt@...dmis.org, paulus@...ba.org, dsahern@...il.com,
	namhyung.kim@....com, linux-kernel@...r.kernel.org,
	Irina Tirdea <irina.tirdea@...el.com>
Subject: Re: [PATCH v2 05/12] perf tools: include basename for non-glibc systems

On Sat, Sep 8, 2012 at 3:43 AM, Irina Tirdea <irina.tirdea@...il.com> wrote:
> From: Irina Tirdea <irina.tirdea@...el.com>
>
> perf uses the glibc version of basename(), by defining _GNU_SOURCE, including
> string.h and not including libgen.h. The glibc version of basename is better
> than the POSIX version since it does not modify its argument.
>
> Android has only one version of basename which is defined in libgen.h.
> This version is the same as the glibc version.
>
> Error on Android:
> util/annotate.c: In function 'symbol__annotate_printf':
> util/annotate.c:503:3: error: implicit declaration of function 'basename'
> [-Werror=implicit-function-declaration]
> util/annotate.c:503:3: error: nested extern declaration of 'basename'
> [-Werror=nested-externs]
> util/annotate.c:503:14: error: assignment makes pointer from integer without
> a cast [-Werror]
>
> On Android libgen.h should be included to define basename.
>
> Signed-off-by: Irina Tirdea <irina.tirdea@...el.com>
> ---
>  tools/perf/util/symbol.h |    3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
> index fc4b1e6..d3b330c 100644
> --- a/tools/perf/util/symbol.h
> +++ b/tools/perf/util/symbol.h
> @@ -10,6 +10,9 @@
>  #include <linux/rbtree.h>
>  #include <stdio.h>
>  #include <byteswap.h>
> +#if defined(__BIONIC__)
> +#include <libgen.h>
> +#endif

It's safe to include <libgen.h> on glibc Linux systems as well, no? So
there's no need to check for __BIONIC__.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ