diff mbox series

drm/i915: fix header test with GCOV

Message ID 20200221105414.14358-1-jani.nikula@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915: fix header test with GCOV | expand

Commit Message

Jani Nikula Feb. 21, 2020, 10:54 a.m. UTC
$(CC) with $(CFLAGS_GCOV) assumes the output filename with .gcno suffix
appended is writable. This is not the case when the output filename is
/dev/null:

  HDRTEST drivers/gpu/drm/i915/display/intel_frontbuffer.h
/dev/null:1:0: error: cannot open /dev/null.gcno
  HDRTEST drivers/gpu/drm/i915/display/intel_ddi.h
/dev/null:1:0: error: cannot open /dev/null.gcno
make[5]: *** [../drivers/gpu/drm/i915/Makefile:307:
drivers/gpu/drm/i915/display/intel_ddi.hdrtest] Error 1
make[5]: *** Waiting for unfinished jobs....
make[5]: *** [../drivers/gpu/drm/i915/Makefile:307:
drivers/gpu/drm/i915/display/intel_frontbuffer.hdrtest] Error 1

Filter out $(CFLAGS_GVOC) from the header test $(c_flags) as they don't
make sense here anyway.

References: http://lore.kernel.org/r/d8112767-4089-4c58-d7d3-2ce03139858a@infradead.org
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Fixes: c6d4a099a240 ("drm/i915: reimplement header test feature")
Cc: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Randy Dunlap Feb. 21, 2020, 3:59 p.m. UTC | #1
On 2/21/20 2:54 AM, Jani Nikula wrote:
> $(CC) with $(CFLAGS_GCOV) assumes the output filename with .gcno suffix
> appended is writable. This is not the case when the output filename is
> /dev/null:
> 
>   HDRTEST drivers/gpu/drm/i915/display/intel_frontbuffer.h
> /dev/null:1:0: error: cannot open /dev/null.gcno
>   HDRTEST drivers/gpu/drm/i915/display/intel_ddi.h
> /dev/null:1:0: error: cannot open /dev/null.gcno
> make[5]: *** [../drivers/gpu/drm/i915/Makefile:307:
> drivers/gpu/drm/i915/display/intel_ddi.hdrtest] Error 1
> make[5]: *** Waiting for unfinished jobs....
> make[5]: *** [../drivers/gpu/drm/i915/Makefile:307:
> drivers/gpu/drm/i915/display/intel_frontbuffer.hdrtest] Error 1
> 
> Filter out $(CFLAGS_GVOC) from the header test $(c_flags) as they don't
> make sense here anyway.
> 
> References: http://lore.kernel.org/r/d8112767-4089-4c58-d7d3-2ce03139858a@infradead.org
> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> Fixes: c6d4a099a240 ("drm/i915: reimplement header test feature")
> Cc: Masahiro Yamada <masahiroy@kernel.org>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>

Acked-by: Randy Dunlap <rdunlap@infradead.org> # build-tested

Thanks.

> ---
>  drivers/gpu/drm/i915/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile
> index b314d44ded5e..bc28c31c4f78 100644
> --- a/drivers/gpu/drm/i915/Makefile
> +++ b/drivers/gpu/drm/i915/Makefile
> @@ -301,7 +301,7 @@ extra-$(CONFIG_DRM_I915_WERROR) += \
>  		$(shell cd $(srctree)/$(src) && find * -name '*.h')))
>  
>  quiet_cmd_hdrtest = HDRTEST $(patsubst %.hdrtest,%.h,$@)
> -      cmd_hdrtest = $(CC) $(c_flags) -S -o /dev/null -x c /dev/null -include $<; touch $@
> +      cmd_hdrtest = $(CC) $(filter-out $(CFLAGS_GCOV), $(c_flags)) -S -o /dev/null -x c /dev/null -include $<; touch $@
>  
>  $(obj)/%.hdrtest: $(src)/%.h FORCE
>  	$(call if_changed_dep,hdrtest)
>
Masahiro Yamada Feb. 22, 2020, 4:43 a.m. UTC | #2
Hi Jani,

