On 5/17/25 8:04 AM, Paolo Bonzini wrote:
On 5/16/25 07:27, Pierrick Bouvier wrote:
Now that target configuration can be applied to lib{system, user}_ss,
there is no reason to keep that separate from the existing {system,
user}_ss.

The reason would be that previously you wouldn't have
-DCOMPILING_SYSTEM_VS_USER defined for the files in system_ss/user_ss.
I don't think it's a problem, because it's usually clear if a file is
common QEMU infrastructure or specific to system emulation; but it's
worth mentioning it in the commit message.


Yes, sure, I'll add it.
Indeed, it's not changing much, just unpoisoining CONFIG_USER_ONLY and CONFIG_SOFTMMU. The only difference this change make is that existing system/user files now can eventually use those defines, which should be harmless as they were not using them before.

Paolo

                            c_args: ['-DCONFIG_USER_ONLY',
                                     '-DCOMPILING_SYSTEM_VS_USER'],
-                         dependencies: libuser_ss.all_dependencies(),
+                         include_directories: common_user_inc,
+                         dependencies: user_ss.all_dependencies(),
                            build_by_default: false)
libsystem = static_library('system',
-                           libsystem_ss.all_sources() + genh,
+                           system_ss.all_sources() + genh,
                              c_args: ['-DCONFIG_SOFTMMU',
                                       '-DCOMPILING_SYSTEM_VS_USER'],
-                           dependencies: libsystem_ss.all_dependencies(),
+                           dependencies: system_ss.all_dependencies(),
                              build_by_default: false)
# Note that this library is never used directly (only through extract_objects)
@@ -4121,7 +4119,6 @@ libsystem = static_library('system',
   common_all = static_library('common',
                               build_by_default: false,
                               sources: common_ss.all_sources() + genh,
-                            include_directories: common_user_inc,
                               implicit_include_directories: false,
                               dependencies: common_ss.all_dependencies())
@@ -4135,10 +4132,20 @@ foreach target_base_arch, config_base_arch : config_base_arch_mak
     inc = [common_user_inc + target_inc]
target_common = common_ss.apply(config_target, strict: false)
+  target_system = system_ss.apply(config_target, strict: false)
+  target_user = user_ss.apply(config_target, strict: false)
     common_deps = []
+  system_deps = []
+  user_deps = []
     foreach dep: target_common.dependencies()
       common_deps += dep.partial_dependency(compile_args: true, includes: true)
     endforeach
+  foreach dep: target_system.dependencies()
+    system_deps += dep.partial_dependency(compile_args: true, includes: true)
+  endforeach
+  foreach dep: target_user.dependencies()
+    user_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
@@ -4154,7 +4161,7 @@ foreach target_base_arch, config_base_arch : 
config_base_arch_mak
           sources: src.all_sources() + genh,
           include_directories: inc,
           c_args: target_system_c_args,
-        dependencies: src.all_dependencies() + common_deps)
+        dependencies: src.all_dependencies() + common_deps + system_deps)
         hw_common_arch_libs += {target_base_arch: lib}
       endif
     endif
@@ -4168,7 +4175,8 @@ foreach target_base_arch, config_base_arch : 
config_base_arch_mak
           sources: src.all_sources() + genh,
           include_directories: inc,
           c_args: target_c_args,
-        dependencies: src.all_dependencies() + common_deps)
+        dependencies: src.all_dependencies() + common_deps +
+                      system_deps + user_deps)
         target_common_arch_libs += {target_base_arch: lib}
       endif
     endif
@@ -4182,7 +4190,7 @@ foreach target_base_arch, config_base_arch : 
config_base_arch_mak
           sources: src.all_sources() + genh,
           include_directories: inc,
           c_args: target_system_c_args,
-        dependencies: src.all_dependencies() + common_deps)
+        dependencies: src.all_dependencies() + common_deps + system_deps)
         target_common_system_arch_libs += {target_base_arch: lib}
       endif
     endif
@@ -4358,12 +4366,12 @@ foreach target : target_dirs
     objects = [common_all.extract_objects(target_common.sources())]
     arch_deps += target_common.dependencies()
     if target_type == 'system'
-    src = libsystem_ss.apply(config_target, strict: false)
+    src = system_ss.apply(config_target, strict: false)
       objects += libsystem.extract_objects(src.sources())
       arch_deps += src.dependencies()
     endif
     if target_type == 'user'
-    src = libuser_ss.apply(config_target, strict: false)
+    src = user_ss.apply(config_target, strict: false)
       objects += libuser.extract_objects(src.sources())
       arch_deps += src.dependencies()
     endif



Reply via email to