6950375: Remove msvcrt.dll from the Windows JRE bundles

Reviewed-by: prr
This commit is contained in:
Kelly O'Hair 2011-01-14 14:04:54 -08:00
parent 426009abd5
commit d7cd379d57
8 changed files with 24 additions and 115 deletions

View File

@ -100,7 +100,6 @@ CACERTS_FILE.desc = Location of certificates file
DEVTOOLS_PATH.desc = Directory containing zip and unzip
CUPS_HEADERS_PATH.desc = Include directory location for CUPS header files
DXSDK_PATH.desc = Root directory of DirectX SDK
MSVCRT_DLL_PATH.desc = Directory containing mscvrt.dll
# Make variables to print out (description and value)
VARIABLE_PRINTVAL_LIST += \
@ -133,12 +132,10 @@ VARIABLE_CHECKFIL_LIST += \
ifeq ($(PLATFORM), windows)
VARIABLE_PRINTVAL_LIST += \
DXSDK_PATH \
MSVCRT_DLL_PATH
DXSDK_PATH
VARIABLE_CHECKDIR_LIST += \
DXSDK_PATH \
MSVCRT_DLL_PATH
DXSDK_PATH
endif

View File

@ -68,28 +68,27 @@ PLATFORM_INCLUDE = $(INCLUDEDIR)/$(PLATFORM_INCLUDE_NAME)
# The following DLL's are considered MS runtime libraries and should
# not to be REBASEd, see deploy/make/common/Release.gmk.
# msvcrt.dll, msvcrnn.dll [msvcr71 or msvcr80 or msvcr90] : Microsoft runtimes
MS_RUNTIME_LIBRARIES = msvcrt.dll
# msvcr*.dll: Microsoft runtimes
ifeq ($(ARCH_DATA_MODEL), 32)
ifeq ($(COMPILER_VERSION), VS2003)
MSVCRNN_DLL = msvcr71.dll
MSVCPNN_DLL = msvcp71.dll
MS_RUNTIME_LIBRARIES += $(MSVCRNN_DLL)
MS_RUNTIME_LIBRARIES = msvcrt.dll $(MSVCRNN_DLL)
endif
ifeq ($(COMPILER_VERSION), VS2005)
MSVCRNN_DLL = msvcr80.dll
MSVCPNN_DLL = msvcp80.dll
MS_RUNTIME_LIBRARIES += $(MSVCRNN_DLL)
MS_RUNTIME_LIBRARIES = msvcrt.dll $(MSVCRNN_DLL)
endif
ifeq ($(COMPILER_VERSION), VS2008)
MSVCRNN_DLL = msvcr90.dll
MSVCPNN_DLL = msvcp90.dll
MS_RUNTIME_LIBRARIES += $(MSVCRNN_DLL)
MS_RUNTIME_LIBRARIES = msvcrt.dll $(MSVCRNN_DLL)
endif
ifeq ($(COMPILER_VERSION), VS2010)
MSVCRNN_DLL = msvcr100.dll
MSVCPNN_DLL = msvcp100.dll
MS_RUNTIME_LIBRARIES += $(MSVCRNN_DLL)
MS_RUNTIME_LIBRARIES = $(MSVCRNN_DLL)
endif
endif
@ -97,12 +96,12 @@ ifeq ($(ARCH_DATA_MODEL), 64)
ifeq ($(COMPILER_VERSION), VS2008)
MSVCRNN_DLL = msvcr90.dll
MSVCPNN_DLL = msvcp90.dll
MS_RUNTIME_LIBRARIES += $(MSVCRNN_DLL)
MS_RUNTIME_LIBRARIES = msvcrt.dll $(MSVCRNN_DLL)
endif
ifeq ($(COMPILER_VERSION), VS2010)
MSVCRNN_DLL = msvcr100.dll
MSVCPNN_DLL = msvcp100.dll
MS_RUNTIME_LIBRARIES += $(MSVCRNN_DLL)
MS_RUNTIME_LIBRARIES = $(MSVCRNN_DLL)
endif
endif
@ -284,7 +283,7 @@ ifeq ($(MFC_DEBUG), true)
MS_RUNTIME_OPTION=-MTd
else
# This MS debugging flag forces a dependence on the debug
# version of the runtime library (MSVCRTD.DLL), as does -MDd.
# version of the runtime library (MSVCR*D.DLL), as does -MDd.
# We cannot re-distribute this debug runtime.
MS_RUNTIME_OPTION=-MDd
endif

View File

