From: Paolo Bonzini <pbonzini@redhat.com>
To: Kamil Rytarowski <n54@gmx.com>, qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org
Subject: Re: [Qemu-devel] [PATCH] target-i386: Enhance the stub for kvm_arch_get_supported_cpuid()
Date: Thu, 14 Feb 2019 21:51:39 +0100 [thread overview]
Message-ID: <fc6a0084-815c-5e4a-cd5c-11046f16f33b@redhat.com> (raw)
In-Reply-To: <d0b7bfcb-8894-5a06-8290-ac9daf5a05da@gmx.com>
[-- Attachment #1: Type: text/plain, Size: 3722 bytes --]
On 14/02/19 20:41, Kamil Rytarowski wrote:
> Please do replace the current kludge that is sensitive to:
> - compiler behavior that can change with new versions
> - compiler gcc/clang
> - optimization options
Not really, any half-decent compiler will optimize away "if (0)" and
QEMU is far from being the only software that relies on that.
GCC has been doing that even at -O0 for like 15 years, at some point it
was basically the only optimization it did. Just try it for yourself:
int f(void);
int main()
{
if (0)
return f();
else
return 0;
}
Throw it at all compilers and optimization levels, and it *will* work.
If it doesn't then I'll consider again your patch.
> - linux(KVM) - non-linux (no-KVM) build
That's the point. We want your non-Linux non-KVM build to be as lean as
possible and not cause possible run-time failures due to people
forgetting about them.
> - community not actively testing non-linux no-kvm build with
> optimization on clang
False, we test OS X and there are VM builds for the BSDs.
> My patch replaced it makes it work.
>
> Build error:
>
> LINK i386-bsd-user/qemu-i386
Ok, please use "make -C i386-bsd-user target/i386/cpu.o V=1" to get the
command line, invoke it again with "-save-temps" at the end, and send me
both the command line and the resulting "cpu.i" file.
Paolo
> /usr/bin/ld: /usr/lib/libc.so and /usr/lib/crt0.o: warning: multiple
> common of `environ'
> /usr/bin/ld: target/i386/cpu.o: in function `x86_cpu_filter_features':
> /tmp/pkgsrc-tmp/emulators/qemu/work/qemu-3.1.0/target/i386/cpu.c:5047:
> undefined reference to `kvm_arch_get_supported_cpuid'
> /usr/bin/ld:
> /tmp/pkgsrc-tmp/emulators/qemu/work/qemu-3.1.0/target/i386/cpu.c:5048:
> undefined reference to `kvm_arch_get_supported_cpuid'
> /usr/bin/ld:
> /tmp/pkgsrc-tmp/emulators/qemu/work/qemu-3.1.0/target/i386/cpu.c:5049:
> undefined reference to `kvm_arch_get_supported_cpuid'
> /usr/bin/ld:
> /tmp/pkgsrc-tmp/emulators/qemu/work/qemu-3.1.0/target/i386/cpu.c:5050:
> undefined reference to `kvm_arch_get_supported_cpuid'
> /usr/bin/ld:
> /tmp/pkgsrc-tmp/emulators/qemu/work/qemu-3.1.0/target/i386/cpu.c:5051:
> undefined reference to `kvm_arch_get_supported_cpuid'
> clang-9: error: linker command failed with exit code 1 (use -v to see
> invocation)
> make[1]: *** [Makefile:199: qemu-i386] Error 1
> gmake: *** [Makefile:483: subdir-i386-bsd-user] Error 2
> gmake: *** Waiting for unfinished jobs....
> LINK x86_64-bsd-user/qemu-x86_64
> /usr/bin/ld: /usr/lib/libc.so and /usr/lib/crt0.o: warning: multiple
> common of `environ'
> /usr/bin/ld: target/i386/cpu.o: in function `x86_cpu_filter_features':
> /tmp/pkgsrc-tmp/emulators/qemu/work/qemu-3.1.0/target/i386/cpu.c:5047:
> undefined reference to `kvm_arch_get_supported_cpuid'
> /usr/bin/ld:
> /tmp/pkgsrc-tmp/emulators/qemu/work/qemu-3.1.0/target/i386/cpu.c:5048:
> undefined reference to `kvm_arch_get_supported_cpuid'
> /usr/bin/ld:
> /tmp/pkgsrc-tmp/emulators/qemu/work/qemu-3.1.0/target/i386/cpu.c:5049:
> undefined reference to `kvm_arch_get_supported_cpuid'
> /usr/bin/ld:
> /tmp/pkgsrc-tmp/emulators/qemu/work/qemu-3.1.0/target/i386/cpu.c:5050:
> undefined reference to `kvm_arch_get_supported_cpuid'
> /usr/bin/ld:
> /tmp/pkgsrc-tmp/emulators/qemu/work/qemu-3.1.0/target/i386/cpu.c:5051:
> undefined reference to `kvm_arch_get_supported_cpuid'
> clang-9: error: linker command failed with exit code 1 (use -v to see
> invocation)
> make[1]: *** [Makefile:199: qemu-x86_64] Error 1
> gmake: *** [Makefile:483: subdir-x86_64-bsd-user] Error 2
> *** Error code 2
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2019-02-14 21:05 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-02 14:45 [Qemu-devel] [PATCH] target-i386: Enhance the stub for kvm_arch_get_supported_cpuid() Kamil Rytarowski
2019-02-03 17:31 ` no-reply
2019-02-14 18:43 ` Kamil Rytarowski
2019-02-14 18:44 ` Paolo Bonzini
2019-02-14 19:41 ` Kamil Rytarowski
2019-02-14 20:51 ` Paolo Bonzini [this message]
2019-02-14 23:38 ` Kamil Rytarowski
2019-02-20 11:59 ` Kamil Rytarowski
2019-02-20 17:29 ` Paolo Bonzini
2019-02-21 2:08 ` Kamil Rytarowski
2019-02-21 17:41 ` Paolo Bonzini
2019-02-25 6:26 ` Kamil Rytarowski
[not found] ` <CABgObfb22erktrGeOArTvF=0YMG3W8vHQT1+s0p9iRAMa4BvMA@mail.gmail.com>
2019-02-25 8:31 ` Kamil Rytarowski
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=fc6a0084-815c-5e4a-cd5c-11046f16f33b@redhat.com \
--to=pbonzini@redhat.com \
--cc=n54@gmx.com \
--cc=peter.maydell@linaro.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).