United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-6666494 : Add compiler option to reduce binaries linked with UpdateConf.cpp

Details
Type:
Enhancement
Submit Date:
2008-02-22
Status:
Closed
Updated Date:
2010-09-17
Project Name:
JDK
Resolved Date:
2008-06-16
Component:
install
OS:
windows_xp
Sub-Component:
install
CPU:
x86
Priority:
P3
Resolution:
Fixed
Affected Versions:
6u10
Fixed Versions:
6u10 (b21)

Related Reports
Backport:

Sub Tasks

Description
deploy/src/plugin/win32/regutils/UpdateConf.cpp is included and recompiled for several install binaries.  Each binary does not necessarily use all of the functions, but without the /Gy compiler option to enable function level linking along with the /OPT:REF linker option, the linker cannot eliminate functions that are never referenced.  http://msdn2.microsoft.com/en-us/library/bxwfs976(VS.80).aspx

Adding -Gy to CXXFLAGS in deploy/make/plugin/regutilsmsi/Makefile reduced the size of the DLL by 8 KB.

The following use UpdateConf.cpp:
plugin/jupdate/checker - jucheck.exe
plugin/jupdate/scheduler - jusched.exe
plugin/regutils - regutils.dll
plugin/regutilsmsi - regutilsmsi.dll
installer/bundles/windows/ishield/wrapper/wrapper.jdk/
installer/bundles/windows/ishield/wrapper/wrapper.jre/Makefile
installer/bundles/windows/ishield/wrapper/wrapper.jre/Makefile.sponsor
installer/bundles/windows/ishield/wrapper_online/jre/
installer/bundles/windows/ishield/wrapper_online/sdk/

                                    

Comments
SUGGESTED FIX

added -Gy compiler option for jucheck.exe, jusched.exe, regutils.dll, and RegUtilsMSI.dll

webrev: http://sa.sfbay.sun.com/projects/deployment_data/6u10/6666494.0
                                     
2008-02-23
EVALUATION

-Gy compiler option plus existing -OPT:REF linker option removes 4 to 12 KB of unused functions from each of these binaries:
deploy/make/plugin/jupdate/checker/Makefile
     jucheck.exe         328 - 320 = 8 KB

deploy/make/plugin/jupdate/scheduler/Makefile
     jusched.exe         140 - 128 = 12 KB

deploy/make/plugin/regutils/Makefile
     regutils.dll        248 - 244 = 4 KB

deploy/make/plugin/regutilsmsi/Makefile
     RegUtilsMSI.dll     300 - 292 = 8 KB

I didn not see any savings with binaris build in the install workspace:
  wrapper-jdk\obj\wrapper.exe
  wrapper-jre\obj\wrapper.exe,
  wrapper-jre-sponsor\obj\wrapper.exe
  jinstall-jre\obj\jinstall.exe
  jinstall-sdk\obj\jinstall_sdk.exe
  jinstall-jkernel\obj\jinstall_jkernel.exe
For these files, -Gy and -OPT:REF did not decrease the size of the executables.
                                     
2008-02-22



Hardware and Software, Engineered to Work Together