On Fri, Feb 21, 2020 at 7:54 PM Jani Nikula <jani.nikula@intel.com> wrote:
>
> $(CC) with $(CFLAGS_GCOV) assumes the output filename with .gcno suffix
> appended is writable. This is not the case when the output filename is
> /dev/null:
>
>   HDRTEST drivers/gpu/drm/i915/display/intel_frontbuffer.h
> /dev/null:1:0: error: cannot open /dev/null.gcno
>   HDRTEST drivers/gpu/drm/i915/display/intel_ddi.h
> /dev/null:1:0: error: cannot open /dev/null.gcno
> make[5]: *** [../drivers/gpu/drm/i915/Makefile:307:
> drivers/gpu/drm/i915/display/intel_ddi.hdrtest] Error 1
> make[5]: *** Waiting for unfinished jobs....
> make[5]: *** [../drivers/gpu/drm/i915/Makefile:307:
> drivers/gpu/drm/i915/display/intel_frontbuffer.hdrtest] Error 1
>
> Filter out $(CFLAGS_GVOC) from the header test $(c_flags) as they don't
> make sense here anyway.



Is GCOV the only case that produces a separate file?

Could you also test CONFIG_DEBUG_INFO_SPLIT, please ?


The GCC manual says this:

-gsplit-dwarf

   Separate as much DWARF debugging information as possible into a
separate output
   file with the extension .dwo. This option allows the build system
to avoid linking
   files with debug information. To be useful, this option requires a debugger
   capable of reading .dwo files.




If this does not work, filtering flags
does not seem to be a maintainable way.




>
> References: http://lore.kernel.org/r/d8112767-4089-4c58-d7d3-2ce03139858a@infradead.org
> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> Fixes: c6d4a099a240 ("drm/i915: reimplement header test feature")
> Cc: Masahiro Yamada <masahiroy@kernel.org>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  drivers/gpu/drm/i915/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile
> index b314d44ded5e..bc28c31c4f78 100644
> --- a/drivers/gpu/drm/i915/Makefile
> +++ b/drivers/gpu/drm/i915/Makefile
> @@ -301,7 +301,7 @@ extra-$(CONFIG_DRM_I915_WERROR) += \
>                 $(shell cd $(srctree)/$(src) && find * -name '*.h')))
>
>  quiet_cmd_hdrtest = HDRTEST $(patsubst %.hdrtest,%.h,$@)
> -      cmd_hdrtest = $(CC) $(c_flags) -S -o /dev/null -x c /dev/null -include $<; touch $@
> +      cmd_hdrtest = $(CC) $(filter-out $(CFLAGS_GCOV), $(c_flags)) -S -o /dev/null -x c /dev/null -include $<; touch $@
>
>  $(obj)/%.hdrtest: $(src)/%.h FORCE
>         $(call if_changed_dep,hdrtest)
> --
> 2.20.1
>
Masahiro Yamada Feb. 22, 2020, 4:53 a.m. UTC | #3
On Sat, Feb 22, 2020 at 1:43 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> Hi Jani,
>
> On Fri, Feb 21, 2020 at 7:54 PM Jani Nikula <jani.nikula@intel.com> wrote:
> >
> > $(CC) with $(CFLAGS_GCOV) assumes the output filename with .gcno suffix
> > appended is writable. This is not the case when the output filename is
> > /dev/null:
> >
> >   HDRTEST drivers/gpu/drm/i915/display/intel_frontbuffer.h
> > /dev/null:1:0: error: cannot open /dev/null.gcno
> >   HDRTEST drivers/gpu/drm/i915/display/intel_ddi.h
> > /dev/null:1:0: error: cannot open /dev/null.gcno
> > make[5]: *** [../drivers/gpu/drm/i915/Makefile:307:
> > drivers/gpu/drm/i915/display/intel_ddi.hdrtest] Error 1
> > make[5]: *** Waiting for unfinished jobs....
> > make[5]: *** [../drivers/gpu/drm/i915/Makefile:307:
> > drivers/gpu/drm/i915/display/intel_frontbuffer.hdrtest] Error 1
> >
> > Filter out $(CFLAGS_GVOC) from the header test $(c_flags) as they don't
> > make sense here anyway.
>
>
>
> Is GCOV the only case that produces a separate file?
>
> Could you also test CONFIG_DEBUG_INFO_SPLIT, please ?
>
>
> The GCC manual says this:
>
> -gsplit-dwarf
>
>    Separate as much DWARF debugging information as possible into a
> separate output
>    file with the extension .dwo. This option allows the build system
> to avoid linking
>    files with debug information. To be useful, this option requires a debugger
>    capable of reading .dwo files.
>


