[PATCH v2 05/14] tcg: Link only when required in system mode

Richard Henderson posted 14 patches 2 months ago
There is a newer version of this series
[PATCH v2 05/14] tcg: Link only when required in system mode
Posted by Richard Henderson 2 months ago
Rather than unconditional linkage via system_ss, conditinally
include the static library via specific_ss.  This will elide
the code when CONFIG_TCG is disabled for a specific target.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 tcg/meson.build | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tcg/meson.build b/tcg/meson.build
index 2977df5862..8266bcb324 100644
--- a/tcg/meson.build
+++ b/tcg/meson.build
@@ -49,4 +49,8 @@ libtcg_system = static_library('tcg_system',
 
 tcg_system = declare_dependency(objects: libtcg_system.extract_all_objects(recursive: false),
                                 dependencies: tcg_ss.dependencies())
-system_ss.add(tcg_system)
+
+specific_ss.add(when: ['CONFIG_SYSTEM_ONLY', 'CONFIG_TCG'], if_true: tcg_system)
+if host_os == 'linux'
+  specific_ss.add(when: 'CONFIG_TCG', if_false: files('perf-stubs.c'))
+endif
-- 
2.43.0
Re: [PATCH v2 05/14] tcg: Link only when required in system mode
Posted by Alex Bennée 2 months ago
Richard Henderson <richard.henderson@linaro.org> writes:

> Rather than unconditional linkage via system_ss, conditinally
> include the static library via specific_ss.  This will elide
> the code when CONFIG_TCG is disabled for a specific target.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>

-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro
Re: [PATCH v2 05/14] tcg: Link only when required in system mode
Posted by Thomas Huth 2 months ago
On 03/02/2025 04.18, Richard Henderson wrote:
> Rather than unconditional linkage via system_ss, conditinally
> include the static library via specific_ss.  This will elide
> the code when CONFIG_TCG is disabled for a specific target.
> 
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>   tcg/meson.build | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/tcg/meson.build b/tcg/meson.build
> index 2977df5862..8266bcb324 100644
> --- a/tcg/meson.build
> +++ b/tcg/meson.build
> @@ -49,4 +49,8 @@ libtcg_system = static_library('tcg_system',
>   
>   tcg_system = declare_dependency(objects: libtcg_system.extract_all_objects(recursive: false),
>                                   dependencies: tcg_ss.dependencies())
> -system_ss.add(tcg_system)
> +
> +specific_ss.add(when: ['CONFIG_SYSTEM_ONLY', 'CONFIG_TCG'], if_true: tcg_system)
> +if host_os == 'linux'
> +  specific_ss.add(when: 'CONFIG_TCG', if_false: files('perf-stubs.c'))
> +endif

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