diff mbox series

[3/7] meltdown: Set CFLAGS for check targets

Message ID 20210629072710.23800-4-rpalethorpe@suse.com
State Superseded
Headers show
Series Sparse based checker and rule proposal | expand

Commit Message

Richard Palethorpe June 29, 2021, 7:27 a.m. UTC
The include set in the CFLAGS is necessary for Sparse to parse the
test source. If a specific target has variables set on it. Then these
won't be available to the corresponding check-target. Usually this is
not a problem because most variables set on a target are just for
linking and the checker doesn't need them.

Signed-off-by: Richard Palethorpe <rpalethorpe@suse.com>
---
 testcases/cve/Makefile | 1 +
 1 file changed, 1 insertion(+)

Comments

Cyril Hrubis July 8, 2021, 1:11 p.m. UTC | #1
Hi!
> The include set in the CFLAGS is necessary for Sparse to parse the
> test source. If a specific target has variables set on it. Then these
> won't be available to the corresponding check-target. Usually this is
> not a problem because most variables set on a target are just for
> linking and the checker doesn't need them.
> 
> Signed-off-by: Richard Palethorpe <rpalethorpe@suse.com>
> ---
>  testcases/cve/Makefile | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/testcases/cve/Makefile b/testcases/cve/Makefile
> index ddf8b6fe1..7b011b6c9 100644
> --- a/testcases/cve/Makefile
> +++ b/testcases/cve/Makefile
> @@ -19,6 +19,7 @@ cve-2014-0196:  LDLIBS += -lutil
>  endif
>  
>  meltdown: CFLAGS += -I$(abs_srcdir)/../realtime/include
> +check-meltdown: CFLAGS += -I$(abs_srcdir)/../realtime/include

Uff, this will likely bite us in a different ways later on.

I guess that it would be cleaner to move the libtsc.h into top level
include so that it's clear that the header is used in several tests.
Richard Palethorpe July 9, 2021, 7:49 a.m. UTC | #2
Hello,

Cyril Hrubis <chrubis@suse.cz> writes:

> Hi!
>> The include set in the CFLAGS is necessary for Sparse to parse the
>> test source. If a specific target has variables set on it. Then these
>> won't be available to the corresponding check-target. Usually this is
>> not a problem because most variables set on a target are just for
>> linking and the checker doesn't need them.
>> 
>> Signed-off-by: Richard Palethorpe <rpalethorpe@suse.com>
>> ---
>>  testcases/cve/Makefile | 1 +
>>  1 file changed, 1 insertion(+)
>> 
>> diff --git a/testcases/cve/Makefile b/testcases/cve/Makefile
>> index ddf8b6fe1..7b011b6c9 100644
>> --- a/testcases/cve/Makefile
>> +++ b/testcases/cve/Makefile
>> @@ -19,6 +19,7 @@ cve-2014-0196:  LDLIBS += -lutil
>>  endif
>>  
>>  meltdown: CFLAGS += -I$(abs_srcdir)/../realtime/include
>> +check-meltdown: CFLAGS += -I$(abs_srcdir)/../realtime/include
>
> Uff, this will likely bite us in a different ways later on.
>
> I guess that it would be cleaner to move the libtsc.h into top level
> include so that it's clear that the header is used in several tests.

+1
diff mbox series

Patch

diff --git a/testcases/cve/Makefile b/testcases/cve/Makefile
index ddf8b6fe1..7b011b6c9 100644
--- a/testcases/cve/Makefile
+++ b/testcases/cve/Makefile
@@ -19,6 +19,7 @@  cve-2014-0196:  LDLIBS += -lutil
 endif
 
 meltdown: CFLAGS += -I$(abs_srcdir)/../realtime/include
+check-meltdown: CFLAGS += -I$(abs_srcdir)/../realtime/include
 
 ifneq (,$(filter $(HOST_CPU),x86 x86_64))
 meltdown: CFLAGS += -msse2