On 5/5/25 9:59 AM, Richard Henderson wrote:
On 5/4/25 18:51, Pierrick Bouvier wrote:
semihosting code needs to be included only if CONFIG_SEMIHOSTING is set.
However, this is a target configuration, so we need to apply it to the
libsystem libuser source sets.

Signed-off-by: Pierrick Bouvier <pierrick.bouv...@linaro.org>
---
   meson.build | 26 ++++++++++++++------------
   1 file changed, 14 insertions(+), 12 deletions(-)

Acked-by: Richard Henderson <richard.hender...@linaro.org>

I'm not quite sure how this is supposed to work.  It appears this compiles 
everything in
libsystem_ss, and then later selects whether the individual objects should be 
included in
the link.  This is fine for internal CONFIG like SEMIHOSTING, but won't be fine 
for a
CONFIG that implies external dependencies like VNC.


The trick used in our build system is that static libraries are never fully compiled (no archive is created), but everything is done by extracting objects matching sources available after config. It's a bit weird, but it works. I understand it was done this way to avoid creating specific static libraries per QEMU target.

Before this patch libsystem was including all object files by default (thus the link error with --disable-tcg in Philippe series), while now, it selects them based on target config, so it's a subset.

In short: Static libraries in QEMU build system are just virtual sets of files (sharing flags and dependencies), and only a subset is included in each binary based on target config.

I guess we can think about externals later, if it becomes an issue.


Most of our external dependencies are not set as required, so if no object files selected uses it, it should link fine without the dependency being present on linker command line.


r~



Reply via email to