diff options
author | Tomofumi Yagi <yagit@mknada.sakura.ne.jp> | 2016-04-11 13:33:21 +0900 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2016-05-05 13:00:22 +0000 |
commit | 3085aba021b411370ab6bc2400e0652cf279d6d3 (patch) | |
tree | 2fe79a1b124bef58e027da1510967d9af6d7436a | |
parent | clang-tidy modernize-loop-convert in oox to sax (diff) | |
download | core-3085aba021b411370ab6bc2400e0652cf279d6d3.tar.gz core-3085aba021b411370ab6bc2400e0652cf279d6d3.zip |
Fix linking of 64 bit artifacts in 32 bit Windows build with VS2015
In some 64bit Windows environments we get the link error while building
libraries for 64-bit Explorer extensions.
This patch will fix this error.
This error occours only when we build 32bit LibreOffice on 64bit Windows
with Visual Studio 2015.
In some environments UCRT SDK directory does not match Windows SDK
directory.
In that case UCRT library's directory path is incorrect at the linking
phase.
Change-Id: I245b1a70f5e1137a8840aa2e7a70f521eab18cb3
Reviewed-on: https://gerrit.libreoffice.org/23982
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
-rw-r--r-- | config_host.mk.in | 2 | ||||
-rw-r--r-- | configure.ac | 30 | ||||
-rw-r--r-- | solenv/gbuild/platform/com_MSC_class.mk | 2 |
3 files changed, 21 insertions, 13 deletions
diff --git a/config_host.mk.in b/config_host.mk.in index 0a2ec0b7a46a..60b87bd24722 100644 --- a/config_host.mk.in +++ b/config_host.mk.in @@ -594,6 +594,8 @@ export TLS=@TLS@ export TMPDIR=@TEMP_DIRECTORY@ export TOUCH=@TOUCH@ export TYPO_EXTENSION_PACK=@TYPO_EXTENSION_PACK@ +export UCRTSDKDIR=@UCRTSDKDIR@ +export UCRTVERSION=@UCRTVERSION@ export UNOWINREG_DLL=@UNOWINREG_DLL@ export USE_LIBRARY_BIN_TAR=@USE_LIBRARY_BIN_TAR@ export USE_XINERAMA=@USE_XINERAMA@ diff --git a/configure.ac b/configure.ac index 36bb3a0e540a..3f1b7f0e9334 100644 --- a/configure.ac +++ b/configure.ac @@ -3322,15 +3322,16 @@ find_ucrt() { reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v10.0/InstallationFolder" if test -n "$regvalue"; then - ucrttest=$regvalue + PathFormat "$regvalue" + UCRTSDKDIR=$formatted_path reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v10.0/ProductVersion" - ucrtdir=$regvalue + UCRTVERSION=$regvalue fi - if test -z "$ucrttest"; then + if test -z "$UCRTSDKDIR"; then if test -f "$VC_PRODUCT_DIR/../Common7/Tools/vsvars32.bat"; then PathFormat "`win_get_env_from_vsvars32bat "UniversalCRTSdkDir"`" - ucrttest=$formatted_path - ucrtdir=`win_get_env_from_vsvars32bat "UCRTVersion"` + UCRTSDKDIR=$formatted_path + UCRTVERSION=`win_get_env_from_vsvars32bat "UCRTVersion"` fi fi } @@ -3421,6 +3422,9 @@ if test "$_os" = "WINNT"; then AC_MSG_RESULT([No]) fi + UCRTSDKDIR= + UCRTVERSION= + AC_MSG_CHECKING([whether UCRT is needed for this compiler version]) if test "$vcnum" = "120"; then AC_MSG_RESULT([No]) @@ -3428,10 +3432,10 @@ if test "$_os" = "WINNT"; then AC_MSG_RESULT([Yes]) AC_MSG_CHECKING([for UCRT location]) find_ucrt - if test -n "$ucrttest"; then + if test -n "$UCRTSDKDIR"; then AC_MSG_RESULT([found]) - PathFormat "$ucrttest" - ucrtincpath_formatted="${formatted_path}Include/$ucrtdir/ucrt" + PathFormat "${UCRTSDKDIR}Include/$UCRTVERSION/ucrt" + ucrtincpath_formatted=$formatted_path # SOLARINC is used for external modules and must be set too. # And no, it's not sufficient to set SOLARINC only, as configure # itself doesn't honour it. @@ -3443,6 +3447,8 @@ if test "$_os" = "WINNT"; then AC_MSG_ERROR([not found]) fi fi + AC_SUBST(UCRTSDKDIR) + AC_SUBST(UCRTVERSION) # Find the proper version of MSBuild.exe to use based on the VS version reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/MSBuild/$vcnumwithdot/MSBuildOverrideTasksPath @@ -12532,8 +12538,8 @@ if test "$build_os" = "cygwin"; then ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/x64" fi if test $VCVER = 140; then - PathFormat "$ucrttest" - ucrtlibpath_formatted="${formatted_path}lib/$ucrtdir/ucrt/x64" + PathFormat "${UCRTSDKDIR}lib/$UCRTVERSION/ucrt/x64" + ucrtlibpath_formatted=$formatted_path ILIB="$ILIB;$ucrtlibpath_formatted" fi else @@ -12546,8 +12552,8 @@ if test "$build_os" = "cygwin"; then ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/x86" fi if test $VCVER = 140; then - PathFormat "$ucrttest" - ucrtlibpath_formatted="${formatted_path}lib/$ucrtdir/ucrt/x86" + PathFormat "${UCRTSDKDIR}lib/$UCRTVERSION/ucrt/x86" + ucrtlibpath_formatted=$formatted_path ILIB="$ILIB;$ucrtlibpath_formatted" fi fi diff --git a/solenv/gbuild/platform/com_MSC_class.mk b/solenv/gbuild/platform/com_MSC_class.mk index e7b5f5cbb049..c757f9a51f5f 100644 --- a/solenv/gbuild/platform/com_MSC_class.mk +++ b/solenv/gbuild/platform/com_MSC_class.mk @@ -172,7 +172,7 @@ $(call gb_Helper_abbreviate_dirs,\ -LIBPATH:$(COMPATH)/lib/amd64 \ -LIBPATH:$(WINDOWS_SDK_HOME)/lib/x64 \ $(if $(filter 80 81 10,$(WINDOWS_SDK_VERSION)),-LIBPATH:$(WINDOWS_SDK_HOME)/lib/$(WINDOWS_SDK_LIB_SUBDIR)/um/x64) \ - $(if $(filter-out 120,$(VCVER)),-LIBPATH:$(WINDOWS_SDK_HOME)/lib/$(WINDOWS_SDK_LIB_SUBDIR)/ucrt/x64)) \ + $(if $(filter-out 120,$(VCVER)),-LIBPATH:$(UCRTSDKDIR)lib/$(UCRTVERSION)/ucrt/x64)) \ $(T_LDFLAGS) \ @$${RESPONSEFILE} \ $(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_ilibfilename,$(lib))) \ |