All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] tools: perf: Fix test build error when bindir contains double slash
@ 2015-07-28 14:10 Pawel Moll
  2015-07-28 14:46 ` Jiri Olsa
  2015-07-31 13:49 ` [tip:perf/core] perf tools: " tip-bot for Pawel Moll
  0 siblings, 2 replies; 4+ messages in thread
From: Pawel Moll @ 2015-07-28 14:10 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 abspath 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..e8d987a 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 = $(abspath $(prefix)/$(bindir_relative))
 mandir = share/man
 infodir = share/info
 perfexecdir = libexec/perf-core
-- 
2.1.4


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

* Re: [PATCH v2] tools: perf: Fix test build error when bindir contains double slash
  2015-07-28 14:10 [PATCH v2] tools: perf: Fix test build error when bindir contains double slash Pawel Moll
@ 2015-07-28 14:46 ` Jiri Olsa
  2015-07-28 16:04   ` Arnaldo Carvalho de Melo
  2015-07-31 13:49 ` [tip:perf/core] perf tools: " tip-bot for Pawel Moll
  1 sibling, 1 reply; 4+ messages in thread
From: Jiri Olsa @ 2015-07-28 14:46 UTC (permalink / raw)
  To: Pawel Moll
  Cc: Arnaldo Carvalho de Melo, Peter Zijlstra, Ingo Molnar,
	Namhyung Kim, Adrian Hunter, linux-kernel

On Tue, Jul 28, 2015 at 03:10:13PM +0100, Pawel Moll wrote:
> 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 abspath function.

nice ;-)

Acked-by: Jiri Olsa <jolsa@kernel.org>

thanks,
jirka

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

* Re: [PATCH v2] tools: perf: Fix test build error when bindir contains double slash
  2015-07-28 14:46 ` Jiri Olsa
@ 2015-07-28 16:04   ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-07-28 16:04 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Pawel Moll, Peter Zijlstra, Ingo Molnar, Namhyung Kim,
	Adrian Hunter, linux-kernel

Em Tue, Jul 28, 2015 at 04:46:00PM +0200, Jiri Olsa escreveu:
> On Tue, Jul 28, 2015 at 03:10:13PM +0100, Pawel Moll wrote:
> > When building with a prefix ending with a slash, for example:
> > 
> > This patch works around the problem by "cleaning" the bindir string
> > using make's abspath function.
> 
> nice ;-)
> 
> Acked-by: Jiri Olsa <jolsa@kernel.org>

Applied.

- Arnaldo

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

* [tip:perf/core] perf tools: Fix test build error when bindir contains double slash
  2015-07-28 14:10 [PATCH v2] tools: perf: Fix test build error when bindir contains double slash Pawel Moll
  2015-07-28 14:46 ` Jiri Olsa
@ 2015-07-31 13:49 ` tip-bot for Pawel Moll
  1 sibling, 0 replies; 4+ messages in thread
From: tip-bot for Pawel Moll @ 2015-07-31 13:49 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: jolsa, a.p.zijlstra, pawel.moll, adrian.hunter, linux-kernel,
	namhyung, mingo, tglx, hpa, acme

Commit-ID:  0927beeca5f9d1a7978f8da9c9d28647859816d3
Gitweb:     http://git.kernel.org/tip/0927beeca5f9d1a7978f8da9c9d28647859816d3
Author:     Pawel Moll <pawel.moll@arm.com>
AuthorDate: Tue, 28 Jul 2015 15:10:13 +0100
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Tue, 28 Jul 2015 13:03:49 -0300

perf tools: Fix test build error when bindir contains double slash

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 abspath function.

Signed-off-by: Pawel Moll <pawel.moll@arm.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1438092613-21014-1-git-send-email-pawel.moll@arm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.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 094ddae..d31fac1 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 = $(abspath $(prefix)/$(bindir_relative))
 mandir = share/man
 infodir = share/info
 perfexecdir = libexec/perf-core

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

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

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-28 14:10 [PATCH v2] tools: perf: Fix test build error when bindir contains double slash Pawel Moll
2015-07-28 14:46 ` Jiri Olsa
2015-07-28 16:04   ` Arnaldo Carvalho de Melo
2015-07-31 13:49 ` [tip:perf/core] perf tools: " tip-bot for Pawel Moll

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.