Open Bug 1379732 Opened 7 years ago Updated 2 years ago

Building on a fresh windows VM with MSVC 2017 failing with link error: module machine type 'X86' conflicts with target machine type 'x64'

Categories

(Firefox Build System :: General, defect)

defect

Tracking

(Not tracked)

People

(Reporter: Alex_Gaynor, Unassigned)

Details

Full log is here with the actual error message highlighted:

https://gist.github.com/anonymous/85660b2d2131632e0c76f48e4e5ef23a#file-gistfile1-txt-L3233-L3236

> 27:59.83 error: linking with `link.exe` failed: exit code: 1112
> 27:59.91   |
> 27:59.92   = note: "link.exe" "/NOLOGO" "/NXCOMPAT" "/LIBPATH:C:\\Users\\IEUser\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib" "c:/mozilla-source/mozilla-central/obj-i686-pc-mingw32/toolkit/library\\release\\build\\rayon-core-4e0760150ff6b7e4\\build_script_build-4e0760150ff6b7e4.0.o" "/OUT:c:/mozilla-source/mozilla-central/obj-i686-pc-mingw32/toolkit/library\\release\\build\\rayon-core-4e0760150ff6b7e4\\build_script_build-4e0760150ff6b7e4.exe" "/OPT:REF,ICF" "/DEBUG" "/LIBPATH:c:/mozilla-source/mozilla-central/obj-i686-pc-mingw32/toolkit/library\\release\\deps" "/LIBPATH:C:\\Users\\IEUser\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib" "C:\\Users\\IEUser\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libstd-0a78323911070f99.rlib" "C:\\Users\\IEUser\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librand-c279a51d66700350.rlib" "C:\\Users\\IEUser\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcollections-d7bf31a4ca1ea637.rlib" "C:\\Users\\IEUser\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libstd_unicode-d367c3ba0db49600.rlib" "C:\\Users\\IEUser\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libpanic_unwind-2d4bf02140c11dcb.rlib" "C:\\Users\\IEUser\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libunwind-add7a84d7e82d084.rlib" "C:\\Users\\IEUser\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\liblibc-84688accbc86d6b7.rlib" "C:\\Users\\IEUser\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\liballoc-fe2e68b21f0bdd7a.rlib" "C:\\Users\\IEUser\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\liballoc_system-7fc0381594c93f56.rlib" "C:\\Users\\IEUser\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcore-ea9d77e7c23fe65c.rlib" "C:\\Users\\IEUser\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcompiler_builtins-91b619d34dd1f5aa.rlib" "advapi32.lib" "ws2_32.lib" "userenv.lib" "shell32.lib" "msvcrt.lib"
> 27:59.94 = note: msvcrt.lib(chkstk.obj) : fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'

This is a fresh Windows 10 VM with MSVC 2017 installed.
Were there any outcomes from the IRC conversation about this?
Flags: needinfo?(agaynor)
Yes, as a result I added the following to my mozconfig:

    ac_add_options --host=x86_64-pc-mingw32
    ac_add_options --target=x86_64-pc-mingw32

I also uninstalled the 32-bit target from rustup, though I don't think that was necessary.
Flags: needinfo?(agaynor)
So this feels like a bug with configure not properly vetting the toolchains. I wouldn't be surprised if we have a dupe for this: our toolchain configuration story on Windows is lacking compared to !windows.
Product: Core → Firefox Build System
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.