mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-20 08:45:46 +00:00
24f3ed4b74
We currently use a 32-bit Rust toolchain for win32 builds, but this can lead to OOM situations. This patch makes win32 builds use a 64-bit Rust toolchain, which requires a little bit of extra configuration because rustc needs to be able to find a link.exe that produces 64-bit binaries for building things like build scripts, which are host binaries. We will now generate a batch file that sets LIB to the paths to 64-bit libraries and invokes the x64-targeting link.exe, and add a section to the .cargo/config file to instruct cargo to use that batch file as the linker when producing 64-bit binaries. MozReview-Commit-ID: 9vKBbm7Gvra --HG-- extra : rebase_source : 599b3b661c7a8a5db1f32a2a9732fc202fb55e1e
31 lines
1.5 KiB
Plaintext
31 lines
1.5 KiB
Plaintext
if [ -z "${VSPATH}" ]; then
|
|
TOOLTOOL_DIR=${TOOLTOOL_DIR:-$topsrcdir}
|
|
VSPATH="$(cd ${TOOLTOOL_DIR} && pwd)/vs2017_15.4.2"
|
|
fi
|
|
|
|
if [ -d "${VSPATH}" ]; then
|
|
VSWINPATH="$(cd ${VSPATH} && pwd -W)"
|
|
|
|
export WINDOWSSDKDIR="${VSWINPATH}/SDK"
|
|
export WIN32_REDIST_DIR="${VSPATH}/VC/redist/x86/Microsoft.VC141.CRT"
|
|
export WIN_UCRT_REDIST_DIR="${VSPATH}/SDK/Redist/ucrt/DLLs/x86"
|
|
|
|
export PATH="${VSPATH}/VC/bin/Hostx86/x86:${VSPATH}/VC/bin/Hostx64/x86:${VSPATH}/VC/bin/Hostx64/x64:${VSPATH}/SDK/bin/10.0.15063.0/x64:${VSPATH}/DIA SDK/bin:${PATH}"
|
|
export PATH="${VSPATH}/VC/redist/x86/Microsoft.VC141.CRT:${VSPATH}/SDK/Redist/ucrt/DLLs/x86:${PATH}"
|
|
|
|
export INCLUDE="${VSPATH}/VC/include:${VSPATH}/VC/atlmfc/include:${VSPATH}/SDK/Include/10.0.15063.0/ucrt:${VSPATH}/SDK/Include/10.0.15063.0/shared:${VSPATH}/SDK/Include/10.0.15063.0/um:${VSPATH}/SDK/Include/10.0.15063.0/winrt:${VSPATH}/DIA SDK/include"
|
|
export LIB="${VSPATH}/VC/lib/x86:${VSPATH}/VC/atlmfc/lib/x86:${VSPATH}/SDK/Lib/10.0.15063.0/ucrt/x86:${VSPATH}/SDK/Lib/10.0.15063.0/um/x86:${VSPATH}/DIA SDK/lib"
|
|
|
|
export WIN64_LINK="${VSPATH}/VC/bin/Hostx64/x64/link.exe"
|
|
export WIN64_LIB="${VSPATH}/VC/lib/x64:${VSPATH}/VC/atlmfc/lib/x64:${VSPATH}/SDK/Lib/10.0.15063.0/ucrt/x64:${VSPATH}/SDK/Lib/10.0.15063.0/um/x64:${VSPATH}/DIA SDK/lib/amd64"
|
|
fi
|
|
|
|
. $topsrcdir/build/mozconfig.vs-common
|
|
|
|
mk_export_correct_style WINDOWSSDKDIR
|
|
mk_export_correct_style WIN32_REDIST_DIR
|
|
mk_export_correct_style WIN_UCRT_REDIST_DIR
|
|
mk_export_correct_style PATH
|
|
mk_export_correct_style INCLUDE
|
|
mk_export_correct_style LIB
|