LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] kbuild: Don't pass -rR to selftest makefiles
@ 2015-03-04 10:19 Michael Ellerman
  2015-03-09 14:28 ` Shuah Khan
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Ellerman @ 2015-03-04 10:19 UTC (permalink / raw)
  To: shuahkh; +Cc: linux-kernel, davej, mmarek, linux-api

The makefiles under tools/testing/selftests are not real kbuild
makefiles, they are regular stand alone makefiles. As such they *do*
want all the standard implicit rules and variables defined.

So before calling those makefiles, filter -rR out of MAKEFLAGS.

Without this not all the selftests are built correctly when called via
the top-level Makefile.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index e6a9b1b94656..da72798644fd 100644
--- a/Makefile
+++ b/Makefile
@@ -1085,7 +1085,7 @@ headers_check: headers_install
 
 PHONY += kselftest
 kselftest:
-	$(Q)$(MAKE) -C tools/testing/selftests run_tests
+	$(Q)$(MAKE) -C tools/testing/selftests MAKEFLAGS="$(filter-out rR,$(MAKEFLAGS))" run_tests
 
 # ---------------------------------------------------------------------------
 # Modules
-- 
2.1.0


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

* Re: [PATCH] kbuild: Don't pass -rR to selftest makefiles
  2015-03-04 10:19 [PATCH] kbuild: Don't pass -rR to selftest makefiles Michael Ellerman
@ 2015-03-09 14:28 ` Shuah Khan
  2015-03-09 22:49   ` Shuah Khan
  0 siblings, 1 reply; 8+ messages in thread
From: Shuah Khan @ 2015-03-09 14:28 UTC (permalink / raw)
  To: Michael Ellerman, mmarek; +Cc: linux-kernel, davej, linux-api

On 03/04/2015 03:19 AM, Michael Ellerman wrote:
> The makefiles under tools/testing/selftests are not real kbuild
> makefiles, they are regular stand alone makefiles. As such they *do*
> want all the standard implicit rules and variables defined.
> 
> So before calling those makefiles, filter -rR out of MAKEFLAGS.
> 
> Without this not all the selftests are built correctly when called via
> the top-level Makefile.
> 
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

Hi Michal,

Could you please take this patch in your tree.

Acked-by: Shuah Khan <shuahkh@osg.samsung.com>

thanks,
-- Shuah


-- 
Shuah Khan
Sr. Linux Kernel Developer
Open Source Innovation Group
Samsung Research America (Silicon Valley)
shuahkh@osg.samsung.com | (970) 217-8978

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

* Re: [PATCH] kbuild: Don't pass -rR to selftest makefiles
  2015-03-09 14:28 ` Shuah Khan
@ 2015-03-09 22:49   ` Shuah Khan
  2015-03-10 23:36     ` Michael Ellerman
  0 siblings, 1 reply; 8+ messages in thread
From: Shuah Khan @ 2015-03-09 22:49 UTC (permalink / raw)
  To: Michael Ellerman, mmarek; +Cc: linux-kernel, davej, linux-api

On 03/09/2015 08:28 AM, Shuah Khan wrote:
> On 03/04/2015 03:19 AM, Michael Ellerman wrote:
>> The makefiles under tools/testing/selftests are not real kbuild
>> makefiles, they are regular stand alone makefiles. As such they *do*
>> want all the standard implicit rules and variables defined.
>>
>> So before calling those makefiles, filter -rR out of MAKEFLAGS.
>>
>> Without this not all the selftests are built correctly when called via
>> the top-level Makefile.
>>
>> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> 
> Hi Michal,
> 
> Could you please take this patch in your tree.
> 
> Acked-by: Shuah Khan <shuahkh@osg.samsung.com>
> 

I am changing this to a Nack. This is not fully cooked.
I am seeing new failures on some tests.

gcc: error: elf_x86_64: No such file or directory
gcc: error: unrecognized command line option ‘-m’

thanks,
-- Shuah


-- 
Shuah Khan
Sr. Linux Kernel Developer
Open Source Innovation Group
Samsung Research America (Silicon Valley)
shuahkh@osg.samsung.com | (970) 217-8978

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

