Initial Commit
- initial default booting image
This commit is contained in:
@@ -0,0 +1,109 @@
|
||||
From c990ac56c441682b65a3dc699a753e1d924b40d1 Mon Sep 17 00:00:00 2001
|
||||
From: Alexey Brodkin <abrodkin@synopsys.com>
|
||||
Date: Mon, 18 Oct 2021 05:20:05 -0700
|
||||
Subject: [PATCH] Add ARCv2 ISA processors support to Zero
|
||||
|
||||
This adds ARCv2 processors support in OpenJDK via
|
||||
"Zero Assembly Project" (see https://openjdk.java.net/projects/zero).
|
||||
|
||||
That' a purely interpretive mode, so likely not that fast
|
||||
as JIT'ed version, but for starters it's much better than nothing.
|
||||
|
||||
Once all the logistical problems are solved hopefully this
|
||||
change will be accepted upstream.
|
||||
|
||||
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
|
||||
---
|
||||
make/autoconf/libraries.m4 | 8 ++++++++
|
||||
make/autoconf/platform.m4 | 8 ++++++++
|
||||
src/hotspot/os/linux/os_linux.cpp | 8 +++++++-
|
||||
3 files changed, 23 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/make/autoconf/libraries.m4 b/make/autoconf/libraries.m4
|
||||
index 51d4f724c33..41844933a14 100644
|
||||
--- a/make/autoconf/libraries.m4
|
||||
+++ b/make/autoconf/libraries.m4
|
||||
@@ -157,6 +157,14 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBRARIES],
|
||||
BASIC_JVM_LIBS="$BASIC_JVM_LIBS -lrt"
|
||||
fi
|
||||
|
||||
+ # Libatomic library
|
||||
+ # 32-bit ARC needs fallback library for 8-byte atomic ops
|
||||
+ # Inspired by a fix for MIPS, see https://github.com/openjdk/jdk/commit/1b3aa3af
|
||||
+ if test "x$OPENJDK_TARGET_OS" = xlinux &&
|
||||
+ (test "x$OPENJDK_TARGET_CPU" = xarc); then
|
||||
+ BASIC_JVM_LIBS="$BASIC_JVM_LIBS -latomic"
|
||||
+ fi
|
||||
+
|
||||
# perfstat lib
|
||||
if test "x$OPENJDK_TARGET_OS" = xaix; then
|
||||
BASIC_JVM_LIBS="$BASIC_JVM_LIBS -lperfstat"
|
||||
diff --git a/make/autoconf/platform.m4 b/make/autoconf/platform.m4
|
||||
index df610cc489b..2e21572ba4d 100644
|
||||
--- a/make/autoconf/platform.m4
|
||||
+++ b/make/autoconf/platform.m4
|
||||
@@ -54,6 +54,12 @@ AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_CPU],
|
||||
VAR_CPU_BITS=64
|
||||
VAR_CPU_ENDIAN=little
|
||||
;;
|
||||
+ arc)
|
||||
+ VAR_CPU=arc
|
||||
+ VAR_CPU_ARCH=arc
|
||||
+ VAR_CPU_BITS=32
|
||||
+ VAR_CPU_ENDIAN=little
|
||||
+ ;;
|
||||
arm*)
|
||||
VAR_CPU=arm
|
||||
VAR_CPU_ARCH=arm
|
||||
@@ -571,6 +577,8 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS_HELPER],
|
||||
HOTSPOT_$1_CPU_DEFINE=RISCV64
|
||||
|
||||
# The cpu defines below are for zero, we don't support them directly.
|
||||
+ elif test "x$OPENJDK_$1_CPU" = xarc; then
|
||||
+ HOTSPOT_$1_CPU_DEFINE=ARC
|
||||
elif test "x$OPENJDK_$1_CPU" = xsparc; then
|
||||
HOTSPOT_$1_CPU_DEFINE=SPARC
|
||||
elif test "x$OPENJDK_$1_CPU" = xppc; then
|
||||
diff --git a/src/hotspot/os/linux/os_linux.cpp b/src/hotspot/os/linux/os_linux.cpp
|
||||
index 492300a37d4..3a10790f4a0 100644
|
||||
--- a/src/hotspot/os/linux/os_linux.cpp
|
||||
+++ b/src/hotspot/os/linux/os_linux.cpp
|
||||
@@ -1663,6 +1663,9 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen) {
|
||||
#ifndef EM_AARCH64
|
||||
#define EM_AARCH64 183 /* ARM AARCH64 */
|
||||
#endif
|
||||
+#ifndef EM_ARC_COMPACT2
|
||||
+ #define EM_ARC_COMPACT2 195 /* ARC ARCv2 ISA */
|
||||
+#endif
|
||||
#ifndef EM_RISCV
|
||||
#define EM_RISCV 243 /* RISC-V */
|
||||
#endif
|
||||
@@ -1687,6 +1690,7 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen) {
|
||||
{EM_SH, EM_SH, ELFCLASS32, ELFDATA2MSB, (char*)"SuperH BE"},
|
||||
#endif
|
||||
{EM_ARM, EM_ARM, ELFCLASS32, ELFDATA2LSB, (char*)"ARM"},
|
||||
+ {EM_ARC_COMPACT2, EM_ARC_COMPACT2, ELFCLASS32, ELFDATA2LSB, (char*)"ARC"},
|
||||
// we only support 64 bit z architecture
|
||||
{EM_S390, EM_S390, ELFCLASS64, ELFDATA2MSB, (char*)"IBM System/390"},
|
||||
{EM_ALPHA, EM_ALPHA, ELFCLASS64, ELFDATA2LSB, (char*)"Alpha"},
|
||||
@@ -1719,6 +1723,8 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen) {
|
||||
static Elf32_Half running_arch_code=EM_PPC;
|
||||
#elif (defined AARCH64)
|
||||
static Elf32_Half running_arch_code=EM_AARCH64;
|
||||
+#elif (defined ARC)
|
||||
+ static Elf32_Half running_arch_code=EM_ARC_COMPACT2;
|
||||
#elif (defined ARM)
|
||||
static Elf32_Half running_arch_code=EM_ARM;
|
||||
#elif (defined S390)
|
||||
@@ -1741,7 +1747,7 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen) {
|
||||
static Elf32_Half running_arch_code=EM_LOONGARCH;
|
||||
#else
|
||||
#error Method os::dll_load requires that one of following is defined:\
|
||||
- AARCH64, ALPHA, ARM, AMD64, IA32, IA64, LOONGARCH64, M68K, MIPS, MIPSEL, PARISC, __powerpc__, __powerpc64__, RISCV, S390, SH, __sparc
|
||||
+ AARCH64, ALPHA, ARC, ARM, AMD64, IA32, IA64, LOONGARCH64, M68K, MIPS, MIPSEL, PARISC, __powerpc__, __powerpc64__, RISCV, S390, SH, __sparc
|
||||
#endif
|
||||
|
||||
// Identify compatibility class for VM's architecture and library's architecture
|
||||
--
|
||||
2.43.0
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
From 13a908b3d192e477b7572b522837efd771f5e2f9 Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Devoogdt <thomas@devoogdt.com>
|
||||
Date: Thu, 13 Nov 2025 17:23:44 +0100
|
||||
Subject: [PATCH] awt: fix HEADLESS compilation without X11
|
||||
|
||||
Upstream: https://github.com/openjdk/jdk/pull/28310
|
||||
Signed-off-by: Thomas Devoogdt <thomas@devoogdt.com>
|
||||
---
|
||||
make/modules/java.desktop/lib/Awt2dLibraries.gmk | 16 ++++++++++++++--
|
||||
.../unix/native/common/awt/utility/rect.h | 4 ++--
|
||||
2 files changed, 16 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/make/modules/java.desktop/lib/Awt2dLibraries.gmk b/make/modules/java.desktop/lib/Awt2dLibraries.gmk
|
||||
index a33f219e83e..de57e88a4ce 100644
|
||||
--- a/make/modules/java.desktop/lib/Awt2dLibraries.gmk
|
||||
+++ b/make/modules/java.desktop/lib/Awt2dLibraries.gmk
|
||||
@@ -77,6 +77,10 @@ ifeq ($(call isTargetOs, windows), true)
|
||||
#
|
||||
endif
|
||||
|
||||
+ifeq ($(ENABLE_HEADLESS_ONLY), true)
|
||||
+ LIBAWT_CFLAGS += -DHEADLESS
|
||||
+endif
|
||||
+
|
||||
ifeq ($(call isTargetOs, linux macosx aix), true)
|
||||
LIBAWT_EXFILES += awt_Font.c CUPSfuncs.c fontpath.c X11Color.c
|
||||
endif
|
||||
@@ -368,13 +372,20 @@ ifeq ($(call isTargetOs, windows macosx), false)
|
||||
$(TOPDIR)/src/$(MODULE)/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
|
||||
#
|
||||
|
||||
- LIBAWT_HEADLESS_EXCLUDES := medialib
|
||||
+ LIBAWT_HEADLESS_EXCLUDES := medialib opengl
|
||||
+
|
||||
+ LIBAWT_HEADLESS_EXCLUDE_FILES := \
|
||||
+ GLXGraphicsConfig.c \
|
||||
+ GLXSurfaceData.c \
|
||||
+ X11PMBlitLoops.c \
|
||||
+ X11Renderer.c \
|
||||
+ X11SurfaceData.c \
|
||||
+ #
|
||||
|
||||
LIBAWT_HEADLESS_EXTRA_HEADER_DIRS := \
|
||||
$(LIBAWT_DEFAULT_HEADER_DIRS) \
|
||||
common/awt/debug \
|
||||
common/font \
|
||||
- common/java2d/opengl \
|
||||
#
|
||||
|
||||
LIBAWT_HEADLESS_CFLAGS := $(CUPS_CFLAGS) $(FONTCONFIG_CFLAGS) $(X_CFLAGS) \
|
||||
@@ -384,6 +395,7 @@ ifeq ($(call isTargetOs, windows macosx), false)
|
||||
NAME := awt_headless, \
|
||||
EXTRA_SRC := $(LIBAWT_HEADLESS_EXTRA_SRC), \
|
||||
EXCLUDES := $(LIBAWT_HEADLESS_EXCLUDES), \
|
||||
+ EXCLUDE_FILES := $(LIBAWT_HEADLESS_EXCLUDE_FILES), \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) \
|
||||
$(LIBAWT_HEADLESS_CFLAGS), \
|
||||
diff --git a/src/java.desktop/unix/native/common/awt/utility/rect.h b/src/java.desktop/unix/native/common/awt/utility/rect.h
|
||||
index ceea38f4349..91b5a17ec58 100644
|
||||
--- a/src/java.desktop/unix/native/common/awt/utility/rect.h
|
||||
+++ b/src/java.desktop/unix/native/common/awt/utility/rect.h
|
||||
@@ -28,7 +28,7 @@
|
||||
#ifndef _AWT_RECT_H
|
||||
#define _AWT_RECT_H
|
||||
|
||||
-#ifndef MACOSX
|
||||
+#if !defined(HEADLESS) && !defined(MACOSX)
|
||||
#include <X11/Xlib.h>
|
||||
typedef XRectangle RECT_T;
|
||||
#else
|
||||
@@ -39,7 +39,7 @@ typedef struct {
|
||||
int width;
|
||||
int height;
|
||||
} RECT_T;
|
||||
-#endif /* !MACOSX */
|
||||
+#endif /* !HEADLESS && !MACOSX */
|
||||
|
||||
#define RECT_EQ_X(r1,r2) ((r1).x==(r2).x && (r1).width==(r2).width)
|
||||
|
||||
--
|
||||
2.43.0
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
From 46b9a0ad24f7f299ff23e13bc8ef01c188d246b6 Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Devoogdt <thomas@devoogdt.com>
|
||||
Date: Thu, 13 Nov 2025 23:10:20 +0100
|
||||
Subject: [PATCH] autoconf: libraries: drop the need for X11 in headless mode
|
||||
|
||||
Upstream: https://github.com/openjdk/jdk/pull/28310
|
||||
Signed-off-by: Thomas Devoogdt <thomas@devoogdt.com>
|
||||
---
|
||||
make/autoconf/libraries.m4 | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/make/autoconf/libraries.m4 b/make/autoconf/libraries.m4
|
||||
index 51d4f724c33..6a8b925c3f2 100644
|
||||
--- a/make/autoconf/libraries.m4
|
||||
+++ b/make/autoconf/libraries.m4
|
||||
@@ -42,12 +42,12 @@ m4_include([lib-tests.m4])
|
||||
AC_DEFUN_ONCE([LIB_DETERMINE_DEPENDENCIES],
|
||||
[
|
||||
# Check if X11 is needed
|
||||
- if test "x$OPENJDK_TARGET_OS" = xwindows || test "x$OPENJDK_TARGET_OS" = xmacosx; then
|
||||
- # No X11 support on windows or macosx
|
||||
+ if test "x$OPENJDK_TARGET_OS" = xwindows ||
|
||||
+ test "x$OPENJDK_TARGET_OS" = xmacosx ||
|
||||
+ test "x$ENABLE_HEADLESS_ONLY" = xtrue; then
|
||||
NEEDS_LIB_X11=false
|
||||
else
|
||||
- # All other instances need X11, even if building headless only, libawt still
|
||||
- # needs X11 headers.
|
||||
+ # All other instances need X11 for libawt.
|
||||
NEEDS_LIB_X11=true
|
||||
fi
|
||||
|
||||
--
|
||||
2.43.0
|
||||
|
||||
Reference in New Issue
Block a user