8043491: warning LNK4197: export '... ...' specified multiple times; using first specification
authorccheung
Wed, 12 Nov 2014 16:22:12 -0800
changeset 27652 b07e72c58aef
parent 27650 199cbba2f8f9
child 27653 4c2e88d870ed
8043491: warning LNK4197: export '... ...' specified multiple times; using first specification Summary: no need to use the /export linker option on windows 64-bit platform Reviewed-by: ctornqvi, minqi
hotspot/make/windows/makefiles/vm.make
hotspot/src/share/tools/ProjectCreator/BuildConfig.java
hotspot/src/share/tools/ProjectCreator/WinGammaPlatformVC10.java
--- a/hotspot/make/windows/makefiles/vm.make	Wed Nov 12 18:31:05 2014 +0000
+++ b/hotspot/make/windows/makefiles/vm.make	Wed Nov 12 16:22:12 2014 -0800
@@ -89,19 +89,24 @@
 
 # If you modify exports below please do the corresponding changes in
 # src/share/tools/ProjectCreator/WinGammaPlatformVC7.java
-LD_FLAGS=$(LD_FLAGS) $(STACK_SIZE) /subsystem:windows /dll /base:0x8000000 \
-  /export:JNI_GetDefaultJavaVMInitArgs       \
-  /export:JNI_CreateJavaVM                   \
-  /export:JVM_FindClassFromBootLoader        \
-  /export:JNI_GetCreatedJavaVMs              \
-  /export:jio_snprintf                       \
-  /export:jio_printf                         \
-  /export:jio_fprintf                        \
-  /export:jio_vfprintf                       \
-  /export:jio_vsnprintf                      \
-  $(AGCT_EXPORT)                             \
-  /export:JVM_GetVersionInfo                 \
-  /export:JVM_InitAgentProperties
+!if "$(BUILDARCH)" == "amd64"
+EXPORT_LIST=
+!else
+EXPORT_LIST=/export:JNI_GetDefaultJavaVMInitArgs \
+            /export:JNI_CreateJavaVM             \
+            /export:JVM_FindClassFromBootLoader  \
+            /export:JNI_GetCreatedJavaVMs        \
+            /export:jio_snprintf                 \
+            /export:jio_printf                   \
+            /export:jio_fprintf                  \
+            /export:jio_vfprintf                 \
+            /export:jio_vsnprintf                \
+            $(AGCT_EXPORT)                       \
+            /export:JVM_GetVersionInfo           \
+            /export:JVM_InitAgentProperties
+!endif
+
+LD_FLAGS=$(LD_FLAGS) $(STACK_SIZE) /subsystem:windows /dll /base:0x8000000 $(EXPORT_LIST)
 
 CXX_INCLUDE_DIRS=/I "..\generated"
 
--- a/hotspot/src/share/tools/ProjectCreator/BuildConfig.java	Wed Nov 12 18:31:05 2014 +0000
+++ b/hotspot/src/share/tools/ProjectCreator/BuildConfig.java	Wed Nov 12 16:22:12 2014 -0800
@@ -512,7 +512,9 @@
 abstract class GenericDebugNonKernelConfig extends GenericDebugConfig {
     protected void init(Vector includes, Vector defines) {
         super.init(includes, defines);
-        getCI().getAdditionalNonKernelLinkerFlags(getV("LinkerFlags"));
+        if (get("PlatformName").equals("Win32")) {
+            getCI().getAdditionalNonKernelLinkerFlags(getV("LinkerFlags"));
+        }
    }
 }
 
--- a/hotspot/src/share/tools/ProjectCreator/WinGammaPlatformVC10.java	Wed Nov 12 18:31:05 2014 +0000
+++ b/hotspot/src/share/tools/ProjectCreator/WinGammaPlatformVC10.java	Wed Nov 12 16:22:12 2014 -0800
@@ -401,16 +401,18 @@
     Vector getBaseLinkerFlags(String outDir, String outDll, String platformName) {
         Vector rv = new Vector();
 
-        addAttr(rv, "AdditionalOptions",
-                "/export:JNI_GetDefaultJavaVMInitArgs " +
-                "/export:JNI_CreateJavaVM " +
-                "/export:JVM_FindClassFromBootLoader "+
-                "/export:JNI_GetCreatedJavaVMs "+
-                "/export:jio_snprintf /export:jio_printf "+
-                "/export:jio_fprintf /export:jio_vfprintf "+
-                "/export:jio_vsnprintf "+
-                "/export:JVM_GetVersionInfo "+
-                "/export:JVM_InitAgentProperties");
+        if(platformName.equals("Win32")) {
+            addAttr(rv, "AdditionalOptions",
+                    "/export:JNI_GetDefaultJavaVMInitArgs " +
+                    "/export:JNI_CreateJavaVM " +
+                    "/export:JVM_FindClassFromBootLoader "+
+                    "/export:JNI_GetCreatedJavaVMs "+
+                    "/export:jio_snprintf /export:jio_printf "+
+                    "/export:jio_fprintf /export:jio_vfprintf "+
+                    "/export:jio_vsnprintf "+
+                    "/export:JVM_GetVersionInfo "+
+                    "/export:JVM_InitAgentProperties");
+        }
         addAttr(rv, "AdditionalDependencies", "kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;Wsock32.lib;winmm.lib;psapi.lib;version.lib");
         addAttr(rv, "OutputFile", outDll);
         addAttr(rv, "SuppressStartupBanner", "true");