* Re: [PATCH] kbuild: Don't pass -rR to selftest makefiles
  2015-03-09 22:49   ` Shuah Khan
@ 2015-03-10 23:36     ` Michael Ellerman
  2015-03-10 23:39       ` Shuah Khan
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Ellerman @ 2015-03-10 23:36 UTC (permalink / raw)
  To: Shuah Khan; +Cc: mmarek, linux-kernel, davej, linux-api

On Mon, 2015-03-09 at 16:49 -0600, Shuah Khan wrote:
> On 03/09/2015 08:28 AM, Shuah Khan wrote:
> > On 03/04/2015 03:19 AM, Michael Ellerman wrote:
> >> The makefiles under tools/testing/selftests are not real kbuild
> >> makefiles, they are regular stand alone makefiles. As such they *do*
> >> want all the standard implicit rules and variables defined.
> >>
> >> So before calling those makefiles, filter -rR out of MAKEFLAGS.
> >>
> >> Without this not all the selftests are built correctly when called via
> >> the top-level Makefile.
> >>
> >> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> > 
> > Hi Michal,
> > 
> > Could you please take this patch in your tree.
> > 
> > Acked-by: Shuah Khan <shuahkh@osg.samsung.com>
> > 
> 
> I am changing this to a Nack. This is not fully cooked.
> I am seeing new failures on some tests.
> 
> gcc: error: elf_x86_64: No such file or directory
> gcc: error: unrecognized command line option ‘-m’

I can't reproduce that here. In what way do you think it's related to this
patch?

cheers




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

* Re: [PATCH] kbuild: Don't pass -rR to selftest makefiles
  2015-03-10 23:36     ` Michael Ellerman
@ 2015-03-10 23:39       ` Shuah Khan
  2015-03-10 23:49         ` Michael Ellerman
  0 siblings, 1 reply; 8+ messages in thread
From: Shuah Khan @ 2015-03-10 23:39 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: mmarek, linux-kernel, davej, linux-api

On 03/10/2015 05:36 PM, Michael Ellerman wrote:
> On Mon, 2015-03-09 at 16:49 -0600, Shuah Khan wrote:
>> On 03/09/2015 08:28 AM, Shuah Khan wrote:
>>> On 03/04/2015 03:19 AM, Michael Ellerman wrote:
>>>> The makefiles under tools/testing/selftests are not real kbuild
>>>> makefiles, they are regular stand alone makefiles. As such they *do*
>>>> want all the standard implicit rules and variables defined.
>>>>
>>>> So before calling those makefiles, filter -rR out of MAKEFLAGS.
>>>>
>>>> Without this not all the selftests are built correctly when called via
>>>> the top-level Makefile.
>>>>
>>>> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
>>>
>>> Hi Michal,
>>>
>>> Could you please take this patch in your tree.
>>>
>>> Acked-by: Shuah Khan <shuahkh@osg.samsung.com>
>>>
>>
>> I am changing this to a Nack. This is not fully cooked.
>> I am seeing new failures on some tests.
>>
>> gcc: error: elf_x86_64: No such file or directory
>> gcc: error: unrecognized command line option ‘-m’
> 
> I can't reproduce that here. In what way do you think it's related to this
> patch?
> 
> cheers

I have just your patch on tops of linux 4.0-rc3 and ran
make kselftest and that's what I see.

If you can fix this problem I can take your patch, otherwise,
I have to go with individual Makefiles fixes.

-- Shuah


-- 
Shuah Khan
Sr. Linux Kernel Developer
Open Source Innovation Group
Samsung Research America (Silicon Valley)
shuahkh@osg.samsung.com | (970) 217-8978

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

