]> git.proxmox.com Git - mirror_qemu.git/commit
hw/i386: fix short-circuit logic with non-optimizing builds
authorDaniel Hoffman <dhoff749@gmail.com>
Sun, 19 Nov 2023 20:31:16 +0000 (12:31 -0800)
committerMichael S. Tsirkin <mst@redhat.com>
Sat, 2 Dec 2023 20:56:49 +0000 (15:56 -0500)
commitc04cfb4596ad5032a9869a8f77fe9114ca8af9e0
treeacbe3e81fd6f8f3a4f879f8f519ab20330f5880a
parent20bc50137f3add52eb4788b420d717de27fed14b
hw/i386: fix short-circuit logic with non-optimizing builds

`kvm_enabled()` is compiled down to `0` and short-circuit logic is
used to remove references to undefined symbols at the compile stage.
Some build configurations with some compilers don't attempt to
simplify this logic down in some cases (the pattern appears to be
that the literal false must be the first term) and this was causing
some builds to emit references to undefined symbols.

An example of such a configuration is clang 16.0.6 with the following
configure: ./configure --enable-debug --without-default-features
--target-list=x86_64-softmmu --enable-tcg-interpreter

Signed-off-by: Daniel Hoffman <dhoff749@gmail.com>
Message-Id: <20231119203116.3027230-1-dhoff749@gmail.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/i386/x86.c