From d98f82b1acb1c1bb261ee44e53c0c4bcaaaed06c Mon Sep 17 00:00:00 2001 From: Mandeep Singh Grang Date: Mon, 21 Sep 2020 12:56:15 -0700 Subject: [PATCH] On Windows, build an x86 compiler using x64 tools --- Windows/build.bat | 4 ++-- Windows/config-vars.bat | 9 +++++++-- Windows/test-lit.bat | 4 ++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Windows/build.bat b/Windows/build.bat index 25e1e71..b3e430a 100755 --- a/Windows/build.bat +++ b/Windows/build.bat @@ -25,8 +25,8 @@ cd %LLVM_OBJ_DIR% @echo.Running the configure step @echo.====================================================================== -@echo "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" %TEST_TARGET_ARCH% -@call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" %TEST_TARGET_ARCH% +@echo "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\%CONFIGURE_SCRIPT%" +@call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\%CONFIGURE_SCRIPT%" if "%BUILD_PACKAGE%"=="Yes" ( if "%BUILDCONFIGURATION%"=="Release" ( diff --git a/Windows/config-vars.bat b/Windows/config-vars.bat index 38212bf..a972840 100755 --- a/Windows/config-vars.bat +++ b/Windows/config-vars.bat @@ -57,12 +57,16 @@ if NOT DEFINED BUILDOS ( exit /b 1; ) -rem Validate or set target architecture for testing. +rem Validate or set target architecture and configure script for testing. + +rem By default, build an x64 compiler using x64 tools. +set CONFIGURE_SCRIPT=vcvars64.bat if NOT DEFINED TEST_TARGET_ARCH ( set TEST_TARGET_ARCH=x64 ) else if "%TEST_TARGET_ARCH%"=="x86" ( - rem + rem Build an x86 compiler using x64 tools. + set CONFIGURE_SCRIPT=vcvarsamd64_x86.bat ) else if "%TEST_TARGET_ARCH%"=="x64" ( rem ) else ( @@ -183,6 +187,7 @@ if NOT DEFINED CL_CPU_COUNT ( @echo. BUILDCONFIGURATION: %BUILDCONFIGURATION% @echo. BUILDOS: %BUILDOS% @echo. TEST_TARGET_ARCH: %TEST_TARGET_ARCH% +@echo. CONFIGURE_SCRIPT: %CONFIGURE_SCRIPT% @echo. TEST_SUITE: %TEST_SUITE% @echo. BUILD_CHECKEDC_CLEAN: %BUILD_CHECKEDC_CLEAN% @echo. BUILD_PACKAGE: %BUILD_PACKAGE% diff --git a/Windows/test-lit.bat b/Windows/test-lit.bat index b87ec9e..58e14d7 100755 --- a/Windows/test-lit.bat +++ b/Windows/test-lit.bat @@ -14,8 +14,8 @@ set PATH="C:\GnuWin32\bin";%PATH% set OLD_DIR=%CD% cd %LLVM_OBJ_DIR% -@echo "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" %TEST_TARGET_ARCH% -@call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" %TEST_TARGET_ARCH% +@echo "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\%CONFIGURE_SCRIPT%" +@call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\%CONFIGURE_SCRIPT%" @echo.====================================================================== @echo.Running the Checked C regression tests