* [BUGFIX PATCH] tools: Let O= makes handle a relative path with -C option
[not found] <9e7beb31-b41f-9e95-c92b-1829e420af77@infradead.org>
@ 2020-03-05 6:03 ` Masami Hiramatsu
2020-03-05 14:51 ` Greg KH
2020-03-05 18:50 ` Randy Dunlap
0 siblings, 2 replies; 5+ messages in thread
From: Masami Hiramatsu @ 2020-03-05 6:03 UTC (permalink / raw)
To: Steven Rostedt
Cc: Geert Uytterhoeven, Borislav Petkov, LKML, Ingo Molnar,
Randy Dunlap, Andrew Morton, Masami Hiramatsu, Peter Zijlstra,
stable, Sasha Levin
When I compiled tools/bootconfig from top directory with
-C option, the O= option didn't work correctly if I passed
a relative path.
$ make O=./builddir/ -C tools/bootconfig/
make: Entering directory '/home/mhiramat/ksrc/linux/tools/bootconfig'
../scripts/Makefile.include:4: *** O=./builddir/ does not exist. Stop.
make: Leaving directory '/home/mhiramat/ksrc/linux/tools/bootconfig'
The O= directory existence check failed because the check
script ran in the build target directory instead of the
directory where I ran the make command.
To fix that, once change directory to $(PWD) and check O=
directory, since the PWD is set to where the make command
runs.
Fixes: c883122acc0d ("perf tools: Let O= makes handle relative paths")
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
---
tools/scripts/Makefile.include | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/scripts/Makefile.include b/tools/scripts/Makefile.include
index ded7a950dc40..6d2f3a1b2249 100644
--- a/tools/scripts/Makefile.include
+++ b/tools/scripts/Makefile.include
@@ -1,8 +1,8 @@
# SPDX-License-Identifier: GPL-2.0
ifneq ($(O),)
ifeq ($(origin O), command line)
- dummy := $(if $(shell test -d $(O) || echo $(O)),$(error O=$(O) does not exist),)
- ABSOLUTE_O := $(shell cd $(O) ; pwd)
+ dummy := $(if $(shell cd $(PWD); test -d $(O) || echo $(O)),$(error O=$(O) does not exist),)
+ ABSOLUTE_O := $(shell cd $(PWD); cd $(O) ; pwd)
OUTPUT := $(ABSOLUTE_O)/$(if $(subdir),$(subdir)/)
COMMAND_O := O=$(ABSOLUTE_O)
ifeq ($(objtree),)
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [BUGFIX PATCH] tools: Let O= makes handle a relative path with -C option
2020-03-05 6:03 ` [BUGFIX PATCH] tools: Let O= makes handle a relative path with -C option Masami Hiramatsu
@ 2020-03-05 14:51 ` Greg KH
2020-03-05 18:50 ` Randy Dunlap
1 sibling, 0 replies; 5+ messages in thread
From: Greg KH @ 2020-03-05 14:51 UTC (permalink / raw)
To: Masami Hiramatsu
Cc: Steven Rostedt, Geert Uytterhoeven, Borislav Petkov, LKML,
Ingo Molnar, Randy Dunlap, Andrew Morton, Peter Zijlstra, stable,
Sasha Levin
On Thu, Mar 05, 2020 at 03:03:03PM +0900, Masami Hiramatsu wrote:
> When I compiled tools/bootconfig from top directory with
> -C option, the O= option didn't work correctly if I passed
> a relative path.
>
> $ make O=./builddir/ -C tools/bootconfig/
> make: Entering directory '/home/mhiramat/ksrc/linux/tools/bootconfig'
> ../scripts/Makefile.include:4: *** O=./builddir/ does not exist. Stop.
> make: Leaving directory '/home/mhiramat/ksrc/linux/tools/bootconfig'
>
> The O= directory existence check failed because the check
> script ran in the build target directory instead of the
> directory where I ran the make command.
>
> To fix that, once change directory to $(PWD) and check O=
> directory, since the PWD is set to where the make command
> runs.
>
> Fixes: c883122acc0d ("perf tools: Let O= makes handle relative paths")
> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
> ---
> tools/scripts/Makefile.include | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
<formletter>
This is not the correct way to submit patches for inclusion in the
stable kernel tree. Please read:
https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
for how to do this properly.
</formletter>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [BUGFIX PATCH] tools: Let O= makes handle a relative path with -C option
2020-03-05 6:03 ` [BUGFIX PATCH] tools: Let O= makes handle a relative path with -C option Masami Hiramatsu
2020-03-05 14:51 ` Greg KH
@ 2020-03-05 18:50 ` Randy Dunlap
2020-03-06 1:39 ` Masami Hiramatsu
1 sibling, 1 reply; 5+ messages in thread
From: Randy Dunlap @ 2020-03-05 18:50 UTC (permalink / raw)
To: Masami Hiramatsu, Steven Rostedt
Cc: Geert Uytterhoeven, Borislav Petkov, LKML, Ingo Molnar,
Andrew Morton, Peter Zijlstra, stable, Sasha Levin
On 3/4/20 10:03 PM, Masami Hiramatsu wrote:
> When I compiled tools/bootconfig from top directory with
> -C option, the O= option didn't work correctly if I passed
> a relative path.
>
> $ make O=./builddir/ -C tools/bootconfig/
> make: Entering directory '/home/mhiramat/ksrc/linux/tools/bootconfig'
> ../scripts/Makefile.include:4: *** O=./builddir/ does not exist. Stop.
> make: Leaving directory '/home/mhiramat/ksrc/linux/tools/bootconfig'
>
> The O= directory existence check failed because the check
> script ran in the build target directory instead of the
> directory where I ran the make command.
>
> To fix that, once change directory to $(PWD) and check O=
> directory, since the PWD is set to where the make command
> runs.
>
> Fixes: c883122acc0d ("perf tools: Let O= makes handle relative paths")
> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Hi Masami,
This patch doesn't fix anything AFAICT.
Didn't help in my testing.
Thanks.
> ---
> tools/scripts/Makefile.include | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/scripts/Makefile.include b/tools/scripts/Makefile.include
> index ded7a950dc40..6d2f3a1b2249 100644
> --- a/tools/scripts/Makefile.include
> +++ b/tools/scripts/Makefile.include
> @@ -1,8 +1,8 @@
> # SPDX-License-Identifier: GPL-2.0
> ifneq ($(O),)
> ifeq ($(origin O), command line)
> - dummy := $(if $(shell test -d $(O) || echo $(O)),$(error O=$(O) does not exist),)
> - ABSOLUTE_O := $(shell cd $(O) ; pwd)
> + dummy := $(if $(shell cd $(PWD); test -d $(O) || echo $(O)),$(error O=$(O) does not exist),)
> + ABSOLUTE_O := $(shell cd $(PWD); cd $(O) ; pwd)
> OUTPUT := $(ABSOLUTE_O)/$(if $(subdir),$(subdir)/)
> COMMAND_O := O=$(ABSOLUTE_O)
> ifeq ($(objtree),)
>
--
~Randy
Reported-by: Randy Dunlap <rdunlap@infradead.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [BUGFIX PATCH] tools: Let O= makes handle a relative path with -C option
2020-03-05 18:50 ` Randy Dunlap
@ 2020-03-06 1:39 ` Masami Hiramatsu
2020-03-06 5:17 ` Randy Dunlap
0 siblings, 1 reply; 5+ messages in thread
From: Masami Hiramatsu @ 2020-03-06 1:39 UTC (permalink / raw)
To: Randy Dunlap
Cc: Steven Rostedt, Geert Uytterhoeven, Borislav Petkov, LKML,
Ingo Molnar, Andrew Morton, Peter Zijlstra, stable, Sasha Levin
On Thu, 5 Mar 2020 10:50:43 -0800
Randy Dunlap <rdunlap@infradead.org> wrote:
> On 3/4/20 10:03 PM, Masami Hiramatsu wrote:
> > When I compiled tools/bootconfig from top directory with
> > -C option, the O= option didn't work correctly if I passed
> > a relative path.
> >
> > $ make O=./builddir/ -C tools/bootconfig/
> > make: Entering directory '/home/mhiramat/ksrc/linux/tools/bootconfig'
> > ../scripts/Makefile.include:4: *** O=./builddir/ does not exist. Stop.
> > make: Leaving directory '/home/mhiramat/ksrc/linux/tools/bootconfig'
> >
> > The O= directory existence check failed because the check
> > script ran in the build target directory instead of the
> > directory where I ran the make command.
> >
> > To fix that, once change directory to $(PWD) and check O=
> > directory, since the PWD is set to where the make command
> > runs.
> >
> > Fixes: c883122acc0d ("perf tools: Let O= makes handle relative paths")
> > Reported-by: Randy Dunlap <rdunlap@infradead.org>
> > Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
>
> Hi Masami,
>
> This patch doesn't fix anything AFAICT.
> Didn't help in my testing.
>
Hmm, what happens on your case? Maybe PWD is not set?
Thank you,
> Thanks.
>
> > ---
> > tools/scripts/Makefile.include | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/tools/scripts/Makefile.include b/tools/scripts/Makefile.include
> > index ded7a950dc40..6d2f3a1b2249 100644
> > --- a/tools/scripts/Makefile.include
> > +++ b/tools/scripts/Makefile.include
> > @@ -1,8 +1,8 @@
> > # SPDX-License-Identifier: GPL-2.0
> > ifneq ($(O),)
> > ifeq ($(origin O), command line)
> > - dummy := $(if $(shell test -d $(O) || echo $(O)),$(error O=$(O) does not exist),)
> > - ABSOLUTE_O := $(shell cd $(O) ; pwd)
> > + dummy := $(if $(shell cd $(PWD); test -d $(O) || echo $(O)),$(error O=$(O) does not exist),)
> > + ABSOLUTE_O := $(shell cd $(PWD); cd $(O) ; pwd)
> > OUTPUT := $(ABSOLUTE_O)/$(if $(subdir),$(subdir)/)
> > COMMAND_O := O=$(ABSOLUTE_O)
> > ifeq ($(objtree),)
> >
>
>
> --
> ~Randy
> Reported-by: Randy Dunlap <rdunlap@infradead.org>
--
Masami Hiramatsu <mhiramat@kernel.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [BUGFIX PATCH] tools: Let O= makes handle a relative path with -C option
2020-03-06 1:39 ` Masami Hiramatsu
@ 2020-03-06 5:17 ` Randy Dunlap
0 siblings, 0 replies; 5+ messages in thread
From: Randy Dunlap @ 2020-03-06 5:17 UTC (permalink / raw)
To: Masami Hiramatsu
Cc: Steven Rostedt, Geert Uytterhoeven, Borislav Petkov, LKML,
Ingo Molnar, Andrew Morton, Peter Zijlstra, stable, Sasha Levin
On 3/5/20 5:39 PM, Masami Hiramatsu wrote:
> On Thu, 5 Mar 2020 10:50:43 -0800
> Randy Dunlap <rdunlap@infradead.org> wrote:
>
>> On 3/4/20 10:03 PM, Masami Hiramatsu wrote:
>>> When I compiled tools/bootconfig from top directory with
>>> -C option, the O= option didn't work correctly if I passed
>>> a relative path.
>>>
>>> $ make O=./builddir/ -C tools/bootconfig/
>>> make: Entering directory '/home/mhiramat/ksrc/linux/tools/bootconfig'
>>> ../scripts/Makefile.include:4: *** O=./builddir/ does not exist. Stop.
>>> make: Leaving directory '/home/mhiramat/ksrc/linux/tools/bootconfig'
>>>
>>> The O= directory existence check failed because the check
>>> script ran in the build target directory instead of the
>>> directory where I ran the make command.
>>>
>>> To fix that, once change directory to $(PWD) and check O=
>>> directory, since the PWD is set to where the make command
>>> runs.
>>>
>>> Fixes: c883122acc0d ("perf tools: Let O= makes handle relative paths")
>>> Reported-by: Randy Dunlap <rdunlap@infradead.org>
>>> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
>>
>> Hi Masami,
>>
>> This patch doesn't fix anything AFAICT.
>> Didn't help in my testing.
>>
>
> Hmm, what happens on your case? Maybe PWD is not set?
>
> Thank you,
The binary is still built in $srctree/tools/bootconfig/.
If I 'echo $PWD' at a prompt, I get the correct pwd.
>
>> Thanks.
>>
>>> ---
>>> tools/scripts/Makefile.include | 4 ++--
>>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/tools/scripts/Makefile.include b/tools/scripts/Makefile.include
>>> index ded7a950dc40..6d2f3a1b2249 100644
>>> --- a/tools/scripts/Makefile.include
>>> +++ b/tools/scripts/Makefile.include
>>> @@ -1,8 +1,8 @@
>>> # SPDX-License-Identifier: GPL-2.0
>>> ifneq ($(O),)
>>> ifeq ($(origin O), command line)
>>> - dummy := $(if $(shell test -d $(O) || echo $(O)),$(error O=$(O) does not exist),)
>>> - ABSOLUTE_O := $(shell cd $(O) ; pwd)
>>> + dummy := $(if $(shell cd $(PWD); test -d $(O) || echo $(O)),$(error O=$(O) does not exist),)
>>> + ABSOLUTE_O := $(shell cd $(PWD); cd $(O) ; pwd)
>>> OUTPUT := $(ABSOLUTE_O)/$(if $(subdir),$(subdir)/)
>>> COMMAND_O := O=$(ABSOLUTE_O)
>>> ifeq ($(objtree),)
--
~Randy
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-03-06 5:17 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <9e7beb31-b41f-9e95-c92b-1829e420af77@infradead.org>
2020-03-05 6:03 ` [BUGFIX PATCH] tools: Let O= makes handle a relative path with -C option Masami Hiramatsu
2020-03-05 14:51 ` Greg KH
2020-03-05 18:50 ` Randy Dunlap
2020-03-06 1:39 ` Masami Hiramatsu
2020-03-06 5:17 ` Randy Dunlap
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox