diff mbox series

[v5,16/17] meson: Move linux_user_ss to linux-user/

Message ID 20211117160412.71563-17-richard.henderson@linaro.org
State Superseded
Headers show
Series linux-user: simplify safe signal handling | expand

Commit Message

Richard Henderson Nov. 17, 2021, 4:04 p.m. UTC
We have no need to reference linux_user_ss outside of linux-user.
Go ahead and merge it directly into specific_ss.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 meson.build            | 3 ---
 linux-user/meson.build | 4 ++++
 2 files changed, 4 insertions(+), 3 deletions(-)

Comments

Philippe Mathieu-Daudé Nov. 17, 2021, 4:56 p.m. UTC | #1
+Thomas/Paolo

On 11/17/21 17:04, Richard Henderson wrote:
> We have no need to reference linux_user_ss outside of linux-user.
> Go ahead and merge it directly into specific_ss.

The patch is correct, so:

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

But ...

> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  meson.build            | 3 ---
>  linux-user/meson.build | 4 ++++
>  2 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/meson.build b/meson.build
> index 9f59c57909..ecc181ea13 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -2363,7 +2363,6 @@ common_user_ss = ss.source_set()
>  crypto_ss = ss.source_set()
>  hwcore_ss = ss.source_set()
>  io_ss = ss.source_set()
> -linux_user_ss = ss.source_set()
>  qmp_ss = ss.source_set()
>  qom_ss = ss.source_set()
>  softmmu_ss = ss.source_set()
> @@ -2614,8 +2613,6 @@

... shouldn't it be cheaper for the build system to
avoid parsing linux-user machinery when we linux-user
is disabled, ...

+ if have_linux_user

subdir('linux-user')

+ endif

