2014-01-26 10:09:57

by Wang Nan

[permalink] [raw]
Subject: [PATCH] Use realpath for srctree and objtree

When BUILD_SRC contains a tailing '/', the file name used in compiling command
will contain '//', and it then goes to .o's debuginfo, confuses debugedit:

https://bugzilla.redhat.com/show_bug.cgi?id=304121

This patch uses realpath to makesure srctree and objtree don't have tailing '/'.

Signed-off-by: Wang Nan <[email protected]>
Cc: Sasha Levin <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Steven Rostedt <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Geng Hui <[email protected]>

---
tools/lib/lockdep/Makefile | 4 ++--
tools/lib/traceevent/Makefile | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/lib/lockdep/Makefile b/tools/lib/lockdep/Makefile
index da8b7aa..e638dd5 100644
--- a/tools/lib/lockdep/Makefile
+++ b/tools/lib/lockdep/Makefile
@@ -87,8 +87,8 @@ endif # BUILD_SRC
# We process the rest of the Makefile if this is the final invocation of make
ifeq ($(skip-makefile),)

-srctree := $(if $(BUILD_SRC),$(BUILD_SRC),$(CURDIR))
-objtree := $(CURDIR)
+srctree := $(realpath $(if $(BUILD_SRC),$(BUILD_SRC),$(CURDIR)))
+objtree := $(realpath $(CURDIR))
src := $(srctree)
obj := $(objtree)

diff --git a/tools/lib/traceevent/Makefile b/tools/lib/traceevent/Makefile
index 56d52a3..dd23171 100644
--- a/tools/lib/traceevent/Makefile
+++ b/tools/lib/traceevent/Makefile
@@ -107,8 +107,8 @@ endif # BUILD_SRC
# We process the rest of the Makefile if this is the final invocation of make
ifeq ($(skip-makefile),)

-srctree := $(if $(BUILD_SRC),$(BUILD_SRC),$(CURDIR))
-objtree := $(CURDIR)
+srctree := $(realpath $(if $(BUILD_SRC),$(BUILD_SRC),$(CURDIR)))
+objtree := $(realpath $(CURDIR))
src := $(srctree)
obj := $(objtree)

--
1.8.4


2014-01-26 16:31:03

by Jiri Olsa

[permalink] [raw]
Subject: Re: [PATCH] Use realpath for srctree and objtree

On Sun, Jan 26, 2014 at 06:06:18PM +0800, Wang Nan wrote:
> When BUILD_SRC contains a tailing '/', the file name used in compiling command
> will contain '//', and it then goes to .o's debuginfo, confuses debugedit:
>
> https://bugzilla.redhat.com/show_bug.cgi?id=304121
>
> This patch uses realpath to makesure srctree and objtree don't have tailing '/'.
>
> Signed-off-by: Wang Nan <[email protected]>
> Cc: Sasha Levin <[email protected]>
> Cc: Arnaldo Carvalho de Melo <[email protected]>
> Cc: Jiri Olsa <[email protected]>
> Cc: Steven Rostedt <[email protected]>
> Cc: Namhyung Kim <[email protected]>
> Cc: Geng Hui <[email protected]>
>
> ---
> tools/lib/lockdep/Makefile | 4 ++--
> tools/lib/traceevent/Makefile | 4 ++--
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/tools/lib/lockdep/Makefile b/tools/lib/lockdep/Makefile
> index da8b7aa..e638dd5 100644
> --- a/tools/lib/lockdep/Makefile
> +++ b/tools/lib/lockdep/Makefile
> @@ -87,8 +87,8 @@ endif # BUILD_SRC
> # We process the rest of the Makefile if this is the final invocation of make
> ifeq ($(skip-makefile),)
>
> -srctree := $(if $(BUILD_SRC),$(BUILD_SRC),$(CURDIR))
> -objtree := $(CURDIR)
> +srctree := $(realpath $(if $(BUILD_SRC),$(BUILD_SRC),$(CURDIR)))
> +objtree := $(realpath $(CURDIR))
> src := $(srctree)
> obj := $(objtree)
>
> diff --git a/tools/lib/traceevent/Makefile b/tools/lib/traceevent/Makefile
> index 56d52a3..dd23171 100644
> --- a/tools/lib/traceevent/Makefile
> +++ b/tools/lib/traceevent/Makefile
> @@ -107,8 +107,8 @@ endif # BUILD_SRC
> # We process the rest of the Makefile if this is the final invocation of make
> ifeq ($(skip-makefile),)
>
> -srctree := $(if $(BUILD_SRC),$(BUILD_SRC),$(CURDIR))
> -objtree := $(CURDIR)
> +srctree := $(realpath $(if $(BUILD_SRC),$(BUILD_SRC),$(CURDIR)))
> +objtree := $(realpath $(CURDIR))
> src := $(srctree)
> obj := $(objtree)

ack for the traceevent change

thanks,
jirka

2014-01-28 17:14:44

by Sasha Levin

[permalink] [raw]
Subject: Re: [PATCH] Use realpath for srctree and objtree