@ -551,18 +551,6 @@ ifndef ALT_BOOTDIR
_BOOTDIR3 =$(SLASH_JAVA)/re/jdk/$(PREVIOUS_JDK_VERSION)/archive/fcs/binaries/$(PLATFORM)-$(ARCH)
endif
# 32 bit always needs 2 runtimes, 64 bit usually does too
# MSVCRT_DLL_PATH: location of msvcrt.dll that will be re-distributed
ifdef ALT_MSVCRT_DLL_PATH
xALT_MSVCRT_DLL_PATH :="$(subst \,/,$(ALT_MSVCRT_DLL_PATH))"
MSVCRT_DLL_PATH :=$(call FullPath,$(xALT_MSVCRT_DLL_PATH))
else
MSVCRT_DLL_PATH :=$(call FullPath,$(_system_root)/system32/)
endif
MSVCRT_DLL_PATH:=$(call AltCheckSpaces,MSVCRT_DLL_PATH)
MSVCRT_DLL_PATH:=$(call AltCheckValue,MSVCRT_DLL_PATH)
# 32bit always needs the MSVCRNN runtime, 64bit does when using VS2008
ifeq ($(ARCH_DATA_MODEL), 32)
_NEEDS_MSVCRNN = true

View File

@ -96,7 +96,6 @@ ifeq ($(PLATFORM),solaris)
endif
endif
ifeq ($(PLATFORM),windows)
ALL_SETTINGS+=$(call addAltSetting,MSVCRT_DLL_PATH)
ifneq ($(MSVCRNN_DLL),)
ALL_SETTINGS+=$(call addAltSetting,MSVCRNN_DLL_PATH)
endif

View File

@ -879,13 +879,6 @@ sane-devtools_path:
######################################################
sane-msvcrt_path:
ifeq ($(PLATFORM), windows)
@if [ ! -r "$(MSVCRT_DLL_PATH)/msvcrt.dll" ]; then \
$(ECHO) "ERROR: You do not have access to msvcrt.dll. \n" \
" Please check your access to \n" \
" $(MSVCRT_DLL_PATH) \n" \
" and/or check your value of ALT_MSVCRT_DLL_PATH. \n" \
"" >> $(ERROR_FILE) ; \
fi
ifneq ($(MSVCRNN_DLL),)
@if [ ! -r "$(MSVCRNN_DLL_PATH)/$(MSVCRNN_DLL)" ]; then \
$(ECHO) "ERROR: You do not have access to $(MSVCRNN_DLL). \n" \

View File

@ -93,10 +93,6 @@ ifeq ($(PLATFORM), windows)
IMPORT_LIST += $(MS_RUNTIME_LIBRARIES:%=$(BINDIR)/%)
# NOTE: These might actually come from BUILDDIR, depends on the settings.
$(BINDIR)/msvcrt.dll: $(MSVCRT_DLL_PATH)/msvcrt.dll
$(install-import-file)
$(call chmod-file, a+x)
$(BINDIR)/$(MSVCRNN_DLL): $(MSVCRNN_DLL_PATH)/$(MSVCRNN_DLL)
$(install-import-file)
$(call chmod-file, a+x)

View File

