From 1db42e44cfd00f7446b12c63e648202a00a78813 Mon Sep 17 00:00:00 2001 From: eabdullin Date: Tue, 16 May 2023 20:26:49 +0300 Subject: [PATCH] Add missing file --- .../jdk8186464-rh1433262-zip64_failure.patch | 43 +++--- SOURCES/remove-intree-libraries.sh | 131 ++++++++++++++++++ ...lite-libs_instead_of_pcsc-lite-devel.patch | 4 +- 3 files changed, 156 insertions(+), 22 deletions(-) create mode 100644 SOURCES/remove-intree-libraries.sh diff --git a/SOURCES/jdk8186464-rh1433262-zip64_failure.patch b/SOURCES/jdk8186464-rh1433262-zip64_failure.patch index ed699a8..572a36e 100644 --- a/SOURCES/jdk8186464-rh1433262-zip64_failure.patch +++ b/SOURCES/jdk8186464-rh1433262-zip64_failure.patch @@ -8,17 +8,18 @@ Reviewed-by: martin diff --git openjdk.orig/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java openjdk/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java +index 26e2a5bf9e9..2630c118817 100644 --- openjdk.orig/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java +++ openjdk/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java -@@ -93,6 +93,7 @@ +@@ -92,6 +92,7 @@ public class ZipFileSystem extends FileSystem { private final boolean createNew; // create a new zip if not exists private static final boolean isWindows = System.getProperty("os.name").startsWith("Windows"); + private final boolean forceEnd64; - ZipFileSystem(ZipFileSystemProvider provider, - Path zfpath, -@@ -109,12 +110,13 @@ + // a threshold, in bytes, to decide whether to create a temp file + // for outputstream of a zip entry +@@ -112,12 +113,13 @@ public class ZipFileSystem extends FileSystem { if (this.defaultDir.charAt(0) != '/') throw new IllegalArgumentException("default dir should be absolute"); @@ -33,7 +34,7 @@ diff --git openjdk.orig/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFi } } else { throw new FileSystemNotFoundException(zfpath.toString()); -@@ -1011,28 +1013,36 @@ +@@ -1014,28 +1016,36 @@ public class ZipFileSystem extends FileSystem { end.cenoff = ENDOFF(buf); end.comlen = ENDCOM(buf); end.endpos = pos + i; @@ -72,7 +73,7 @@ diff --git openjdk.orig/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFi + != end64buf.length || + !end64SigAt(end64buf, 0)) { + return end; - } ++ } + // end64 found, + long cenlen64 = ZIP64_ENDSIZ(end64buf); + long cenoff64 = ZIP64_ENDOFF(end64buf); @@ -82,7 +83,7 @@ diff --git openjdk.orig/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFi + cenoff64 != end.cenoff && end.cenoff != ZIP64_MINVAL || + centot64 != end.centot && end.centot != ZIP64_MINVAL32) { + return end; -+ } + } + // to use the end64 values + end.cenlen = cenlen64; + end.cenoff = cenoff64; @@ -91,7 +92,7 @@ diff --git openjdk.orig/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFi return end; } } -@@ -1198,7 +1208,7 @@ +@@ -1201,7 +1211,7 @@ public class ZipFileSystem extends FileSystem { // sync the zip file system, if there is any udpate private void sync() throws IOException { @@ -100,7 +101,7 @@ diff --git openjdk.orig/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFi // check ex-closer if (!exChClosers.isEmpty()) { for (ExChannelCloser ecc : exChClosers) { -@@ -1289,7 +1299,7 @@ +@@ -1292,7 +1302,7 @@ public class ZipFileSystem extends FileSystem { } end.centot = elist.size(); end.cenlen = written - end.cenoff; @@ -109,7 +110,7 @@ diff --git openjdk.orig/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFi } if (!streams.isEmpty()) { // -@@ -1727,8 +1737,8 @@ +@@ -1849,8 +1859,8 @@ public class ZipFileSystem extends FileSystem { long endpos; int disktot; @@ -120,7 +121,7 @@ diff --git openjdk.orig/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFi long xlen = cenlen; long xoff = cenoff; if (xlen >= ZIP64_MINVAL) { -@@ -1753,8 +1763,8 @@ +@@ -1875,8 +1885,8 @@ public class ZipFileSystem extends FileSystem { writeShort(os, 45); // version needed to extract writeInt(os, 0); // number of this disk writeInt(os, 0); // central directory start disk @@ -131,10 +132,11 @@ diff --git openjdk.orig/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFi writeLong(os, cenlen); // length of central directory writeLong(os, cenoff); // offset of central directory -diff --git a/src/share/native/javopenjdk.orig/jdk/util/zip/zip_util.c openjdk/jdk/src/share/native/java/util/zip/zip_util.c +diff --git openjdk.orig/jdk/src/share/native/java/util/zip/zip_util.c openjdk/jdk/src/share/native/java/util/zip/zip_util.c +index 5fd6fea049d..858e5814e92 100644 --- openjdk.orig/jdk/src/share/native/java/util/zip/zip_util.c +++ openjdk/jdk/src/share/native/java/util/zip/zip_util.c -@@ -383,6 +383,9 @@ +@@ -385,6 +385,9 @@ findEND64(jzfile *zip, void *end64buf, jlong endpos) { char loc64[ZIP64_LOCHDR]; jlong end64pos; @@ -144,7 +146,7 @@ diff --git a/src/share/native/javopenjdk.orig/jdk/util/zip/zip_util.c openjdk/jd if (readFullyAt(zip->zfd, loc64, ZIP64_LOCHDR, endpos - ZIP64_LOCHDR) == -1) { return -1; // end64 locator not found } -@@ -545,6 +548,7 @@ +@@ -567,6 +570,7 @@ readCEN(jzfile *zip, jint knownTotal) { /* Following are unsigned 32-bit */ jlong endpos, end64pos, cenpos, cenlen, cenoff; @@ -152,7 +154,7 @@ diff --git a/src/share/native/javopenjdk.orig/jdk/util/zip/zip_util.c openjdk/jd /* Following are unsigned 16-bit */ jint total, tablelen, i, j; unsigned char *cenbuf = NULL; -@@ -572,13 +576,20 @@ +@@ -594,13 +598,20 @@ readCEN(jzfile *zip, jint knownTotal) cenlen = ENDSIZ(endbuf); cenoff = ENDOFF(endbuf); total = ENDTOT(endbuf); @@ -180,7 +182,8 @@ diff --git a/src/share/native/javopenjdk.orig/jdk/util/zip/zip_util.c openjdk/jd endpos = end64pos; endhdrlen = ZIP64_ENDHDR; } -diff --git a/test/javopenjdk.orig/jdk/util/zip/ZipFile/ReadZip.java openjdk/jdk/test/java/util/zip/ZipFile/ReadZip.java +diff --git openjdk.orig/jdk/test/java/util/zip/ZipFile/ReadZip.java openjdk/jdk/test/java/util/zip/ZipFile/ReadZip.java +index ffe8a8ed712..9b380003893 100644 --- openjdk.orig/jdk/test/java/util/zip/ZipFile/ReadZip.java +++ openjdk/jdk/test/java/util/zip/ZipFile/ReadZip.java @@ -22,7 +22,7 @@ @@ -192,7 +195,7 @@ diff --git a/test/javopenjdk.orig/jdk/util/zip/ZipFile/ReadZip.java openjdk/jdk/ * @summary Make sure we can read a zip file. @key randomness * @run main/othervm ReadZip -@@ -30,12 +30,24 @@ +@@ -31,12 +31,24 @@ */ import java.io.*; @@ -217,7 +220,7 @@ diff --git a/test/javopenjdk.orig/jdk/util/zip/ZipFile/ReadZip.java openjdk/jdk/ public class ReadZip { private static void unreached (Object o) throws Exception -@@ -143,8 +155,6 @@ +@@ -144,8 +156,6 @@ public class ReadZip { newZip.delete(); } @@ -226,7 +229,7 @@ diff --git a/test/javopenjdk.orig/jdk/util/zip/ZipFile/ReadZip.java openjdk/jdk/ // Throw a FNF exception when read a non-existing zip file try { unreached (new ZipFile( new File(System.getProperty("test.src", "."), -@@ -152,5 +162,54 @@ +@@ -153,5 +163,54 @@ public class ReadZip { + String.valueOf(new java.util.Random().nextInt()) + ".zip"))); } catch (FileNotFoundException fnfe) {} @@ -280,4 +283,4 @@ diff --git a/test/javopenjdk.orig/jdk/util/zip/ZipFile/ReadZip.java openjdk/jdk/ + Files.deleteIfExists(path); + } } - } \ No newline at end of file + } diff --git a/SOURCES/remove-intree-libraries.sh b/SOURCES/remove-intree-libraries.sh new file mode 100644 index 0000000..201a220 --- /dev/null +++ b/SOURCES/remove-intree-libraries.sh @@ -0,0 +1,131 @@ +#!/bin/sh + +ZIP_SRC=openjdk/jdk/src/share/native/java/util/zip/zlib +JPEG_SRC=openjdk/jdk/src/share/native/sun/awt/image/jpeg +GIF_SRC=openjdk/jdk/src/share/native/sun/awt/giflib +PNG_SRC=openjdk/jdk/src/share/native/sun/awt/libpng +LCMS_SRC=openjdk/jdk/src/share/native/sun/java2d/cmm/lcms + +echo "Removing built-in libs (they will be linked)" + +echo "Removing zlib" +if [ ! -d ${ZIP_SRC} ]; then + echo "${ZIP_SRC} does not exist. Refusing to proceed." + exit 1 +fi +rm -rvf ${ZIP_SRC} + +echo "Removing libjpeg" +if [ ! -f ${JPEG_SRC}/jdhuff.c ]; then # some file that sound definitely exist + echo "${JPEG_SRC} does not contain jpeg sources. Refusing to proceed." + exit 1 +fi + +rm -vf ${JPEG_SRC}/jcomapi.c +rm -vf ${JPEG_SRC}/jdapimin.c +rm -vf ${JPEG_SRC}/jdapistd.c +rm -vf ${JPEG_SRC}/jdcoefct.c +rm -vf ${JPEG_SRC}/jdcolor.c +rm -vf ${JPEG_SRC}/jdct.h +rm -vf ${JPEG_SRC}/jddctmgr.c +rm -vf ${JPEG_SRC}/jdhuff.c +rm -vf ${JPEG_SRC}/jdhuff.h +rm -vf ${JPEG_SRC}/jdinput.c +rm -vf ${JPEG_SRC}/jdmainct.c +rm -vf ${JPEG_SRC}/jdmarker.c +rm -vf ${JPEG_SRC}/jdmaster.c +rm -vf ${JPEG_SRC}/jdmerge.c +rm -vf ${JPEG_SRC}/jdphuff.c +rm -vf ${JPEG_SRC}/jdpostct.c +rm -vf ${JPEG_SRC}/jdsample.c +rm -vf ${JPEG_SRC}/jerror.c +rm -vf ${JPEG_SRC}/jerror.h +rm -vf ${JPEG_SRC}/jidctflt.c +rm -vf ${JPEG_SRC}/jidctfst.c +rm -vf ${JPEG_SRC}/jidctint.c +rm -vf ${JPEG_SRC}/jidctred.c +rm -vf ${JPEG_SRC}/jinclude.h +rm -vf ${JPEG_SRC}/jmemmgr.c +rm -vf ${JPEG_SRC}/jmemsys.h +rm -vf ${JPEG_SRC}/jmemnobs.c +rm -vf ${JPEG_SRC}/jmorecfg.h +rm -vf ${JPEG_SRC}/jpegint.h +rm -vf ${JPEG_SRC}/jpeglib.h +rm -vf ${JPEG_SRC}/jquant1.c +rm -vf ${JPEG_SRC}/jquant2.c +rm -vf ${JPEG_SRC}/jutils.c +rm -vf ${JPEG_SRC}/jcapimin.c +rm -vf ${JPEG_SRC}/jcapistd.c +rm -vf ${JPEG_SRC}/jccoefct.c +rm -vf ${JPEG_SRC}/jccolor.c +rm -vf ${JPEG_SRC}/jcdctmgr.c +rm -vf ${JPEG_SRC}/jchuff.c +rm -vf ${JPEG_SRC}/jchuff.h +rm -vf ${JPEG_SRC}/jcinit.c +rm -vf ${JPEG_SRC}/jconfig.h +rm -vf ${JPEG_SRC}/jcmainct.c +rm -vf ${JPEG_SRC}/jcmarker.c +rm -vf ${JPEG_SRC}/jcmaster.c +rm -vf ${JPEG_SRC}/jcparam.c +rm -vf ${JPEG_SRC}/jcphuff.c +rm -vf ${JPEG_SRC}/jcprepct.c +rm -vf ${JPEG_SRC}/jcsample.c +rm -vf ${JPEG_SRC}/jctrans.c +rm -vf ${JPEG_SRC}/jdtrans.c +rm -vf ${JPEG_SRC}/jfdctflt.c +rm -vf ${JPEG_SRC}/jfdctfst.c +rm -vf ${JPEG_SRC}/jfdctint.c +rm -vf ${JPEG_SRC}/jversion.h +rm -vf ${JPEG_SRC}/README + +echo "Removing giflib" +if [ ! -d ${GIF_SRC} ]; then + echo "${GIF_SRC} does not exist. Refusing to proceed." + exit 1 +fi +rm -rvf ${GIF_SRC} + +echo "Removing libpng" +if [ ! -d ${PNG_SRC} ]; then + echo "${PNG_SRC} does not exist. Refusing to proceed." + exit 1 +fi +rm -rvf ${PNG_SRC} + +echo "Removing lcms" +if [ ! -d ${LCMS_SRC} ]; then + echo "${LCMS_SRC} does not exist. Refusing to proceed." + exit 1 +fi +# temporary change to move bundled LCMS +if [ ! true ]; then +rm -vf ${LCMS_SRC}/cmsalpha.c +rm -vf ${LCMS_SRC}/cmscam02.c +rm -vf ${LCMS_SRC}/cmscgats.c +rm -vf ${LCMS_SRC}/cmscnvrt.c +rm -vf ${LCMS_SRC}/cmserr.c +rm -vf ${LCMS_SRC}/cmsgamma.c +rm -vf ${LCMS_SRC}/cmsgmt.c +rm -vf ${LCMS_SRC}/cmshalf.c +rm -vf ${LCMS_SRC}/cmsintrp.c +rm -vf ${LCMS_SRC}/cmsio0.c +rm -vf ${LCMS_SRC}/cmsio1.c +rm -vf ${LCMS_SRC}/cmslut.c +rm -vf ${LCMS_SRC}/cmsmd5.c +rm -vf ${LCMS_SRC}/cmsmtrx.c +rm -vf ${LCMS_SRC}/cmsnamed.c +rm -vf ${LCMS_SRC}/cmsopt.c +rm -vf ${LCMS_SRC}/cmspack.c +rm -vf ${LCMS_SRC}/cmspcs.c +rm -vf ${LCMS_SRC}/cmsplugin.c +rm -vf ${LCMS_SRC}/cmsps2.c +rm -vf ${LCMS_SRC}/cmssamp.c +rm -vf ${LCMS_SRC}/cmssm.c +rm -vf ${LCMS_SRC}/cmstypes.c +rm -vf ${LCMS_SRC}/cmsvirt.c +rm -vf ${LCMS_SRC}/cmswtpnt.c +rm -vf ${LCMS_SRC}/cmsxform.c +rm -vf ${LCMS_SRC}/lcms2.h +rm -vf ${LCMS_SRC}/lcms2_internal.h +rm -vf ${LCMS_SRC}/lcms2_plugin.h +fi diff --git a/SOURCES/rh1684077-openjdk_should_depend_on_pcsc-lite-libs_instead_of_pcsc-lite-devel.patch b/SOURCES/rh1684077-openjdk_should_depend_on_pcsc-lite-libs_instead_of_pcsc-lite-devel.patch index 5e2b254..e909809 100644 --- a/SOURCES/rh1684077-openjdk_should_depend_on_pcsc-lite-libs_instead_of_pcsc-lite-devel.patch +++ b/SOURCES/rh1684077-openjdk_should_depend_on_pcsc-lite-libs_instead_of_pcsc-lite-devel.patch @@ -1,5 +1,5 @@ ---- openjdk/src/java.smartcardio/unix/classes/sun/security/smartcardio/PlatformPCSC.java 2013-03-01 10:48:12.038189968 +0100 -+++ openjdk/src/java.smartcardio/unix/classes/sun/security/smartcardio/PlatformPCSC.java 2013-03-01 10:48:11.913188505 +0100 +--- openjdk/jdk/src/solaris/classes/sun/security/smartcardio/PlatformPCSC.java 2013-03-01 10:48:12.038189968 +0100 ++++ openjdk/jdk/src/solaris/classes/sun/security/smartcardio/PlatformPCSC.java 2013-03-01 10:48:11.913188505 +0100 @@ -48,8 +48,8 @@ private final static String PROP_NAME = "sun.security.smartcardio.library";