* Re: [PATCH] kbuild: Don't pass -rR to selftest makefiles
  2015-03-10 23:39       ` Shuah Khan
@ 2015-03-10 23:49         ` Michael Ellerman
  2015-03-11  0:35           ` Shuah Khan
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Ellerman @ 2015-03-10 23:49 UTC (permalink / raw)
  To: Shuah Khan; +Cc: mmarek, linux-kernel, davej, linux-api

On Tue, 2015-03-10 at 17:39 -0600, Shuah Khan wrote:
> On 03/10/2015 05:36 PM, Michael Ellerman wrote:
> > On Mon, 2015-03-09 at 16:49 -0600, Shuah Khan wrote:
> >> On 03/09/2015 08:28 AM, Shuah Khan wrote:
> >>> On 03/04/2015 03:19 AM, Michael Ellerman wrote:
> >>>> The makefiles under tools/testing/selftests are not real kbuild
> >>>> makefiles, they are regular stand alone makefiles. As such they *do*
> >>>> want all the standard implicit rules and variables defined.
> >>>>
> >>>> So before calling those makefiles, filter -rR out of MAKEFLAGS.
> >>>>
> >>>> Without this not all the selftests are built correctly when called via
> >>>> the top-level Makefile.
> >>>>
> >>>> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> >>>
> >>> Hi Michal,
> >>>
> >>> Could you please take this patch in your tree.
> >>>
> >>> Acked-by: Shuah Khan <shuahkh@osg.samsung.com>
> >>>
> >>
> >> I am changing this to a Nack. This is not fully cooked.
> >> I am seeing new failures on some tests.
> >>
> >> gcc: error: elf_x86_64: No such file or directory
> >> gcc: error: unrecognized command line option ‘-m’
> > 
> > I can't reproduce that here. In what way do you think it's related to this
> > patch?
> 
> I have just your patch on tops of linux 4.0-rc3 and ran
> make kselftest and that's what I see.
> 
> If you can fix this problem I can take your patch, otherwise,
> I have to go with individual Makefiles fixes.

OK I see it now, only happens on x86.

It looks like it's coming in via kbuild. Though I can only see it being set in
arch/x86/Makefile.um, and I don't know why that is being sourced. But it must
be.

So this is another symptom of running via the top-level Makefile rather than
directly.

I'll try and find a fix.

cheers



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

* Re: [PATCH] kbuild: Don't pass -rR to selftest makefiles
  2015-03-10 23:49         ` Michael Ellerman
@ 2015-03-11  0:35           ` Shuah Khan
  2015-03-11  0:46             ` Michael Ellerman
  0 siblings, 1 reply; 8+ messages in thread
From: Shuah Khan @ 2015-03-11  0:35 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: mmarek, linux-kernel, davej, linux-api

On 03/10/2015 05:49 PM, Michael Ellerman wrote:
> On Tue, 2015-03-10 at 17:39 -0600, Shuah Khan wrote:
>> On 03/10/2015 05:36 PM, Michael Ellerman wrote:
>>> On Mon, 2015-03-09 at 16:49 -0600, Shuah Khan wrote:
>>>> On 03/09/2015 08:28 AM, Shuah Khan wrote:
>>>>> On 03/04/2015 03:19 AM, Michael Ellerman wrote:
>>>>>> The makefiles under tools/testing/selftests are not real kbuild
>>>>>> makefiles, they are regular stand alone makefiles. As such they *do*
>>>>>> want all the standard implicit rules and variables defined.
>>>>>>
>>>>>> So before calling those makefiles, filter -rR out of MAKEFLAGS.
>>>>>>
>>>>>> Without this not all the selftests are built correctly when called via
>>>>>> the top-level Makefile.
>>>>>>
>>>>>> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
>>>>>
>>>>> Hi Michal,
>>>>>
>>>>> Could you please take this patch in your tree.
>>>>>
>>>>> Acked-by: Shuah Khan <shuahkh@osg.samsung.com>
>>>>>
>>>>
>>>> I am changing this to a Nack. This is not fully cooked.
>>>> I am seeing new failures on some tests.
>>>>
>>>> gcc: error: elf_x86_64: No such file or directory
>>>> gcc: error: unrecognized command line option ‘-m’
>>>
>>> I can't reproduce that here. In what way do you think it's related to this
>>> patch?
>>
>> I have just your patch on tops of linux 4.0-rc3 and ran
>> make kselftest and that's what I see.
>>
>> If you can fix this problem I can take your patch, otherwise,
>> I have to go with individual Makefiles fixes.
> 
> OK I see it now, only happens on x86.
> 
> It looks like it's coming in via kbuild. Though I can only see it being set in
> arch/x86/Makefile.um, and I don't know why that is being sourced. But it must
> be.
> 
> So this is another symptom of running via the top-level Makefile rather than
> directly.
> 
> I'll try and find a fix.
> 

