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:	Sun, 2 Aug 2009 15:44:54 -0400
From:	Kyle McMartin <kyle@...artin.ca>
To:	Ingo Molnar <mingo@...e.hu>
Cc:	Arnaldo Carvalho de Melo <acme@...hat.com>,
	Jens Axboe <jens.axboe@...cle.com>,
	Anton Blanchard <anton@...ba.org>, davem@...emloft.net,
	linux-kernel@...r.kernel.org, a.p.zijlstra@...llo.nl,
	fweisbec@...il.com, benh@...nel.crashing.org,
	penberg@...helsinki.fi, vegard.nossum@...il.com, paulus@...ba.org,
	williams@...hat.com
Subject: Re: [PATCH] basic perf support for sparc

On Sun, Aug 02, 2009 at 08:41:48PM +0200, Ingo Molnar wrote:
> Could we somehow define a weak symbol for those library functions 
> ourselves and thus just fall back to that (which does nothing) 
> instead of failing the link?
> 

Well, you could just dlopen the object, but that's kind of gross...

Why not abuse the perf Makefile, which already has this kind of
portability gunk in it?

$ make NO_BFD_DEMANGLE=1
succeeds with no libbfd.

$ make
succeeds when libbfd is around.

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index a5e9b87..67ab097 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -345,7 +345,6 @@ BUILTIN_OBJS += builtin-stat.o
 BUILTIN_OBJS += builtin-top.o
 
 PERFLIBS = $(LIB_FILE)
-EXTLIBS = -lbfd
 
 #
 # Platform specific tweaks
@@ -541,6 +540,11 @@ endif
 ifdef NO_EXTERNAL_GREP
 	BASIC_CFLAGS += -DNO_EXTERNAL_GREP
 endif
+ifdef NO_BFD_DEMANGLE
+	BASIC_CFLAGS += -DNO_BFD_DEMANGLE
+else
+	EXTLIBS += -lbfd
+endif
 
 ifeq ($(PERL_PATH),)
 NO_PERL=NoThanks
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 2810605..736b8db 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -6,10 +6,20 @@
 #include <libelf.h>
 #include <gelf.h>
 #include <elf.h>
+
+#ifndef NO_BFD_DEMANGLE
 #include <bfd.h>
+#endif /* NO_BFD_DEMANGLE */
 
 const char *sym_hist_filter;
 
+#ifdef NO_BFD_DEMANGLE
+static inline char *bfd_demangle(void __used *v, const char __used *c,
+				int __used i) {
+	return NULL;
+}
+#endif
+
 #ifndef DMGL_PARAMS
 #define DMGL_PARAMS      (1 << 0)       /* Include function args */
 #define DMGL_ANSI        (1 << 1)       /* Include const, volatile, etc */
--
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