@ -50,7 +50,7 @@
#
# Assumes basic unix utilities are in the PATH already (uname, hostname, etc.).
#
# On Windows, assumes PROCESSOR_IDENTIFIER, VS71COMNTOOLS,
# On Windows, assumes PROCESSOR_IDENTIFIER, VS100COMNTOOLS,
# SYSTEMROOT (or SystemRoot), COMPUTERNAME (or hostname works), and
# USERNAME is defined in the environment.
# This profile does not rely on using vcvars32.bat and 64bit Setup.bat.
@ -81,8 +81,7 @@
# Windows Only:
# ALT_UNIXCOMMAND_PATH
# ALT_DXSDK_PATH
# ALT_MSVCRT_DLL_PATH
# ALT_MSVCR71_DLL_PATH
# ALT_MSVCRNN_DLL_PATH
#
#############################################################################
#
@ -213,78 +212,17 @@ else
# Compiler setup (nasty part)
# NOTE: You can use vcvars32.bat to set PATH, LIB, and INCLUDE.
# NOTE: CYGWIN has a link.exe too, make sure the compilers are first
if [ "${windows_arch}" = i586 ] ; then
# 32bit Windows compiler settings
# VisualStudio .NET 2003 VC++ 7.1 (VS71COMNTOOLS should be defined)
vs_root=$(${cygpath} "${VS71COMNTOOLS}/../..")
# Fill in PATH, LIB, and INCLUDE (unset all others to make sure)
vc7_root="${vs_root}/Vc7"
compiler_path="${vc7_root}/bin"
platform_sdk="${vc7_root}/PlatformSDK"
# LIB and INCLUDE must use ; as a separator
include4sdk="${vc7_root}/atlmfc/include"
include4sdk="${include4sdk};${vc7_root}/include"
include4sdk="${include4sdk};${platform_sdk}/include/prerelease"
include4sdk="${include4sdk};${platform_sdk}/include"
include4sdk="${include4sdk};${vs_root}/SDK/v1.1/include"
lib4sdk="${lib4sdk};${vc7_root}/lib"
lib4sdk="${lib4sdk};${platform_sdk}/lib/prerelease"
lib4sdk="${lib4sdk};${platform_sdk}/lib"
lib4sdk="${lib4sdk};${vs_root}/SDK/v1.1/lib"
# Search path and DLL locating path
# WARNING: CYGWIN has a link.exe too, make sure compilers are first
path4sdk="${vs_root}/Common7/Tools/bin;${path4sdk}"
path4sdk="${vs_root}/SDK/v1.1/bin;${path4sdk}"
path4sdk="${vs_root}/Common7/Tools;${path4sdk}"
path4sdk="${vs_root}/Common7/Tools/bin/prerelease;${path4sdk}"
path4sdk="${vs_root}/Common7/IDE;${path4sdk}"
path4sdk="${compiler_path};${path4sdk}"
elif [ "${windows_arch}" = amd64 ] ; then
# AMD64 64bit Windows compiler settings
if [ "${ALT_DEPLOY_MSSDK}" != "" ] ; then
platform_sdk=${ALT_DEPLOY_MSSDK}
else
platform_sdk=$(${cygpath} "C:/Program Files/Microsoft Platform SDK/")
fi
if [ "${ALT_COMPILER_PATH}" != "" ] ; then
compiler_path=${ALT_COMPILER_PATH}
if [ "${ALT_DEPLOY_MSSDK}" = "" ] ; then
platform_sdk=${ALT_COMPILER_PATH}/../../../..
fi
else
compiler_path="${platform_sdk}/Bin/win64/x86/AMD64"
fi
# LIB and INCLUDE must use ; as a separator
include4sdk="${platform_sdk}/Include"
include4sdk="${include4sdk};${platform_sdk}/Include/crt/sys"
include4sdk="${include4sdk};${platform_sdk}/Include/mfc"
include4sdk="${include4sdk};${platform_sdk}/Include/atl"
include4sdk="${include4sdk};${platform_sdk}/Include/crt"
lib4sdk="${platform_sdk}/Lib/AMD64"
lib4sdk="${lib4sdk};${platform_sdk}/Lib/AMD64/atlmfc"
# Search path and DLL locating path
# WARNING: CYGWIN has a link.exe too, make sure compilers are first
path4sdk="${platform_sdk}/bin;${path4sdk}"
path4sdk="${compiler_path};${path4sdk}"
fi
# Export LIB and INCLUDE
unset lib
unset Lib
LIB="${lib4sdk}"
export LIB
unset include
unset Include
INCLUDE="${include4sdk}"
export INCLUDE
# Turn all \\ into /, remove duplicates and trailing /
slash_path="$(echo ${path4sdk} | sed -e 's@\\\\@/@g' -e 's@//@/@g' -e 's@/$@@' -e 's@/;@;@g')"
path4sdk="${slash_path}"
# Convert path4sdk to cygwin style
path4sdk="$(/usr/bin/cygpath -p ${path4sdk})"
# Use supplied vsvars.sh
repo=`hg root`
if [ -f "${repo}/make/scripts/vsvars.sh" ] ; then
eval `sh ${repo}/make/scripts/vsvars.sh -v10`
elif [ -f "${repo}/../make/scripts/vsvars.sh" ] ; then
eval `sh ${repo}/../make/scripts/vsvars.sh -v10`
else
echo "WARNING: No make/scripts/vsvars.sh file found"
fi
fi
# Get the previous JDK to be used to bootstrap the build

View File

@ -389,10 +389,9 @@ Library: Use <code>/opt:REF </code> when building the dll.
<li>
MS DLL Runtime: Use the <code>/MD /D _STATIC_CPPLIB</code> option.
<br>
This causes your dll to become dependent on MSVCRT.DLL and/or
the newer C++ runtime MSVCR71.DLL.
This causes your dll to become dependent on just MSVCR*.DLL.
The option /D _STATIC_CPPLIB prevents you from becoming dependent on the
C++ library MSVCP71.DLL.
C++ library MSVCP*.DLL.
This is what we use in the JDK, but there are probably many combinations
that you could safely use, unfortunately there are many combinations
of runtimes that will not work.