I just tested it.

This is not a problem for header test
because cmd_hdrtest uses '-S' instead of '-c'.

If '-c' were used, we would see a similar error.


So, gsplit-dwarf is OK.




>
>
> If this does not work, filtering flags
> does not seem to be a maintainable way.
>
>
>
>
> >
> > References: http://lore.kernel.org/r/d8112767-4089-4c58-d7d3-2ce03139858a@infradead.org
> > Reported-by: Randy Dunlap <rdunlap@infradead.org>
> > Fixes: c6d4a099a240 ("drm/i915: reimplement header test feature")
> > Cc: Masahiro Yamada <masahiroy@kernel.org>
> > Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> > ---
> >  drivers/gpu/drm/i915/Makefile | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile
> > index b314d44ded5e..bc28c31c4f78 100644
> > --- a/drivers/gpu/drm/i915/Makefile
> > +++ b/drivers/gpu/drm/i915/Makefile
> > @@ -301,7 +301,7 @@ extra-$(CONFIG_DRM_I915_WERROR) += \
> >                 $(shell cd $(srctree)/$(src) && find * -name '*.h')))
> >
> >  quiet_cmd_hdrtest = HDRTEST $(patsubst %.hdrtest,%.h,$@)
> > -      cmd_hdrtest = $(CC) $(c_flags) -S -o /dev/null -x c /dev/null -include $<; touch $@
> > +      cmd_hdrtest = $(CC) $(filter-out $(CFLAGS_GCOV), $(c_flags)) -S -o /dev/null -x c /dev/null -include $<; touch $@
> >
> >  $(obj)/%.hdrtest: $(src)/%.h FORCE
> >         $(call if_changed_dep,hdrtest)
> > --
> > 2.20.1
> >
>
>
> --
> Best Regards
> Masahiro Yamada
Randy Dunlap Feb. 22, 2020, 5:25 a.m. UTC | #4
On 2/21/20 8:53 PM, Masahiro Yamada wrote:
> On Sat, Feb 22, 2020 at 1:43 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
>>
>> Hi Jani,
>>
>> On Fri, Feb 21, 2020 at 7:54 PM Jani Nikula <jani.nikula@intel.com> wrote:
>>>
>>> $(CC) with $(CFLAGS_GCOV) assumes the output filename with .gcno suffix
>>> appended is writable. This is not the case when the output filename is
>>> /dev/null:
>>>
>>>   HDRTEST drivers/gpu/drm/i915/display/intel_frontbuffer.h
>>> /dev/null:1:0: error: cannot open /dev/null.gcno
>>>   HDRTEST drivers/gpu/drm/i915/display/intel_ddi.h
>>> /dev/null:1:0: error: cannot open /dev/null.gcno
>>> make[5]: *** [../drivers/gpu/drm/i915/Makefile:307:
>>> drivers/gpu/drm/i915/display/intel_ddi.hdrtest] Error 1
>>> make[5]: *** Waiting for unfinished jobs....
>>> make[5]: *** [../drivers/gpu/drm/i915/Makefile:307:
>>> drivers/gpu/drm/i915/display/intel_frontbuffer.hdrtest] Error 1
>>>
>>> Filter out $(CFLAGS_GVOC) from the header test $(c_flags) as they don't
>>> make sense here anyway.
>>
>>
>>
>> Is GCOV the only case that produces a separate file?
>>
>> Could you also test CONFIG_DEBUG_INFO_SPLIT, please ?
>>
>>
>> The GCC manual says this:
>>
>> -gsplit-dwarf
>>
>>    Separate as much DWARF debugging information as possible into a
>> separate output
>>    file with the extension .dwo. This option allows the build system
>> to avoid linking
>>    files with debug information. To be useful, this option requires a debugger
>>    capable of reading .dwo files.
>>
> 
> 
> I just tested it.
> 
> This is not a problem for header test
> because cmd_hdrtest uses '-S' instead of '-c'.
> 
> If '-c' were used, we would see a similar error.
> 
> 
> So, gsplit-dwarf is OK.

Yes, works for me also.

