diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2019-07-02 00:03:57 +1000 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2019-07-02 03:06:13 +0200 |
commit | 81ab6abe574a75f1ed229a88ceee9eb3b143a18a (patch) | |
tree | 6582d8626a16bf99a915b56bd601474cc25aa7ad /configure.ac | |
parent | 19724cb7f886cbcc60cd8a1f5e6eda6fdca41155 (diff) |
Use tools for proper architecture for both x64 and x86 builds
This allows to use 64-bit tools on x64 hosts for all modules,
both 32- and 64-bit, and so avoid memory problems, like in
https://ci.libreoffice.org/job/gerrit_windows/39174/console
LINK : the 32-bit linker (C:\PROGRA~2\MIB055~1\2017\COMMUN~1\VC\Tools\MSVC\1414~1.264\bin\HostX86\x86\link.exe) failed to do memory mapped file I/O on `out\zlib.lib' and is going to restart linking with a 64-bit linker for better throughput
LINK : restarting link with 64-bit linker `C:/cygwin/bin\link.exe'
where it then picks wrong linker, failing the build.
Also, it theoretically allows using 32-bit tools when building on
32-bit host, and build both 32- and 64-bit modules (no idea if it
is actually possible though).
Removed checks for tools locations from older VS versions.
Change-Id: I4798a1c66df580027243ca8c7b4d375148214984
Co-authored-by: Jan-Marek Glogowski <glogow@fbihome.de>
Reviewed-on: https://gerrit.libreoffice.org/74924
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 82 |
1 files changed, 32 insertions, 50 deletions
diff --git a/configure.ac b/configure.ac index 3aefd18cd107..b73d0b73f644 100644 --- a/configure.ac +++ b/configure.ac @@ -3372,20 +3372,16 @@ if test "$_os" = "WINNT"; then fi if test "$BITNESS_OVERRIDE" = ""; then - if test -f "$vctest/bin/cl.exe"; then - VC_PRODUCT_DIR=$vctest - elif test -f "$vctest/VC/Tools/MSVC/$vcbuildnumber/bin/HostX86/x86/cl.exe"; then + if test -f "$vctest/VC/Tools/MSVC/$vcbuildnumber/bin/HostX86/x86/cl.exe"; then VC_PRODUCT_DIR=$vctest/VC else - AC_MSG_ERROR([No compiler (cl.exe) in $vctest/bin/cl.exe]) + AC_MSG_ERROR([No compiler (cl.exe) in $vctest/VC/Tools/MSVC/$vcbuildnumber/bin/HostX86/x86]) fi else - if test -f "$vctest/bin/amd64/cl.exe"; then - VC_PRODUCT_DIR=$vctest - elif test -f "$vctest/VC/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64/cl.exe"; then + if test -f "$vctest/VC/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64/cl.exe"; then VC_PRODUCT_DIR=$vctest/VC else - AC_MSG_ERROR([No compiler (cl.exe) in $vctest/VC/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64/cl.exe or $vctest/bin/amd64/cl.exe or $vctest/bin/x86_amd64/cl.exe]) + AC_MSG_ERROR([No compiler (cl.exe) in $vctest/VC/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64]) fi fi @@ -3448,16 +3444,22 @@ if test "$_os" = "WINNT"; then dnl Check for the corresponding mspdb*.dll dnl =========================================================== + VC_HOST_DIR= MSPDB_PATH= - CL_DIR= - CL_LIB= + CL_PATH= + + if "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64/cl.exe" -? </dev/null >/dev/null 2>&1; then + VC_HOST_DIR="HostX64" + MSPDB_PATH="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/$VC_HOST_DIR/x64" + else + VC_HOST_DIR="HostX86" + MSPDB_PATH="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/$VC_HOST_DIR/x86" + fi if test "$BITNESS_OVERRIDE" = ""; then - MSPDB_PATH="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/HostX86/x86" - CL_DIR=Tools/MSVC/$vcbuildnumber/bin/HostX86/x86 + CL_PATH="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/$VC_HOST_DIR/x86" else - MSPDB_PATH="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64" - CL_DIR=Tools/MSVC/$vcbuildnumber/bin/HostX64/x64 + CL_PATH="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/$VC_HOST_DIR/x64" fi # MSVC 15.0 has libraries from 14.0? @@ -3467,11 +3469,9 @@ if test "$_os" = "WINNT"; then AC_MSG_ERROR([No mspdb${mspdbnum}.dll in $MSPDB_PATH, Visual Studio installation broken?]) fi - MSPDB_PATH=`cygpath -d "$MSPDB_PATH"` - MSPDB_PATH=`cygpath -u "$MSPDB_PATH"` - dnl The path needs to be added before cl is called - PATH="$MSPDB_PATH:$PATH" + TEMP_PATH=`cygpath -d "$MSPDB_PATH"` + PATH="`cygpath -u "$TEMP_PATH"`:$PATH" AC_MSG_CHECKING([cl.exe]) @@ -3483,8 +3483,8 @@ if test "$_os" = "WINNT"; then dnl Save the true MSVC cl.exe for use when CC/CXX is actually clang-cl, dnl needed when building CLR code: if test -z "$MSVC_CXX"; then - if test -f "$VC_PRODUCT_DIR/$CL_DIR/cl.exe"; then - MSVC_CXX="$VC_PRODUCT_DIR/$CL_DIR/cl.exe" + if test -f "$CL_PATH/cl.exe"; then + MSVC_CXX="$CL_PATH/cl.exe" fi # This gives us a posix path with 8.3 filename restrictions @@ -3574,22 +3574,11 @@ if test "$_os" = "WINNT"; then if test "$BITNESS_OVERRIDE" = ""; then AC_MSG_CHECKING([for a x64 compiler and libraries for 64-bit Explorer extensions]) - if test -f "$VC_PRODUCT_DIR/atlmfc/lib/amd64/atls.lib"; then - # Prefer native x64 compiler to cross-compiler, in case we are running - # the build on a 64-bit OS. - if "$VC_PRODUCT_DIR/bin/amd64/cl.exe" -? </dev/null >/dev/null 2>&1; then - BUILD_X64=TRUE - CXX_X64_BINARY="$VC_PRODUCT_DIR/bin/amd64/cl.exe" - elif "$VC_PRODUCT_DIR/bin/x86_amd64/cl.exe" -? </dev/null >/dev/null 2>&1; then - BUILD_X64=TRUE - CXX_X64_BINARY="$VC_PRODUCT_DIR/bin/x86_amd64/cl.exe" - fi - elif test -f "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/atlmfc/lib/x64/atls.lib" || \ + if test -f "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/atlmfc/lib/x64/atls.lib" || \ test -f "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/atlmfc/lib/spectre/x64/atls.lib"; then - # nobody uses 32-bit OS to build, just pick the 64-bit compiler - if "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64/cl.exe" -? </dev/null >/dev/null 2>&1; then + if "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/$VC_HOST_DIR/x64/cl.exe" -? </dev/null >/dev/null 2>&1; then BUILD_X64=TRUE - CXX_X64_BINARY="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64/cl.exe" + CXX_X64_BINARY=`win_short_path_for_make "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/$VC_HOST_DIR/x64/cl.exe"` fi fi if test "$BUILD_X64" = TRUE; then @@ -3616,9 +3605,10 @@ if test "$_os" = "WINNT"; then if test -n "$CXX_X86_BINARY"; then BUILD_X86=TRUE AC_MSG_RESULT([preset]) - elif "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/HostX86/x86/cl.exe" -? </dev/null >/dev/null 2>&1; then + elif "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/$VC_HOST_DIR/x86/cl.exe" -? </dev/null >/dev/null 2>&1; then BUILD_X86=TRUE - CXX_X86_BINARY="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/HostX86/x86/cl.exe -arch:SSE" + CXX_X86_BINARY=`win_short_path_for_make "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/VC_HOST_DIR/x86/cl.exe"` + CXX_X86_BINARY+=" /arch:SSE" AC_MSG_RESULT([found]) else CXX_X86_BINARY= @@ -3634,8 +3624,6 @@ if test "$_os" = "WINNT"; then fi AC_SUBST(VCVER) AC_SUBST(DEVENV) -PathFormat "$MSPDB_PATH" -MSPDB_PATH="$formatted_path" AC_SUBST(MSVC_CXX) # @@ -10159,25 +10147,17 @@ ML_EXE="" if test "$_os" = "WINNT"; then if test "$BITNESS_OVERRIDE" = ""; then assembler=ml.exe - assembler_bin=$CL_DIR else assembler=ml64.exe - assembler_bin=$CL_DIR fi - AC_MSG_CHECKING([$VC_PRODUCT_DIR/$assembler_bin/$assembler]) - if test -f "$VC_PRODUCT_DIR/$assembler_bin/$assembler"; then - ASM_HOME=$VC_PRODUCT_DIR/$assembler_bin + AC_MSG_CHECKING([$CL_PATH/$assembler]) + if test -f "$CL_PATH/$assembler"; then AC_MSG_RESULT([found]) - ML_EXE="$VC_PRODUCT_DIR/$assembler_bin/$assembler" + ML_EXE="$CL_PATH/$assembler" else AC_MSG_ERROR([Configure did not find $assembler assembler.]) fi - - PathFormat "$ASM_HOME" - ASM_HOME="$formatted_path" -else - ASM_HOME="" fi AC_SUBST(ML_EXE) @@ -12632,12 +12612,14 @@ else if test -f "$DOTNET_FRAMEWORK_HOME/bin"; then pathmunge "$DOTNET_FRAMEWORK_HOME/bin" "before" fi - pathmunge "$ASM_HOME" "before" pathmunge "$WINDOWS_SDK_HOME/bin" "before" pathmunge "$CSC_PATH" "before" pathmunge "$MIDL_PATH" "before" pathmunge "$AL_PATH" "before" pathmunge "$MSPDB_PATH" "before" + if test "$MSPDB_PATH" != "$CL_PATH" ; then + pathmunge "$CL_PATH" "before" + fi if test -n "$MSBUILD_PATH" ; then pathmunge "$MSBUILD_PATH" "before" fi |