system/meson: Restrict libSDL/libpmem/libdaxctl CPPFLAGS to vl/physmem
cover system/meson: Restrict libSDL/libpmem/libdaxctl CPPFLAGS to vl/physmem
Extracted from a huge branch where files are moved from specific_ss[] to system_ss[] after exec/ headers are reworked.
Philippe Mathieu-Daudé (2):
system: Restrict libSDL CPPFLAGS to vl.c
system: Restrict libpmem and libdaxctl CPPFLAGS to physmem.c
system/meson.build | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
Signature · 1 line
2.45.2
PATCH 1/2 system: Restrict libSDL CPPFLAGS to vl.c
Only vl.c includes libSDL headers.
No need to pass them to all system_ss[] files.
--- system/meson.build | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
system/meson.build +4 -1
@@ -23,8 +23,11 @@ system_ss.add(files( 'runstate-hmp-cmds.c', 'runstate.c', 'tpm-hmp-cmds.c', +), libpmem, libdaxctl) + +system_ss.add(files( 'vl.c', -), sdl, libpmem, libdaxctl) +), sdl) if have_tpm system_ss.add(files('tpm.c'))
Signature · 1 line
2.45.2
Re: [PATCH 1/2] system: Restrict libSDL CPPFLAGS to vl.c
Quoted 15 lines · Philippe Mathieu-Daudé
Only
vl.cincludes libSDL headers.
No need to pass them to all system_ss[] files.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- system/meson.build | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)system/meson.build +0
-0@@ -23,8 +23,11 @@ system_ss.add(files( 'runstate-hmp-cmds.c', 'runstate.c',
system/meson.build system_ss.add(files( · line 33
Quoted 10 lines
system/meson.build +4
-1'tpm-hmp-cmds.c', +), libpmem, libdaxctl) + +system_ss.add(files( 'vl.c', -), sdl, libpmem, libdaxctl) +), sdl) if have_tpm system_ss.add(files('tpm.c'))
I'm sure Paolo will correct me, but I don't think this does what you think it does. I believe this has no change at all.
The presence of sdl within a *particular* source_set.add() call is immaterial. If the condition is true (and here, because the condition is missing it is true), all of the files and dependencies get lumped together. In the end, everything gets copied into common_ss.
Both of these patches only alters the order of the items in the link ordering.
r~
Re: [PATCH 1/2] system: Restrict libSDL CPPFLAGS to vl.c
Quoted 19 lines · Richard Henderson
Quoted 18 lines · Philippe Mathieu-Daudé
Only
vl.cincludes libSDL headers.
No need to pass them to all system_ss[] files.Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
system/meson.build | 5 ++++-1 file changed, 4 insertions(+), 1 deletion(-)system/meson.build +2
-0@@ -23,8 +23,11 @@ system_ss.add(files( 'runstate-hmp-cmds.c', 'runstate.c', 'tpm-hmp-cmds.c', +), libpmem, libdaxctl) +
Quoted 8 lines
Quoted 6 lines
system/meson.build +2
-1+system_ss.add(files( 'vl.c', -), sdl, libpmem, libdaxctl) +), sdl)if
have_tpm
system_ss.add(files('tpm.c'))I'm sure Paolo will correct me, but I don't think this does what you think it does. I believe this has no change at all.
No need to correct anything! :)
Quoted 1 line
The presence of sdl within a *particular*
source_set.add()call is immaterial. If the condition is true (and here, because the condition is missing it is true), all of the files and dependencies get lumped together. In the end, everything gets copied intocommon_ss.
Yep. You can have different flags, including library CFLAGS/CPPFLAGS, for specific vs system (the former ends up in the libqemu-*.a.p directory, vs libcommon.a.p for system), or for those sourcesets that are used also by user-mode emulation (IIRC libhwcore.a.p) or by tests (the various directories libio.a.p, libmigration.a.p). However, here there is no effect at all.
If you want to do this as a cleanup to keep the libraries close to their users, I have no objection, but please adjust the commit message and squash the two patches together.
Paolo
Quoted 7 lines
Both of these patches only alters the order of the items in the link ordering.
r~
PATCH 2/2 system: Restrict libpmem and libdaxctl CPPFLAGS to physmem.c
In reply to Philippe Mathieu-DaudéOnly physmem.c includes libpmem and libdaxctl headers. No need to pass them to all system_ss[] files.
--- system/meson.build | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
system/meson.build +5 -2
@@ -2,10 +2,13 @@ specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_true: [files( 'arch_init.c', 'ioport.c', 'memory.c', - 'physmem.c', 'watchpoint.c', )]) +specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_true: [files( + 'physmem.c', +), libpmem, libdaxctl]) + system_ss.add(files( 'balloon.c', 'bootdevice.c',
@@ -23,7 +26,7 @@ system_ss.add(files( 'runstate-hmp-cmds.c', 'runstate.c', 'tpm-hmp-cmds.c', -), libpmem, libdaxctl) +)) system_ss.add(files( 'vl.c',
Signature · 1 line
2.45.2
Re: [PATCH 2/2] system: Restrict libpmem and libdaxctl CPPFLAGS to physmem.c
Quoted 2 lines · Philippe Mathieu-Daudé
Only
physmem.cincludes libpmem and libdaxctl headers. No need to pass them to all system_ss[] files.
I think doing this patch first would leave the other one unnecessary so you could do both in one patch with less churn and maybe reduce this series to a single patch.
Regards,
BALATON Zoltan
Quoted 34 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
system/meson.build | 7 +++++--1 file changed, 5 insertions(+), 2 deletions(-)system/meson.build +4
-1@@ -2,10 +2,13 @@ specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_true: [files( 'arch_init.c', 'ioport.c', 'memory.c', - 'physmem.c', 'watchpoint.c', )]) +specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_true: [files( + 'physmem.c', +), libpmem, libdaxctl]) +system_ss.add(files(
'balloon.c',
'bootdevice.c',system/meson.build +1
-1@@ -23,7 +26,7 @@ system_ss.add(files( 'runstate-hmp-cmds.c', 'runstate.c', 'tpm-hmp-cmds.c', -), libpmem, libdaxctl) +))system_ss.add(files(
'vl.c',
Re: [PATCH 2/2] system: Restrict libpmem and libdaxctl CPPFLAGS to physmem.c
Quoted 5 lines · BALATON Zoltan
Quoted 2 lines · Philippe Mathieu-Daudé
Only
physmem.cincludes libpmem and libdaxctl headers. No need to pass them to all system_ss[] files.I think doing this patch first would leave the other one unnecessary so
This one is about libpmem / libdaxctl in physmem.c, the previous one is about libsdl in vl.c. I'm missing what inverting the order would change.
Besides in 2 patches it is simpler to check what CPPFLAGS are applied.
Anyhow if you insist, I can squash. I don't care much as long as we reduce the flags applied to system_ss[].
Quoted 40 lines
you could do both in one patch with less churn and maybe reduce this series to a single patch.
Regards,
BALATON ZoltanQuoted 35 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
system/meson.build | 7 +++++--1 file changed, 5 insertions(+), 2 deletions(-)system/meson.build +0
-0@@ -2,10 +2,13 @@ specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_true:[files(
'arch_init.c',
'ioport.c',
'memory.c',
- 'physmem.c',
'watchpoint.c',
)])system/meson.build +4
-0+specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_true: [files( + 'physmem.c', +), libpmem, libdaxctl]) +system_ss.add(files(
'balloon.c',
'bootdevice.c',system/meson.build +1
-1@@ -23,7 +26,7 @@ system_ss.add(files( 'runstate-hmp-cmds.c', 'runstate.c', 'tpm-hmp-cmds.c', -), libpmem, libdaxctl) +))system_ss.add(files(
'vl.c',
Re: [PATCH 2/2] system: Restrict libpmem and libdaxctl CPPFLAGS to physmem.c
Quoted 7 lines · Philippe Mathieu-Daudé
Quoted 5 lines · BALATON Zoltan
Quoted 2 lines · Philippe Mathieu-Daudé
Only
physmem.cincludes libpmem and libdaxctl headers. No need to pass them to all system_ss[] files.I think doing this patch first would leave the other one unnecessary so
Quoted 7 lines
This one is about libpmem / libdaxctl in
physmem.c, the previous one is about libsdl invl.c. I'm missing what inverting the order would change.Besides in 2 patches it is simpler to check what CPPFLAGS are applied.
Anyhow if you insist, I can squash. I don't care much as long as
s/care/mind/ ;)
Quoted 43 lines
we reduce the flags applied to system_ss[].
Quoted 40 lines
you could do both in one patch with less churn and maybe reduce this series to a single patch.
Regards,
BALATON ZoltanQuoted 35 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
system/meson.build | 7 +++++--1 file changed, 5 insertions(+), 2 deletions(-)system/meson.build +0
-0@@ -2,10 +2,13 @@ specific_ss.add(when: 'CONFIG_SYSTEM_ONLY',
if_true: [files(
'arch_init.c',
'ioport.c',
'memory.c',
- 'physmem.c',
'watchpoint.c',
)])system/meson.build +4
-0+specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_true: [files( + 'physmem.c', +), libpmem, libdaxctl]) +system_ss.add(files(
'balloon.c',
'bootdevice.c',system/meson.build +1
-1@@ -23,7 +26,7 @@ system_ss.add(files( 'runstate-hmp-cmds.c', 'runstate.c', 'tpm-hmp-cmds.c', -), libpmem, libdaxctl) +))system_ss.add(files(
'vl.c',
Re: [PATCH 2/2] system: Restrict libpmem and libdaxctl CPPFLAGS to physmem.c
In reply to Philippe Mathieu-DaudéQuoted 10 lines · Philippe Mathieu-Daudé
Quoted 5 lines · BALATON Zoltan
Quoted 2 lines · Philippe Mathieu-Daudé
Only
physmem.cincludes libpmem and libdaxctl headers. No need to pass them to all system_ss[] files.I think doing this patch first would leave the other one unnecessary so
This one is about libpmem / libdaxctl in
physmem.c, the previous one is about libsdl invl.c. I'm missing what inverting the order would change.
It seems odd to add the libpmem, libdaxctl libs to one set in the first patch then remove it right away in the next patch. Swapping patches would avoid that and move these to the final place without churn then the sdl change is simpler.
Quoted 4 lines
Besides in 2 patches it is simpler to check what CPPFLAGS are applied.
Anyhow if you insist, I can squash. I don't care much as long as we reduce the flags applied to system_ss[].
I don't insist and don't mind much either but I see others also suggested squashing patches so this will be resolved by that.
Regards,
BALATON Zoltan
Quoted 42 lines
Quoted 40 lines
you could do both in one patch with less churn and maybe reduce this series to a single patch.
Regards,
BALATON ZoltanQuoted 35 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
system/meson.build | 7 +++++--1 file changed, 5 insertions(+), 2 deletions(-)system/meson.build +0
-0@@ -2,10 +2,13 @@ specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_true:[files(
'arch_init.c',
'ioport.c',
'memory.c',
- 'physmem.c',
'watchpoint.c',
)])system/meson.build +4
-0+specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_true: [files( + 'physmem.c', +), libpmem, libdaxctl]) +system_ss.add(files(
'balloon.c',
'bootdevice.c',system/meson.build +1
-1@@ -23,7 +26,7 @@ system_ss.add(files( 'runstate-hmp-cmds.c', 'runstate.c', 'tpm-hmp-cmds.c', -), libpmem, libdaxctl) +))system_ss.add(files(
'vl.c',
Re: [PATCH 2/2] system: Restrict libpmem and libdaxctl CPPFLAGS to physmem.c
Quoted 12 lines · BALATON Zoltan
Quoted 10 lines · Philippe Mathieu-Daudé
Quoted 5 lines · BALATON Zoltan
Quoted 2 lines · Philippe Mathieu-Daudé
Only
physmem.cincludes libpmem and libdaxctl headers. No need to pass them to all system_ss[] files.I think doing this patch first would leave the other one unnecessary so
This one is about libpmem / libdaxctl in
physmem.c, the previous one is about libsdl invl.c. I'm missing what inverting the order would change.
Quoted 8 lines
It seems odd to add the libpmem, libdaxctl libs to one set in the first patch then remove it right away in the next patch. Swapping patches would avoid that and move these to the final place without churn then the sdl change is simpler.
Quoted 4 lines
Besides in 2 patches it is simpler to check what CPPFLAGS are applied.
Anyhow if you insist, I can squash. I don't care much as long as we reduce the flags applied to system_ss[].
I don't insist and don't mind much either but I see others also suggested squashing patches so this will be resolved by that.
Nah, you are right, I didn't notice. Besides, Paolo and Richard showed me I don't understand clearly meson dependencies. My bad.
Quoted 46 lines
Regards,
BALATON ZoltanQuoted 42 lines
Quoted 40 lines
you could do both in one patch with less churn and maybe reduce this series to a single patch.
Regards,
BALATON ZoltanQuoted 35 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
system/meson.build | 7 +++++--1 file changed, 5 insertions(+), 2 deletions(-)system/meson.build +0
-0@@ -2,10 +2,13 @@ specific_ss.add(when: 'CONFIG_SYSTEM_ONLY',
if_true: [files(
'arch_init.c',
'ioport.c',
'memory.c',
- 'physmem.c',
'watchpoint.c',
)])system/meson.build +4
-0+specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_true: [files( + 'physmem.c', +), libpmem, libdaxctl]) +system_ss.add(files(
'balloon.c',
'bootdevice.c',system/meson.build +1
-1@@ -23,7 +26,7 @@ system_ss.add(files( 'runstate-hmp-cmds.c', 'runstate.c', 'tpm-hmp-cmds.c', -), libpmem, libdaxctl) +))system_ss.add(files(
'vl.c',