(I think you have a faster build machine that I do. I began the build
almost immediately after reading your email. :)
Masahiro Yamada Feb. 22, 2020, 5:49 a.m. UTC | #5
On Sat, Feb 22, 2020 at 2:25 PM Randy Dunlap <rdunlap@infradead.org> wrote:
>
> On 2/21/20 8:53 PM, Masahiro Yamada wrote:
> > On Sat, Feb 22, 2020 at 1:43 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
> >>
> >> Hi Jani,
> >>
> >> On Fri, Feb 21, 2020 at 7:54 PM Jani Nikula <jani.nikula@intel.com> wrote:
> >>>
> >>> $(CC) with $(CFLAGS_GCOV) assumes the output filename with .gcno suffix
> >>> appended is writable. This is not the case when the output filename is
> >>> /dev/null:
> >>>
> >>>   HDRTEST drivers/gpu/drm/i915/display/intel_frontbuffer.h
> >>> /dev/null:1:0: error: cannot open /dev/null.gcno
> >>>   HDRTEST drivers/gpu/drm/i915/display/intel_ddi.h
> >>> /dev/null:1:0: error: cannot open /dev/null.gcno
> >>> make[5]: *** [../drivers/gpu/drm/i915/Makefile:307:
> >>> drivers/gpu/drm/i915/display/intel_ddi.hdrtest] Error 1
> >>> make[5]: *** Waiting for unfinished jobs....
> >>> make[5]: *** [../drivers/gpu/drm/i915/Makefile:307:
> >>> drivers/gpu/drm/i915/display/intel_frontbuffer.hdrtest] Error 1
> >>>
> >>> Filter out $(CFLAGS_GVOC) from the header test $(c_flags) as they don't
> >>> make sense here anyway.
> >>
> >>
> >>
> >> Is GCOV the only case that produces a separate file?
> >>
> >> Could you also test CONFIG_DEBUG_INFO_SPLIT, please ?
> >>
> >>
> >> The GCC manual says this:
> >>
> >> -gsplit-dwarf
> >>
> >>    Separate as much DWARF debugging information as possible into a
> >> separate output
> >>    file with the extension .dwo. This option allows the build system
> >> to avoid linking
> >>    files with debug information. To be useful, this option requires a debugger
> >>    capable of reading .dwo files.
> >>
> >
> >
> > I just tested it.
> >
> > This is not a problem for header test
> > because cmd_hdrtest uses '-S' instead of '-c'.
> >
> > If '-c' were used, we would see a similar error.
> >
> >
> > So, gsplit-dwarf is OK.
>
> Yes, works for me also.
>
> (I think you have a faster build machine that I do. I began the build
> almost immediately after reading your email. :)


I use a reasonable PC for my development.
(core-i9 with 4 physical cores)


I just compiled under i915/ with this command:

make drivers/gpu/drm/i915/
Randy Dunlap Feb. 22, 2020, 5:53 a.m. UTC | #6
On 2/21/20 9:49 PM, Masahiro Yamada wrote:
> On Sat, Feb 22, 2020 at 2:25 PM Randy Dunlap <rdunlap@infradead.org> wrote:
>>
>> On 2/21/20 8:53 PM, Masahiro Yamada wrote:
>>> On Sat, Feb 22, 2020 at 1:43 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
>>>>
>>>> Hi Jani,
>>>>
>>>> On Fri, Feb 21, 2020 at 7:54 PM Jani Nikula <jani.nikula@intel.com> wrote:
>>>>>
>>>>> $(CC) with $(CFLAGS_GCOV) assumes the output filename with .gcno suffix
>>>>> appended is writable. This is not the case when the output filename is
>>>>> /dev/null:
>>>>>
>>>>>   HDRTEST drivers/gpu/drm/i915/display/intel_frontbuffer.h
>>>>> /dev/null:1:0: error: cannot open /dev/null.gcno
>>>>>   HDRTEST drivers/gpu/drm/i915/display/intel_ddi.h
>>>>> /dev/null:1:0: error: cannot open /dev/null.gcno
>>>>> make[5]: *** [../drivers/gpu/drm/i915/Makefile:307:
>>>>> drivers/gpu/drm/i915/display/intel_ddi.hdrtest] Error 1
>>>>> make[5]: *** Waiting for unfinished jobs....
>>>>> make[5]: *** [../drivers/gpu/drm/i915/Makefile:307:
>>>>> drivers/gpu/drm/i915/display/intel_frontbuffer.hdrtest] Error 1
>>>>>
>>>>> Filter out $(CFLAGS_GVOC) from the header test $(c_flags) as they don't
>>>>> make sense here anyway.
>>>>
>>>>
>>>>
>>>> Is GCOV the only case that produces a separate file?
>>>>
>>>> Could you also test CONFIG_DEBUG_INFO_SPLIT, please ?
>>>>
>>>>
>>>> The GCC manual says this:
>>>>
>>>> -gsplit-dwarf
>>>>
>>>>    Separate as much DWARF debugging information as possible into a
>>>> separate output
>>>>    file with the extension .dwo. This option allows the build system
>>>> to avoid linking
>>>>    files with debug information. To be useful, this option requires a debugger
>>>>    capable of reading .dwo files.
>>>>
>>>
>>>
>>> I just tested it.
>>>
>>> This is not a problem for header test
>>> because cmd_hdrtest uses '-S' instead of '-c'.
>>>
>>> If '-c' were used, we would see a similar error.
>>>
>>>
>>> So, gsplit-dwarf is OK.
>>
>> Yes, works for me also.
>>
>> (I think you have a faster build machine that I do. I began the build
>> almost immediately after reading your email. :)
> 
> 
> I use a reasonable PC for my development.
> (core-i9 with 4 physical cores)
> 
> 
> I just compiled under i915/ with this command:
> 
> make drivers/gpu/drm/i915/

