[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] yank: Avoid linking into executables that don't want it
From: |
Markus Armbruster |
Subject: |
Re: [PATCH] yank: Avoid linking into executables that don't want it |
Date: |
Tue, 23 Mar 2021 10:43:31 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) |
Thomas Huth <thuth@redhat.com> writes:
> On 16/03/2021 14.59, Markus Armbruster wrote:
>> util/yank.c and stubs/yank.c are both in libqemuutil.a, even though
>> their external symbols conflict. The linker happens to pick the
>> former. This links a bunch of unneeded code into the executables that
>> actually want the latter: qemu-io, qemu-img, qemu-nbd, and several
>> tests. Amazingly, none of them fails to link.
>> To fix this, the non-stub yank.c from sourceset util_ss to sourceset
>> qmp_ss. This requires moving it from util/ to monitor/.
>
> In another patch ("tests: Use the normal yank code instead of stubs in
> relevant tests"), Lukas now changed the tests to always explicitly
> link against the real yank.c code. That makes me wonder whether we
> need the yank stubs at all ... it's not that much code after all, and
> it's very much self-contained without references to other files, so I
> think it should also be ok if we simply always keep it in the utils
> library and ditch the stubs?
Any solution that links and doesn't put duplicate symbols in .a is fine
with me.