On 2016-02-23 23:50, Erik Joelsson wrote:
The windows 32 bit build is currently DOA.
In JDK-8150203, the following build warning on Windows x64 was
eliminated:
CRC32.c: warning LNK4197: export 'ZIP_CRC32' specified multiple times;
using first specification
This warning is emitted because the function both has a JNIEXPORT
declaration and a link time -export:ZIP_CRC32. The change removed the
-export link flag which removed the warning.
On Windows x86, removing the explicit -export link flag is causing
trouble. Just using JNIEXPORT (or really __declspec(dllexport)) is not
the same thing as the link flag -export. The first will export
_ZIP_CRC32 and the second ZIP_CRC32. In hotspot, jvm.dll will look for
the symbol ZIP_CRC32 and will fail without the -export link flag.
My proposed fix is to readd the -export and remove the JNIEXPORT from
this function. This would mimic the pattern of the other exported
symbols in this library.
Looks good to me. But in that case, probably all the removals of
-export:* in JDK-8150203 was incorrect and should be fixed.
/Magnus
Bug: https://bugs.openjdk.java.net/browse/JDK-8150456
Patch:
diff -r 9d536355b828 make/lib/CoreLibraries.gmk
--- a/make/lib/CoreLibraries.gmk Tue Feb 23 09:49:04 2016 +0100
+++ b/make/lib/CoreLibraries.gmk Tue Feb 23 23:49:10 2016 +0100
@@ -225,7 +225,7 @@
$(call SET_SHARED_LIBRARY_ORIGIN), \
LDFLAGS_windows := -export:ZIP_Open -export:ZIP_Close
-export:ZIP_FindEntry \
-export:ZIP_ReadEntry -export:ZIP_GetNextEntry \
- -export:ZIP_InflateFully, \
+ -export:ZIP_InflateFully -export:ZIP_CRC32, \
LIBS_unix := -ljvm -ljava $(LIBZ), \
LIBS_solaris := -lc, \
LIBS_windows := jvm.lib $(WIN_JAVA_LIB), \
diff -r 9d536355b828 src/java.base/share/native/libzip/CRC32.c
--- a/src/java.base/share/native/libzip/CRC32.c Tue Feb 23 09:49:04
2016 +0100
+++ b/src/java.base/share/native/libzip/CRC32.c Tue Feb 23 23:49:10
2016 +0100
@@ -54,7 +54,7 @@
return crc;
}
-JNIEXPORT jint JNICALL
+jint JNICALL
ZIP_CRC32(jint crc, const jbyte *buf, jint len)
{
return crc32(crc, (Bytef*)buf, len);
/Erik