All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] buildsys: Avoid building unused objects
@ 2022-02-04 15:29 Philippe Mathieu-Daudé via
  2022-02-04 15:29 ` [PATCH 1/4] configure: Restrict TCG to emulation Philippe Mathieu-Daudé via
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Philippe Mathieu-Daudé via @ 2022-02-04 15:29 UTC (permalink / raw)
  To: qemu-devel
  Cc: Daniel P. Berrangé,
	Thomas Huth, Paolo Bonzini, Markus Armbruster, Richard Henderson,
	Philippe Mathieu-Daudé

Hi,

I already sent these patches few times. I am refactoring the whole
tree and building over and over various combinations, and still see
unuseful objects being built, so posting these patches again
(rebased).

Based-on: <20220203193803.45671-1-f4bug@amsat.org>

Philippe Mathieu-Daudé (4):
  configure: Restrict TCG to emulation
  tests/fp: Do not build softfloat3 tests if TCG is disabled
  qom: Remove user-creatable objects from user emulation
  qapi/meson: Restrict machine-specific objects to sysemu

 configure                 | 12 ++++++++++--
 qapi/meson.build          | 20 ++++++++++----------
 qom/meson.build           |  7 ++++++-
 qom/user_creatable-stub.c |  8 ++++++++
 tests/fp/meson.build      |  3 +++
 tests/unit/meson.build    |  2 +-
 6 files changed, 38 insertions(+), 14 deletions(-)
 create mode 100644 qom/user_creatable-stub.c

-- 
2.34.1



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

* [PATCH 1/4] configure: Restrict TCG to emulation
  2022-02-04 15:29 [PATCH 0/4] buildsys: Avoid building unused objects Philippe Mathieu-Daudé via
@ 2022-02-04 15:29 ` Philippe Mathieu-Daudé via
  2022-02-04 15:35   ` Thomas Huth
  2022-02-04 16:55   ` Paolo Bonzini
  2022-02-04 15:29 ` [PATCH 2/4] tests/fp: Do not build softfloat3 tests if TCG is disabled Philippe Mathieu-Daudé via
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 14+ messages in thread
From: Philippe Mathieu-Daudé via @ 2022-02-04 15:29 UTC (permalink / raw)
  To: qemu-devel
  Cc: Daniel P. Berrangé,
	Thomas Huth, Paolo Bonzini, Markus Armbruster, Richard Henderson,
	Philippe Mathieu-Daudé

If we don't need to emulate any target, we certainly don't need TCG.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 configure | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 9f40d60196..4002f81ac9 100755
--- a/configure
+++ b/configure
@@ -370,7 +370,7 @@ slirp="auto"
 default_devices="true"
 
 # 3. Automatically enable/disable other options
-tcg="enabled"
+tcg="auto"
 cfi="false"
 
 # 4. Detection partly done in configure
@@ -1777,7 +1777,7 @@ EOF
   fi
 fi
 
-if test "$tcg" = "enabled"; then
+if test "$tcg" != "disabled"; then
     git_submodules="$git_submodules tests/fp/berkeley-testfloat-3"
     git_submodules="$git_submodules tests/fp/berkeley-softfloat-3"
 fi
@@ -1819,6 +1819,14 @@ case " $target_list " in
   ;;
 esac
 
+if test "$tcg" = "auto"; then
+  if test -z "$target_list"; then
+    tcg="disabled"
+  else
+    tcg="enabled"
+  fi
+fi
+
 feature_not_found() {
   feature=$1
   remedy=$2
-- 
2.34.1



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

* [PATCH 2/4] tests/fp: Do not build softfloat3 tests if TCG is disabled
  2022-02-04 15:29 [PATCH 0/4] buildsys: Avoid building unused objects Philippe Mathieu-Daudé via
  2022-02-04 15:29 ` [PATCH 1/4] configure: Restrict TCG to emulation Philippe Mathieu-Daudé via
@ 2022-02-04 15:29 ` Philippe Mathieu-Daudé via
  2022-02-04 15:38   ` Thomas Huth
  2022-02-04 15:29 ` [PATCH 3/4] qom: Remove user-creatable objects from user emulation Philippe Mathieu-Daudé via
  2022-02-04 15:29 ` [PATCH 4/4] qapi/meson: Restrict machine-specific objects to sysemu Philippe Mathieu-Daudé via
  3 siblings, 1 reply; 14+ messages in thread
