public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tools: perf: Fix test build error when bindir contains double slash
@ 2015-07-27 16:46 Pawel Moll
  2015-07-27 18:24 ` [PATCH] perf tests: Adding build test for having ending slash in " Jiri Olsa
  0 siblings, 1 reply; 5+ messages in thread
From: Pawel Moll @ 2015-07-27 16:46 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Peter Zijlstra, Ingo Molnar, Jiri Olsa,
	Namhyung Kim, Adrian Hunter
  Cc: linux-kernel, Pawel Moll

When building with a prefix ending with a slash, for example:

	$ make prefix=/usr/local/

one of the perf tests fail to compile due to BUILD_STR macro mishandling
bindir_SQ string containing with two slashes:

	-DBINDIR="BUILD_STR(/usr/local//bin)"

with the following error:

	  CC       tests/attr.o
	tests/attr.c: In function ‘test__attr’:
	tests/attr.c:168:50: error: expected ‘)’ before ‘;’ token
	  snprintf(path_perf, PATH_MAX, "%s/perf", BINDIR);
                                                  ^
	tests/attr.c:176:1: error: expected ‘;’ before ‘}’ token
	 }
	 ^
	tests/attr.c:176:1: error: control reaches end of non-void function [-Werror=return-type]
	 }
	 ^
	cc1: all warnings being treated as errors

This patch works around the problem by "cleaning" the bindir string
using make's realpath function.

Signed-off-by: Pawel Moll <pawel.moll@arm.com>
---
 tools/perf/config/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index b4a9c29..59e8376 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -638,7 +638,7 @@ ifndef DESTDIR
 prefix ?= $(HOME)
 endif
 bindir_relative = bin
-bindir = $(prefix)/$(bindir_relative)
+bindir = $(realpath $(prefix)/$(bindir_relative))
 mandir = share/man
 infodir = share/info
 perfexecdir = libexec/perf-core
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-07-31 13:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-27 16:46 [PATCH] tools: perf: Fix test build error when bindir contains double slash Pawel Moll
2015-07-27 18:24 ` [PATCH] perf tests: Adding build test for having ending slash in " Jiri Olsa
2015-07-28 12:40   ` Pawel Moll
2015-07-28 13:44     ` Pawel Moll
2015-07-31 13:55   ` [tip:perf/core] perf tests: Adding build test for having ending " tip-bot for Jiri Olsa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox