* [PATCH v1] kbuild: fix sub directory output build of kselftests
@ 2022-06-27 7:02 Muhammad Usama Anjum
2022-06-27 16:54 ` Shuah Khan
0 siblings, 1 reply; 6+ messages in thread
From: Muhammad Usama Anjum @ 2022-06-27 7:02 UTC (permalink / raw)
To: Masahiro Yamada, Michal Marek, Nick Desaulniers, Kieran Bingham
Cc: Muhammad Usama Anjum, kernel, Shuah Khan, Masahiro Yamada,
linux-kbuild, linux-kernel
Build of kselftests fail if kernel's top most Makefile is used for
running or building kselftests with separate output directory which is
sub-directory. srctree is set to .. erroneously.
make kselftest-all O=/linux_mainline/build
Makefile:1080: ../scripts/Makefile.extrawarn: No such file or directory
make kselftest-all O=build
Makefile:1080: ../scripts/Makefile.extrawarn: No such file or directory
Fix this by comparing abs_srctree with CURDIR instead of abs_objtree.
CURDIR changes based on from where the command has been run and it sets
the srctree correctly.
Fixes: 25b146c5b8cee("kbuild: allow Kbuild to start from any directory")
Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
---
Changes in V2:
- Correct the bugfix instead of workaround
V1: https://lore.kernel.org/lkml/20220223191016.1658728-1-usama.anjum@collabora.com/
---
Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index e66358b64ede..4090d7afcda4 100644
--- a/Makefile
+++ b/Makefile
@@ -238,12 +238,12 @@ ifeq ($(need-sub-make),)
# so that IDEs/editors are able to understand relative filenames.
MAKEFLAGS += --no-print-directory
-ifeq ($(abs_srctree),$(abs_objtree))
+ifeq ($(abs_srctree),$(CURDIR))
# building in the source tree
srctree := .
building_out_of_srctree :=
else
- ifeq ($(abs_srctree)/,$(dir $(abs_objtree)))
+ ifeq ($(abs_srctree)/,$(dir $(CURDIR)))
# building in a subdirectory of the source tree
srctree := ..
else
--
2.30.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v1] kbuild: fix sub directory output build of kselftests
2022-06-27 7:02 [PATCH v1] kbuild: fix sub directory output build of kselftests Muhammad Usama Anjum
@ 2022-06-27 16:54 ` Shuah Khan
2022-06-27 17:45 ` Masahiro Yamada
0 siblings, 1 reply; 6+ messages in thread
From: Shuah Khan @ 2022-06-27 16:54 UTC (permalink / raw)
To: Muhammad Usama Anjum, Masahiro Yamada, Michal Marek,
Nick Desaulniers, Kieran Bingham
Cc: kernel, Masahiro Yamada, linux-kbuild, linux-kernel, Shuah Khan
On 6/27/22 1:02 AM, Muhammad Usama Anjum wrote:
> Build of kselftests fail if kernel's top most Makefile is used for
> running or building kselftests with separate output directory which is
> sub-directory. srctree is set to .. erroneously.
>
> make kselftest-all O=/linux_mainline/build
> Makefile:1080: ../scripts/Makefile.extrawarn: No such file or directory
>
> make kselftest-all O=build
> Makefile:1080: ../scripts/Makefile.extrawarn: No such file or directory
>
> Fix this by comparing abs_srctree with CURDIR instead of abs_objtree.
> CURDIR changes based on from where the command has been run and it sets
> the srctree correctly.
>
> Fixes: 25b146c5b8cee("kbuild: allow Kbuild to start from any directory")
> Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
> ---
> Changes in V2:
> - Correct the bugfix instead of workaround
>
> V1: https://lore.kernel.org/lkml/20220223191016.1658728-1-usama.anjum@collabora.com/
> ---
> Makefile | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index e66358b64ede..4090d7afcda4 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -238,12 +238,12 @@ ifeq ($(need-sub-make),)
> # so that IDEs/editors are able to understand relative filenames.
> MAKEFLAGS += --no-print-directory
>
> -ifeq ($(abs_srctree),$(abs_objtree))
> +ifeq ($(abs_srctree),$(CURDIR))
> # building in the source tree
> srctree := .
> building_out_of_srctree :=
> else
> - ifeq ($(abs_srctree)/,$(dir $(abs_objtree)))
> + ifeq ($(abs_srctree)/,$(dir $(CURDIR)))
> # building in a subdirectory of the source tree
> srctree := ..
> else
>
Please resend cc'ing linux-kselftest
thanks,
-- Shuah
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v1] kbuild: fix sub directory output build of kselftests
2022-06-27 16:54 ` Shuah Khan
@ 2022-06-27 17:45 ` Masahiro Yamada
2022-06-27 19:51 ` Shuah Khan
0 siblings, 1 reply; 6+ messages in thread
From: Masahiro Yamada @ 2022-06-27 17:45 UTC (permalink / raw)
To: Shuah Khan
Cc: Muhammad Usama Anjum, Michal Marek, Nick Desaulniers,
Kieran Bingham, kernel, Linux Kbuild mailing list,
Linux Kernel Mailing List
On Tue, Jun 28, 2022 at 1:54 AM Shuah Khan <skhan@linuxfoundation.org> wrote:
>
> On 6/27/22 1:02 AM, Muhammad Usama Anjum wrote:
> > Build of kselftests fail if kernel's top most Makefile is used for
> > running or building kselftests with separate output directory which is
> > sub-directory. srctree is set to .. erroneously.
> >
> > make kselftest-all O=/linux_mainline/build
> > Makefile:1080: ../scripts/Makefile.extrawarn: No such file or directory
> >
> > make kselftest-all O=build
> > Makefile:1080: ../scripts/Makefile.extrawarn: No such file or directory
> >
> > Fix this by comparing abs_srctree with CURDIR instead of abs_objtree.
> > CURDIR changes based on from where the command has been run and it sets
> > the srctree correctly.
> >
> > Fixes: 25b146c5b8cee("kbuild: allow Kbuild to start from any directory")
> > Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
> > ---
> > Changes in V2:
> > - Correct the bugfix instead of workaround
> >
> > V1: https://lore.kernel.org/lkml/20220223191016.1658728-1-usama.anjum@collabora.com/
> > ---
> > Makefile | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/Makefile b/Makefile
> > index e66358b64ede..4090d7afcda4 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -238,12 +238,12 @@ ifeq ($(need-sub-make),)
> > # so that IDEs/editors are able to understand relative filenames.
> > MAKEFLAGS += --no-print-directory
> >
> > -ifeq ($(abs_srctree),$(abs_objtree))
> > +ifeq ($(abs_srctree),$(CURDIR))
> > # building in the source tree
> > srctree := .
> > building_out_of_srctree :=
> > else
> > - ifeq ($(abs_srctree)/,$(dir $(abs_objtree)))
> > + ifeq ($(abs_srctree)/,$(dir $(CURDIR)))
> > # building in a subdirectory of the source tree
> > srctree := ..
> > else
> >
>
> Please resend cc'ing linux-kselftest
>
> thanks,
> -- Shuah
Please do not send this any more.
This part is good as is.
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v1] kbuild: fix sub directory output build of kselftests
2022-06-27 17:45 ` Masahiro Yamada
@ 2022-06-27 19:51 ` Shuah Khan
2022-06-30 9:44 ` Muhammad Usama Anjum
0 siblings, 1 reply; 6+ messages in thread
From: Shuah Khan @ 2022-06-27 19:51 UTC (permalink / raw)
To: Masahiro Yamada
Cc: Muhammad Usama Anjum, Michal Marek, Nick Desaulniers,
Kieran Bingham, kernel, Linux Kbuild mailing list,
Linux Kernel Mailing List, linux-kselftest, Shuah Khan
On 6/27/22 11:45 AM, Masahiro Yamada wrote:
> On Tue, Jun 28, 2022 at 1:54 AM Shuah Khan <skhan@linuxfoundation.org> wrote:
>>
>> On 6/27/22 1:02 AM, Muhammad Usama Anjum wrote:
>>> Build of kselftests fail if kernel's top most Makefile is used for
>>> running or building kselftests with separate output directory which is
>>> sub-directory. srctree is set to .. erroneously.
>>>
>>> make kselftest-all O=/linux_mainline/build
>>> Makefile:1080: ../scripts/Makefile.extrawarn: No such file or directory
>>>
>>> make kselftest-all O=build
>>> Makefile:1080: ../scripts/Makefile.extrawarn: No such file or directory
>>>
>>> Fix this by comparing abs_srctree with CURDIR instead of abs_objtree.
>>> CURDIR changes based on from where the command has been run and it sets
>>> the srctree correctly.
>>>
>>> Fixes: 25b146c5b8cee("kbuild: allow Kbuild to start from any directory")
>>> Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
>>> ---
>>> Changes in V2:
>>> - Correct the bugfix instead of workaround
>>>
>>> V1: https://lore.kernel.org/lkml/20220223191016.1658728-1-usama.anjum@collabora.com/
>>> ---
>>> Makefile | 4 ++--
>>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/Makefile b/Makefile
>>> index e66358b64ede..4090d7afcda4 100644
>>> --- a/Makefile
>>> +++ b/Makefile
>>> @@ -238,12 +238,12 @@ ifeq ($(need-sub-make),)
>>> # so that IDEs/editors are able to understand relative filenames.
>>> MAKEFLAGS += --no-print-directory
>>>
>>> -ifeq ($(abs_srctree),$(abs_objtree))
>>> +ifeq ($(abs_srctree),$(CURDIR))
>>> # building in the source tree
>>> srctree := .
>>> building_out_of_srctree :=
>>> else
>>> - ifeq ($(abs_srctree)/,$(dir $(abs_objtree)))
>>> + ifeq ($(abs_srctree)/,$(dir $(CURDIR)))
>>> # building in a subdirectory of the source tree
>>> srctree := ..
>>> else
>>>
>>
>> Please resend cc'ing linux-kselftest
>>
>> thanks,
>> -- Shuah
>
>
> Please do not send this any more.
> This part is good as is.
>
+ linux-kselftest@vger.kernel.org
The reason I suggested resending cc'ing linux-kselftest is because
this fixes a kselftest problem.
I am assuming this patch will go through kbuild
Acked-by: Shuah Khan <skhan@linuxfoundation.org>
thanks,
-- Shuah
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v1] kbuild: fix sub directory output build of kselftests
2022-06-27 19:51 ` Shuah Khan
@ 2022-06-30 9:44 ` Muhammad Usama Anjum
2022-07-01 10:07 ` Masahiro Yamada
0 siblings, 1 reply; 6+ messages in thread
From: Muhammad Usama Anjum @ 2022-06-30 9:44 UTC (permalink / raw)
To: Shuah Khan, Masahiro Yamada
Cc: usama.anjum, Michal Marek, Nick Desaulniers, Kieran Bingham,
kernel, Linux Kbuild mailing list, Linux Kernel Mailing List,
linux-kselftest, guillaume.tucker
Hi Masahiro,
>>> Please resend cc'ing linux-kselftest
>>>
>>> thanks,
>>> -- Shuah
>>
>>
>> Please do not send this any more.
>> This part is good as is.
I'm confused. Have you accepted or rejected the patch?
>>
>
> + linux-kselftest@vger.kernel.org
>
> The reason I suggested resending cc'ing linux-kselftest is because
> this fixes a kselftest problem.
>
> I am assuming this patch will go through kbuild
>
> Acked-by: Shuah Khan <skhan@linuxfoundation.org>
--
Muhammad Usama Anjum
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v1] kbuild: fix sub directory output build of kselftests
2022-06-30 9:44 ` Muhammad Usama Anjum
@ 2022-07-01 10:07 ` Masahiro Yamada
0 siblings, 0 replies; 6+ messages in thread
From: Masahiro Yamada @ 2022-07-01 10:07 UTC (permalink / raw)
To: Muhammad Usama Anjum
Cc: Shuah Khan, Michal Marek, Nick Desaulniers, Kieran Bingham,
kernel, Linux Kbuild mailing list, Linux Kernel Mailing List,
open list:KERNEL SELFTEST FRAMEWORK, guillaume.tucker
On Thu, Jun 30, 2022 at 6:44 PM Muhammad Usama Anjum
<usama.anjum@collabora.com> wrote:
>
> Hi Masahiro,
>
> >>> Please resend cc'ing linux-kselftest
> >>>
> >>> thanks,
> >>> -- Shuah
> >>
> >>
> >> Please do not send this any more.
> >> This part is good as is.
> I'm confused. Have you accepted or rejected the patch?
Sorry for confusion.
Rejected.
>
> >>
> >
> > + linux-kselftest@vger.kernel.org
> >
> > The reason I suggested resending cc'ing linux-kselftest is because
> > this fixes a kselftest problem.
> >
> > I am assuming this patch will go through kbuild
> >
> > Acked-by: Shuah Khan <skhan@linuxfoundation.org>
>
>
> --
> Muhammad Usama Anjum
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-07-01 10:09 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-27 7:02 [PATCH v1] kbuild: fix sub directory output build of kselftests Muhammad Usama Anjum
2022-06-27 16:54 ` Shuah Khan
2022-06-27 17:45 ` Masahiro Yamada
2022-06-27 19:51 ` Shuah Khan
2022-06-30 9:44 ` Muhammad Usama Anjum
2022-07-01 10:07 ` Masahiro Yamada
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.