From: Markus Armbruster <armbru@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: Artificially target-dependend compiles
Date: Mon, 08 Nov 2021 09:09:22 +0100 [thread overview]
Message-ID: <87ilx3nk5p.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <87fss9u3zj.fsf@dusky.pond.sub.org> (Markus Armbruster's message of "Sat, 06 Nov 2021 08:40:00 +0100")
Markus Armbruster <armbru@redhat.com> writes:
[...]
> I just ran into an instance that may be clearer.
>
> The "rocker" device is target-independent (hw/net/meson.build adds it to
> softmmu_ss), but linked only for selected targets (hw/net/Kconfig has
> depends on PCI && MSI_NONBROKEN).
>
> This makes our build machinery put CONFIG_ROCKER in
> $TARGET-softmmu-config-devices.h, and poison it in config-poison.h.
> Feels uncalled for.
Hmm, maybe not.
Our build process links the rocker stuff for selected targets.
The QAPI schema provides rocker definitions unconditionally.
QAPI-generated rocker code gets linked for all targets. The
command handlers resolve to the real ones when on the selected targets,
else to stubs.
This works and is fairly simple. We link a bit of useless code
(QAPI-generated and stubs). query-qmp-schema can't tell us whether
rocker is present, which is sad, but there's a work-around:
qom-list-types.
We may still run into cases where we really want query-qmp-schema to
tell, say because there is no easy work-around.
Making the QAPI schema definitions properly conditional does the trick,
but makes code artificially target-dependent, slowing down the build.
It can also lead to extra #ifdeffery, because now useless code doesn't
compile anymore.
Simply not poisoning the CONFIG_FOO when the FOO code is actually
target-independent avoids the target-dependency, but also messes up
introspection: new the FOO stuff is present for all targets when *any*
of them has it. This cure feels worse than the disease.
Needs more thought.
next prev parent reply other threads:[~2021-11-08 8:13 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-05 13:45 Artificially target-dependend compiles Markus Armbruster
2021-11-05 16:15 ` Paolo Bonzini
2021-11-06 7:40 ` Markus Armbruster
2021-11-08 8:09 ` Markus Armbruster [this message]
2021-11-08 10:27 ` Paolo Bonzini
2021-11-08 15:38 ` Thomas Huth
2021-11-08 16:23 ` Paolo Bonzini
2021-11-08 16:30 ` Thomas Huth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ilx3nk5p.fsf@dusky.pond.sub.org \
--to=armbru@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.