mirror of
https://github.com/corda/corda.git
synced 2025-04-28 06:49:55 +00:00
fix openjdk/openjdk-src builds for latest JDKs 7 and 8
The tower of patches and hacks grows higher. Ideally, we'll just drop support for JDK 7 soon and clean this mess up a bit, but TravisCI still hasn't gotten the memo that it's dead, so we muddle onward. I've tested this on Windows, but not yet Linux or OS X. Wanted to get a PR before I move on to that.
This commit is contained in:
parent
505c2b8d93
commit
80dc32094f
13
makefile
13
makefile
@ -166,6 +166,10 @@ library-path = $(library-path-variable)=$(build)
|
|||||||
|
|
||||||
|
|
||||||
ifneq ($(openjdk),)
|
ifneq ($(openjdk),)
|
||||||
|
openjdk-version := $(shell $(openjdk)/bin/java -version 2>&1 \
|
||||||
|
| head -n 1 \
|
||||||
|
| sed 's/.*version "1.\([^.]*\).*/\1/')
|
||||||
|
|
||||||
openjdk-arch = $(arch)
|
openjdk-arch = $(arch)
|
||||||
ifeq ($(arch),x86_64)
|
ifeq ($(arch),x86_64)
|
||||||
openjdk-arch = amd64
|
openjdk-arch = amd64
|
||||||
@ -904,7 +908,9 @@ ifeq ($(platform),windows)
|
|||||||
exe-suffix = .exe
|
exe-suffix = .exe
|
||||||
rpath =
|
rpath =
|
||||||
|
|
||||||
lflags = -L$(lib) $(common-lflags) -lws2_32 -liphlpapi -mconsole
|
lflags = -L$(lib) $(common-lflags) -lws2_32 -lversion -luuid -liphlpapi \
|
||||||
|
-lmswsock -mconsole
|
||||||
|
|
||||||
cflags = -I$(inc) $(common-cflags) -DWINVER=0x0500 -U__STRICT_ANSI__
|
cflags = -I$(inc) $(common-cflags) -DWINVER=0x0500 -U__STRICT_ANSI__
|
||||||
|
|
||||||
ifeq (,$(filter mingw32 cygwin,$(build-platform)))
|
ifeq (,$(filter mingw32 cygwin,$(build-platform)))
|
||||||
@ -2265,6 +2271,11 @@ ifeq ($(platform),ios)
|
|||||||
< "$(openjdk-src)/solaris/native/java/lang/childproc.h" \
|
< "$(openjdk-src)/solaris/native/java/lang/childproc.h" \
|
||||||
> $(build)/openjdk/childproc.h; \
|
> $(build)/openjdk/childproc.h; \
|
||||||
fi
|
fi
|
||||||
|
endif
|
||||||
|
ifneq (7,$(openjdk-version))
|
||||||
|
if [ -f openjdk-patches/$(notdir $(<)).8.patch ]; then \
|
||||||
|
( cd $(build) && patch -p0 ) < openjdk-patches/$(notdir $(<)).8.patch; \
|
||||||
|
fi
|
||||||
endif
|
endif
|
||||||
if [ -f openjdk-patches/$(notdir $(<)).patch ]; then \
|
if [ -f openjdk-patches/$(notdir $(<)).patch ]; then \
|
||||||
( cd $(build) && patch -p0 ) < openjdk-patches/$(notdir $(<)).patch; \
|
( cd $(build) && patch -p0 ) < openjdk-patches/$(notdir $(<)).patch; \
|
||||||
|
15
openjdk-patches/Inet6AddressImpl.c.8.patch
Normal file
15
openjdk-patches/Inet6AddressImpl.c.8.patch
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
--- openjdk/Inet6AddressImpl.c
|
||||||
|
+++ openjdk/Inet6AddressImpl.c
|
||||||
|
@@ -360,6 +360,11 @@
|
||||||
|
|
||||||
|
#ifdef AF_INET6
|
||||||
|
|
||||||
|
+typedef struct icmpv6_echo_reply_lh {
|
||||||
|
+ IPV6_ADDRESS_EX Address;
|
||||||
|
+ ULONG Status;
|
||||||
|
+ unsigned int RoundTripTime;
|
||||||
|
+} ICMPV6_ECHO_REPLY, *PICMPV6_ECHO_REPLY;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ping implementation.
|
||||||
|
|
@ -49,7 +49,6 @@ openjdk-sources = \
|
|||||||
$(openjdk-src)/share/native/java/util/zip/zip_util.c \
|
$(openjdk-src)/share/native/java/util/zip/zip_util.c \
|
||||||
$(openjdk-src)/share/native/sun/management/VMManagementImpl.c \
|
$(openjdk-src)/share/native/sun/management/VMManagementImpl.c \
|
||||||
$(openjdk-src)/share/native/sun/misc/GC.c \
|
$(openjdk-src)/share/native/sun/misc/GC.c \
|
||||||
$(openjdk-src)/share/native/sun/misc/URLClassPath.c \
|
|
||||||
$(openjdk-src)/share/native/sun/misc/MessageUtils.c \
|
$(openjdk-src)/share/native/sun/misc/MessageUtils.c \
|
||||||
$(openjdk-src)/share/native/sun/misc/NativeSignalHandler.c \
|
$(openjdk-src)/share/native/sun/misc/NativeSignalHandler.c \
|
||||||
$(openjdk-src)/share/native/sun/misc/Signal.c \
|
$(openjdk-src)/share/native/sun/misc/Signal.c \
|
||||||
@ -143,6 +142,11 @@ openjdk-headers-classes = \
|
|||||||
sun.reflect.Reflection \
|
sun.reflect.Reflection \
|
||||||
sun.security.provider.NativeSeedGenerator
|
sun.security.provider.NativeSeedGenerator
|
||||||
|
|
||||||
|
ifneq (7,$(openjdk-version))
|
||||||
|
openjdk-sources += \
|
||||||
|
$(openjdk-src)/share/native/sun/misc/URLClassPath.c
|
||||||
|
endif
|
||||||
|
|
||||||
# todo: set properties according to architecture targeted and OpenJDK
|
# todo: set properties according to architecture targeted and OpenJDK
|
||||||
# version used:
|
# version used:
|
||||||
openjdk-cflags = \
|
openjdk-cflags = \
|
||||||
@ -181,15 +185,14 @@ ifeq ($(platform),windows)
|
|||||||
$(openjdk-src)/windows/native/java/io/FileDescriptor_md.c \
|
$(openjdk-src)/windows/native/java/io/FileDescriptor_md.c \
|
||||||
$(openjdk-src)/windows/native/java/io/FileInputStream_md.c \
|
$(openjdk-src)/windows/native/java/io/FileInputStream_md.c \
|
||||||
$(openjdk-src)/windows/native/java/io/FileOutputStream_md.c \
|
$(openjdk-src)/windows/native/java/io/FileOutputStream_md.c \
|
||||||
$(openjdk-src)/windows/native/java/io/FileSystem_md.c \
|
|
||||||
$(openjdk-src)/windows/native/java/io/io_util_md.c \
|
$(openjdk-src)/windows/native/java/io/io_util_md.c \
|
||||||
$(openjdk-src)/windows/native/java/io/RandomAccessFile_md.c \
|
$(openjdk-src)/windows/native/java/io/RandomAccessFile_md.c \
|
||||||
$(openjdk-src)/windows/native/java/io/Win32FileSystem_md.c \
|
|
||||||
$(openjdk-src)/windows/native/java/io/WinNTFileSystem_md.c \
|
$(openjdk-src)/windows/native/java/io/WinNTFileSystem_md.c \
|
||||||
$(openjdk-src)/windows/native/java/lang/java_props_md.c \
|
$(openjdk-src)/windows/native/java/lang/java_props_md.c \
|
||||||
$(openjdk-src)/windows/native/java/lang/ProcessEnvironment_md.c \
|
$(openjdk-src)/windows/native/java/lang/ProcessEnvironment_md.c \
|
||||||
$(openjdk-src)/windows/native/java/lang/ProcessImpl_md.c \
|
$(openjdk-src)/windows/native/java/lang/ProcessImpl_md.c \
|
||||||
$(openjdk-src)/windows/native/java/net/net_util_md.c \
|
$(openjdk-src)/windows/native/java/net/net_util_md.c \
|
||||||
|
$(openjdk-src)/windows/native/java/net/ExtendedOptionsImpl.c \
|
||||||
$(openjdk-src)/windows/native/java/net/DualStackPlainSocketImpl.c \
|
$(openjdk-src)/windows/native/java/net/DualStackPlainSocketImpl.c \
|
||||||
$(openjdk-src)/windows/native/java/net/InetAddressImplFactory.c \
|
$(openjdk-src)/windows/native/java/net/InetAddressImplFactory.c \
|
||||||
$(openjdk-src)/windows/native/java/net/Inet4AddressImpl.c \
|
$(openjdk-src)/windows/native/java/net/Inet4AddressImpl.c \
|
||||||
@ -218,6 +221,12 @@ ifeq ($(platform),windows)
|
|||||||
$(openjdk-src)/windows/native/sun/nio/fs/WindowsNativeDispatcher.c \
|
$(openjdk-src)/windows/native/sun/nio/fs/WindowsNativeDispatcher.c \
|
||||||
$(openjdk-src)/windows/native/sun/security/provider/WinCAPISeedGenerator.c
|
$(openjdk-src)/windows/native/sun/security/provider/WinCAPISeedGenerator.c
|
||||||
|
|
||||||
|
ifeq (7,$(openjdk-version))
|
||||||
|
openjdk-sources += \
|
||||||
|
$(openjdk-src)/windows/native/java/io/FileSystem_md.c \
|
||||||
|
$(openjdk-src)/windows/native/java/io/Win32FileSystem_md.c
|
||||||
|
endif
|
||||||
|
|
||||||
openjdk-headers-classes += \
|
openjdk-headers-classes += \
|
||||||
java.net.DualStackPlainSocketImpl \
|
java.net.DualStackPlainSocketImpl \
|
||||||
java.net.SocketImpl \
|
java.net.SocketImpl \
|
||||||
@ -236,14 +245,22 @@ ifeq ($(platform),windows)
|
|||||||
"-I$(openjdk-src)/windows/native/java/util" \
|
"-I$(openjdk-src)/windows/native/java/util" \
|
||||||
"-I$(openjdk-src)/windows/native/sun/nio/ch" \
|
"-I$(openjdk-src)/windows/native/sun/nio/ch" \
|
||||||
"-I$(openjdk-src)/windows/javavm/include" \
|
"-I$(openjdk-src)/windows/javavm/include" \
|
||||||
"-I$(root)/win32/include" \
|
|
||||||
-DLOCALE_SNAME=0x0000005c \
|
-DLOCALE_SNAME=0x0000005c \
|
||||||
-DLOCALE_SISO3166CTRYNAME2=0x00000068 \
|
-DLOCALE_SISO3166CTRYNAME2=0x00000068 \
|
||||||
-DLOCALE_SISO639LANGNAME2=0x00000067 \
|
-DLOCALE_SISO639LANGNAME2=0x00000067 \
|
||||||
-D_JNI_IMPLEMENTATION_ \
|
-D_JNI_IMPLEMENTATION_ \
|
||||||
-D_JAVASOFT_WIN32_TYPEDEF_MD_H_ \
|
-D_JAVASOFT_WIN32_TYPEDEF_MD_H_ \
|
||||||
|
-D_WIN32_WINNT=0x0600 \
|
||||||
-Ds6_words=_s6_words \
|
-Ds6_words=_s6_words \
|
||||||
-Ds6_bytes=_s6_bytes
|
-Ds6_bytes=_s6_bytes \
|
||||||
|
"-D__try=if (1)" \
|
||||||
|
"-D__except(a)=else"
|
||||||
|
|
||||||
|
ifeq ($(arch),x86_64)
|
||||||
|
openjdk-cflags += "-I$(root)/win64/include"
|
||||||
|
else
|
||||||
|
openjdk-cflags += "-I$(root)/win32/include"
|
||||||
|
endif
|
||||||
else
|
else
|
||||||
openjdk-sources += \
|
openjdk-sources += \
|
||||||
$(shell find $(openjdk-src)/solaris/native/common -name '*.c') \
|
$(shell find $(openjdk-src)/solaris/native/common -name '*.c') \
|
||||||
@ -261,6 +278,7 @@ else
|
|||||||
$(openjdk-src)/solaris/native/java/lang/ProcessEnvironment_md.c \
|
$(openjdk-src)/solaris/native/java/lang/ProcessEnvironment_md.c \
|
||||||
$(openjdk-src)/solaris/native/java/lang/UNIXProcess_md.c \
|
$(openjdk-src)/solaris/native/java/lang/UNIXProcess_md.c \
|
||||||
$(openjdk-src)/solaris/native/java/net/net_util_md.c \
|
$(openjdk-src)/solaris/native/java/net/net_util_md.c \
|
||||||
|
$(openjdk-src)/solaris/native/java/net/ExtendedOptionsImpl.c \
|
||||||
$(openjdk-src)/solaris/native/java/net/InetAddressImplFactory.c \
|
$(openjdk-src)/solaris/native/java/net/InetAddressImplFactory.c \
|
||||||
$(openjdk-src)/solaris/native/java/net/Inet4AddressImpl.c \
|
$(openjdk-src)/solaris/native/java/net/Inet4AddressImpl.c \
|
||||||
$(openjdk-src)/solaris/native/java/net/Inet6AddressImpl.c \
|
$(openjdk-src)/solaris/native/java/net/Inet6AddressImpl.c \
|
||||||
|
@ -662,6 +662,9 @@ class MyClasspath : public Classpath {
|
|||||||
#ifdef AVIAN_OPENJDK_SRC
|
#ifdef AVIAN_OPENJDK_SRC
|
||||||
interceptFileOperations(t, true);
|
interceptFileOperations(t, true);
|
||||||
#else // not AVIAN_OPENJDK_SRC
|
#else // not AVIAN_OPENJDK_SRC
|
||||||
|
# ifdef PLATFORM_WINDOWS
|
||||||
|
expect(t, loadLibrary(t, libraryPath, "msvcr100", true, true));
|
||||||
|
# endif
|
||||||
expect(t, loadLibrary(t, libraryPath, "verify", true, true));
|
expect(t, loadLibrary(t, libraryPath, "verify", true, true));
|
||||||
expect(t, loadLibrary(t, libraryPath, "java", true, true));
|
expect(t, loadLibrary(t, libraryPath, "java", true, true));
|
||||||
#endif // not AVIAN_OPENJDK_SRC
|
#endif // not AVIAN_OPENJDK_SRC
|
||||||
@ -3122,6 +3125,11 @@ namespace {
|
|||||||
|
|
||||||
namespace local {
|
namespace local {
|
||||||
|
|
||||||
|
extern "C" AVIAN_EXPORT jobjectArray JNICALL EXPORT(JVM_GetMethodParameters)(Thread*, jobject)
|
||||||
|
{
|
||||||
|
abort();
|
||||||
|
}
|
||||||
|
|
||||||
extern "C" AVIAN_EXPORT jint JNICALL EXPORT(JVM_GetInterfaceVersion)()
|
extern "C" AVIAN_EXPORT jint JNICALL EXPORT(JVM_GetInterfaceVersion)()
|
||||||
{
|
{
|
||||||
return local::InterfaceVersion;
|
return local::InterfaceVersion;
|
||||||
@ -5972,6 +5980,28 @@ extern "C" void* JDK_FindJvmEntry(const char* name)
|
|||||||
return voidPointer(GetProcAddress(jvmHandle, name));
|
return voidPointer(GetProcAddress(jvmHandle, name));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern "C" HMODULE JDK_LoadSystemLibrary(const char* name) {
|
||||||
|
HMODULE handle;
|
||||||
|
char path[MAX_PATH];
|
||||||
|
|
||||||
|
if (GetSystemDirectory(path, sizeof(path)) != 0) {
|
||||||
|
strcat(path, "\\");
|
||||||
|
strcat(path, name);
|
||||||
|
handle = LoadLibrary(path);
|
||||||
|
} else {
|
||||||
|
handle = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (handle == nullptr) {
|
||||||
|
if (GetWindowsDirectory(path, sizeof(path)) != 0) {
|
||||||
|
strcat(path, "\\");
|
||||||
|
strcat(path, name);
|
||||||
|
handle = LoadLibrary(path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return handle;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef AVIAN_OPENJDK_SRC
|
#ifdef AVIAN_OPENJDK_SRC
|
||||||
|
|
||||||
extern "C" char* findJavaTZ_md(const char*, const char*);
|
extern "C" char* findJavaTZ_md(const char*, const char*);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user