diff options
author | Peter Maydell | 2014-02-20 20:42:53 +0100 |
---|---|---|
committer | Peter Maydell | 2014-02-21 11:39:10 +0100 |
commit | 774d566cdbebb916af9760dac629aa7c1adf9d3d (patch) | |
tree | 3b4f5fec2d8742be83f12052dfcbcdf52bf8614f /configure | |
parent | Merge remote-tracking branch 'remotes/kraxel/tags/pull-usb-3' into staging (diff) | |
download | qemu-774d566cdbebb916af9760dac629aa7c1adf9d3d.tar.gz qemu-774d566cdbebb916af9760dac629aa7c1adf9d3d.tar.xz qemu-774d566cdbebb916af9760dac629aa7c1adf9d3d.zip |
tcg/i386: Fix build for systems without working cpuid.h (MacOSX, Win32)
Win32 doesn't have a cpuid.h, and MacOSX may have one but without
the __cpuid() function we use, which means that commit 9d2eec20
broke the build for those platforms. Fix this by tightening up
our configure cpuid.h check to test that the functions we need
are present, and adding some missing #ifdef guards in
tcg/i386/tcg-target.c.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -3564,7 +3564,18 @@ cpuid_h=no cat > $TMPC << EOF #include <cpuid.h> int main(void) { - return 0; + unsigned a, b, c, d; + int max = __get_cpuid_max(0, 0); + + if (max >= 1) { + __cpuid(1, a, b, c, d); + } + + if (max >= 7) { + __cpuid_count(7, 0, a, b, c, d); + } + + return 0; } EOF if compile_prog "" "" ; then |