使用VS2015 x64 x86交叉工具命令提示符编译Boost时cl.exe频繁崩溃求助
Yep, this absolutely smells like a compatibility bug in the VS2015 cross-compilation toolchain—especially when paired with high-core-count AMD CPUs like your Threadripper 1950X. I’ve seen similar issues pop up with older VS versions and AMD’s multi-threaded chips, so let’s break down what’s going on and how to fix it:
Possible Root Causes
- VS2015 Cross-Toolchain Thread Scheduling Bug: The x64-to-x86 cross-compilation mode uses a different code path in
cl.execompared to native x64 compilation. VS2015’s toolchain wasn’t fully optimized for AMD’s high-thread-count CPUs (16 cores/32 threads here), leading to race conditions or resource exhaustion that crash the compiler. - Outdated BIOS/CPU Microcode: Your MSI X399’s BIOS version A.20 is pretty old—early Threadripper BIOS releases had known compatibility quirks with legacy Microsoft compilers. The microcode updates in newer BIOS versions often fix low-level CPU-toolchain interactions.
- Overly Aggressive Parallel Compilation: Boost’s default parallel build settings (
-jflag) might be spawning too many concurrentcl.exeinstances in cross-compile mode. Native x64 can handle more threads, but the cross-toolchain’s overhead pushes it over the edge.
Fixes to Try (Ordered by Ease of Implementation)
Limit Parallel Compilation Threads
When invoking Boost’sb2, explicitly set a lower thread count to reduce load on the cross-toolchain. For example:b2 toolset=msvc-14.0 address-model=32 -j8Start with
-j8or even-j4—you can gradually increase it once you confirm stability.Update VS2015 to Update 3
If you haven’t already, install VS2015 Update 3 (the final major update for VS2015). It patches dozens of compiler stability issues, including several related to cross-compilation.Upgrade Your Motherboard BIOS
MSI has released multiple BIOS updates for the X399 SLI PLUS that fix AMD CPU compatibility bugs. Grab the latest stable version from MSI’s support site (look for updates with microcode patches for Threadripper 1st Gen) and flash it—this often resolves low-level crashes that are hard to pin down.Temporarily Disable Compiler Optimizations
To rule out optimization-stage bugs, add the/Odflag to disable optimizations during compilation:b2 toolset=msvc-14.0 address-model=32 cxxflags="/Od" -j8If this stops the crashes, you can later try re-enabling optimizations one by one (e.g.,
/O1instead of/O2) to find a stable middle ground.Test Single-Library Compilation
Narrow down whether the crash is triggered by a specific Boost library. Try compiling just one library first:b2 toolset=msvc-14.0 address-model=32 --with-systemIf this works, gradually add more libraries to identify the culprit—you might need to adjust flags for that specific library or report the issue to the Boost team if it’s a library-specific bug.
Final Note
This is definitely a known edge-case bug in VS2015’s cross-compilation stack, exacerbated by AMD’s high-core-count hardware. The fixes above should get you past the crashes, but if you can, consider upgrading to a newer VS version (like VS2019 or later) for better AMD CPU support and more stable toolchains.
内容的提问来源于stack exchange,提问作者tensor5375