Good trick.  I did a full build.
Jani Nikula Feb. 24, 2020, 12:22 p.m. UTC | #7
On Fri, 21 Feb 2020, Randy Dunlap <rdunlap@infradead.org> wrote:
> On 2/21/20 2:54 AM, Jani Nikula wrote:
>> $(CC) with $(CFLAGS_GCOV) assumes the output filename with .gcno suffix
>> appended is writable. This is not the case when the output filename is
>> /dev/null:
>> 
>>   HDRTEST drivers/gpu/drm/i915/display/intel_frontbuffer.h
>> /dev/null:1:0: error: cannot open /dev/null.gcno
>>   HDRTEST drivers/gpu/drm/i915/display/intel_ddi.h
>> /dev/null:1:0: error: cannot open /dev/null.gcno
>> make[5]: *** [../drivers/gpu/drm/i915/Makefile:307:
>> drivers/gpu/drm/i915/display/intel_ddi.hdrtest] Error 1
>> make[5]: *** Waiting for unfinished jobs....
>> make[5]: *** [../drivers/gpu/drm/i915/Makefile:307:
>> drivers/gpu/drm/i915/display/intel_frontbuffer.hdrtest] Error 1
>> 
>> Filter out $(CFLAGS_GVOC) from the header test $(c_flags) as they don't
>> make sense here anyway.
>> 
>> References: http://lore.kernel.org/r/d8112767-4089-4c58-d7d3-2ce03139858a@infradead.org
>> Reported-by: Randy Dunlap <rdunlap@infradead.org>
>> Fixes: c6d4a099a240 ("drm/i915: reimplement header test feature")
>> Cc: Masahiro Yamada <masahiroy@kernel.org>
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>
> Acked-by: Randy Dunlap <rdunlap@infradead.org> # build-tested

And pushed, thanks for the ack.

BR,
Jani.