If you can fix it that is great. I don't see any need to change
existing Makefiles to delete explicit rules based on this change
though.

thanks,
-- Shuah

-- 
Shuah Khan
Sr. Linux Kernel Developer
Open Source Innovation Group
Samsung Research America (Silicon Valley)
shuahkh@osg.samsung.com | (970) 217-8978

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

* Re: [PATCH] kbuild: Don't pass -rR to selftest makefiles
  2015-03-11  0:35           ` Shuah Khan
@ 2015-03-11  0:46             ` Michael Ellerman
  0 siblings, 0 replies; 8+ messages in thread
From: Michael Ellerman @ 2015-03-11  0:46 UTC (permalink / raw)
  To: Shuah Khan; +Cc: mmarek, linux-kernel, davej, linux-api

On Tue, 2015-03-10 at 18:35 -0600, Shuah Khan wrote:
> On 03/10/2015 05:49 PM, Michael Ellerman wrote:
> > On Tue, 2015-03-10 at 17:39 -0600, Shuah Khan wrote:
> >> On 03/10/2015 05:36 PM, Michael Ellerman wrote:
> >>> On Mon, 2015-03-09 at 16:49 -0600, Shuah Khan wrote:
> >>>> On 03/09/2015 08:28 AM, Shuah Khan wrote:
> >>>>> On 03/04/2015 03:19 AM, Michael Ellerman wrote:
> >>>>>> The makefiles under tools/testing/selftests are not real kbuild
> >>>>>> makefiles, they are regular stand alone makefiles. As such they *do*
> >>>>>> want all the standard implicit rules and variables defined.
> >>>>>>
> >>>>>> So before calling those makefiles, filter -rR out of MAKEFLAGS.
> >>>>>>
> >>>>>> Without this not all the selftests are built correctly when called via
> >>>>>> the top-level Makefile.
> >>>>>>
> >>>>>> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> >>>>>
> >>>>> Hi Michal,
> >>>>>
> >>>>> Could you please take this patch in your tree.
> >>>>>
> >>>>> Acked-by: Shuah Khan <shuahkh@osg.samsung.com>
> >>>>>
> >>>>
> >>>> I am changing this to a Nack. This is not fully cooked.
> >>>> I am seeing new failures on some tests.
> >>>>
> >>>> gcc: error: elf_x86_64: No such file or directory
> >>>> gcc: error: unrecognized command line option ‘-m’
> >>>
> >>> I can't reproduce that here. In what way do you think it's related to this
> >>> patch?
> >>
> >> I have just your patch on tops of linux 4.0-rc3 and ran
> >> make kselftest and that's what I see.
> >>
> >> If you can fix this problem I can take your patch, otherwise,
> >> I have to go with individual Makefiles fixes.
> > 
> > OK I see it now, only happens on x86.
> > 
> > It looks like it's coming in via kbuild. Though I can only see it being set in
> > arch/x86/Makefile.um, and I don't know why that is being sourced. But it must
> > be.
> > 
> > So this is another symptom of running via the top-level Makefile rather than
> > directly.
> > 
> > I'll try and find a fix.
> 
> If you can fix it that is great. I don't see any need to change
> existing Makefiles to delete explicit rules based on this change
> though.

I do. The explicit rules are generally wrong in some way, ie. they use flags
inconsistently, or they don't use CROSS_COMPILE when they should.

There should be no need to have explicit rules for simple tests that just build
a binary from a .c file.

cheers




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

end of thread, other threads:[~2015-03-11  0:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-04 10:19 [PATCH] kbuild: Don't pass -rR to selftest makefiles Michael Ellerman
2015-03-09 14:28 ` Shuah Khan
2015-03-09 22:49   ` Shuah Khan
2015-03-10 23:36     ` Michael Ellerman
2015-03-10 23:39       ` Shuah Khan
2015-03-10 23:49         ` Michael Ellerman
2015-03-11  0:35           ` Shuah Khan
2015-03-11  0:46             ` Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).