On 01/26/2014 05:06 AM, Wang Nan wrote:
> When BUILD_SRC contains a tailing '/', the file name used in compiling command
> will contain '//', and it then goes to .o's debuginfo, confuses debugedit:
>
> https://bugzilla.redhat.com/show_bug.cgi?id=304121
>
> This patch uses realpath to makesure srctree and objtree don't have tailing '/'.
>
> Signed-off-by: Wang Nan <[email protected]>
> Cc: Sasha Levin <[email protected]>
> Cc: Arnaldo Carvalho de Melo <[email protected]>
> Cc: Jiri Olsa <[email protected]>
> Cc: Steven Rostedt <[email protected]>
> Cc: Namhyung Kim <[email protected]>
> Cc: Geng Hui <[email protected]>
>
> ---

For the liblockdep changes:

Acked-by: Sasha Levin <[email protected]>


Thanks,
Sasha

2014-02-08 01:47:12

by Wang Nan

[permalink] [raw]
Subject: [PATCH resend 1/2] liblockdep: Use realpath for srctree and objtree

If BUILD_SRC or CURDIR contains tailing '/', the file names passed to gcc will
contain '//'. It will be contained .o's in debuginfo, then confuse debugedit:

https://bugzilla.redhat.com/show_bug.cgi?id=304121

This patch uses realpath command to makesure potential tailing '/'s are removed.

Signed-off-by: Wang Nan <[email protected]>
Acked-by: Sasha Levin <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Geng Hui <[email protected]>

---
tools/lib/lockdep/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/lib/lockdep/Makefile b/tools/lib/lockdep/Makefile
index da8b7aa..e638dd5 100644
--- a/tools/lib/lockdep/Makefile
+++ b/tools/lib/lockdep/Makefile
@@ -87,8 +87,8 @@ endif # BUILD_SRC
# We process the rest of the Makefile if this is the final invocation of make
ifeq ($(skip-makefile),)

-srctree := $(if $(BUILD_SRC),$(BUILD_SRC),$(CURDIR))
-objtree := $(CURDIR)
+srctree := $(realpath $(if $(BUILD_SRC),$(BUILD_SRC),$(CURDIR)))
+objtree := $(realpath $(CURDIR))
src := $(srctree)
obj := $(objtree)

--
1.8.4

2014-02-08 01:47:53

by Wang Nan

[permalink] [raw]
Subject: [PATCH resend 2/2] tools lib traceevent: Use realpath for srctree and objtree

If BUILD_SRC or CURDIR contains tailing '/', the file names passed to gcc will
contain '//'. It will be contained .o's in debuginfo, then confuse debugedit:

https://bugzilla.redhat.com/show_bug.cgi?id=304121

This patch uses realpath command to makesure potential tailing '/'s are removed.

Signed-off-by: Wang Nan <[email protected]>
Acked-by: Jiri Olsa <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Steven Rostedt <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Geng Hui <[email protected]>

---
tools/lib/traceevent/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/lib/traceevent/Makefile b/tools/lib/traceevent/Makefile
index 005c9cc..5bb281c 100644
--- a/tools/lib/traceevent/Makefile
+++ b/tools/lib/traceevent/Makefile
@@ -107,8 +107,8 @@ endif # BUILD_SRC
# We process the rest of the Makefile if this is the final invocation of make
ifeq ($(skip-makefile),)

-srctree := $(if $(BUILD_SRC),$(BUILD_SRC),$(CURDIR))
-objtree := $(CURDIR)
+srctree := $(realpath $(if $(BUILD_SRC),$(BUILD_SRC),$(CURDIR)))
+objtree := $(realpath $(CURDIR))
src := $(srctree)
obj := $(objtree)

--
1.8.4

2014-02-08 23:14:46

by Sasha Levin

[permalink] [raw]
Subject: Re: [PATCH resend 1/2] liblockdep: Use realpath for srctree and objtree

Hi Wang,

Thanks! I've picked it up and will send it in the next pull request.


Thanks,
Sasha

On 02/07/2014 08:43 PM, Wang Nan wrote:
> If BUILD_SRC or CURDIR contains tailing '/', the file names passed to gcc will
> contain '//'. It will be contained .o's in debuginfo, then confuse debugedit:
>
> https://bugzilla.redhat.com/show_bug.cgi?id=304121
>
> This patch uses realpath command to makesure potential tailing '/'s are removed.
>
> Signed-off-by: Wang Nan <[email protected]>
> Acked-by: Sasha Levin <[email protected]>
> Cc: Ingo Molnar <[email protected]>
> Cc: Andrew Morton <[email protected]>
> Cc: Geng Hui <[email protected]>
>
> ---
> tools/lib/lockdep/Makefile | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/lib/lockdep/Makefile b/tools/lib/lockdep/Makefile
> index da8b7aa..e638dd5 100644
> --- a/tools/lib/lockdep/Makefile
> +++ b/tools/lib/lockdep/Makefile
> @@ -87,8 +87,8 @@ endif # BUILD_SRC
> # We process the rest of the Makefile if this is the final invocation of make
> ifeq ($(skip-makefile),)
>
> -srctree := $(if $(BUILD_SRC),$(BUILD_SRC),$(CURDIR))
> -objtree := $(CURDIR)
> +srctree := $(realpath $(if $(BUILD_SRC),$(BUILD_SRC),$(CURDIR)))
> +objtree := $(realpath $(CURDIR))
> src := $(srctree)
> obj := $(objtree)
>
>