>
> Thanks.
>
>> ---
>>  drivers/gpu/drm/i915/Makefile | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile
>> index b314d44ded5e..bc28c31c4f78 100644
>> --- a/drivers/gpu/drm/i915/Makefile
>> +++ b/drivers/gpu/drm/i915/Makefile
>> @@ -301,7 +301,7 @@ extra-$(CONFIG_DRM_I915_WERROR) += \
>>  		$(shell cd $(srctree)/$(src) && find * -name '*.h')))
>>  
>>  quiet_cmd_hdrtest = HDRTEST $(patsubst %.hdrtest,%.h,$@)
>> -      cmd_hdrtest = $(CC) $(c_flags) -S -o /dev/null -x c /dev/null -include $<; touch $@
>> +      cmd_hdrtest = $(CC) $(filter-out $(CFLAGS_GCOV), $(c_flags)) -S -o /dev/null -x c /dev/null -include $<; touch $@
>>  
>>  $(obj)/%.hdrtest: $(src)/%.h FORCE
>>  	$(call if_changed_dep,hdrtest)
>>
Jani Nikula Feb. 24, 2020, 12:29 p.m. UTC | #8
On Fri, 21 Feb 2020, Randy Dunlap <rdunlap@infradead.org> wrote:
> On 2/21/20 9:49 PM, Masahiro Yamada wrote:
>> On Sat, Feb 22, 2020 at 2:25 PM Randy Dunlap <rdunlap@infradead.org> wrote:
>>>
>>> On 2/21/20 8:53 PM, Masahiro Yamada wrote:
>>>> On Sat, Feb 22, 2020 at 1:43 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
>>>>>
>>>>> Hi Jani,
>>>>>
>>>>> On Fri, Feb 21, 2020 at 7:54 PM Jani Nikula <jani.nikula@intel.com> wrote:
>>>>>>
>>>>>> $(CC) with $(CFLAGS_GCOV) assumes the output filename with .gcno suffix
>>>>>> appended is writable. This is not the case when the output filename is
>>>>>> /dev/null:
>>>>>>
>>>>>>   HDRTEST drivers/gpu/drm/i915/display/intel_frontbuffer.h
>>>>>> /dev/null:1:0: error: cannot open /dev/null.gcno
>>>>>>   HDRTEST drivers/gpu/drm/i915/display/intel_ddi.h
>>>>>> /dev/null:1:0: error: cannot open /dev/null.gcno
>>>>>> make[5]: *** [../drivers/gpu/drm/i915/Makefile:307:
>>>>>> drivers/gpu/drm/i915/display/intel_ddi.hdrtest] Error 1
>>>>>> make[5]: *** Waiting for unfinished jobs....
>>>>>> make[5]: *** [../drivers/gpu/drm/i915/Makefile:307:
>>>>>> drivers/gpu/drm/i915/display/intel_frontbuffer.hdrtest] Error 1
>>>>>>
>>>>>> Filter out $(CFLAGS_GVOC) from the header test $(c_flags) as they don't
>>>>>> make sense here anyway.
>>>>>
>>>>>
>>>>>
>>>>> Is GCOV the only case that produces a separate file?
>>>>>
>>>>> Could you also test CONFIG_DEBUG_INFO_SPLIT, please ?
>>>>>
>>>>>
>>>>> The GCC manual says this:
>>>>>
>>>>> -gsplit-dwarf
>>>>>
>>>>>    Separate as much DWARF debugging information as possible into a
>>>>> separate output
>>>>>    file with the extension .dwo. This option allows the build system
>>>>> to avoid linking
>>>>>    files with debug information. To be useful, this option requires a debugger
>>>>>    capable of reading .dwo files.
>>>>>
>>>>
>>>>
>>>> I just tested it.
>>>>
>>>> This is not a problem for header test
>>>> because cmd_hdrtest uses '-S' instead of '-c'.
>>>>
>>>> If '-c' were used, we would see a similar error.
>>>>
>>>>
>>>> So, gsplit-dwarf is OK.
>>>
>>> Yes, works for me also.
>>>
>>> (I think you have a faster build machine that I do. I began the build
>>> almost immediately after reading your email. :)
>> 
>> 
>> I use a reasonable PC for my development.
>> (core-i9 with 4 physical cores)
>> 
>> 
>> I just compiled under i915/ with this command:
>> 
>> make drivers/gpu/drm/i915/
>
> Good trick.  I did a full build.

Thanks for the testing.

I also checked with some other options, did not see any failures. I'll
go with this for now, let's revisit as needed.

Another related thing is we try to hide this a bit from build testing
outside of our CI with "depends on !COMPILE_TEST" but I guess there's no
way to ensure something is not enabled on a randconfig build...

BR,
Jani.
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile
index b314d44ded5e..bc28c31c4f78 100644
--- a/drivers/gpu/drm/i915/Makefile
+++ b/drivers/gpu/drm/i915/Makefile
@@ -301,7 +301,7 @@  extra-$(CONFIG_DRM_I915_WERROR) += \
 		$(shell cd $(srctree)/$(src) && find * -name '*.h')))
 
 quiet_cmd_hdrtest = HDRTEST $(patsubst %.hdrtest,%.h,$@)
-      cmd_hdrtest = $(CC) $(c_flags) -S -o /dev/null -x c /dev/null -include $<; touch $@
+      cmd_hdrtest = $(CC) $(filter-out $(CFLAGS_GCOV), $(c_flags)) -S -o /dev/null -x c /dev/null -include $<; touch $@
 
 $(obj)/%.hdrtest: $(src)/%.h FORCE
 	$(call if_changed_dep,hdrtest)