From: Philippe Mathieu-Daudé via @ 2022-02-04 15:29 UTC (permalink / raw)
  To: qemu-devel
  Cc: Daniel P. Berrangé,
	Thomas Huth, Paolo Bonzini, Markus Armbruster, Richard Henderson,
	Philippe Mathieu-Daudé

Technically we don't need the TCG accelerator to run the
softfloat3 tests. However it is unlikely an interesting
build combination. Developers using softfloat3 likely use
TCG too. Similarly, developers disabling TCG shouldn't
mind much about softfloat3 tests.

This reduces a non-TCG build by 474 objects!

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 tests/fp/meson.build | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tests/fp/meson.build b/tests/fp/meson.build
index 59776a00a7..60843fce85 100644
--- a/tests/fp/meson.build
+++ b/tests/fp/meson.build
@@ -1,3 +1,6 @@
+if 'CONFIG_TCG' not in config_all
+  subdir_done()
+endif
 # There are namespace pollution issues on Windows, due to osdep.h
 # bringing in Windows headers that define a FLOAT128 type.
 if targetos == 'windows'
-- 
2.34.1



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

* [PATCH 3/4] qom: Remove user-creatable objects from user emulation
  2022-02-04 15:29 [PATCH 0/4] buildsys: Avoid building unused objects Philippe Mathieu-Daudé via
  2022-02-04 15:29 ` [PATCH 1/4] configure: Restrict TCG to emulation Philippe Mathieu-Daudé via
  2022-02-04 15:29 ` [PATCH 2/4] tests/fp: Do not build softfloat3 tests if TCG is disabled Philippe Mathieu-Daudé via
@ 2022-02-04 15:29 ` Philippe Mathieu-Daudé via
  2022-02-04 15:56   ` Thomas Huth
  2022-02-04 16:56   ` Paolo Bonzini
  2022-02-04 15:29 ` [PATCH 4/4] qapi/meson: Restrict machine-specific objects to sysemu Philippe Mathieu-Daudé via
  3 siblings, 2 replies; 14+ messages in thread
From: Philippe Mathieu-Daudé via @ 2022-02-04 15:29 UTC (permalink / raw)
  To: qemu-devel
  Cc: Daniel P. Berrangé,
	Thomas Huth, Paolo Bonzini, Markus Armbruster, Richard Henderson,
	Philippe Mathieu-Daudé

user-mode don't use user-creatable objects. Restrict it to
sysemu / tools.

Add a stub to avoid a link failure with the global callback:

  /usr/bin/ld: libqom.fa(qom_object.c.o): in function `object_initialize_child_with_propsv':
  ../qom/object.c:578: undefined reference to `user_creatable_complete'
  /usr/bin/ld: libqom.fa(qom_object.c.o): in function `object_new_with_propv':
  ../qom/object.c:801: undefined reference to `user_creatable_complete'
  collect2: error: ld returned 1 exit status

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 qom/meson.build           | 7 ++++++-
 qom/user_creatable-stub.c | 8 ++++++++
 tests/unit/meson.build    | 2 +-
 3 files changed, 15 insertions(+), 2 deletions(-)
 create mode 100644 qom/user_creatable-stub.c

diff --git a/qom/meson.build b/qom/meson.build
index 062a3789d8..afc60cc19d 100644
--- a/qom/meson.build
+++ b/qom/meson.build
@@ -2,9 +2,14 @@ qom_ss.add(genh)
 qom_ss.add(files(
   'container.c',
   'object.c',
-  'object_interfaces.c',
   'qom-qobject.c',
 ))
 
+if have_system or have_tools
+  qom_ss.add(files('object_interfaces.c'))
+else
+  qom_ss.add(files('user_creatable-stub.c'))
+endif
+
 qmp_ss.add(files('qom-qmp-cmds.c'))
 softmmu_ss.add(files('qom-hmp-cmds.c'))
