This commit is contained in:
TriForceX
2021-03-13 22:13:38 -03:00
parent c77595adbd
commit b3ecc6e32d
7043 changed files with 119377 additions and 73694 deletions

View File

@@ -0,0 +1,119 @@
From 58911e9de888aece29f491995a8b8a31f7d6b424 Mon Sep 17 00:00:00 2001
From: Patrick Zhang <patrick.zhang@amperecomputing.com>
Date: Wed, 05 Feb 2020 17:14:15 -0700
Subject: [PATCH] fix gcc 10 support
This patch fixes the "multiple definition" link errors with GCC10 due to
GCC10 setting -fno-common by default.
This is a combination of the following upstream commits:
- https://hg.openjdk.java.net/jdk/jdk/rev/8e6fa89397ca
- https://hg.openjdk.java.net/jdk/jdk/rev/6925fca95959
- https://hg.openjdk.java.net/jdk/jdk/rev/9e54ea7d9cd9
Signed-off-by: Patrick Zhang <patrick.zhang@amperecomputing.com>
Signed-off-by: Adam Duskett <Aduskett@gmail.com>
---
src/java.base/unix/native/libjava/childproc.c | 1 +
src/java.base/unix/native/libjava/childproc.h | 2 +-
.../share/native/libj2gss/NativeFunc.c | 3 +++
.../share/native/libj2gss/NativeFunc.h | 2 +-
src/jdk.sctp/unix/native/libsctp/Sctp.h | 12 ++++++------
src/jdk.sctp/unix/native/libsctp/SctpNet.c | 7 +++++++
6 files changed, 19 insertions(+), 8 deletions(-)
diff --git a/src/java.base/unix/native/libjava/childproc.c b/src/java.base/unix/native/libjava/childproc.c
index 811aaeac5..16480bfbf 100644
--- a/src/java.base/unix/native/libjava/childproc.c
+++ b/src/java.base/unix/native/libjava/childproc.c
@@ -33,6 +33,7 @@
#include "childproc.h"
+const char * const *parentPathv;
ssize_t
restartableWrite(int fd, const void *buf, size_t count)
diff --git a/src/java.base/unix/native/libjava/childproc.h b/src/java.base/unix/native/libjava/childproc.h
index 091150930..d57e44b6e 100644
--- a/src/java.base/unix/native/libjava/childproc.h
+++ b/src/java.base/unix/native/libjava/childproc.h
@@ -118,7 +118,7 @@ typedef struct _SpawnInfo {
* The cached and split version of the JDK's effective PATH.
* (We don't support putenv("PATH=...") in native code)
*/
-const char * const *parentPathv;
+extern const char * const *parentPathv;
ssize_t restartableWrite(int fd, const void *buf, size_t count);
int restartableDup2(int fd_from, int fd_to);
diff --git a/src/java.security.jgss/share/native/libj2gss/NativeFunc.c b/src/java.security.jgss/share/native/libj2gss/NativeFunc.c
index da7bc0445..5941f7b5a 100644
--- a/src/java.security.jgss/share/native/libj2gss/NativeFunc.c
+++ b/src/java.security.jgss/share/native/libj2gss/NativeFunc.c
@@ -27,6 +27,9 @@
#include <stdlib.h>
#include "NativeFunc.h"
+/* global GSS function table */
+GSS_FUNCTION_TABLE_PTR ftab;
+
/* standard GSS method names (ordering is from mapfile) */
static const char RELEASE_NAME[] = "gss_release_name";
static const char IMPORT_NAME[] = "gss_import_name";
diff --git a/src/java.security.jgss/share/native/libj2gss/NativeFunc.h b/src/java.security.jgss/share/native/libj2gss/NativeFunc.h
index 82914387c..e4a4981a3 100644
--- a/src/java.security.jgss/share/native/libj2gss/NativeFunc.h
+++ b/src/java.security.jgss/share/native/libj2gss/NativeFunc.h
@@ -277,6 +277,6 @@ typedef struct GSS_FUNCTION_TABLE {
typedef GSS_FUNCTION_TABLE *GSS_FUNCTION_TABLE_PTR;
/* global GSS function table */
-GSS_FUNCTION_TABLE_PTR ftab;
+extern GSS_FUNCTION_TABLE_PTR ftab;
#endif
diff --git a/src/jdk.sctp/unix/native/libsctp/Sctp.h b/src/jdk.sctp/unix/native/libsctp/Sctp.h
index cc1367f78..46b07db0a 100644
--- a/src/jdk.sctp/unix/native/libsctp/Sctp.h
+++ b/src/jdk.sctp/unix/native/libsctp/Sctp.h
@@ -322,12 +322,12 @@ typedef int sctp_peeloff_func(int sock, sctp_assoc_t id);
#endif /* __linux__ */
-sctp_getladdrs_func* nio_sctp_getladdrs;
-sctp_freeladdrs_func* nio_sctp_freeladdrs;
-sctp_getpaddrs_func* nio_sctp_getpaddrs;
-sctp_freepaddrs_func* nio_sctp_freepaddrs;
-sctp_bindx_func* nio_sctp_bindx;
-sctp_peeloff_func* nio_sctp_peeloff;
+extern sctp_getladdrs_func* nio_sctp_getladdrs;
+extern sctp_freeladdrs_func* nio_sctp_freeladdrs;
+extern sctp_getpaddrs_func* nio_sctp_getpaddrs;
+extern sctp_freepaddrs_func* nio_sctp_freepaddrs;
+extern sctp_bindx_func* nio_sctp_bindx;
+extern sctp_peeloff_func* nio_sctp_peeloff;
jboolean loadSocketExtensionFuncs(JNIEnv* env);
diff --git a/src/jdk.sctp/unix/native/libsctp/SctpNet.c b/src/jdk.sctp/unix/native/libsctp/SctpNet.c
index d40c15aa3..ab9b6e093 100644
--- a/src/jdk.sctp/unix/native/libsctp/SctpNet.c
+++ b/src/jdk.sctp/unix/native/libsctp/SctpNet.c
@@ -43,6 +43,13 @@ static jmethodID isaCtrID = 0;
static const char* nativeSctpLib = "libsctp.so.1";
static jboolean funcsLoaded = JNI_FALSE;
+sctp_getladdrs_func* nio_sctp_getladdrs;
+sctp_freeladdrs_func* nio_sctp_freeladdrs;
+sctp_getpaddrs_func* nio_sctp_getpaddrs;
+sctp_freepaddrs_func* nio_sctp_freepaddrs;
+sctp_bindx_func* nio_sctp_bindx;
+sctp_peeloff_func* nio_sctp_peeloff;
+
JNIEXPORT jint JNICALL DEF_JNI_OnLoad
(JavaVM *vm, void *reserved) {
return JNI_VERSION_1_2;
--
2.26.2

View File

@@ -0,0 +1,119 @@
From 58911e9de888aece29f491995a8b8a31f7d6b424 Mon Sep 17 00:00:00 2001
From: Patrick Zhang <patrick.zhang@amperecomputing.com>
Date: Wed, 05 Feb 2020 17:14:15 -0700
Subject: [PATCH] fix gcc 10 support
This patch fixes the "multiple definition" link errors with GCC10 due to
GCC10 setting -fno-common by default.
This is a combination of the following upstream commits:
- https://hg.openjdk.java.net/jdk/jdk/rev/8e6fa89397ca
- https://hg.openjdk.java.net/jdk/jdk/rev/6925fca95959
- https://hg.openjdk.java.net/jdk/jdk/rev/9e54ea7d9cd9
Signed-off-by: Patrick Zhang <patrick.zhang@amperecomputing.com>
Signed-off-by: Adam Duskett <Aduskett@gmail.com>
---
src/java.base/unix/native/libjava/childproc.c | 1 +
src/java.base/unix/native/libjava/childproc.h | 2 +-
.../share/native/libj2gss/NativeFunc.c | 3 +++
.../share/native/libj2gss/NativeFunc.h | 2 +-
src/jdk.sctp/unix/native/libsctp/Sctp.h | 12 ++++++------
src/jdk.sctp/unix/native/libsctp/SctpNet.c | 7 +++++++
6 files changed, 19 insertions(+), 8 deletions(-)
diff --git a/src/java.base/unix/native/libjava/childproc.c b/src/java.base/unix/native/libjava/childproc.c
index 811aaeac5..16480bfbf 100644
--- a/src/java.base/unix/native/libjava/childproc.c
+++ b/src/java.base/unix/native/libjava/childproc.c
@@ -34,6 +34,7 @@
#include "childproc.h"
+const char * const *parentPathv;
ssize_t
restartableWrite(int fd, const void *buf, size_t count)
diff --git a/src/java.base/unix/native/libjava/childproc.h b/src/java.base/unix/native/libjava/childproc.h
index 091150930..d57e44b6e 100644
--- a/src/java.base/unix/native/libjava/childproc.h
+++ b/src/java.base/unix/native/libjava/childproc.h
@@ -126,7 +126,7 @@ typedef struct _SpawnInfo {
* The cached and split version of the JDK's effective PATH.
* (We don't support putenv("PATH=...") in native code)
*/
-const char * const *parentPathv;
+extern const char * const *parentPathv;
ssize_t restartableWrite(int fd, const void *buf, size_t count);
int restartableDup2(int fd_from, int fd_to);
diff --git a/src/java.security.jgss/share/native/libj2gss/NativeFunc.c b/src/java.security.jgss/share/native/libj2gss/NativeFunc.c
index da7bc0445..5941f7b5a 100644
--- a/src/java.security.jgss/share/native/libj2gss/NativeFunc.c
+++ b/src/java.security.jgss/share/native/libj2gss/NativeFunc.c
@@ -27,6 +27,9 @@
#include <stdlib.h>
#include "NativeFunc.h"
+/* global GSS function table */
+GSS_FUNCTION_TABLE_PTR ftab;
+
/* standard GSS method names (ordering is from mapfile) */
static const char RELEASE_NAME[] = "gss_release_name";
static const char IMPORT_NAME[] = "gss_import_name";
diff --git a/src/java.security.jgss/share/native/libj2gss/NativeFunc.h b/src/java.security.jgss/share/native/libj2gss/NativeFunc.h
index 82914387c..e4a4981a3 100644
--- a/src/java.security.jgss/share/native/libj2gss/NativeFunc.h
+++ b/src/java.security.jgss/share/native/libj2gss/NativeFunc.h
@@ -277,6 +277,6 @@ typedef struct GSS_FUNCTION_TABLE {
typedef GSS_FUNCTION_TABLE *GSS_FUNCTION_TABLE_PTR;
/* global GSS function table */
-GSS_FUNCTION_TABLE_PTR ftab;
+extern GSS_FUNCTION_TABLE_PTR ftab;
#endif
diff --git a/src/jdk.sctp/unix/native/libsctp/Sctp.h b/src/jdk.sctp/unix/native/libsctp/Sctp.h
index cc1367f78..46b07db0a 100644
--- a/src/jdk.sctp/unix/native/libsctp/Sctp.h
+++ b/src/jdk.sctp/unix/native/libsctp/Sctp.h
@@ -322,12 +322,12 @@ typedef int sctp_peeloff_func(int sock, sctp_assoc_t id);
#endif /* __linux__ */
-sctp_getladdrs_func* nio_sctp_getladdrs;
-sctp_freeladdrs_func* nio_sctp_freeladdrs;
-sctp_getpaddrs_func* nio_sctp_getpaddrs;
-sctp_freepaddrs_func* nio_sctp_freepaddrs;
-sctp_bindx_func* nio_sctp_bindx;
-sctp_peeloff_func* nio_sctp_peeloff;
+extern sctp_getladdrs_func* nio_sctp_getladdrs;
+extern sctp_freeladdrs_func* nio_sctp_freeladdrs;
+extern sctp_getpaddrs_func* nio_sctp_getpaddrs;
+extern sctp_freepaddrs_func* nio_sctp_freepaddrs;
+extern sctp_bindx_func* nio_sctp_bindx;
+extern sctp_peeloff_func* nio_sctp_peeloff;
jboolean loadSocketExtensionFuncs(JNIEnv* env);
diff --git a/src/jdk.sctp/unix/native/libsctp/SctpNet.c b/src/jdk.sctp/unix/native/libsctp/SctpNet.c
index d40c15aa3..ab9b6e093 100644
--- a/src/jdk.sctp/unix/native/libsctp/SctpNet.c
+++ b/src/jdk.sctp/unix/native/libsctp/SctpNet.c
@@ -43,6 +43,13 @@ static jmethodID isaCtrID = 0;
static const char* nativeSctpLib = "libsctp.so.1";
static jboolean funcsLoaded = JNI_FALSE;
+sctp_getladdrs_func* nio_sctp_getladdrs;
+sctp_freeladdrs_func* nio_sctp_freeladdrs;
+sctp_getpaddrs_func* nio_sctp_getpaddrs;
+sctp_freepaddrs_func* nio_sctp_freepaddrs;
+sctp_bindx_func* nio_sctp_bindx;
+sctp_peeloff_func* nio_sctp_peeloff;
+
JNIEXPORT jint JNICALL DEF_JNI_OnLoad
(JavaVM *vm, void *reserved) {
return JNI_VERSION_1_2;
--
2.26.2

View File

@@ -11,7 +11,6 @@ config BR2_PACKAGE_OPENJDK_ARCH_SUPPORTS
default y if BR2_m68k
default y if BR2_powerpc || BR2_powerpc64 || BR2_powerpc64le
default y if BR2_sh
default y if BR2_sparc || BR2_sparc64
config BR2_PACKAGE_OPENJDK
bool "openjdk"
@@ -49,6 +48,74 @@ config BR2_PACKAGE_OPENJDK
if BR2_PACKAGE_OPENJDK
choice
prompt "openjdk version"
default BR2_OPENJDK_VERSION_LATEST
help
Select the version of OpenJDK you wish to use.
config BR2_OPENJDK_VERSION_LTS
bool "LTS (OpenJDK 11)"
config BR2_OPENJDK_VERSION_LATEST
bool "latest (OpenJDK 14)"
endchoice
config BR2_PACKAGE_OPENJDK_FULL_JDK
bool "Build the full JDK"
help
Install the full JDK instead of just the run time.
The full JDK includes several packages used for debugging and
development. Some useful tools included with the JDK are:
- javaws
Command line tool for launching Java Web Start and setting
various options.
- jcmd:
JVM Diagnostic Commands tool: Sends diagnostic command
requests to a running Java Virtual Machine.
- jinfo
Configuration Info for Java: Prints configuration
information for a given process or core file or a remote
debug server.
- jmap
Memory Map for Java: Prints shared object memory maps or
heap memory details of a given process or core file or a
remote debug server.
- jsadebugd
Serviceability Agent Debug Daemon for Java: Attaches to a
process or core file and acts as a debug server.
- jstack
Stack Trace for Java - Prints a stack trace of threads for
a given process or core file or remote debug server.
- jstat
JVM Statistics Monitoring Tool: Attaches to an
instrumented HotSpot Java virtual machine and collects and
logs performance statistics as specified by the command
line options.
- jstatd
JVM jstat Daemon - Launches an RMI server application that
monitors for the creation and termination of instrumented
HotSpot Java virtual machines and provides an interface to
allow remote monitoring tools to attach to Java virtual
machines running on the local system.
Note:
While the JDK also comes with several tools which can be used
for developing java applications on a target, Buildroot does
not support development on a target. Building the full JDK is
supported for debugging purposes only.
Selecting this option increases the file system by
approximately 110M.
choice
prompt "openjdk variant"
default BR2_PACKAGE_OPENJDK_JVM_VARIANT_SERVER if !BR2_powerpc

View File

@@ -1,3 +1,4 @@
# Locally computed
sha256 5f73d86ed516173965b27754f1bb21374ccb1194a17c2d89d8018280ce5ffa78 openjdk-12.0.2+10.tar.gz
sha256 4b9abebc4338048a7c2dc184e9f800deb349366bdf28eb23c2677a77b4c87726 LICENSE
sha256 dfb3607f1b675458f29a185a40f1dbbf896439cf33b3aa0f3d89df297e604935 jdk-14.0.2+12.tar.gz
sha256 7fc124b5e20428cd5df42d78b001abc663558b0881e66a5def0892b98265b6e9 jdk-11.0.8+10.tar.gz
sha256 4b9abebc4338048a7c2dc184e9f800deb349366bdf28eb23c2677a77b4c87726 LICENSE

View File

@@ -4,12 +4,23 @@
#
################################################################################
OPENJDK_VERSION_MAJOR = 12.0.2
ifeq ($(BR2_OPENJDK_VERSION_LATEST),y)
OPENJDK_VERSION_MAJOR = 14.0.2
OPENJDK_VERSION_MINOR = 12
OPENJDK_VERSION = $(OPENJDK_VERSION_MAJOR)+$(OPENJDK_VERSION_MINOR)
OPENJDK_SOURCE = jdk-$(OPENJDK_VERSION).tar.gz
OPENJDK_SITE = https://hg.openjdk.java.net/jdk-updates/jdk14u/archive
else
OPENJDK_VERSION_MAJOR = 11.0.8
OPENJDK_VERSION_MINOR = 10
OPENJDK_VERSION = $(OPENJDK_VERSION_MAJOR)+$(OPENJDK_VERSION_MINOR)
OPENJDK_SITE = $(call github,AdoptOpenJDK,openjdk-jdk12u,jdk-$(OPENJDK_VERSION))
OPENJDK_SOURCE = jdk-$(OPENJDK_VERSION).tar.gz
OPENJDK_SITE = https://hg.openjdk.java.net/jdk-updates/jdk11u/archive
endif
OPENJDK_LICENSE = GPL-2.0+ with exception
OPENJDK_LICENSE_FILES = LICENSE
OPENJDK_INSTALL_STAGING = YES
# OpenJDK requires Alsa, cups, and X11 even for a headless build.
# host-zip is needed for the zip executable.
@@ -45,6 +56,21 @@ OPENJDK_JVM_VARIANT = zero
OPENJDK_DEPENDENCIES += libffi
endif
ifeq ($(BR2_PACKAGE_OPENJDK_FULL_JDK),y)
OPENJDK_VARIANT = jdk
OPENJDK_MAKE_TARGET = jdk-image
else
OPENJDK_VARIANT = jre
OPENJDK_MAKE_TARGET = legacy-jre-image
endif
# OpenJDK installs a file named 'modules' in jre/lib, which gets installed as
# /usr/lib/modules. However, with a merged /usr, this conflicts with the
# directory named 'modules' installed by the kernel. If OpenJDK gets built
# after the kernel, this manifests itself with: "cp: cannot overwrite
# directory '/usr/lib/modules with non-directory."
OPENJDK_INSTALL_BASE = /usr/lib/jvm
# OpenJDK ignores some variables unless passed via the environment.
# These variables are PATH, LD, CC, CXX, and CPP.
# OpenJDK defaults ld to the ld binary but passes -Xlinker and -z as
@@ -68,11 +94,13 @@ OPENJDK_CONF_OPTS = \
--enable-openjdk-only \
--enable-unlimited-crypto \
--openjdk-target=$(GNU_TARGET_NAME) \
--with-boot-jdk=$(HOST_DIR) \
--with-boot-jdk=$(HOST_OPENJDK_BIN_ROOT_DIR) \
--with-stdc++lib=dynamic \
--with-debug-level=release \
--with-devkit=$(HOST_DIR) \
--with-extra-cflags="$(TARGET_CFLAGS)" \
--with-extra-cxxflags="$(TARGET_CXXFLAGS)" \
--with-extra-ldflags="-Wl,-rpath,$(OPENJDK_INSTALL_BASE)/lib,-rpath,$(OPENJDK_INSTALL_BASE)/lib/$(OPENJDK_JVM_VARIANT)" \
--with-giflib=system \
--with-jobs=$(PARALLEL_JOBS) \
--with-jvm-variants=$(OPENJDK_JVM_VARIANT) \
@@ -83,9 +111,6 @@ OPENJDK_CONF_OPTS = \
--with-native-debug-symbols=none \
--without-version-pre \
--with-sysroot=$(STAGING_DIR) \
--with-vendor-name="AdoptOpenJDK" \
--with-vendor-url="https://adoptopenjdk.net/" \
--with-vendor-version-string="AdoptOpenJDK" \
--with-version-build="$(OPENJDK_VERSION_MAJOR)" \
--with-version-string="$(OPENJDK_VERSION_MAJOR)"
@@ -109,14 +134,31 @@ endef
# Make -jn is unsupported. Instead, set the "--with-jobs=" configure option,
# and use $(MAKE1).
define OPENJDK_BUILD_CMDS
$(TARGET_MAKE_ENV) $(MAKE1) -C $(@D) legacy-jre-image
$(TARGET_MAKE_ENV) $(OPENJDK_CONF_ENV) $(MAKE1) -C $(@D) $(OPENJDK_MAKE_TARGET)
endef
# Calling make install always builds and installs the JDK instead of the JRE,
# which makes manual installation necessary.
define OPENJDK_INSTALL_TARGET_CMDS
cp -dpfr $(@D)/build/linux-*-release/images/jre/bin/* $(TARGET_DIR)/usr/bin/
cp -dpfr $(@D)/build/linux-*-release/images/jre/lib/* $(TARGET_DIR)/usr/lib/
mkdir -p $(TARGET_DIR)$(OPENJDK_INSTALL_BASE)
cp -dpfr $(@D)/build/linux-*-release/images/$(OPENJDK_VARIANT)/* \
$(TARGET_DIR)$(OPENJDK_INSTALL_BASE)/
cd $(TARGET_DIR)/usr/bin && ln -snf ../..$(OPENJDK_INSTALL_BASE)/bin/* .
endef
define OPENJDK_INSTALL_STAGING_CMDS
mkdir -p $(STAGING_DIR)/usr/include/jvm
cp -dpfr $(@D)/build/linux-*-release/jdk/include/* \
$(STAGING_DIR)/usr/include/jvm
endef
# Demos and includes are not needed on the target
ifeq ($(BR2_PACKAGE_OPENJDK_FULL_JDK),y)
define OPENJDK_REMOVE_UNEEDED_JDK_DIRECTORIES
$(RM) -r $(TARGET_DIR)$(OPENJDK_INSTALL_BASE)/include/
$(RM) -r $(TARGET_DIR)$(OPENJDK_INSTALL_BASE)/demo/
endef
OPENJDK_TARGET_FINALIZE_HOOKS += OPENJDK_REMOVE_UNEEDED_JDK_DIRECTORIES
endif
$(eval $(generic-package))