diff mbox series

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

Message ID 20250203031821.741477-6-richard.henderson@linaro.org
State New
Headers show
Series meson: Deprecate 32-bit host support | expand

Commit Message

Richard Henderson Feb. 3, 2025, 3:18 a.m. UTC
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(-)

Comments

Thomas Huth Feb. 3, 2025, 10:15 a.m. UTC | #1
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>
Alex Bennée Feb. 3, 2025, 11:48 a.m. UTC | #2
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>
diff mbox series

Patch

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