8148955: libjimage.so compiled with wrong flags
authorerikj
Thu, 04 Feb 2016 09:51:24 +0100
changeset 35706 c6bc87214e4c
parent 35705 5c3998b1b7ea
child 35707 66cdb7e01a3e
8148955: libjimage.so compiled with wrong flags Reviewed-by: alanb
jdk/make/lib/CoreLibraries.gmk
jdk/src/java.base/share/native/libjimage/imageDecompressor.cpp
--- a/jdk/make/lib/CoreLibraries.gmk	Thu Feb 04 14:38:17 2016 +0800
+++ b/jdk/make/lib/CoreLibraries.gmk	Thu Feb 04 09:51:24 2016 +0100
@@ -247,6 +247,13 @@
   LIBJIMAGE_TOOLCHAIN := TOOLCHAIN_LINK_CXX
 endif # OPENJDK_TARGET_OS aix
 
+JIMAGELIB_CPPFLAGS := \
+    -I$(JDK_TOPDIR)/src/java.base/share/native/libjava \
+    -I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjava \
+    -I$(JDK_TOPDIR)/src/java.base/share/native/libjimage \
+    -I$(SUPPORT_OUTPUTDIR)/headers/java.base \
+    #
+
 $(eval $(call SetupNativeCompilation,BUILD_LIBJIMAGE, \
     LIBRARY := jimage, \
     TOOLCHAIN := $(LIBJIMAGE_TOOLCHAIN), \
@@ -255,12 +262,8 @@
     SRC := $(JDK_TOPDIR)/src/java.base/share/native/libjimage \
         $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjimage, \
     EXCLUDES := $(LIBJIMAGE_EXCLUDES), \
-    CFLAGS := $(CFLAGS_JDKLIB) \
-        $(JIMAGELIB_CPPFLAGS) \
-        -I$(JDK_TOPDIR)/src/java.base/share/native/libjava \
-        -I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjava \
-        -I$(JDK_TOPDIR)/src/java.base/share/native/libjimage \
-        -I$(SUPPORT_OUTPUTDIR)/headers/java.base, \
+    CFLAGS := $(CFLAGS_JDKLIB) $(JIMAGELIB_CPPFLAGS), \
+    CXXFLAGS := $(CXXFLAGS_JDKLIB) $(JIMAGELIB_CPPFLAGS), \
     CFLAGS_unix := -UDEBUG, \
     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjimage/mapfile-vers, \
     LDFLAGS := $(LDFLAGS_JDKLIB) \
--- a/jdk/src/java.base/share/native/libjimage/imageDecompressor.cpp	Thu Feb 04 14:38:17 2016 +0800
+++ b/jdk/src/java.base/share/native/libjimage/imageDecompressor.cpp	Thu Feb 04 09:51:24 2016 +0100
@@ -190,8 +190,8 @@
             { // String in Strings table
                 *uncompressed_resource = 1;
                 uncompressed_resource += 1;
-                int i = decompress_int(data);
-                const char * string = strings->get(i);
+                int k = decompress_int(data);
+                const char * string = strings->get(k);
                 int str_length = (int) strlen(string);
                 Endian::set_java(uncompressed_resource, str_length);
                 uncompressed_resource += 2;