Repository: rust
Issue: libcompiler_builtins and libprofiler_builtins for aarch64-pc-windows-msvc contain x86 objects
Labels: O-windows-msvc,O-AArch64

I was trying to look at the code generated by nightly rust for arm64 windows, which turned up to not be supported by my binutils, but in the middle of the otherwise empty `objdump -d` output, I got the surprise to see x86 assembly. As it turns out, several object files embedded in libcompiler_builtins and libprofiler_builtins (but not all of them) are pe-i386 objects.

```
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/ucmpti2.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/ucmpdi2.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/trunctfsf2.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/trunctfdf2.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/truncsfhf2.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/truncdfsf2.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/truncdfhf2.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/subvti3.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/subvsi3.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/subvdi3.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/powixf2.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/popcountti2.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/popcountsi2.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/popcountdi2.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/parityti2.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/paritysi2.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/paritydi2.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/negvti2.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/negvsi2.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/negvdi2.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/negti2.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/negsf2.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/negdi2.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/negdf2.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/mulxc3.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/mulvti3.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/mulvsi3.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/mulvdi3.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/mulsc3.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/muldc3.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/int_util.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/floatunsitf.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/floatunditf.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/floatsitf.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/floatditf.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/fixunstfti.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/fixunstfsi.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/fixunstfdi.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/fixtfti.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/fixtfsi.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/fixtfdi.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/ffsti2.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/extendsftf2.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/extendhfsf2.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/extenddftf2.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/divxc3.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/divsc3.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/divdc3.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/ctzti2.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/ctzsi2.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/ctzdi2.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/comparetf2.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/cmpti2.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/cmpdi2.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/clzti2.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/clzsi2.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/clzdi2.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/apple_versioning.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/addvti3.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/addvsi3.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/addvdi3.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/absvti2.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/absvsi2.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/compiler_builtins-ab033e49e368917e/out/./compiler-rt/lib/builtins/absvdi2.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/profiler_builtins-d4c98d7f03f32e3d/out/WindowsMMap.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/profiler_builtins-d4c98d7f03f32e3d/out/InstrProfilingWriter.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/profiler_builtins-d4c98d7f03f32e3d/out/InstrProfilingValue.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/profiler_builtins-d4c98d7f03f32e3d/out/InstrProfilingUtil.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/profiler_builtins-d4c98d7f03f32e3d/out/InstrProfilingRuntime.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/profiler_builtins-d4c98d7f03f32e3d/out/InstrProfilingPlatformOther.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/profiler_builtins-d4c98d7f03f32e3d/out/InstrProfilingPlatformLinux.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/profiler_builtins-d4c98d7f03f32e3d/out/InstrProfilingPlatformDarwin.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/profiler_builtins-d4c98d7f03f32e3d/out/InstrProfilingNameVar.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/profiler_builtins-d4c98d7f03f32e3d/out/InstrProfilingMergeFile.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/profiler_builtins-d4c98d7f03f32e3d/out/InstrProfilingMerge.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/profiler_builtins-d4c98d7f03f32e3d/out/InstrProfilingFile.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/profiler_builtins-d4c98d7f03f32e3d/out/InstrProfilingBuffer.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/profiler_builtins-d4c98d7f03f32e3d/out/InstrProfiling.o:     file format pe-i386
C:/projects/rust/build/x86_64-pc-windows-msvc/stage2-std/aarch64-pc-windows-msvc/release/build/profiler_builtins-d4c98d7f03f32e3d/out/GCDAProfiling.o:     file format pe-i386
```

Cc: @froydnj, @alexcrichton