Repository: rust
Issue: Windows 32-bit shell: x.py fails (in hard to dissect fashion) during LLVM build 
Labels: O-windows,C-enhancement,O-windows-msvc,T-bootstrap,E-medium

I tried this code:

```
D:\pnkfelix\RustLang\rust.git> python x.py build
```

I expected to see this happen: 


```
[...]
build completed successfully in 99:99:99
```

Instead, this happened: 

```
[...]
running: "cmake" "--build" "." "--target" "install" "--config" "Release" "--" "-j" "8"
[5/396] Building CXX object tools\llvm-cxxdump\CMakeFiles\llvm-cxxdump.dir\Error.cpp.obj
cl : Command line warning D9025 : overriding '/MD' with '/MT'
[8/396] Linking CXX executable bin\llvm-cfi-verify.exe
FAILED: bin/llvm-cfi-verify.exe
cmd.exe /C "cd . && "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E vs_link_exe --intdir=tools\llvm-cfi-verify\CMakeFiles\llvm-cfi-verify.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100190~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100190~1.0\x64\mt.exe --manifests  -- C:\PROGRA~1\MICROS~1\2022\COMMUN~1\VC\Tools\MSVC\1431~1.311\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\llvm-cfi-verify.rsp  /out:bin\llvm-cfi-verify.exe /implib:lib\llvm-cfi-verify.lib /pdb:bin\llvm-cfi-verify.pdb /version:0.0 /STACK:10000000 /INCREMENTAL:NO /subsystem:console  && cd ."
LINK: command "C:\PROGRA~1\MICROS~1\2022\COMMUN~1\VC\Tools\MSVC\1431~1.311\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\llvm-cfi-verify.rsp /out:bin\llvm-cfi-verify.exe /implib:lib\llvm-cfi-verify.lib /pdb:bin\llvm-cfi-verify.pdb /version:0.0 /STACK:10000000 /INCREMENTAL:NO /subsystem:console /MANIFEST /MANIFESTFILE:bin\llvm-cfi-verify.exe.manifest" failed (exit code 1120) with the following output:
LLVMDebugInfoPDB.lib(DIATable.cpp.obj) : error LNK2001: unresolved external symbol "class ATL::CAtlBaseModule ATL::_AtlBaseModule" (?_AtlBaseModule@ATL@@3VCAtlBaseModule@1@A)
LLVMDebugInfoPDB.lib(DIAEnumSymbols.cpp.obj) : error LNK2001: unresolved external symbol "class ATL::CAtlBaseModule ATL::_AtlBaseModule" (?_AtlBaseModule@ATL@@3VCAtlBaseModule@1@A)
[...]
ninja: build stopped: subcommand failed.
thread 'main' panicked at '
command did not execute successfully, got: exit code: 1

build script failed, must exit now', C:\Users\pnkfelix\.cargo\registry\src\github.com-1ecc6299db9ec823\cmake-0.1.44\src\lib.rs:885:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
        finished in 15.072 seconds
Build completed unsuccessfully in 99:99:99
```

Actual log, which you would have to dissect to see the actual problem: https://gist.github.com/pnkfelix/4dd2aba17632cccf2803f5f5cda7dba6


The actual problem is that my command prompt had started up using Visual Studio's 32-bit (x86) mode.

But that choice of mode does not influence what Rust does for its own bootstrapping. Which then leads its LLVM build to go astray during the link step.

----

I have not yet checked to see if skipping the LLVM entirely works in this context. I suspect it might.

But if we do request an LLVM build from bootstrap, then `x.py` could do a better job of detecting this scenario at the outset, and reporting it to the user.

(Arguably LLVM could/should be doing this itself, on our behalf. But its easier for me to figure out how to give a great user experience via `x.py` and `bootstrap` rather than figure out LLVM's CMake business.)