From 6fd5b82b2fb704346871579be15dc4ab2459de79 Mon Sep 17 00:00:00 2001 From: Yichao Yu Date: Wed, 1 Jul 2020 00:39:52 -0400 Subject: [PATCH] Fix CPU feature specification on virtualized x64. --- src/processor_x86.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/processor_x86.cpp b/src/processor_x86.cpp index 0b8cfe8dccdce..624d8452bf8b2 100644 --- a/src/processor_x86.cpp +++ b/src/processor_x86.cpp @@ -840,6 +840,12 @@ get_llvm_target_noext(const TargetData &data) features.push_back("+sse2"); features.push_back("+mmx"); features.push_back("+fxsr"); +#ifdef _CPU_X86_64_ + // This is required to make LLVM happy if LLVM's feature based CPU arch guess + // returns a value that may not have 64bit support. + // This can happen with virtualization. + features.push_back("+64bit"); +#endif return std::make_pair(std::move(name), std::move(features)); }