diff --git a/qom/user_creatable-stub.c b/qom/user_creatable-stub.c
new file mode 100644
index 0000000000..cc3638e20d
--- /dev/null
+++ b/qom/user_creatable-stub.c
@@ -0,0 +1,8 @@
+#include "qemu/osdep.h"
+
+#include "qom/object_interfaces.h"
+
+bool user_creatable_complete(UserCreatable *uc, Error **errp)
+{
+    g_assert_not_reached();
+}
diff --git a/tests/unit/meson.build b/tests/unit/meson.build
index 64a5e7bfde..2cdcd136c9 100644
--- a/tests/unit/meson.build
+++ b/tests/unit/meson.build
@@ -39,7 +39,6 @@ tests = {
   'test-bitcnt': [],
   'test-qgraph': ['../qtest/libqos/qgraph.c'],
   'check-qom-interface': [qom],
-  'check-qom-proplist': [qom],
   'test-qemu-opts': [],
   'test-keyval': [testqapi],
   'test-logging': [],
@@ -51,6 +50,7 @@ tests = {
 
 if have_system or have_tools
   tests += {
+    'check-qom-proplist': [qom],
     'test-qmp-event': [testqapi],
   }
 endif
-- 
2.34.1



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

* [PATCH 4/4] qapi/meson: Restrict machine-specific objects to sysemu
  2022-02-04 15:29 [PATCH 0/4] buildsys: Avoid building unused objects Philippe Mathieu-Daudé via
                   ` (2 preceding siblings ...)
  2022-02-04 15:29 ` [PATCH 3/4] qom: Remove user-creatable objects from user emulation Philippe Mathieu-Daudé via
@ 2022-02-04 15:29 ` Philippe Mathieu-Daudé via
  2022-02-04 16:25   ` Thomas Huth
  2022-02-04 17:00   ` Paolo Bonzini
  3 siblings, 2 replies; 14+ messages in thread
From: Philippe Mathieu-Daudé via @ 2022-02-04 15:29 UTC (permalink / raw)
  To: qemu-devel
  Cc: Daniel P. Berrangé,
	Thomas Huth, Paolo Bonzini, Markus Armbruster, Richard Henderson,
	Philippe Mathieu-Daudé

machine/ and net/ are only useful to machines;
block/ and migration/ to machine or tools.

Note we need to keep building machine.json generated sources
on all targets because some want to access X86CPUFeatureWordInfo
from any architecture ¯\_(ツ)_/¯ Otherwise we get on all but
x86 targets:

  /usr/bin/ld: libqemu-i386-linux-user.fa.p/target_i386_cpu.c.o: in function `x86_cpu_get_feature_words':
  ../target/i386/cpu.c:4587: undefined reference to `visit_type_X86CPUFeatureWordInfoList'
  collect2: error: ld returned 1 exit status

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 qapi/meson.build | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/qapi/meson.build b/qapi/meson.build
index 656ef0e039..38b01f3083 100644
--- a/qapi/meson.build
+++ b/qapi/meson.build
@@ -23,10 +23,6 @@ endif
 
 qapi_all_modules = [
   'authz',
-  'block',
-  'block-core',
-  'block-export',
-  'char',
   'common',
   'compat',
   'control',
@@ -35,26 +31,23 @@ qapi_all_modules = [
   'error',
   'introspect',
   'job',
-  'machine',
-  'machine-target',
+  'machine', # x86 is considered multiarch by some
   'migration',
   'misc',
   'misc-target',
-  'net',
   'pragma',
-  'qom',
   'replay',
   'run-state',
   'sockets',
   'trace',
-  'transaction',
-  'yank',
 ]
 if have_system
   qapi_all_modules += [
     'acpi',
     'audio',
     'qdev',
+    'machine-target',
+    'net',
     'pci',
     'rdma',
     'rocker',
@@ -63,7 +56,14 @@ if have_system
 endif
 if have_system or have_tools
   qapi_all_modules += [
+    'block',
+    'block-core',
+    'block-export',
+    'char',
+    'qom',
     'ui',
+    'transaction',
+    'yank',
   ]
 endif
 
-- 
2.34.1



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

* Re: [PATCH 1/4] configure: Restrict TCG to emulation
  2022-02-04 15:29 ` [PATCH 1/4] configure: Restrict TCG to emulation Philippe Mathieu-Daudé via
@ 2022-02-04 15:35   ` Thomas Huth
  2022-02-04 16:55   ` Paolo Bonzini
  1 sibling, 0 replies; 14+ messages in thread
From: Thomas Huth @ 2022-02-04 15:35 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Paolo Bonzini, Richard Henderson, Daniel P. Berrangé,
	Markus Armbruster

On 04/02/2022 16.29, Philippe Mathieu-Daudé wrote:
> If we don't need to emulate any target, we certainly don't need TCG.
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>   configure | 12 ++++++++++--
>   1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/configure b/configure
> index 9f40d60196..4002f81ac9 100755
> --- a/configure
> +++ b/configure
> @@ -370,7 +370,7 @@ slirp="auto"
>   default_devices="true"
>   
>   # 3. Automatically enable/disable other options
> -tcg="enabled"
> +tcg="auto"
>   cfi="false"
>   
>   # 4. Detection partly done in configure
> @@ -1777,7 +1777,7 @@ EOF
>     fi
>   fi
>   
> -if test "$tcg" = "enabled"; then
> +if test "$tcg" != "disabled"; then
>       git_submodules="$git_submodules tests/fp/berkeley-testfloat-3"
>       git_submodules="$git_submodules tests/fp/berkeley-softfloat-3"
>   fi
> @@ -1819,6 +1819,14 @@ case " $target_list " in
>     ;;
>   esac
>   
> +if test "$tcg" = "auto"; then
> +  if test -z "$target_list"; then
> +    tcg="disabled"
> +  else
> +    tcg="enabled"
> +  fi
> +fi
> +
>   feature_not_found() {
>     feature=$1
>     remedy=$2

Reviewed-by: Thomas Huth <thuth@redhat.com>



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

* Re: [PATCH 2/4] tests/fp: Do not build softfloat3 tests if TCG is disabled
  2022-02-04 15:29 ` [PATCH 2/4] tests/fp: Do not build softfloat3 tests if TCG is disabled Philippe Mathieu-Daudé via
@ 2022-02-04 15:38   ` Thomas Huth
  0 siblings, 0 replies; 14+ messages in thread
From: Thomas Huth @ 2022-02-04 15:38 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Paolo Bonzini, Richard Henderson, Daniel P. Berrangé,
	Markus Armbruster

On 04/02/2022 16.29, Philippe Mathieu-Daudé wrote:
> Technically we don't need the TCG accelerator to run the
> softfloat3 tests. However it is unlikely an interesting
> build combination. Developers using softfloat3 likely use
> TCG too. Similarly, developers disabling TCG shouldn't
> mind much about softfloat3 tests.
> 
> This reduces a non-TCG build by 474 objects!
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>   tests/fp/meson.build | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/tests/fp/meson.build b/tests/fp/meson.build
> index 59776a00a7..60843fce85 100644
> --- a/tests/fp/meson.build
> +++ b/tests/fp/meson.build
> @@ -1,3 +1,6 @@
> +if 'CONFIG_TCG' not in config_all

Alternatively "if not config_all.has_key('CONFIG_TCG')" ? ... not sure which 
one is better, though

> +  subdir_done()
> +endif
>   # There are namespace pollution issues on Windows, due to osdep.h
>   # bringing in Windows headers that define a FLOAT128 type.
>   if targetos == 'windows'

Reviewed-by: Thomas Huth <thuth@redhat.com>



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

* Re: [PATCH 3/4] qom: Remove user-creatable objects from user emulation
  2022-02-04 15:29 ` [PATCH 3/4] qom: Remove user-creatable objects from user emulation Philippe Mathieu-Daudé via
@ 2022-02-04 15:56   ` Thomas Huth
  2022-02-04 16:14     ` Philippe Mathieu-Daudé via
  2022-02-04 16:56   ` Paolo Bonzini
  1 sibling, 1 reply; 14+ messages in thread
From: Thomas Huth @ 2022-02-04 15:56 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Paolo Bonzini, Richard Henderson, Daniel P. Berrangé,
	Markus Armbruster

On 04/02/2022 16.29, Philippe Mathieu-Daudé wrote:
> user-mode don't use user-creatable objects. Restrict it to
> sysemu / tools.
> 
> Add a stub to avoid a link failure with the global callback:
> 
>    /usr/bin/ld: libqom.fa(qom_object.c.o): in function `object_initialize_child_with_propsv':
>    ../qom/object.c:578: undefined reference to `user_creatable_complete'
>    /usr/bin/ld: libqom.fa(qom_object.c.o): in function `object_new_with_propv':
>    ../qom/object.c:801: undefined reference to `user_creatable_complete'
>    collect2: error: ld returned 1 exit status
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>   qom/meson.build           | 7 ++++++-
>   qom/user_creatable-stub.c | 8 ++++++++
>   tests/unit/meson.build    | 2 +-
>   3 files changed, 15 insertions(+), 2 deletions(-)
>   create mode 100644 qom/user_creatable-stub.c
> 
> diff --git a/qom/meson.build b/qom/meson.build
> index 062a3789d8..afc60cc19d 100644
> --- a/qom/meson.build
> +++ b/qom/meson.build
> @@ -2,9 +2,14 @@ qom_ss.add(genh)
>   qom_ss.add(files(
>     'container.c',
>     'object.c',
> -  'object_interfaces.c',
>     'qom-qobject.c',
>   ))
>   
> +if have_system or have_tools
> +  qom_ss.add(files('object_interfaces.c'))
> +else
> +  qom_ss.add(files('user_creatable-stub.c'))
> +endif

Could you please name the new file object_interfaces_stub.c, so that it is 
clear that they belong together?

  Thanks,
   Thomas



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

* Re: [PATCH 3/4] qom: Remove user-creatable objects from user emulation
  2022-02-04 15:56   ` Thomas Huth
@ 2022-02-04 16:14     ` Philippe Mathieu-Daudé via
  0 siblings, 0 replies; 14+ messages in thread
From: Philippe Mathieu-Daudé via @ 2022-02-04 16:14 UTC (permalink / raw)
  To: Thomas Huth, qemu-devel
  Cc: Daniel P. Berrangé,
	Paolo Bonzini, Markus Armbruster, Richard Henderson

On 4/2/22 16:56, Thomas Huth wrote:
> On 04/02/2022 16.29, Philippe Mathieu-Daudé wrote:
>> user-mode don't use user-creatable objects. Restrict it to
>> sysemu / tools.
>>
>> Add a stub to avoid a link failure with the global callback:
>>
>>    /usr/bin/ld: libqom.fa(qom_object.c.o): in function 
>> `object_initialize_child_with_propsv':
>>    ../qom/object.c:578: undefined reference to `user_creatable_complete'
>>    /usr/bin/ld: libqom.fa(qom_object.c.o): in function 
>> `object_new_with_propv':
>>    ../qom/object.c:801: undefined reference to `user_creatable_complete'
>>    collect2: error: ld returned 1 exit status
>>
>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>> ---
>>   qom/meson.build           | 7 ++++++-
>>   qom/user_creatable-stub.c | 8 ++++++++
>>   tests/unit/meson.build    | 2 +-
>>   3 files changed, 15 insertions(+), 2 deletions(-)
>>   create mode 100644 qom/user_creatable-stub.c
>>
>> diff --git a/qom/meson.build b/qom/meson.build
>> index 062a3789d8..afc60cc19d 100644
>> --- a/qom/meson.build
>> +++ b/qom/meson.build
>> @@ -2,9 +2,14 @@ qom_ss.add(genh)
>>   qom_ss.add(files(
>>     'container.c',
>>     'object.c',
>> -  'object_interfaces.c',
>>     'qom-qobject.c',
>>   ))
>> +if have_system or have_tools
>> +  qom_ss.add(files('object_interfaces.c'))
>> +else
>> +  qom_ss.add(files('user_creatable-stub.c'))
>> +endif
> 
> Could you please name the new file object_interfaces_stub.c, so that it 
> is clear that they belong together?

Sure!


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

* Re: [PATCH 4/4] qapi/meson: Restrict machine-specific objects to sysemu
  2022-02-04 15:29 ` [PATCH 4/4] qapi/meson: Restrict machine-specific objects to sysemu Philippe Mathieu-Daudé via
@ 2022-02-04 16:25   ` Thomas Huth
  2022-02-04 17:00   ` Paolo Bonzini
  1 sibling, 0 replies; 14+ messages in thread
From: Thomas Huth @ 2022-02-04 16:25 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Paolo Bonzini, Richard Henderson, Daniel P. Berrangé,
	Markus Armbruster

On 04/02/2022 16.29, Philippe Mathieu-Daudé wrote:
> machine/ and net/ are only useful to machines;
> block/ and migration/ to machine or tools.
> 
> Note we need to keep building machine.json generated sources
> on all targets because some want to access X86CPUFeatureWordInfo
> from any architecture ¯\_(ツ)_/¯ Otherwise we get on all but
> x86 targets:
> 
>    /usr/bin/ld: libqemu-i386-linux-user.fa.p/target_i386_cpu.c.o: in function `x86_cpu_get_feature_words':
>    ../target/i386/cpu.c:4587: undefined reference to `visit_type_X86CPUFeatureWordInfoList'
>    collect2: error: ld returned 1 exit status

Would it be possible to move the X86CPUFeatureWordInfo stuff into 
machine-target.json first, adding a proper 'if': 'TARGET_I386' there?

  Thomas


> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>   qapi/meson.build | 20 ++++++++++----------
>   1 file changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/qapi/meson.build b/qapi/meson.build
> index 656ef0e039..38b01f3083 100644
> --- a/qapi/meson.build
> +++ b/qapi/meson.build
> @@ -23,10 +23,6 @@ endif
>   
>   qapi_all_modules = [
>     'authz',
> -  'block',
> -  'block-core',
> -  'block-export',
> -  'char',
>     'common',
>     'compat',
>     'control',
> @@ -35,26 +31,23 @@ qapi_all_modules = [
>     'error',
>     'introspect',
>     'job',
> -  'machine',
> -  'machine-target',
> +  'machine', # x86 is considered multiarch by some
>     'migration',
>     'misc',
>     'misc-target',
> -  'net',
>     'pragma',
> -  'qom',
>     'replay',
>     'run-state',
>     'sockets',
>     'trace',
> -  'transaction',
> -  'yank',
>   ]
>   if have_system
>     qapi_all_modules += [
>       'acpi',
>       'audio',
>       'qdev',
> +    'machine-target',
> +    'net',
>       'pci',
>       'rdma',
>       'rocker',
> @@ -63,7 +56,14 @@ if have_system
>   endif
>   if have_system or have_tools
>     qapi_all_modules += [
> +    'block',
> +    'block-core',
> +    'block-export',
> +    'char',
> +    'qom',
>       'ui',
> +    'transaction',
> +    'yank',
>     ]
>   endif
>   



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

* Re: [PATCH 1/4] configure: Restrict TCG to emulation
  2022-02-04 15:29 ` [PATCH 1/4] configure: Restrict TCG to emulation Philippe Mathieu-Daudé via
  2022-02-04 15:35   ` Thomas Huth
@ 2022-02-04 16:55   ` Paolo Bonzini
  1 sibling, 0 replies; 14+ messages in thread
From: Paolo Bonzini @ 2022-02-04 16:55 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Richard Henderson, Thomas Huth, Daniel P. Berrangé,
	Markus Armbruster

On 2/4/22 16:29, Philippe Mathieu-Daudé via wrote:
> If we don't need to emulate any target, we certainly don't need TCG.
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>   configure | 12 ++++++++++--
>   1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/configure b/configure
> index 9f40d60196..4002f81ac9 100755
> --- a/configure
> +++ b/configure
> @@ -370,7 +370,7 @@ slirp="auto"
>   default_devices="true"
>   
>   # 3. Automatically enable/disable other options
> -tcg="enabled"
> +tcg="auto"
>   cfi="false"
>   
>   # 4. Detection partly done in configure
> @@ -1777,7 +1777,7 @@ EOF
>     fi
>   fi
>   
> -if test "$tcg" = "enabled"; then
> +if test "$tcg" != "disabled"; then
>       git_submodules="$git_submodules tests/fp/berkeley-testfloat-3"
>       git_submodules="$git_submodules tests/fp/berkeley-softfloat-3"
>   fi

This should be in patch 2, and it should at the same time move this "if" 
after auto is changed to "disabled/enabled" below.

Paolo

> @@ -1819,6 +1819,14 @@ case " $target_list " in
>     ;;
>   esac
>   
> +if test "$tcg" = "auto"; then
> +  if test -z "$target_list"; then
> +    tcg="disabled"
> +  else
> +    tcg="enabled"
> +  fi
> +fi

>   feature_not_found() {
>     feature=$1
>     remedy=$2



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

* Re: [PATCH 3/4] qom: Remove user-creatable objects from user emulation
  2022-02-04 15:29 ` [PATCH 3/4] qom: Remove user-creatable objects from user emulation Philippe Mathieu-Daudé via
  2022-02-04 15:56   ` Thomas Huth
@ 2022-02-04 16:56   ` Paolo Bonzini
  1 sibling, 0 replies; 14+ messages in thread
From: Paolo Bonzini @ 2022-02-04 16:56 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Richard Henderson, Thomas Huth, Daniel P. Berrangé,
	Markus Armbruster

On 2/4/22 16:29, Philippe Mathieu-Daudé via wrote:
> user-mode don't use user-creatable objects. Restrict it to
> sysemu / tools.
> 
> Add a stub to avoid a link failure with the global callback:
> 
>    /usr/bin/ld: libqom.fa(qom_object.c.o): in function `object_initialize_child_with_propsv':
>    ../qom/object.c:578: undefined reference to `user_creatable_complete'
>    /usr/bin/ld: libqom.fa(qom_object.c.o): in function `object_new_with_propv':
>    ../qom/object.c:801: undefined reference to `user_creatable_complete'
>    collect2: error: ld returned 1 exit status

Please instead move these two functions to qom/object_interfaces.c.

Paolo


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

* Re: [PATCH 4/4] qapi/meson: Restrict machine-specific objects to sysemu
  2022-02-04 15:29 ` [PATCH 4/4] qapi/meson: Restrict machine-specific objects to sysemu Philippe Mathieu-Daudé via
  2022-02-04 16:25   ` Thomas Huth
@ 2022-02-04 17:00   ` Paolo Bonzini
  2022-02-04 23:40     ` Philippe Mathieu-Daudé via
  1 sibling, 1 reply; 14+ messages in thread
From: Paolo Bonzini @ 2022-02-04 17:00 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Richard Henderson, Thomas Huth, Daniel P. Berrangé,
	Markus Armbruster

On 2/4/22 16:29, Philippe Mathieu-Daudé via wrote:
> machine/ and net/ are only useful to machines;
> block/ and migration/ to machine or tools.
> 
> Note we need to keep building machine.json generated sources
> on all targets because some want to access X86CPUFeatureWordInfo
> from any architecture ¯\_(ツ)_/¯ Otherwise we get on all but
> x86 targets:
> 
>    /usr/bin/ld: libqemu-i386-linux-user.fa.p/target_i386_cpu.c.o: in function `x86_cpu_get_feature_words':
>    ../target/i386/cpu.c:4587: undefined reference to `visit_type_X86CPUFeatureWordInfoList'
>    collect2: error: ld returned 1 exit status

I suppose you mean "on all but x86 hosts", since it links 
libqemu-i386-linux-user.fa.p?  But I don't understand how that happens. 
  Is it related to

{ 'struct': 'DummyForceArrays',
   'data': { 'unused': ['X86CPUFeatureWordInfo'] } }

and if so can DummyForceArrays be moved to machine-target.json together 
with X86CPUFeatureWordInfo, and under 'if': 'TARGET_I386'?

Thanks,

Paolo

> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>   qapi/meson.build | 20 ++++++++++----------
>   1 file changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/qapi/meson.build b/qapi/meson.build
> index 656ef0e039..38b01f3083 100644
> --- a/qapi/meson.build
> +++ b/qapi/meson.build
> @@ -23,10 +23,6 @@ endif
>   
>   qapi_all_modules = [
>     'authz',
> -  'block',
> -  'block-core',
> -  'block-export',
> -  'char',
>     'common',
>     'compat',
>     'control',
> @@ -35,26 +31,23 @@ qapi_all_modules = [
>     'error',
>     'introspect',
>     'job',
> -  'machine',
> -  'machine-target',
> +  'machine', # x86 is considered multiarch by some
>     'migration',
>     'misc',
>     'misc-target',
> -  'net',
>     'pragma',
> -  'qom',
>     'replay',
>     'run-state',
>     'sockets',
>     'trace',
> -  'transaction',
> -  'yank',
>   ]
>   if have_system
>     qapi_all_modules += [
>       'acpi',
>       'audio',
>       'qdev',
> +    'machine-target',
> +    'net',
>       'pci',
>       'rdma',
>       'rocker',
> @@ -63,7 +56,14 @@ if have_system
>   endif
>   if have_system or have_tools
>     qapi_all_modules += [
> +    'block',
> +    'block-core',
> +    'block-export',
> +    'char',
> +    'qom',
>       'ui',
> +    'transaction',
> +    'yank',
>     ]
>   endif
>   



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

* Re: [PATCH 4/4] qapi/meson: Restrict machine-specific objects to sysemu
  2022-02-04 17:00   ` Paolo Bonzini
@ 2022-02-04 23:40     ` Philippe Mathieu-Daudé via
  0 siblings, 0 replies; 14+ messages in thread
From: Philippe Mathieu-Daudé via @ 2022-02-04 23:40 UTC (permalink / raw)
  To: Paolo Bonzini, qemu-devel, Thomas Huth
  Cc: Daniel P. Berrangé, Markus Armbruster, Richard Henderson

On 4/2/22 18:00, Paolo Bonzini wrote:
> On 2/4/22 16:29, Philippe Mathieu-Daudé via wrote:
>> machine/ and net/ are only useful to machines;
>> block/ and migration/ to machine or tools.
>>
>> Note we need to keep building machine.json generated sources
>> on all targets because some want to access X86CPUFeatureWordInfo
>> from any architecture ¯\_(ツ)_/¯ Otherwise we get on all but
>> x86 targets:
>>
>>    /usr/bin/ld: libqemu-i386-linux-user.fa.p/target_i386_cpu.c.o: in 
>> function `x86_cpu_get_feature_words':
>>    ../target/i386/cpu.c:4587: undefined reference to 
>> `visit_type_X86CPUFeatureWordInfoList'
>>    collect2: error: ld returned 1 exit status
> 
> I suppose you mean "on all but x86 hosts", since it links 
> libqemu-i386-linux-user.fa.p?  But I don't understand how that happens. 
>   Is it related to
> 
> { 'struct': 'DummyForceArrays',
>    'data': { 'unused': ['X86CPUFeatureWordInfo'] } }
> 
> and if so can DummyForceArrays be moved to machine-target.json together 
> with X86CPUFeatureWordInfo, and under 'if': 'TARGET_I386'?

Err this one is not an *arch* problem, but a user/system one (sorry I
got confused with another one). Here the problem is it is not trivial
to restrict visit_type_X86CPUFeatureWordInfoList() to sysemu.

So machine.json must be in qapi_all_modules[] even if !have_system.


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

end of thread, other threads:[~2022-02-04 23:41 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-04 15:29 [PATCH 0/4] buildsys: Avoid building unused objects Philippe Mathieu-Daudé via
2022-02-04 15:29 ` [PATCH 1/4] configure: Restrict TCG to emulation Philippe Mathieu-Daudé via
2022-02-04 15:35   ` Thomas Huth
2022-02-04 16:55   ` Paolo Bonzini
2022-02-04 15:29 ` [PATCH 2/4] tests/fp: Do not build softfloat3 tests if TCG is disabled Philippe Mathieu-Daudé via
2022-02-04 15:38   ` Thomas Huth
2022-02-04 15:29 ` [PATCH 3/4] qom: Remove user-creatable objects from user emulation Philippe Mathieu-Daudé via
2022-02-04 15:56   ` Thomas Huth
2022-02-04 16:14     ` Philippe Mathieu-Daudé via
2022-02-04 16:56   ` Paolo Bonzini
2022-02-04 15:29 ` [PATCH 4/4] qapi/meson: Restrict machine-specific objects to sysemu Philippe Mathieu-Daudé via
2022-02-04 16:25   ` Thomas Huth
2022-02-04 17:00   ` Paolo Bonzini
2022-02-04 23:40     ` Philippe Mathieu-Daudé via

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.