mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
meson: build target libraries with common dependencies
As mentioned in [1], dependencies
were missing when compiling per target libraries, thus breaking
compilation on certain host systems.
We now explicitly add common dependencies to those libraries, so it
solves the problem.
[1] https://lore.kernel.org/qemu-devel/20250513115637.184940-1-thuth@redhat.com/
Tested-by: Thomas Huth <thuth@redhat.com>
Fixes: 6f4e8a92bb
("hw/arm: make most of the compilation units common")
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Link: https://lore.kernel.org/r/20250521223414.248276-2-pierrick.bouvier@linaro.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
f0737158b4
commit
4fb54de823
1 changed files with 40 additions and 35 deletions
75
meson.build
75
meson.build
|
@ -3242,6 +3242,7 @@ config_devices_mak_list = []
|
|||
config_devices_h = {}
|
||||
config_target_h = {}
|
||||
config_target_mak = {}
|
||||
config_base_arch_mak = {}
|
||||
|
||||
disassemblers = {
|
||||
'alpha' : ['CONFIG_ALPHA_DIS'],
|
||||
|
@ -3433,6 +3434,11 @@ foreach target : target_dirs
|
|||
config_all_devices += config_devices
|
||||
endif
|
||||
config_target_mak += {target: config_target}
|
||||
|
||||
# build a merged config for all targets with the same TARGET_BASE_ARCH
|
||||
target_base_arch = config_target['TARGET_BASE_ARCH']
|
||||
config_base_arch = config_base_arch_mak.get(target_base_arch, {}) + config_target
|
||||
config_base_arch_mak += {target_base_arch: config_base_arch}
|
||||
endforeach
|
||||
target_dirs = actual_target_dirs
|
||||
|
||||
|
@ -4111,57 +4117,56 @@ common_all = static_library('common',
|
|||
hw_common_arch_libs = {}
|
||||
target_common_arch_libs = {}
|
||||
target_common_system_arch_libs = {}
|
||||
foreach target : target_dirs
|
||||
foreach target_base_arch, config_base_arch : config_base_arch_mak
|
||||
config_target = config_target_mak[target]
|
||||
target_base_arch = config_target['TARGET_BASE_ARCH']
|
||||
target_inc = [include_directories('target' / target_base_arch)]
|
||||
inc = [common_user_inc + target_inc]
|
||||
|
||||
target_common = common_ss.apply(config_target, strict: false)
|
||||
common_deps = []
|
||||
foreach dep: target_common.dependencies()
|
||||
common_deps += dep.partial_dependency(compile_args: true, includes: true)
|
||||
endforeach
|
||||
|
||||
# prevent common code to access cpu compile time definition,
|
||||
# but still allow access to cpu.h
|
||||
target_c_args = ['-DCPU_DEFS_H']
|
||||
target_system_c_args = target_c_args + ['-DCOMPILING_SYSTEM_VS_USER', '-DCONFIG_SOFTMMU']
|
||||
|
||||
if target_base_arch in hw_common_arch
|
||||
if target_base_arch not in hw_common_arch_libs
|
||||
src = hw_common_arch[target_base_arch]
|
||||
lib = static_library(
|
||||
'hw_' + target_base_arch,
|
||||
build_by_default: false,
|
||||
sources: src.all_sources() + genh,
|
||||
include_directories: inc,
|
||||
c_args: target_system_c_args,
|
||||
dependencies: src.all_dependencies())
|
||||
hw_common_arch_libs += {target_base_arch: lib}
|
||||
endif
|
||||
src = hw_common_arch[target_base_arch]
|
||||
lib = static_library(
|
||||
'hw_' + target_base_arch,
|
||||
build_by_default: false,
|
||||
sources: src.all_sources() + genh,
|
||||
include_directories: inc,
|
||||
c_args: target_system_c_args,
|
||||
dependencies: src.all_dependencies() + common_deps)
|
||||
hw_common_arch_libs += {target_base_arch: lib}
|
||||
endif
|
||||
|
||||
if target_base_arch in target_common_arch
|
||||
if target_base_arch not in target_common_arch_libs
|
||||
src = target_common_arch[target_base_arch]
|
||||
lib = static_library(
|
||||
'target_' + target_base_arch,
|
||||
build_by_default: false,
|
||||
sources: src.all_sources() + genh,
|
||||
include_directories: inc,
|
||||
c_args: target_c_args,
|
||||
dependencies: src.all_dependencies())
|
||||
target_common_arch_libs += {target_base_arch: lib}
|
||||
endif
|
||||
src = target_common_arch[target_base_arch]
|
||||
lib = static_library(
|
||||
'target_' + target_base_arch,
|
||||
build_by_default: false,
|
||||
sources: src.all_sources() + genh,
|
||||
include_directories: inc,
|
||||
c_args: target_c_args,
|
||||
dependencies: src.all_dependencies() + common_deps)
|
||||
target_common_arch_libs += {target_base_arch: lib}
|
||||
endif
|
||||
|
||||
if target_base_arch in target_common_system_arch
|
||||
if target_base_arch not in target_common_system_arch_libs
|
||||
src = target_common_system_arch[target_base_arch]
|
||||
lib = static_library(
|
||||
'target_system_' + target_base_arch,
|
||||
build_by_default: false,
|
||||
sources: src.all_sources() + genh,
|
||||
include_directories: inc,
|
||||
c_args: target_system_c_args,
|
||||
dependencies: src.all_dependencies())
|
||||
target_common_system_arch_libs += {target_base_arch: lib}
|
||||
endif
|
||||
src = target_common_system_arch[target_base_arch]
|
||||
lib = static_library(
|
||||
'target_system_' + target_base_arch,
|
||||
build_by_default: false,
|
||||
sources: src.all_sources() + genh,
|
||||
include_directories: inc,
|
||||
c_args: target_system_c_args,
|
||||
dependencies: src.all_dependencies() + common_deps)
|
||||
target_common_system_arch_libs += {target_base_arch: lib}
|
||||
endif
|
||||
endforeach
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue