-
Bug
-
Resolution: Fixed
-
P3
-
None
There are several problems with the current code for detecting locating a proper msvcr100.dll on Windows, which is done in TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV in toolchain_windows.m4. This bug regards how to check the correctness of the file we find.
As reported inJDK-8001912, with a full VS2010 installation, we have both 32- and 64-bit versions of the file available at
/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0//VC/redist/x64/Microsoft.VC100.CRT/
and
/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0//VC/redist/x86/Microsoft.VC100.CRT/
However, it is very easy to point out a version of msvcr100.dll that does not match the target architecture. Therefore we should check that the one we finally chose (either due to an user option, or our own search), is correct. I propose using "file". This is the result of using "file" on the two files above:
./VC/redist/x64/Microsoft.VC100.CRT/msvcr100.dll: PE32+ executable (DLL) (GUI) x86-64, for MS Windows
./VC/redist/x86/Microsoft.VC100.CRT/msvcr100.dll: PE32 executable (DLL) (GUI) Intel 80386, for MS Windows
So something like "file $MSVCDLL | grep x86-64" should be true for x86_64, and "file $MSVCDLL | grep 386" should be true for x86.
This is not just a theoretical issue, we had a quite long conversation in build-infra-dev with a user with build problems (Mahesh Pujari) which turned out to be an uncorrect msvcr100.dll.
As reported in
/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0//VC/redist/x64/Microsoft.VC100.CRT/
and
/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0//VC/redist/x86/Microsoft.VC100.CRT/
However, it is very easy to point out a version of msvcr100.dll that does not match the target architecture. Therefore we should check that the one we finally chose (either due to an user option, or our own search), is correct. I propose using "file". This is the result of using "file" on the two files above:
./VC/redist/x64/Microsoft.VC100.CRT/msvcr100.dll: PE32+ executable (DLL) (GUI) x86-64, for MS Windows
./VC/redist/x86/Microsoft.VC100.CRT/msvcr100.dll: PE32 executable (DLL) (GUI) Intel 80386, for MS Windows
So something like "file $MSVCDLL | grep x86-64" should be true for x86_64, and "file $MSVCDLL | grep 386" should be true for x86.
This is not just a theoretical issue, we had a quite long conversation in build-infra-dev with a user with build problems (Mahesh Pujari) which turned out to be an uncorrect msvcr100.dll.