>  
>  specific_ss.add_all(when: 'CONFIG_BSD_USER', if_true: bsd_user_ss)
>  
> -specific_ss.add_all(when: 'CONFIG_LINUX_USER', if_true: linux_user_ss)
> -
>  common_user_ss = common_user_ss.apply(config_all, strict: false)
>  common_user = static_library('common-user',
>                               sources: common_user_ss.sources(),
> diff --git a/linux-user/meson.build b/linux-user/meson.build
> index fcf7d40f23..b89534c49c 100644
> --- a/linux-user/meson.build
> +++ b/linux-user/meson.build
> @@ -2,6 +2,8 @@ if not have_linux_user
>     subdir_done()
>  endif
>  
> +linux_user_ss = ss.source_set()
> +
>  common_user_inc += include_directories('host/' / config_host['ARCH'])
>  common_user_inc += include_directories('.')
>  
> @@ -42,3 +44,5 @@ subdir('sh4')
>  subdir('sparc')
>  subdir('x86_64')
>  subdir('xtensa')
> +
> +specific_ss.add_all(when: 'CONFIG_LINUX_USER', if_true: linux_user_ss)

... and add here unconditionally?
Richard Henderson Nov. 17, 2021, 5:04 p.m. UTC | #2
On 11/17/21 5:56 PM, Philippe Mathieu-Daudé wrote:
> +Thomas/Paolo
> 
> On 11/17/21 17:04, Richard Henderson wrote:
>> We have no need to reference linux_user_ss outside of linux-user.
>> Go ahead and merge it directly into specific_ss.
> 
> The patch is correct, so:
> 
> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> 
> But ...
> 
>> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
>> ---
>>   meson.build            | 3 ---
>>   linux-user/meson.build | 4 ++++
>>   2 files changed, 4 insertions(+), 3 deletions(-)
>>
>> diff --git a/meson.build b/meson.build
>> index 9f59c57909..ecc181ea13 100644
>> --- a/meson.build
>> +++ b/meson.build
>> @@ -2363,7 +2363,6 @@ common_user_ss = ss.source_set()
>>   crypto_ss = ss.source_set()
>>   hwcore_ss = ss.source_set()
>>   io_ss = ss.source_set()
>> -linux_user_ss = ss.source_set()
>>   qmp_ss = ss.source_set()
>>   qom_ss = ss.source_set()
>>   softmmu_ss = ss.source_set()
>> @@ -2614,8 +2613,6 @@
> 
> ... shouldn't it be cheaper for the build system to
> avoid parsing linux-user machinery when we linux-user
> is disabled, ...
> 
> + if have_linux_user
> 
> subdir('linux-user')
> 
> + endif

We had this discussion before, and settled on

if not have_linux_user
    subdir_done()
endif

within linux-user/meson.build.

>> +specific_ss.add_all(when: 'CONFIG_LINUX_USER', if_true: linux_user_ss)
> 
> ... and add here unconditionally?

Can't do it unconditionally.  We still need to distinguish specific_ss files that are 
CONFIG_USER_ONLY, when building both user-only and sysemu binaries.

I thought about changing this to CONFIG_USER_ONLY, but thought that would just be a step 
too far for this patch.


r~
Philippe Mathieu-Daudé Nov. 17, 2021, 5:11 p.m. UTC | #3
On Wed, Nov 17, 2021 at 6:04 PM Richard Henderson
<richard.henderson@linaro.org> wrote:
> On 11/17/21 5:56 PM, Philippe Mathieu-Daudé wrote:
> > +Thomas/Paolo
> >
> > On 11/17/21 17:04, Richard Henderson wrote:
> >> We have no need to reference linux_user_ss outside of linux-user.
> >> Go ahead and merge it directly into specific_ss.
> >
> > The patch is correct, so:
> >
> > Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> >
> > But ...
> >
> >> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> >> ---
> >>   meson.build            | 3 ---
> >>   linux-user/meson.build | 4 ++++
> >>   2 files changed, 4 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/meson.build b/meson.build
> >> index 9f59c57909..ecc181ea13 100644
> >> --- a/meson.build
> >> +++ b/meson.build
> >> @@ -2363,7 +2363,6 @@ common_user_ss = ss.source_set()
> >>   crypto_ss = ss.source_set()
> >>   hwcore_ss = ss.source_set()
> >>   io_ss = ss.source_set()
> >> -linux_user_ss = ss.source_set()
> >>   qmp_ss = ss.source_set()
> >>   qom_ss = ss.source_set()
> >>   softmmu_ss = ss.source_set()
> >> @@ -2614,8 +2613,6 @@
> >
> > ... shouldn't it be cheaper for the build system to
> > avoid parsing linux-user machinery when we linux-user
> > is disabled, ...
> >
> > + if have_linux_user
> >
> > subdir('linux-user')
> >
> > + endif
>
> We had this discussion before, and settled on
>
> if not have_linux_user
>     subdir_done()
> endif
>
> within linux-user/meson.build.

Indeed sorry. Too much context switching.

> >> +specific_ss.add_all(when: 'CONFIG_LINUX_USER', if_true: linux_user_ss)
> >
> > ... and add here unconditionally?
>
> Can't do it unconditionally.  We still need to distinguish specific_ss files that are
> CONFIG_USER_ONLY, when building both user-only and sysemu binaries.

Indeed.

> I thought about changing this to CONFIG_USER_ONLY, but thought that would just be a step
> too far for this patch.
>
>
> r~
Warner Losh Nov. 17, 2021, 5:31 p.m. UTC | #4
On Wed, Nov 17, 2021 at 9:04 AM Richard Henderson <
richard.henderson@linaro.org> wrote:

> We have no need to reference linux_user_ss outside of linux-user.
> Go ahead and merge it directly into specific_ss.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  meson.build            | 3 ---
>  linux-user/meson.build | 4 ++++
>  2 files changed, 4 insertions(+), 3 deletions(-)
>

Reviewed-by: Warner Losh <imp@bsdimp.com>

BTW, I don't think I have anything meaningful to add to the discussions to
date on this bug, and I'm
agnostic as to the final decision...


> diff --git a/meson.build b/meson.build
> index 9f59c57909..ecc181ea13 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -2363,7 +2363,6 @@ common_user_ss = ss.source_set()
>  crypto_ss = ss.source_set()
>  hwcore_ss = ss.source_set()
>  io_ss = ss.source_set()
> -linux_user_ss = ss.source_set()
>  qmp_ss = ss.source_set()
>  qom_ss = ss.source_set()
>  softmmu_ss = ss.source_set()
> @@ -2614,8 +2613,6 @@ subdir('linux-user')
>
>  specific_ss.add_all(when: 'CONFIG_BSD_USER', if_true: bsd_user_ss)
>
> -specific_ss.add_all(when: 'CONFIG_LINUX_USER', if_true: linux_user_ss)
> -
>  common_user_ss = common_user_ss.apply(config_all, strict: false)
>  common_user = static_library('common-user',
>                               sources: common_user_ss.sources(),
> diff --git a/linux-user/meson.build b/linux-user/meson.build
> index fcf7d40f23..b89534c49c 100644
> --- a/linux-user/meson.build
> +++ b/linux-user/meson.build
> @@ -2,6 +2,8 @@ if not have_linux_user
>     subdir_done()
>  endif
>
> +linux_user_ss = ss.source_set()
> +
>  common_user_inc += include_directories('host/' / config_host['ARCH'])
>  common_user_inc += include_directories('.')
>
> @@ -42,3 +44,5 @@ subdir('sh4')
>  subdir('sparc')
>  subdir('x86_64')
>  subdir('xtensa')
> +
> +specific_ss.add_all(when: 'CONFIG_LINUX_USER', if_true: linux_user_ss)
> --
> 2.25.1
>
>
diff mbox series

Patch

diff --git a/meson.build b/meson.build
index 9f59c57909..ecc181ea13 100644
--- a/meson.build
+++ b/meson.build
@@ -2363,7 +2363,6 @@  common_user_ss = ss.source_set()
 crypto_ss = ss.source_set()
 hwcore_ss = ss.source_set()
 io_ss = ss.source_set()
-linux_user_ss = ss.source_set()
 qmp_ss = ss.source_set()
 qom_ss = ss.source_set()
 softmmu_ss = ss.source_set()
@@ -2614,8 +2613,6 @@  subdir('linux-user')
 
 specific_ss.add_all(when: 'CONFIG_BSD_USER', if_true: bsd_user_ss)
 
-specific_ss.add_all(when: 'CONFIG_LINUX_USER', if_true: linux_user_ss)
-
 common_user_ss = common_user_ss.apply(config_all, strict: false)
 common_user = static_library('common-user',
                              sources: common_user_ss.sources(),
diff --git a/linux-user/meson.build b/linux-user/meson.build
index fcf7d40f23..b89534c49c 100644
--- a/linux-user/meson.build
+++ b/linux-user/meson.build
@@ -2,6 +2,8 @@  if not have_linux_user
    subdir_done()
 endif
 
+linux_user_ss = ss.source_set()
+
 common_user_inc += include_directories('host/' / config_host['ARCH'])
 common_user_inc += include_directories('.')
 
@@ -42,3 +44,5 @@  subdir('sh4')
 subdir('sparc')
 subdir('x86_64')
 subdir('xtensa')
+
+specific_ss.add_all(when: 'CONFIG_LINUX_USER', if_true: linux_user_ss)