From 0789f9101c69025941f85baa76cc57d38a957103 Mon Sep 17 00:00:00 2001 From: Elliot Saba Date: Mon, 15 Oct 2018 22:53:14 +0800 Subject: [PATCH] Throw extremely specific error if `CX16` is unsupported when it should be. --- src/processor_x86.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/processor_x86.cpp b/src/processor_x86.cpp index 8023172d987f0..5cf83970db683 100644 --- a/src/processor_x86.cpp +++ b/src/processor_x86.cpp @@ -715,10 +715,20 @@ static uint32_t sysimg_init_cb(const void *id) // We translate `generic` to `pentium4` or `x86-64` before sending it to LLVM // (see `get_llvm_target_noext`) which will be serialized into the sysimg target data. // Translate them back so we can actually match them. + bool sysimg_allows_no_cx16 = false; for (auto &t: sysimg) { if (auto nname = normalize_cpu_name(t.name)) { t.name = nname; } + + // Take note to see if the sysimg explicitly allows an architecture without cx16 + sysimg_allows_no_cx16 |= !test_nbit(t.en.features, Feature::cx16); + } + if (!sysimg_allows_no_cx16 && !test_nbit(target.en.features, Feature::cx16)) { + jl_error("Your CPU does not support the CX16 instruction, which is required " + "by this version of Julia! This is often due to running inside of a " + "virtualized environment. Please read " + "https://docs.julialang.org/en/stable/devdocs/sysimg/ for more."); } auto match = match_sysimg_targets(sysimg, target, max_vector_size); // Now we've decided on which sysimg version to use.