Skip to contentSkip to conversation

perf tools: Emit more precise message for missing glibc static library

tip:perf/core tip-bot for Arnaldo Carvalho de Melo 1 participant 1 message Jun 12, 2014 perf events

lore
Share & tools
lore
#0 lore raw
Commit-ID:  f9ca2d8918979e8ef806a8b6b4635a79b4f40d1a
Gitweb:     http://git.kernel.org/tip/f9ca2d8918979e8ef806a8b6b4635a79b4f40d1a
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Thu, 5 Jun 2014 12:46:04 -0300
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 9 Jun 2014 12:14:08 -0300

perf tools: Emit more precise message for missing glibc static library

When the user does:

make -C tools/perf LDFLAGS=-static

asking for a static build, and the glibc-static (or equivalent) is not found, the message wasn't clear, stating that one of glibc-devel or glibc-static wasn't installed, clarify it checking if -static is present in LDFLAGS.

Cc Adrian Hunter <[email protected]>
Cc David Ahern <[email protected]>
Cc Don Zickus <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Stephane Eranian <[email protected]>
---
 tools/perf/config/Makefile | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
tools/perf/config/Makefile +5 -1
index 4f100b5..f30ac5e 100644
@@ -299,7 +299,11 @@ else
       NO_LIBUNWIND := 1
       NO_LIBDW_DWARF_UNWIND := 1
     else
-      msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]/glibc-static);
+      ifneq ($(filter s% -static%,$(LDFLAGS),),)
+        msg := $(error No static glibc found, please install glibc-static);
+      else
+        msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]);
+      endif
     endif
   else
     ifndef NO_LIBDW_DWARF_UNWIND