aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r--gnu/packages/patches/dconf-meson-0.52.patch19
-rw-r--r--gnu/packages/patches/gdb-hurd.patch69
-rw-r--r--gnu/packages/patches/grim-revert-output-rotation.patch27
-rw-r--r--gnu/packages/patches/icedtea-6-extend-hotspot-aarch64-support.patch1831
-rw-r--r--gnu/packages/patches/icedtea-6-hotspot-gcc-segfault-workaround.patch42
-rw-r--r--gnu/packages/patches/icedtea-7-hotspot-aarch64-use-c++98.patch33
-rw-r--r--gnu/packages/patches/icedtea-7-hotspot-gcc-segfault-workaround.patch45
-rw-r--r--gnu/packages/patches/jamvm-1.5.1-aarch64-support.patch572
-rw-r--r--gnu/packages/patches/jamvm-1.5.1-armv7-support.patch (renamed from gnu/packages/patches/jamvm-arm.patch)0
-rw-r--r--gnu/packages/patches/jamvm-2.0.0-aarch64-support.patch645
-rw-r--r--gnu/packages/patches/jamvm-2.0.0-opcode-guard.patch35
-rw-r--r--gnu/packages/patches/java-tunnelvisionlabs-antlr-code-too-large.patch87
-rw-r--r--gnu/packages/patches/libcyaml-libyaml-compat.patch51
-rw-r--r--gnu/packages/patches/libdrm-realpath-virtio.patch42
-rw-r--r--gnu/packages/patches/libsndfile-CVE-2017-12562.patch97
-rw-r--r--gnu/packages/patches/libsndfile-CVE-2017-8361-8363-8365.patch77
-rw-r--r--gnu/packages/patches/libsndfile-CVE-2017-8362.patch61
-rw-r--r--gnu/packages/patches/libsndfile-armhf-type-checks.patch42
-rw-r--r--gnu/packages/patches/mariadb-client-test-32bit.patch37
-rw-r--r--gnu/packages/patches/nss-pkgconfig.patch225
-rw-r--r--gnu/packages/patches/python-gst-fix-build-with-python-3.8.patch36
-rw-r--r--gnu/packages/patches/sbcl-graph-asdf-definitions.patch70
22 files changed, 3323 insertions, 820 deletions
diff --git a/gnu/packages/patches/dconf-meson-0.52.patch b/gnu/packages/patches/dconf-meson-0.52.patch
deleted file mode 100644
index c636edc108..0000000000
--- a/gnu/packages/patches/dconf-meson-0.52.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-Fix build failure with Meson 0.52.
-
-Taken from upstream:
-https://gitlab.gnome.org/GNOME/dconf/commit/7ad890fb7a2ec90a777a756a1fa20a615ec7245e
-https://gitlab.gnome.org/GNOME/dconf/merge_requests/54
-
-diff --git a/client/meson.build b/client/meson.build
-index f3b7122cb05bfa7bb481c487e3cd052aa1ad58e5..de6387e2cac2aba12b83f2614c277bada434fd16 100644
---- a/client/meson.build
-+++ b/client/meson.build
-@@ -28,7 +28,7 @@ libdconf_client = static_library(
-
- libdconf_client_dep = declare_dependency(
- dependencies: gio_dep,
-- link_whole: libdconf_client,
-+ link_with: libdconf_client,
- )
-
- libdconf = shared_library(
diff --git a/gnu/packages/patches/gdb-hurd.patch b/gnu/packages/patches/gdb-hurd.patch
new file mode 100644
index 0000000000..0af8d4dc28
--- /dev/null
+++ b/gnu/packages/patches/gdb-hurd.patch
@@ -0,0 +1,69 @@
+Taken from upstream, removed ChangeLog.
+
+From 6930bffe3373690b3431d6291f9f7c116d6a1ec4 Mon Sep 17 00:00:00 2001
+From: Samuel Thibault <samuel.thibault@ens-lyon.org>
+Date: Sat, 30 May 2020 18:35:59 +0000
+Subject: [PATCH] hurd: fix gnu_debug_flag type
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Fixes
+
+../../gdb/gnu-nat.c:96:6: error: conflicting declaration ‘bool gnu_debug_flag’
+ 96 | bool gnu_debug_flag = false;
+../../gdb/gnu-nat.c: In function ‘void _initialize_gnu_nat()’:
+../../gdb/gnu-nat.c:3511:7: error: cannot
+
+gdb/ChangeLog:
+
+ * gnu-nat.h (gnu_debug_flag): Set type to bool.
+---
+ gdb/ChangeLog | 4 ++++
+ gdb/gnu-nat.h | 2 +-
+ 2 files changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/gdb/gnu-nat.h b/gdb/gnu-nat.h
+index 77c57817b2..766f716587 100644
+--- a/gdb/gnu-nat.h
++++ b/gdb/gnu-nat.h
+@@ -111,7 +111,7 @@ extern char *proc_string (struct proc *proc);
+ __proc_pid (__proc), __proc->tid, \
+ host_address_to_string (__proc) , ##args); } while (0)
+
+-extern int gnu_debug_flag;
++extern bool gnu_debug_flag;
+
+ #define debug(msg, args...) \
+ do { if (gnu_debug_flag) \
+--
+Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
+Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com
+
+commit 366f550a593c7e6bae3699a4b6d65fe937af5603
+Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
+Date: Sat May 30 18:41:30 2020 +0000
+
+ hurd: add missing include
+
+ Fixes
+
+ ../../gdb/gnu-nat.c:2522:14: error: ‘target_gdbarch’ was not declared in this scope; did you mean ‘target_detach’?
+ 2522 | paddress (target_gdbarch (), memaddr), pulongest (len),
+
+ gdb/Changelog:
+
+ * gnu-nat.c: Include "gdbarch.h".
+
+diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c
+index 3b438a9a43..9b93488b41 100644
+--- a/gdb/gnu-nat.c
++++ b/gdb/gnu-nat.c
+@@ -64,6 +64,7 @@ extern "C"
+ #include "language.h"
+ #include "target.h"
+ #include "gdbsupport/gdb_wait.h"
++#include "gdbarch.h"
+ #include "gdbcmd.h"
+ #include "gdbcore.h"
+ #include "gdbthread.h"
diff --git a/gnu/packages/patches/grim-revert-output-rotation.patch b/gnu/packages/patches/grim-revert-output-rotation.patch
deleted file mode 100644
index cbf0a86502..0000000000
--- a/gnu/packages/patches/grim-revert-output-rotation.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From 80b17ceaff90b81b28b44004d2aca4cc40f365be Mon Sep 17 00:00:00 2001
-From: Tobias Geerinckx-Rice <me@tobias.gr>
-Date: Fri, 2 Oct 2020 00:07:30 +0200
-Subject: [PATCH] Revert "Correct interpretation of output rotation"
-
-This reverts commit 8f9d60885ce2f9bd66cd93d3378dcb6866d4588a.
-It is incompatible with the current Sway version (1.4) in Guix.
----
- render.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/render.c b/render.c
-index 8f31e7e..a6b0b12 100644
---- a/render.c
-+++ b/render.c
-@@ -104,7 +104,7 @@ cairo_surface_t *render(struct grim_state *state, struct grim_box *geometry,
- cairo_matrix_translate(&matrix,
- (double)output->geometry.width / 2,
- (double)output->geometry.height / 2);
-- cairo_matrix_rotate(&matrix, get_output_rotation(output->transform));
-+ cairo_matrix_rotate(&matrix, -get_output_rotation(output->transform));
- cairo_matrix_scale(&matrix,
- (double)raw_output_width / output_width * output_flipped_x,
- (double)raw_output_height / output_height * output_flipped_y);
---
-2.28.0
-
diff --git a/gnu/packages/patches/icedtea-6-extend-hotspot-aarch64-support.patch b/gnu/packages/patches/icedtea-6-extend-hotspot-aarch64-support.patch
new file mode 100644
index 0000000000..9dc112a344
--- /dev/null
+++ b/gnu/packages/patches/icedtea-6-extend-hotspot-aarch64-support.patch
@@ -0,0 +1,1831 @@
+From d51cb8c0f7966ac0b870e90e421cc8a796d98abf Mon Sep 17 00:00:00 2001
+From: Simon South <simon@simonsouth.net>
+Date: Tue, 9 Jun 2020 13:48:42 -0400
+Subject: [PATCH] Extend AArch64 support
+
+This adds to IcedTea 6 a patch that extends the support for AArch64 in
+its version of HotSpot, allowing the portable Zero virtual machine to
+be built for that platform.
+
+The patch added is a backport of the one prepared for JDK 9 by the
+OpenJDK AArch64 Porting Project, available (as of 11 June 2020) for
+download from https://openjdk.java.net/jeps/237.
+---
+ Makefile.am | 3 +-
+ Makefile.in | 12 +-
+ .../hs23/aarch64-extended-support.patch | 1766 +++++++++++++++++
+ 3 files changed, 1775 insertions(+), 6 deletions(-)
+ create mode 100644 patches/hotspot/hs23/aarch64-extended-support.patch
+
+diff --git a/Makefile.am b/Makefile.am
+index 97dac85..f5c917b 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -621,7 +621,8 @@ ICEDTEA_PATCHES = \
+ patches/openjdk/6260348-pr3068.patch \
+ patches/openjdk/6961123-pr2975.patch \
+ patches/pr2800-missing_resources.patch \
+- patches/pr3213-conditional_arm32jit.patch
++ patches/pr3213-conditional_arm32jit.patch \
++ patches/hotspot/hs23/aarch64-extended-support.patch
+
+ if WITH_RHINO
+ ICEDTEA_PATCHES += \
+diff --git a/Makefile.in b/Makefile.in
+index aced7c2..e3545ee 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -1049,11 +1049,13 @@ ICEDTEA_PATCHES = $(DROP_PATCHES) $(SECURITY_PATCHES) \
+ patches/openjdk/6260348-pr3068.patch \
+ patches/openjdk/6961123-pr2975.patch \
+ patches/pr2800-missing_resources.patch \
+- patches/pr3213-conditional_arm32jit.patch $(am__append_21) \
+- $(am__append_22) $(am__append_23) $(am__append_24) \
+- $(am__append_25) $(am__append_26) $(am__append_27) \
+- $(am__append_28) $(am__append_29) $(am__append_30) \
+- $(am__append_31) $(am__append_32) $(DISTRIBUTION_PATCHES)
++ patches/pr3213-conditional_arm32jit.patch \
++ patches/hotspot/hs23/aarch64-extended-support.patch \
++ $(am__append_21) $(am__append_22) $(am__append_23) \
++ $(am__append_24) $(am__append_25) $(am__append_26) \
++ $(am__append_27) $(am__append_28) $(am__append_29) \
++ $(am__append_30) $(am__append_31) $(am__append_32) \
++ $(DISTRIBUTION_PATCHES)
+ @ENABLE_NSS_FALSE@NSS_PATCHES = patches/nss-not-enabled-config.patch
+ @ENABLE_NSS_TRUE@NSS_PATCHES = patches/nss-config.patch
+
+diff --git a/patches/hotspot/hs23/aarch64-extended-support.patch b/patches/hotspot/hs23/aarch64-extended-support.patch
+new file mode 100644
+index 0000000..7817f4d
+--- /dev/null
++++ b/patches/hotspot/hs23/aarch64-extended-support.patch
+@@ -0,0 +1,1766 @@
++diff --git openjdk.orig/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c openjdk/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c
++index 5771fdd..b23cc17 100644
++--- openjdk.orig/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c
+++++ openjdk/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c
++@@ -304,6 +304,9 @@ JNIEXPORT jlongArray JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLo
++ #ifdef amd64
++ #define NPRGREG sun_jvm_hotspot_debugger_amd64_AMD64ThreadContext_NPRGREG
++ #endif
+++#ifdef aarch64
+++#define NPRGREG 32
+++#endif
++ #if defined(sparc) || defined(sparcv9)
++ #define NPRGREG sun_jvm_hotspot_debugger_sparc_SPARCThreadContext_NPRGREG
++ #endif
++@@ -406,6 +409,12 @@ JNIEXPORT jlongArray JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLo
++ regs[REG_INDEX(R_O7)] = gregs.u_regs[14];
++ #endif /* sparc */
++
+++#if defined(aarch64)
+++
+++#define REG_INDEX(reg) sun_jvm_hotspot_debugger_aarch64_AARCH64ThreadContext_##reg
+++
+++#endif /* aarch64 */
+++
++
++ (*env)->ReleaseLongArrayElements(env, array, regs, JNI_COMMIT);
++ return array;
++diff --git openjdk.orig/hotspot/agent/src/os/linux/libproc.h openjdk/hotspot/agent/src/os/linux/libproc.h
++index e4d77f7..c02b841 100644
++--- openjdk.orig/hotspot/agent/src/os/linux/libproc.h
+++++ openjdk/hotspot/agent/src/os/linux/libproc.h
++@@ -54,6 +54,10 @@ struct pt_regs {
++
++ #endif //sparc or sparcv9
++
+++#if defined(aarch64)
+++#include "asm/ptrace.h"
+++#endif
+++
++ /************************************************************************************
++
++ 0. This is very minimal subset of Solaris libproc just enough for current application.
++@@ -97,6 +101,9 @@ unsigned long regs[IA64_REG_COUNT]; /* integer and fp regs */
++ #if defined(sparc) || defined(sparcv9)
++ #define user_regs_struct pt_regs
++ #endif
+++#if defined(aarch64)
+++#define user_regs_struct user_pt_regs
+++#endif
++
++ // This C bool type must be int for compatibility with Linux calls and
++ // it would be a mistake to equivalence it to C++ bool on many platforms
++diff --git openjdk.orig/hotspot/make/defs.make openjdk/hotspot/make/defs.make
++index 44f21f8..4e8d00b 100644
++--- openjdk.orig/hotspot/make/defs.make
+++++ openjdk/hotspot/make/defs.make
++@@ -232,7 +232,7 @@ ifneq ($(OSNAME),windows)
++
++ # Use uname output for SRCARCH, but deal with platform differences. If ARCH
++ # is not explicitly listed below, it is treated as x86.
++- SRCARCH = $(ARCH/$(filter sparc sparc64 ia64 amd64 x86_64 arm ppc zero,$(ARCH)))
+++ SRCARCH = $(ARCH/$(filter sparc sparc64 ia64 amd64 x86_64 arm ppc aarch64 zero,$(ARCH)))
++ ARCH/ = x86
++ ARCH/sparc = sparc
++ ARCH/sparc64= sparc
++@@ -242,6 +242,7 @@ ifneq ($(OSNAME),windows)
++ ARCH/ppc64 = ppc
++ ARCH/ppc = ppc
++ ARCH/arm = arm
+++ ARCH/aarch64= aarch64
++ ARCH/zero = zero
++
++ # BUILDARCH is usually the same as SRCARCH, except for sparcv9
++@@ -267,11 +268,12 @@ ifneq ($(OSNAME),windows)
++ LIBARCH/sparcv9 = sparcv9
++ LIBARCH/ia64 = ia64
++ LIBARCH/ppc64 = ppc
+++ LIBARCH/aarch64 = aarch64
++ LIBARCH/ppc = ppc
++ LIBARCH/arm = arm
++ LIBARCH/zero = $(ZERO_LIBARCH)
++
++- LP64_ARCH = sparcv9 amd64 ia64 zero
+++ LP64_ARCH = sparcv9 amd64 ia64 aarch64 zero
++ endif
++
++ # Required make macro settings for all platforms
++diff --git openjdk.orig/hotspot/make/linux/makefiles/buildtree.make openjdk/hotspot/make/linux/makefiles/buildtree.make
++index 7c3d4f9..3bc7e8a 100644
++--- openjdk.orig/hotspot/make/linux/makefiles/buildtree.make
+++++ openjdk/hotspot/make/linux/makefiles/buildtree.make
++@@ -385,6 +385,7 @@ DATA_MODE/sparc = 32
++ DATA_MODE/sparcv9 = 64
++ DATA_MODE/amd64 = 64
++ DATA_MODE/ia64 = 64
+++DATA_MODE/aarch64 = 64
++ DATA_MODE/zero = $(ARCH_DATA_MODEL)
++
++ JAVA_FLAG/32 = -d32
++diff --git openjdk.orig/hotspot/make/linux/makefiles/defs.make openjdk/hotspot/make/linux/makefiles/defs.make
++index 7bb3149..39ffda4 100644
++--- openjdk.orig/hotspot/make/linux/makefiles/defs.make
+++++ openjdk/hotspot/make/linux/makefiles/defs.make
++@@ -118,6 +118,15 @@ ifeq ($(ARCH), ppc)
++ HS_ARCH = ppc
++ endif
++
+++# AARCH64
+++ifeq ($(ARCH), aarch64)
+++ ARCH_DATA_MODEL = 64
+++ MAKE_ARGS += LP64=1
+++ PLATFORM = linux-aarch64
+++ VM_PLATFORM = linux_aarch64
+++ HS_ARCH = aarch64
+++endif
+++
++ # determine if HotSpot is being built in JDK6 or earlier version
++ JDK6_OR_EARLIER=0
++ ifeq "$(shell expr \( '$(JDK_MAJOR_VERSION)' != '' \& '$(JDK_MINOR_VERSION)' != '' \& '$(JDK_MICRO_VERSION)' != '' \))" "1"
++diff --git openjdk.orig/hotspot/make/linux/makefiles/gcc.make openjdk/hotspot/make/linux/makefiles/gcc.make
++index 897e3a6..44f1673 100644
++--- openjdk.orig/hotspot/make/linux/makefiles/gcc.make
+++++ openjdk/hotspot/make/linux/makefiles/gcc.make
++@@ -104,6 +104,7 @@ endif
++ ARCHFLAG = $(ARCHFLAG/$(BUILDARCH))
++ ARCHFLAG/i486 = -m32 -march=i586
++ ARCHFLAG/amd64 = -m64
+++ARCHFLAG/aarch64 =
++ ARCHFLAG/ia64 =
++ ARCHFLAG/sparc = -m32 -mcpu=v9
++ ARCHFLAG/sparcv9 = -m64 -mcpu=v9
++diff --git openjdk.orig/hotspot/src/os/linux/vm/os_linux.cpp openjdk/hotspot/src/os/linux/vm/os_linux.cpp
++index c1b0e5c..9f7cda0 100644
++--- openjdk.orig/hotspot/src/os/linux/vm/os_linux.cpp
+++++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp
++@@ -296,6 +296,8 @@ static char cpu_arch[] = "sparcv9";
++ # else
++ static char cpu_arch[] = "sparc";
++ # endif
+++#elif defined(AARCH64)
+++static char cpu_arch[] = "aarch64";
++ #else
++ #error Add appropriate cpu_arch setting
++ #endif
++@@ -1442,7 +1444,7 @@ void os::Linux::clock_init() {
++ #ifndef SYS_clock_getres
++
++ #if defined(IA32) || defined(AMD64)
++-#define SYS_clock_getres IA32_ONLY(266) AMD64_ONLY(229)
+++#define SYS_clock_getres IA32_ONLY(266) AMD64_ONLY(229) AARCH64_ONLY(114)
++ #define sys_clock_getres(x,y) ::syscall(SYS_clock_getres, x, y)
++ #else
++ #warning "SYS_clock_getres not defined for this platform, disabling fast_thread_cpu_time"
++@@ -1930,7 +1932,7 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen)
++ static Elf32_Half running_arch_code=EM_AARCH64;
++ #else
++ #error Method os::dll_load requires that one of following is defined:\
++- IA32, AMD64, IA64, __sparc, __powerpc__, ARM, S390, ALPHA, MIPS, MIPSEL, PARISC, M68K, SH
+++ IA32, AMD64, IA64, __sparc, __powerpc__, ARM, S390, ALPHA, MIPS, MIPSEL, PARISC, M68K, SH, AARCH64
++ #endif
++
++ // Identify compatability class for VM's architecture and library's architecture
++@@ -3056,7 +3058,7 @@ void os::large_page_init() {
++
++ #ifndef ZERO
++ _large_page_size = IA32_ONLY(4 * M) AMD64_ONLY(2 * M) IA64_ONLY(256 * M) SPARC_ONLY(4 * M)
++- ARM_ONLY(2 * M) PPC_ONLY(4 * M);
+++ ARM_ONLY(2 * M) PPC_ONLY(4 * M) AARCH64_ONLY(2 * M);
++ #endif // ZERO
++
++ FILE *fp = fopen("/proc/meminfo", "r");
++@@ -5378,11 +5380,11 @@ void Parker::unpark() {
++ extern char** environ;
++
++ #ifndef __NR_fork
++-#define __NR_fork IA32_ONLY(2) IA64_ONLY(not defined) AMD64_ONLY(57)
+++#define __NR_fork IA32_ONLY(2) IA64_ONLY(not defined) AMD64_ONLY(57) AARCH64_ONLY(1079)
++ #endif
++
++ #ifndef __NR_execve
++-#define __NR_execve IA32_ONLY(11) IA64_ONLY(1033) AMD64_ONLY(59)
+++#define __NR_execve IA32_ONLY(11) IA64_ONLY(1033) AMD64_ONLY(59) AARCH64_ONLY(221)
++ #endif
++
++ // Run the specified command in a separate process. Return its exit value,
++diff --git openjdk.orig/hotspot/src/share/vm/adlc/main.cpp openjdk/hotspot/src/share/vm/adlc/main.cpp
++index 47e207a..b93504e 100644
++--- openjdk.orig/hotspot/src/share/vm/adlc/main.cpp
+++++ openjdk/hotspot/src/share/vm/adlc/main.cpp
++@@ -244,6 +244,11 @@ int main(int argc, char *argv[])
++ AD.addInclude(AD._CPP_file, "assembler_arm.inline.hpp");
++ AD.addInclude(AD._CPP_file, "nativeInst_arm.hpp");
++ AD.addInclude(AD._CPP_file, "vmreg_arm.inline.hpp");
+++#endif
+++#ifdef TARGET_ARCH_aarch64
+++ AD.addInclude(AD._CPP_file, "assembler_aarch64.inline.hpp");
+++ AD.addInclude(AD._CPP_file, "nativeInst_aarch64.hpp");
+++ AD.addInclude(AD._CPP_file, "vmreg_aarch64.inline.hpp");
++ #endif
++ AD.addInclude(AD._HPP_file, "memory/allocation.hpp");
++ AD.addInclude(AD._HPP_file, "opto/machnode.hpp");
++diff --git openjdk.orig/hotspot/src/share/vm/asm/assembler.cpp openjdk/hotspot/src/share/vm/asm/assembler.cpp
++index 2bcdcbc..57787ac 100644
++--- openjdk.orig/hotspot/src/share/vm/asm/assembler.cpp
+++++ openjdk/hotspot/src/share/vm/asm/assembler.cpp
++@@ -43,6 +43,9 @@
++ #ifdef TARGET_ARCH_ppc
++ # include "assembler_ppc.inline.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "assembler_aarch64.inline.hpp"
+++#endif
++
++
++ // Implementation of AbstractAssembler
++diff --git openjdk.orig/hotspot/src/share/vm/asm/assembler.hpp openjdk/hotspot/src/share/vm/asm/assembler.hpp
++index c25aa3f..4f77825 100644
++--- openjdk.orig/hotspot/src/share/vm/asm/assembler.hpp
+++++ openjdk/hotspot/src/share/vm/asm/assembler.hpp
++@@ -51,6 +51,10 @@
++ # include "register_ppc.hpp"
++ # include "vm_version_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "register_aarch64.hpp"
+++# include "vm_version_aarch64.hpp"
+++#endif
++
++ // This file contains platform-independent assembler declarations.
++
++@@ -459,6 +463,9 @@ class AbstractAssembler : public ResourceObj {
++ #ifdef TARGET_ARCH_ppc
++ # include "assembler_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "assembler_aarch64.hpp"
+++#endif
++
++
++ #endif // SHARE_VM_ASM_ASSEMBLER_HPP
++diff --git openjdk.orig/hotspot/src/share/vm/asm/codeBuffer.hpp openjdk/hotspot/src/share/vm/asm/codeBuffer.hpp
++index 685297a..002faef 100644
++--- openjdk.orig/hotspot/src/share/vm/asm/codeBuffer.hpp
+++++ openjdk/hotspot/src/share/vm/asm/codeBuffer.hpp
++@@ -573,6 +573,9 @@ class CodeBuffer: public StackObj {
++ #ifdef TARGET_ARCH_ppc
++ # include "codeBuffer_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "codeBuffer_aarch64.hpp"
+++#endif
++
++ };
++
++diff --git openjdk.orig/hotspot/src/share/vm/c1/c1_Canonicalizer.cpp openjdk/hotspot/src/share/vm/c1/c1_Canonicalizer.cpp
++index c95a23c..2ec31e5 100644
++--- openjdk.orig/hotspot/src/share/vm/c1/c1_Canonicalizer.cpp
+++++ openjdk/hotspot/src/share/vm/c1/c1_Canonicalizer.cpp
++@@ -877,6 +877,13 @@ static bool match(UnsafeRawOp* x,
++ return false;
++ }
++
+++// AARCH64 cannot handle shifts which are not either 0, or log2 of the type size
+++#ifdef AARCH64
+++ if (*log2_scale != 0 &&
+++ (1 << *log2_scale) != type2aelembytes(x->basic_type(), true))
+++ return false;
+++#endif
+++
++ // If the value is pinned then it will be always be computed so
++ // there's no profit to reshaping the expression.
++ return !root->is_pinned();
++diff --git openjdk.orig/hotspot/src/share/vm/c1/c1_Defs.hpp openjdk/hotspot/src/share/vm/c1/c1_Defs.hpp
++index bebb3b0..ddaceb7 100644
++--- openjdk.orig/hotspot/src/share/vm/c1/c1_Defs.hpp
+++++ openjdk/hotspot/src/share/vm/c1/c1_Defs.hpp
++@@ -41,6 +41,9 @@
++ #ifdef TARGET_ARCH_ppc
++ # include "register_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "register_aarch64.hpp"
+++#endif
++
++ // set frame size and return address offset to these values in blobs
++ // (if the compiled frame uses ebp as link pointer on IA; otherwise,
++@@ -62,6 +65,9 @@ enum {
++ #ifdef TARGET_ARCH_ppc
++ # include "c1_Defs_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "c1_Defs_aarch64.hpp"
+++#endif
++
++
++ // native word offsets from memory address
++diff --git openjdk.orig/hotspot/src/share/vm/c1/c1_FpuStackSim.hpp openjdk/hotspot/src/share/vm/c1/c1_FpuStackSim.hpp
++index a1e4c38..491b064 100644
++--- openjdk.orig/hotspot/src/share/vm/c1/c1_FpuStackSim.hpp
+++++ openjdk/hotspot/src/share/vm/c1/c1_FpuStackSim.hpp
++@@ -44,6 +44,9 @@ class FpuStackSim;
++ #ifdef TARGET_ARCH_ppc
++ # include "c1_FpuStackSim_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "c1_FpuStackSim_aarch64.hpp"
+++#endif
++
++
++ #endif // SHARE_VM_C1_C1_FPUSTACKSIM_HPP
++diff --git openjdk.orig/hotspot/src/share/vm/c1/c1_FrameMap.cpp openjdk/hotspot/src/share/vm/c1/c1_FrameMap.cpp
++index ea50b27..6a3dc63 100644
++--- openjdk.orig/hotspot/src/share/vm/c1/c1_FrameMap.cpp
+++++ openjdk/hotspot/src/share/vm/c1/c1_FrameMap.cpp
++@@ -41,6 +41,9 @@
++ #ifdef TARGET_ARCH_ppc
++ # include "vmreg_ppc.inline.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "vmreg_aarch64.inline.hpp"
+++#endif
++
++
++
++diff --git openjdk.orig/hotspot/src/share/vm/c1/c1_FrameMap.hpp openjdk/hotspot/src/share/vm/c1/c1_FrameMap.hpp
++index 288fc5c..e9a0250 100644
++--- openjdk.orig/hotspot/src/share/vm/c1/c1_FrameMap.hpp
+++++ openjdk/hotspot/src/share/vm/c1/c1_FrameMap.hpp
++@@ -93,6 +93,9 @@ class FrameMap : public CompilationResourceObj {
++ #endif
++ #ifdef TARGET_ARCH_ppc
++ # include "c1_FrameMap_ppc.hpp"
+++#endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "c1_FrameMap_aarch64.hpp"
++ #endif
++
++
++diff --git openjdk.orig/hotspot/src/share/vm/c1/c1_LIR.cpp openjdk/hotspot/src/share/vm/c1/c1_LIR.cpp
++index 776a6a3..6e1a362 100644
++--- openjdk.orig/hotspot/src/share/vm/c1/c1_LIR.cpp
+++++ openjdk/hotspot/src/share/vm/c1/c1_LIR.cpp
++@@ -67,7 +67,7 @@ FloatRegister LIR_OprDesc::as_double_reg() const {
++
++ #endif
++
++-#ifdef ARM
+++#if defined(ARM) || defined (TARGET_ARCH_aarch64)
++
++ FloatRegister LIR_OprDesc::as_float_reg() const {
++ return as_FloatRegister(fpu_regnr());
++@@ -147,7 +147,11 @@ void LIR_Address::verify() const {
++ #endif
++ #ifdef _LP64
++ assert(base()->is_cpu_register(), "wrong base operand");
+++#ifndef TARGET_ARCH_aarch64
++ assert(index()->is_illegal() || index()->is_double_cpu(), "wrong index operand");
+++#else
+++ assert(index()->is_illegal() || index()->is_double_cpu() || index()->is_single_cpu(), "wrong index operand");
+++#endif
++ assert(base()->type() == T_OBJECT || base()->type() == T_LONG,
++ "wrong type for addresses");
++ #else
++@@ -545,7 +549,7 @@ void LIR_OpVisitState::visit(LIR_Op* op) {
++ assert(opConvert->_info == NULL, "must be");
++ if (opConvert->_opr->is_valid()) do_input(opConvert->_opr);
++ if (opConvert->_result->is_valid()) do_output(opConvert->_result);
++-#ifdef PPC
+++#if defined(PPC) || defined(TARGET_ARCH_aarch64)
++ if (opConvert->_tmp1->is_valid()) do_temp(opConvert->_tmp1);
++ if (opConvert->_tmp2->is_valid()) do_temp(opConvert->_tmp2);
++ #endif
++@@ -1468,6 +1472,11 @@ void LIR_OprDesc::print(outputStream* out) const {
++ out->print("fpu%d", fpu_regnr());
++ } else if (is_double_fpu()) {
++ out->print("fpu%d", fpu_regnrLo());
+++#elif defined(AARCH64)
+++ } else if (is_single_fpu()) {
+++ out->print("fpu%d", fpu_regnr());
+++ } else if (is_double_fpu()) {
+++ out->print("fpu%d", fpu_regnrLo());
++ #elif defined(ARM)
++ } else if (is_single_fpu()) {
++ out->print("s%d", fpu_regnr());
++@@ -1836,7 +1845,7 @@ void LIR_OpConvert::print_instr(outputStream* out) const {
++ print_bytecode(out, bytecode());
++ in_opr()->print(out); out->print(" ");
++ result_opr()->print(out); out->print(" ");
++-#ifdef PPC
+++#if defined(PPC) || defined(TARGET_ARCH_aarch64)
++ if(tmp1()->is_valid()) {
++ tmp1()->print(out); out->print(" ");
++ tmp2()->print(out); out->print(" ");
++diff --git openjdk.orig/hotspot/src/share/vm/c1/c1_LIR.hpp openjdk/hotspot/src/share/vm/c1/c1_LIR.hpp
++index f8589c3..eb3383f 100644
++--- openjdk.orig/hotspot/src/share/vm/c1/c1_LIR.hpp
+++++ openjdk/hotspot/src/share/vm/c1/c1_LIR.hpp
++@@ -437,8 +437,8 @@ class LIR_OprDesc: public CompilationResourceObj {
++ XMMRegister as_xmm_double_reg() const;
++ // for compatibility with RInfo
++ int fpu () const { return lo_reg_half(); }
++-#endif // X86
++-#if defined(SPARC) || defined(ARM) || defined(PPC)
+++#endif
+++#if defined(SPARC) || defined(ARM) || defined(PPC) || defined(AARCH64)
++ FloatRegister as_float_reg () const;
++ FloatRegister as_double_reg () const;
++ #endif
++@@ -526,7 +526,7 @@ class LIR_Address: public LIR_OprPtr {
++ , _type(type)
++ , _disp(0) { verify(); }
++
++-#if defined(X86) || defined(ARM)
+++#if defined(X86) || defined(ARM) || defined(AARCH64)
++ LIR_Address(LIR_Opr base, LIR_Opr index, Scale scale, intx disp, BasicType type):
++ _base(base)
++ , _index(index)
++@@ -601,7 +601,7 @@ class LIR_OprFact: public AllStatic {
++ LIR_OprDesc::fpu_register |
++ LIR_OprDesc::double_size); }
++ #endif
++-#ifdef X86
+++#if defined(X86) || defined(AARCH64)
++ static LIR_Opr double_fpu(int reg) { return (LIR_Opr)(intptr_t)((reg << LIR_OprDesc::reg1_shift) |
++ (reg << LIR_OprDesc::reg2_shift) |
++ LIR_OprDesc::double_type |
++@@ -1398,7 +1398,7 @@ class LIR_OpConvert: public LIR_Op1 {
++ private:
++ Bytecodes::Code _bytecode;
++ ConversionStub* _stub;
++-#ifdef PPC
+++#if defined(PPC) || defined(TARGET_ARCH_aarch64)
++ LIR_Opr _tmp1;
++ LIR_Opr _tmp2;
++ #endif
++@@ -1413,7 +1413,7 @@ class LIR_OpConvert: public LIR_Op1 {
++ #endif
++ , _bytecode(code) {}
++
++-#ifdef PPC
+++#if defined(PPC) || defined(TARGET_ARCH_aarch64)
++ LIR_OpConvert(Bytecodes::Code code, LIR_Opr opr, LIR_Opr result, ConversionStub* stub
++ ,LIR_Opr tmp1, LIR_Opr tmp2)
++ : LIR_Op1(lir_convert, opr, result)
++@@ -1425,7 +1425,7 @@ class LIR_OpConvert: public LIR_Op1 {
++
++ Bytecodes::Code bytecode() const { return _bytecode; }
++ ConversionStub* stub() const { return _stub; }
++-#ifdef PPC
+++#if defined(PPC) || defined(TARGET_ARCH_aarch64)
++ LIR_Opr tmp1() const { return _tmp1; }
++ LIR_Opr tmp2() const { return _tmp2; }
++ #endif
++@@ -1973,7 +1973,14 @@ class LIR_List: public CompilationResourceObj {
++ #ifdef PPC
++ void convert(Bytecodes::Code code, LIR_Opr left, LIR_Opr dst, LIR_Opr tmp1, LIR_Opr tmp2) { append(new LIR_OpConvert(code, left, dst, NULL, tmp1, tmp2)); }
++ #endif
+++#if defined (TARGET_ARCH_aarch64)
+++ void convert(Bytecodes::Code code, LIR_Opr left, LIR_Opr dst,
+++ ConversionStub* stub = NULL, LIR_Opr tmp1 = LIR_OprDesc::illegalOpr()) {
+++ append(new LIR_OpConvert(code, left, dst, stub, tmp1, LIR_OprDesc::illegalOpr()));
+++ }
+++#else
++ void convert(Bytecodes::Code code, LIR_Opr left, LIR_Opr dst, ConversionStub* stub = NULL/*, bool is_32bit = false*/) { append(new LIR_OpConvert(code, left, dst, stub)); }
+++#endif
++
++ void logical_and (LIR_Opr left, LIR_Opr right, LIR_Opr dst) { append(new LIR_Op2(lir_logic_and, left, right, dst)); }
++ void logical_or (LIR_Opr left, LIR_Opr right, LIR_Opr dst) { append(new LIR_Op2(lir_logic_or, left, right, dst)); }
++diff --git openjdk.orig/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp openjdk/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp
++index 528f21e..4d83fca 100644
++--- openjdk.orig/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp
+++++ openjdk/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp
++@@ -50,6 +50,10 @@
++ # include "nativeInst_ppc.hpp"
++ # include "vmreg_ppc.inline.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "nativeInst_aarch64.hpp"
+++# include "vmreg_aarch64.inline.hpp"
+++#endif
++
++
++ void LIR_Assembler::patching_epilog(PatchingStub* patch, LIR_PatchCode patch_code, Register obj, CodeEmitInfo* info) {
++diff --git openjdk.orig/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp openjdk/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp
++index 58adf59..f4a49b3 100644
++--- openjdk.orig/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp
+++++ openjdk/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp
++@@ -261,6 +261,9 @@ class LIR_Assembler: public CompilationResourceObj {
++ #ifdef TARGET_ARCH_ppc
++ # include "c1_LIRAssembler_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "c1_LIRAssembler_aarch64.hpp"
+++#endif
++
++ };
++
++diff --git openjdk.orig/hotspot/src/share/vm/c1/c1_LinearScan.cpp openjdk/hotspot/src/share/vm/c1/c1_LinearScan.cpp
++index aaae71d..93f9f5f 100644
++--- openjdk.orig/hotspot/src/share/vm/c1/c1_LinearScan.cpp
+++++ openjdk/hotspot/src/share/vm/c1/c1_LinearScan.cpp
++@@ -47,6 +47,9 @@
++ #ifdef TARGET_ARCH_ppc
++ # include "vmreg_ppc.inline.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "vmreg_aarch64.inline.hpp"
+++#endif
++
++
++ #ifndef PRODUCT
++@@ -2190,7 +2193,7 @@ LIR_Opr LinearScan::color_lir_opr(LIR_Opr opr, int op_id, LIR_OpVisitState::OprM
++
++ LIR_Opr res = operand_for_interval(interval);
++
++-#ifdef X86
+++#if defined(X86) || defined(AARCH64)
++ // new semantic for is_last_use: not only set on definite end of interval,
++ // but also before hole
++ // This may still miss some cases (e.g. for dead values), but it is not necessary that the
++diff --git openjdk.orig/hotspot/src/share/vm/c1/c1_LinearScan.hpp openjdk/hotspot/src/share/vm/c1/c1_LinearScan.hpp
++index 0c06f1b..a152328 100644
++--- openjdk.orig/hotspot/src/share/vm/c1/c1_LinearScan.hpp
+++++ openjdk/hotspot/src/share/vm/c1/c1_LinearScan.hpp
++@@ -985,6 +985,9 @@ class LinearScanTimers : public StackObj {
++ #ifdef TARGET_ARCH_ppc
++ # include "c1_LinearScan_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "c1_LinearScan_aarch64.hpp"
+++#endif
++
++
++ #endif // SHARE_VM_C1_C1_LINEARSCAN_HPP
++diff --git openjdk.orig/hotspot/src/share/vm/c1/c1_MacroAssembler.hpp openjdk/hotspot/src/share/vm/c1/c1_MacroAssembler.hpp
++index 55d9803..eda2174 100644
++--- openjdk.orig/hotspot/src/share/vm/c1/c1_MacroAssembler.hpp
+++++ openjdk/hotspot/src/share/vm/c1/c1_MacroAssembler.hpp
++@@ -41,6 +41,9 @@
++ #ifdef TARGET_ARCH_ppc
++ # include "assembler_ppc.inline.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "assembler_aarch64.inline.hpp"
+++#endif
++
++ class CodeEmitInfo;
++
++@@ -73,6 +76,9 @@ class C1_MacroAssembler: public MacroAssembler {
++ #ifdef TARGET_ARCH_ppc
++ # include "c1_MacroAssembler_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "c1_MacroAssembler_aarch64.hpp"
+++#endif
++
++ };
++
++diff --git openjdk.orig/hotspot/src/share/vm/c1/c1_Runtime1.cpp openjdk/hotspot/src/share/vm/c1/c1_Runtime1.cpp
++index 765dec4..f0b3aae 100644
++--- openjdk.orig/hotspot/src/share/vm/c1/c1_Runtime1.cpp
+++++ openjdk/hotspot/src/share/vm/c1/c1_Runtime1.cpp
++@@ -1103,6 +1103,7 @@ JRT_END
++ // completes we can check for deoptimization. This simplifies the
++ // assembly code in the cpu directories.
++ //
+++#ifndef TARGET_ARCH_aarch64
++ int Runtime1::move_klass_patching(JavaThread* thread) {
++ //
++ // NOTE: we are still in Java
++@@ -1150,6 +1151,7 @@ int Runtime1::access_field_patching(JavaThread* thread) {
++
++ return caller_is_deopted();
++ JRT_END
+++#endif
++
++
++ JRT_LEAF(void, Runtime1::trace_block_entry(jint block_id))
++diff --git openjdk.orig/hotspot/src/share/vm/c1/c1_Runtime1.hpp openjdk/hotspot/src/share/vm/c1/c1_Runtime1.hpp
++index 2032564..19261be 100644
++--- openjdk.orig/hotspot/src/share/vm/c1/c1_Runtime1.hpp
+++++ openjdk/hotspot/src/share/vm/c1/c1_Runtime1.hpp
++@@ -159,6 +159,9 @@ class Runtime1: public AllStatic {
++ static int move_klass_patching(JavaThread* thread);
++
++ static void patch_code(JavaThread* thread, StubID stub_id);
+++#ifdef TARGET_ARCH_aarch64
+++ static void patch_code_aarch64(JavaThread* thread, StubID stub_id);
+++#endif
++
++ public:
++ // initialization
++diff --git openjdk.orig/hotspot/src/share/vm/c1/c1_globals.hpp openjdk/hotspot/src/share/vm/c1/c1_globals.hpp
++index 15f3cc1..4143a87 100644
++--- openjdk.orig/hotspot/src/share/vm/c1/c1_globals.hpp
+++++ openjdk/hotspot/src/share/vm/c1/c1_globals.hpp
++@@ -38,6 +38,9 @@
++ #ifdef TARGET_ARCH_ppc
++ # include "c1_globals_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "c1_globals_aarch64.hpp"
+++#endif
++ #ifdef TARGET_OS_FAMILY_linux
++ # include "c1_globals_linux.hpp"
++ #endif
++diff --git openjdk.orig/hotspot/src/share/vm/classfile/classFileStream.hpp openjdk/hotspot/src/share/vm/classfile/classFileStream.hpp
++index cf6f0e5..b128b3a 100644
++--- openjdk.orig/hotspot/src/share/vm/classfile/classFileStream.hpp
+++++ openjdk/hotspot/src/share/vm/classfile/classFileStream.hpp
++@@ -41,6 +41,9 @@
++ #ifdef TARGET_ARCH_ppc
++ # include "bytes_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "bytes_aarch64.hpp"
+++#endif
++
++ // Input stream for reading .class file
++ //
++diff --git openjdk.orig/hotspot/src/share/vm/classfile/stackMapTable.hpp openjdk/hotspot/src/share/vm/classfile/stackMapTable.hpp
++index f876029..ac415b6 100644
++--- openjdk.orig/hotspot/src/share/vm/classfile/stackMapTable.hpp
+++++ openjdk/hotspot/src/share/vm/classfile/stackMapTable.hpp
++@@ -46,6 +46,9 @@
++ #ifdef TARGET_ARCH_ppc
++ # include "bytes_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "bytes_aarch64.hpp"
+++#endif
++
++ class StackMapReader;
++
++diff --git openjdk.orig/hotspot/src/share/vm/classfile/verifier.cpp openjdk/hotspot/src/share/vm/classfile/verifier.cpp
++index c5c5e11..9c22a21 100644
++--- openjdk.orig/hotspot/src/share/vm/classfile/verifier.cpp
+++++ openjdk/hotspot/src/share/vm/classfile/verifier.cpp
++@@ -60,6 +60,9 @@
++ #ifdef TARGET_ARCH_ppc
++ # include "bytes_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "bytes_aarch64.hpp"
+++#endif
++
++ #define NOFAILOVER_MAJOR_VERSION 51
++
++diff --git openjdk.orig/hotspot/src/share/vm/code/codeBlob.cpp openjdk/hotspot/src/share/vm/code/codeBlob.cpp
++index 244c320..429e0be 100644
++--- openjdk.orig/hotspot/src/share/vm/code/codeBlob.cpp
+++++ openjdk/hotspot/src/share/vm/code/codeBlob.cpp
++@@ -54,6 +54,9 @@
++ #ifdef TARGET_ARCH_ppc
++ # include "nativeInst_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "nativeInst_aarch64.hpp"
+++#endif
++ #ifdef COMPILER1
++ #include "c1/c1_Runtime1.hpp"
++ #endif
++diff --git openjdk.orig/hotspot/src/share/vm/code/compiledIC.hpp openjdk/hotspot/src/share/vm/code/compiledIC.hpp
++index fe1cfb3..c9f6a2e 100644
++--- openjdk.orig/hotspot/src/share/vm/code/compiledIC.hpp
+++++ openjdk/hotspot/src/share/vm/code/compiledIC.hpp
++@@ -44,6 +44,9 @@
++ #ifdef TARGET_ARCH_ppc
++ # include "nativeInst_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "nativeInst_aarch64.hpp"
+++#endif
++
++ //-----------------------------------------------------------------------------
++ // The CompiledIC represents a compiled inline cache.
++diff --git openjdk.orig/hotspot/src/share/vm/code/icBuffer.cpp openjdk/hotspot/src/share/vm/code/icBuffer.cpp
++index ed70457..d022482 100644
++--- openjdk.orig/hotspot/src/share/vm/code/icBuffer.cpp
+++++ openjdk/hotspot/src/share/vm/code/icBuffer.cpp
++@@ -52,6 +52,9 @@
++ #ifdef TARGET_ARCH_ppc
++ # include "assembler_ppc.inline.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "assembler_aarch64.inline.hpp"
+++#endif
++
++
++ DEF_STUB_INTERFACE(ICStub);
++diff --git openjdk.orig/hotspot/src/share/vm/code/relocInfo.cpp openjdk/hotspot/src/share/vm/code/relocInfo.cpp
++index 4fd82df..78310e6 100644
++--- openjdk.orig/hotspot/src/share/vm/code/relocInfo.cpp
+++++ openjdk/hotspot/src/share/vm/code/relocInfo.cpp
++@@ -49,6 +49,10 @@
++ # include "assembler_ppc.inline.hpp"
++ # include "nativeInst_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "assembler_aarch64.inline.hpp"
+++# include "nativeInst_aarch64.hpp"
+++#endif
++
++
++ const RelocationHolder RelocationHolder::none; // its type is relocInfo::none
++diff --git openjdk.orig/hotspot/src/share/vm/code/relocInfo.hpp openjdk/hotspot/src/share/vm/code/relocInfo.hpp
++index 1d14b44..3823889 100644
++--- openjdk.orig/hotspot/src/share/vm/code/relocInfo.hpp
+++++ openjdk/hotspot/src/share/vm/code/relocInfo.hpp
++@@ -435,6 +435,9 @@ class relocInfo VALUE_OBJ_CLASS_SPEC {
++ #endif
++ #ifdef TARGET_ARCH_ppc
++ # include "relocInfo_ppc.hpp"
+++#endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "relocInfo_aarch64.hpp"
++ #endif
++
++
++diff --git openjdk.orig/hotspot/src/share/vm/code/vmreg.hpp openjdk/hotspot/src/share/vm/code/vmreg.hpp
++index d57e6f8..1c18e47 100644
++--- openjdk.orig/hotspot/src/share/vm/code/vmreg.hpp
+++++ openjdk/hotspot/src/share/vm/code/vmreg.hpp
++@@ -42,6 +42,9 @@
++ #ifdef TARGET_ARCH_ppc
++ # include "register_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "register_aarch64.hpp"
+++#endif
++ #ifdef COMPILER2
++ #include "opto/adlcVMDeps.hpp"
++ #include "utilities/ostream.hpp"
++@@ -63,6 +66,9 @@
++ #ifdef TARGET_ARCH_MODEL_ppc
++ # include "adfiles/adGlobals_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_MODEL_aarch64
+++# include "adfiles/adGlobals_aarch64.hpp"
+++#endif
++ #endif
++
++ //------------------------------VMReg------------------------------------------
++@@ -182,6 +188,9 @@ public:
++ #ifdef TARGET_ARCH_ppc
++ # include "vmreg_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "vmreg_aarch64.hpp"
+++#endif
++
++
++ };
++diff --git openjdk.orig/hotspot/src/share/vm/compiler/disassembler.cpp openjdk/hotspot/src/share/vm/compiler/disassembler.cpp
++index 9603e86..3a67259 100644
++--- openjdk.orig/hotspot/src/share/vm/compiler/disassembler.cpp
+++++ openjdk/hotspot/src/share/vm/compiler/disassembler.cpp
++@@ -47,6 +47,9 @@
++ #ifdef TARGET_ARCH_ppc
++ # include "depChecker_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "depChecker_aarch64.hpp"
+++#endif
++ #ifdef SHARK
++ #include "shark/sharkEntry.hpp"
++ #endif
++diff --git openjdk.orig/hotspot/src/share/vm/compiler/disassembler.hpp openjdk/hotspot/src/share/vm/compiler/disassembler.hpp
++index a70b8cc..4c90c9a 100644
++--- openjdk.orig/hotspot/src/share/vm/compiler/disassembler.hpp
+++++ openjdk/hotspot/src/share/vm/compiler/disassembler.hpp
++@@ -78,6 +78,9 @@ class Disassembler {
++ #endif
++ #ifdef TARGET_ARCH_ppc
++ # include "disassembler_ppc.hpp"
+++#endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "disassembler_aarch64.hpp"
++ #endif
++
++
++diff --git openjdk.orig/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp openjdk/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp
++index d23f37a..24ca30e 100644
++--- openjdk.orig/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp
+++++ openjdk/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp
++@@ -44,6 +44,9 @@
++ #ifdef TARGET_ARCH_MODEL_ppc
++ # include "interp_masm_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_MODEL_aarch64
+++# include "interp_masm_aarch64.hpp"
+++#endif
++ #ifdef TARGET_OS_FAMILY_linux
++ # include "thread_linux.inline.hpp"
++ #endif
++diff --git openjdk.orig/hotspot/src/share/vm/interpreter/bytecode.hpp openjdk/hotspot/src/share/vm/interpreter/bytecode.hpp
++index 107161a..205d0f7 100644
++--- openjdk.orig/hotspot/src/share/vm/interpreter/bytecode.hpp
+++++ openjdk/hotspot/src/share/vm/interpreter/bytecode.hpp
++@@ -43,6 +43,9 @@
++ #ifdef TARGET_ARCH_ppc
++ # include "bytes_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "bytes_aarch64.hpp"
+++#endif
++
++ class ciBytecodeStream;
++
++diff --git openjdk.orig/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp openjdk/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp
++index e637414..308ad3b 100644
++--- openjdk.orig/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp
+++++ openjdk/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp
++@@ -47,6 +47,9 @@
++ #ifdef TARGET_ARCH_ppc
++ # include "bytes_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "bytes_aarch64.hpp"
+++#endif
++
++ #ifdef CC_INTERP
++
++@@ -618,6 +621,9 @@ void print();
++ #ifdef TARGET_ARCH_ppc
++ # include "bytecodeInterpreter_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "bytecodeInterpreter_aarch64.hpp"
+++#endif
++
++
++ }; // BytecodeInterpreter
++diff --git openjdk.orig/hotspot/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp openjdk/hotspot/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp
++index 3715a52..0d6a8aa 100644
++--- openjdk.orig/hotspot/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp
+++++ openjdk/hotspot/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp
++@@ -58,6 +58,9 @@
++ #ifdef TARGET_ARCH_ppc
++ # include "bytecodeInterpreter_ppc.inline.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "bytecodeInterpreter_aarch64.inline.hpp"
+++#endif
++
++ #endif // CC_INTERP
++
++diff --git openjdk.orig/hotspot/src/share/vm/interpreter/bytecodeStream.hpp openjdk/hotspot/src/share/vm/interpreter/bytecodeStream.hpp
++index 6106eac..f3dee0a 100644
++--- openjdk.orig/hotspot/src/share/vm/interpreter/bytecodeStream.hpp
+++++ openjdk/hotspot/src/share/vm/interpreter/bytecodeStream.hpp
++@@ -43,6 +43,9 @@
++ #ifdef TARGET_ARCH_ppc
++ # include "bytes_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "bytes_aarch64.hpp"
+++#endif
++
++ // A BytecodeStream is used for fast iteration over the bytecodes
++ // of a methodOop.
++diff --git openjdk.orig/hotspot/src/share/vm/interpreter/bytecodes.cpp openjdk/hotspot/src/share/vm/interpreter/bytecodes.cpp
++index 04f3f64..48ef30e 100644
++--- openjdk.orig/hotspot/src/share/vm/interpreter/bytecodes.cpp
+++++ openjdk/hotspot/src/share/vm/interpreter/bytecodes.cpp
++@@ -41,6 +41,9 @@
++ #ifdef TARGET_ARCH_ppc
++ # include "bytes_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "bytes_aarch64.hpp"
+++#endif
++
++
++ #if defined(WIN32) && (defined(_MSC_VER) && (_MSC_VER < 1600))
++diff --git openjdk.orig/hotspot/src/share/vm/interpreter/cppInterpreter.hpp openjdk/hotspot/src/share/vm/interpreter/cppInterpreter.hpp
++index e3a9f2e..8347473 100644
++--- openjdk.orig/hotspot/src/share/vm/interpreter/cppInterpreter.hpp
+++++ openjdk/hotspot/src/share/vm/interpreter/cppInterpreter.hpp
++@@ -101,6 +101,9 @@ class CppInterpreter: public AbstractInterpreter {
++ #ifdef TARGET_ARCH_ppc
++ # include "cppInterpreter_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "cppInterpreter_aarch64.hpp"
+++#endif
++
++
++ };
++diff --git openjdk.orig/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.hpp openjdk/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.hpp
++index c27805e..272f6e8 100644
++--- openjdk.orig/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.hpp
+++++ openjdk/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.hpp
++@@ -59,6 +59,9 @@ class CppInterpreterGenerator: public AbstractInterpreterGenerator {
++ #ifdef TARGET_ARCH_ppc
++ # include "cppInterpreterGenerator_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "cppInterpreterGenerator_aarch64.hpp"
+++#endif
++
++ };
++
++diff --git openjdk.orig/hotspot/src/share/vm/interpreter/interpreter.hpp openjdk/hotspot/src/share/vm/interpreter/interpreter.hpp
++index 0ab0be7..6a6822f 100644
++--- openjdk.orig/hotspot/src/share/vm/interpreter/interpreter.hpp
+++++ openjdk/hotspot/src/share/vm/interpreter/interpreter.hpp
++@@ -158,6 +158,9 @@ class Interpreter: public CC_INTERP_ONLY(CppInterpreter) NOT_CC_INTERP(TemplateI
++ #ifdef TARGET_ARCH_ppc
++ # include "interpreter_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "interpreter_aarch64.hpp"
+++#endif
++
++ };
++
++diff --git openjdk.orig/hotspot/src/share/vm/interpreter/interpreterGenerator.hpp openjdk/hotspot/src/share/vm/interpreter/interpreterGenerator.hpp
++index 7bc43ec..0434ca3 100644
++--- openjdk.orig/hotspot/src/share/vm/interpreter/interpreterGenerator.hpp
+++++ openjdk/hotspot/src/share/vm/interpreter/interpreterGenerator.hpp
++@@ -56,6 +56,9 @@ InterpreterGenerator(StubQueue* _code);
++ #ifdef TARGET_ARCH_ppc
++ # include "interpreterGenerator_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "interpreterGenerator_aarch64.hpp"
+++#endif
++
++
++ };
++diff --git openjdk.orig/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp openjdk/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp
++index e451c04..37700fb 100644
++--- openjdk.orig/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp
+++++ openjdk/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp
++@@ -71,6 +71,9 @@
++ #ifdef TARGET_ARCH_ppc
++ # include "vm_version_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "vm_version_aarch64.hpp"
+++#endif
++ #ifdef COMPILER2
++ #include "opto/runtime.hpp"
++ #endif
++diff --git openjdk.orig/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp openjdk/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp
++index 93c1a9e..425400e 100644
++--- openjdk.orig/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp
+++++ openjdk/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp
++@@ -164,6 +164,9 @@ class InterpreterRuntime: AllStatic {
++ #endif
++ #ifdef TARGET_ARCH_ppc
++ # include "interpreterRT_ppc.hpp"
+++#endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "interpreterRT_aarch64.hpp"
++ #endif
++
++
++diff --git openjdk.orig/hotspot/src/share/vm/interpreter/templateInterpreter.hpp openjdk/hotspot/src/share/vm/interpreter/templateInterpreter.hpp
++index 25d74f7..f78a16e 100644
++--- openjdk.orig/hotspot/src/share/vm/interpreter/templateInterpreter.hpp
+++++ openjdk/hotspot/src/share/vm/interpreter/templateInterpreter.hpp
++@@ -198,6 +198,9 @@ class TemplateInterpreter: public AbstractInterpreter {
++ #ifdef TARGET_ARCH_ppc
++ # include "templateInterpreter_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "templateInterpreter_aarch64.hpp"
+++#endif
++
++
++ };
++diff --git openjdk.orig/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp openjdk/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp
++index fb7bdc5..6007630 100644
++--- openjdk.orig/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp
+++++ openjdk/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp
++@@ -101,6 +101,9 @@ class TemplateInterpreterGenerator: public AbstractInterpreterGenerator {
++ #ifdef TARGET_ARCH_ppc
++ # include "templateInterpreterGenerator_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "templateInterpreterGenerator_aarch64.hpp"
+++#endif
++
++
++ };
++diff --git openjdk.orig/hotspot/src/share/vm/interpreter/templateTable.hpp openjdk/hotspot/src/share/vm/interpreter/templateTable.hpp
++index 5d2a7e8..c5e0f0a 100644
++--- openjdk.orig/hotspot/src/share/vm/interpreter/templateTable.hpp
+++++ openjdk/hotspot/src/share/vm/interpreter/templateTable.hpp
++@@ -43,6 +43,9 @@
++ #ifdef TARGET_ARCH_MODEL_ppc
++ # include "interp_masm_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_MODEL_aarch64
+++# include "interp_masm_aarch64.hpp"
+++#endif
++
++ #ifndef CC_INTERP
++ // All the necessary definitions used for (bytecode) template generation. Instead of
++@@ -373,6 +376,9 @@ class TemplateTable: AllStatic {
++ #ifdef TARGET_ARCH_MODEL_ppc
++ # include "templateTable_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_MODEL_aarch64
+++# include "templateTable_aarch64.hpp"
+++#endif
++
++ };
++ #endif /* !CC_INTERP */
++diff --git openjdk.orig/hotspot/src/share/vm/oops/constantPoolOop.hpp openjdk/hotspot/src/share/vm/oops/constantPoolOop.hpp
++index c2f985d..3d0d0fc 100644
++--- openjdk.orig/hotspot/src/share/vm/oops/constantPoolOop.hpp
+++++ openjdk/hotspot/src/share/vm/oops/constantPoolOop.hpp
++@@ -45,6 +45,9 @@
++ #ifdef TARGET_ARCH_ppc
++ # include "bytes_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "bytes_aarch64.hpp"
+++#endif
++
++ // A constantPool is an array containing class constants as described in the
++ // class file.
++diff --git openjdk.orig/hotspot/src/share/vm/oops/oop.inline.hpp openjdk/hotspot/src/share/vm/oops/oop.inline.hpp
++index db14b2e..c8b326f 100644
++--- openjdk.orig/hotspot/src/share/vm/oops/oop.inline.hpp
+++++ openjdk/hotspot/src/share/vm/oops/oop.inline.hpp
++@@ -58,6 +58,9 @@
++ #ifdef TARGET_ARCH_ppc
++ # include "bytes_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "bytes_aarch64.hpp"
+++#endif
++
++ // Implementation of all inlined member functions defined in oop.hpp
++ // We need a separate file to avoid circular references
++diff --git openjdk.orig/hotspot/src/share/vm/opto/buildOopMap.cpp openjdk/hotspot/src/share/vm/opto/buildOopMap.cpp
++index fc73160..2c5ec41 100644
++--- openjdk.orig/hotspot/src/share/vm/opto/buildOopMap.cpp
+++++ openjdk/hotspot/src/share/vm/opto/buildOopMap.cpp
++@@ -47,6 +47,9 @@
++ #ifdef TARGET_ARCH_ppc
++ # include "vmreg_ppc.inline.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "vmreg_aarch64.inline.hpp"
+++#endif
++
++ // The functions in this file builds OopMaps after all scheduling is done.
++ //
++diff --git openjdk.orig/hotspot/src/share/vm/opto/c2_globals.hpp openjdk/hotspot/src/share/vm/opto/c2_globals.hpp
++index f73dcbd..462c875 100644
++--- openjdk.orig/hotspot/src/share/vm/opto/c2_globals.hpp
+++++ openjdk/hotspot/src/share/vm/opto/c2_globals.hpp
++@@ -35,6 +35,9 @@
++ #ifdef TARGET_ARCH_arm
++ # include "c2_globals_arm.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "c2_globals_aarch64.hpp"
+++#endif
++ #ifdef TARGET_OS_FAMILY_linux
++ # include "c2_globals_linux.hpp"
++ #endif
++diff --git openjdk.orig/hotspot/src/share/vm/opto/c2compiler.cpp openjdk/hotspot/src/share/vm/opto/c2compiler.cpp
++index 713e3f1..948e447 100644
++--- openjdk.orig/hotspot/src/share/vm/opto/c2compiler.cpp
+++++ openjdk/hotspot/src/share/vm/opto/c2compiler.cpp
++@@ -43,6 +43,9 @@
++ #ifdef TARGET_ARCH_MODEL_ppc
++ # include "adfiles/ad_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_MODEL_aarch64
+++# include "adfiles/ad_aarch64.hpp"
+++#endif
++
++
++ volatile int C2Compiler::_runtimes = uninitialized;
++diff --git openjdk.orig/hotspot/src/share/vm/opto/compile.cpp openjdk/hotspot/src/share/vm/opto/compile.cpp
++index a7ee07a..91dc290 100644
++--- openjdk.orig/hotspot/src/share/vm/opto/compile.cpp
+++++ openjdk/hotspot/src/share/vm/opto/compile.cpp
++@@ -80,6 +80,9 @@
++ #ifdef TARGET_ARCH_MODEL_ppc
++ # include "adfiles/ad_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_MODEL_aarch64
+++# include "adfiles/ad_aarch64.hpp"
+++#endif
++
++
++ // -------------------- Compile::mach_constant_base_node -----------------------
++diff --git openjdk.orig/hotspot/src/share/vm/opto/gcm.cpp openjdk/hotspot/src/share/vm/opto/gcm.cpp
++index 8b8f311..4deb0b4 100644
++--- openjdk.orig/hotspot/src/share/vm/opto/gcm.cpp
+++++ openjdk/hotspot/src/share/vm/opto/gcm.cpp
++@@ -53,6 +53,9 @@
++ #ifdef TARGET_ARCH_MODEL_ppc
++ # include "adfiles/ad_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_MODEL_aarch64
+++# include "adfiles/ad_aarch64.hpp"
+++#endif
++
++ // Portions of code courtesy of Clifford Click
++
++diff --git openjdk.orig/hotspot/src/share/vm/opto/lcm.cpp openjdk/hotspot/src/share/vm/opto/lcm.cpp
++index aee6123..4b9aaed 100644
++--- openjdk.orig/hotspot/src/share/vm/opto/lcm.cpp
+++++ openjdk/hotspot/src/share/vm/opto/lcm.cpp
++@@ -48,6 +48,9 @@
++ #ifdef TARGET_ARCH_MODEL_ppc
++ # include "adfiles/ad_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_MODEL_aarch64
+++# include "adfiles/ad_aarch64.hpp"
+++#endif
++
++ // Optimization - Graph Style
++
++diff --git openjdk.orig/hotspot/src/share/vm/opto/locknode.hpp openjdk/hotspot/src/share/vm/opto/locknode.hpp
++index 91b99bc..665594f 100644
++--- openjdk.orig/hotspot/src/share/vm/opto/locknode.hpp
+++++ openjdk/hotspot/src/share/vm/opto/locknode.hpp
++@@ -46,6 +46,9 @@
++ #ifdef TARGET_ARCH_MODEL_ppc
++ # include "adfiles/ad_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_MODEL_aarch64
+++# include "adfiles/ad_aarch64.hpp"
+++#endif
++
++ //------------------------------BoxLockNode------------------------------------
++ class BoxLockNode : public Node {
++diff --git openjdk.orig/hotspot/src/share/vm/opto/matcher.cpp openjdk/hotspot/src/share/vm/opto/matcher.cpp
++index ca2d4e3..d0f55c5 100644
++--- openjdk.orig/hotspot/src/share/vm/opto/matcher.cpp
+++++ openjdk/hotspot/src/share/vm/opto/matcher.cpp
++@@ -55,6 +55,9 @@
++ #ifdef TARGET_ARCH_MODEL_ppc
++ # include "adfiles/ad_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_MODEL_aarch64
+++# include "adfiles/ad_aarch64.hpp"
+++#endif
++
++ OptoReg::Name OptoReg::c_frame_pointer;
++
++diff --git openjdk.orig/hotspot/src/share/vm/opto/output.hpp openjdk/hotspot/src/share/vm/opto/output.hpp
++index 50b6e76..6a920b2 100644
++--- openjdk.orig/hotspot/src/share/vm/opto/output.hpp
+++++ openjdk/hotspot/src/share/vm/opto/output.hpp
++@@ -45,6 +45,9 @@
++ #ifdef TARGET_ARCH_MODEL_ppc
++ # include "adfiles/ad_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_MODEL_aarch64
+++# include "adfiles/ad_aarch64.hpp"
+++#endif
++
++ class Arena;
++ class Bundle;
++diff --git openjdk.orig/hotspot/src/share/vm/opto/regmask.cpp openjdk/hotspot/src/share/vm/opto/regmask.cpp
++index ce220f0..20c6028 100644
++--- openjdk.orig/hotspot/src/share/vm/opto/regmask.cpp
+++++ openjdk/hotspot/src/share/vm/opto/regmask.cpp
++@@ -43,6 +43,9 @@
++ #ifdef TARGET_ARCH_MODEL_ppc
++ # include "adfiles/ad_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_MODEL_aarch64
+++# include "adfiles/ad_aarch64.hpp"
+++#endif
++
++ #define RM_SIZE _RM_SIZE /* a constant private to the class RegMask */
++
++diff --git openjdk.orig/hotspot/src/share/vm/opto/regmask.hpp openjdk/hotspot/src/share/vm/opto/regmask.hpp
++index e50ff84..26c6854 100644
++--- openjdk.orig/hotspot/src/share/vm/opto/regmask.hpp
+++++ openjdk/hotspot/src/share/vm/opto/regmask.hpp
++@@ -46,6 +46,9 @@
++ #ifdef TARGET_ARCH_MODEL_ppc
++ # include "adfiles/adGlobals_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_MODEL_aarch64
+++# include "adfiles/adGlobals_aarch64.hpp"
+++#endif
++
++ // Some fun naming (textual) substitutions:
++ //
++diff --git openjdk.orig/hotspot/src/share/vm/opto/runtime.cpp openjdk/hotspot/src/share/vm/opto/runtime.cpp
++index d315f10..11a58b1 100644
++--- openjdk.orig/hotspot/src/share/vm/opto/runtime.cpp
+++++ openjdk/hotspot/src/share/vm/opto/runtime.cpp
++@@ -86,6 +86,9 @@
++ #ifdef TARGET_ARCH_MODEL_ppc
++ # include "adfiles/ad_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_MODEL_aarch64
+++# include "adfiles/ad_aarch64.hpp"
+++#endif
++
++
++ // For debugging purposes:
++diff --git openjdk.orig/hotspot/src/share/vm/prims/jniCheck.cpp openjdk/hotspot/src/share/vm/prims/jniCheck.cpp
++index 3bf4ecd..2ad9014 100644
++--- openjdk.orig/hotspot/src/share/vm/prims/jniCheck.cpp
+++++ openjdk/hotspot/src/share/vm/prims/jniCheck.cpp
++@@ -51,6 +51,9 @@
++ #ifdef TARGET_ARCH_ppc
++ # include "jniTypes_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "jniTypes_aarch64.hpp"
+++#endif
++
++
++ // Heap objects are allowed to be directly referenced only in VM code,
++diff --git openjdk.orig/hotspot/src/share/vm/prims/jni_md.h openjdk/hotspot/src/share/vm/prims/jni_md.h
++index 7fa5829..3bd4e31 100644
++--- openjdk.orig/hotspot/src/share/vm/prims/jni_md.h
+++++ openjdk/hotspot/src/share/vm/prims/jni_md.h
++@@ -39,6 +39,9 @@
++ #ifdef TARGET_ARCH_ppc
++ # include "jni_ppc.h"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "jni_aarch64.h"
+++#endif
++
++
++ /*
++diff --git openjdk.orig/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp openjdk/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp
++index 97dd154..fd1fa43 100644
++--- openjdk.orig/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp
+++++ openjdk/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp
++@@ -43,6 +43,9 @@
++ #ifdef TARGET_ARCH_ppc
++ # include "bytes_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "bytes_aarch64.hpp"
+++#endif
++ // FIXME: add Deprecated, LVTT attributes
++ // FIXME: fix Synthetic attribute
++ // FIXME: per Serguei, add error return handling for constantPoolOopDesc::copy_cpool_bytes()
++diff --git openjdk.orig/hotspot/src/share/vm/prims/methodHandles.hpp openjdk/hotspot/src/share/vm/prims/methodHandles.hpp
++index 514ba6a..ea747d0 100644
++--- openjdk.orig/hotspot/src/share/vm/prims/methodHandles.hpp
+++++ openjdk/hotspot/src/share/vm/prims/methodHandles.hpp
++@@ -738,6 +738,9 @@ public:
++ #ifdef TARGET_ARCH_ppc
++ # include "methodHandles_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "methodHandles_aarch64.hpp"
+++#endif
++ };
++
++
++diff --git openjdk.orig/hotspot/src/share/vm/runtime/atomic.cpp openjdk/hotspot/src/share/vm/runtime/atomic.cpp
++index 80780d7..5a34f15 100644
++--- openjdk.orig/hotspot/src/share/vm/runtime/atomic.cpp
+++++ openjdk/hotspot/src/share/vm/runtime/atomic.cpp
++@@ -60,6 +60,9 @@
++ #ifdef TARGET_OS_ARCH_linux_ppc
++ # include "atomic_linux_ppc.inline.hpp"
++ #endif
+++#ifdef TARGET_OS_ARCH_linux_aarch64
+++# include "atomic_linux_aarch64.inline.hpp"
+++#endif
++ #ifdef TARGET_OS_ARCH_bsd_x86
++ # include "atomic_bsd_x86.inline.hpp"
++ #endif
++diff --git openjdk.orig/hotspot/src/share/vm/runtime/deoptimization.cpp openjdk/hotspot/src/share/vm/runtime/deoptimization.cpp
++index 4735588..4e7958a 100644
++--- openjdk.orig/hotspot/src/share/vm/runtime/deoptimization.cpp
+++++ openjdk/hotspot/src/share/vm/runtime/deoptimization.cpp
++@@ -65,6 +65,9 @@
++ #ifdef TARGET_ARCH_ppc
++ # include "vmreg_ppc.inline.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "vmreg_aarch64.inline.hpp"
+++#endif
++ #ifdef COMPILER2
++ #ifdef TARGET_ARCH_MODEL_x86_32
++ # include "adfiles/ad_x86_32.hpp"
++@@ -84,6 +87,9 @@
++ #ifdef TARGET_ARCH_MODEL_ppc
++ # include "adfiles/ad_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_MODEL_aarch64
+++# include "adfiles/ad_aarch64.hpp"
+++#endif
++ #endif
++
++ bool DeoptimizationMarker::_is_active = false;
++diff --git openjdk.orig/hotspot/src/share/vm/runtime/dtraceJSDT.hpp openjdk/hotspot/src/share/vm/runtime/dtraceJSDT.hpp
++index bff4310..1129cd6 100644
++--- openjdk.orig/hotspot/src/share/vm/runtime/dtraceJSDT.hpp
+++++ openjdk/hotspot/src/share/vm/runtime/dtraceJSDT.hpp
++@@ -41,6 +41,9 @@
++ #ifdef TARGET_ARCH_ppc
++ # include "nativeInst_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "nativeInst_aarch64.hpp"
+++#endif
++
++ class RegisteredProbes;
++ typedef jlong OpaqueProbes;
++diff --git openjdk.orig/hotspot/src/share/vm/runtime/frame.cpp openjdk/hotspot/src/share/vm/runtime/frame.cpp
++index 7ae9aa8..6654714 100644
++--- openjdk.orig/hotspot/src/share/vm/runtime/frame.cpp
+++++ openjdk/hotspot/src/share/vm/runtime/frame.cpp
++@@ -59,6 +59,9 @@
++ #ifdef TARGET_ARCH_ppc
++ # include "nativeInst_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "nativeInst_aarch64.hpp"
+++#endif
++
++ RegisterMap::RegisterMap(JavaThread *thread, bool update_map) {
++ _thread = thread;
++diff --git openjdk.orig/hotspot/src/share/vm/runtime/frame.hpp openjdk/hotspot/src/share/vm/runtime/frame.hpp
++index c55380e..c13caae 100644
++--- openjdk.orig/hotspot/src/share/vm/runtime/frame.hpp
+++++ openjdk/hotspot/src/share/vm/runtime/frame.hpp
++@@ -50,6 +50,9 @@
++ #ifdef TARGET_ARCH_MODEL_ppc
++ # include "adfiles/adGlobals_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_MODEL_aarch64
+++# include "adfiles/adGlobals_aarch64.hpp"
+++#endif
++ #endif
++ #ifdef ZERO
++ #ifdef TARGET_ARCH_zero
++@@ -491,6 +494,9 @@ class frame VALUE_OBJ_CLASS_SPEC {
++ #ifdef TARGET_ARCH_ppc
++ # include "frame_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "frame_aarch64.hpp"
+++#endif
++
++ };
++
++diff --git openjdk.orig/hotspot/src/share/vm/runtime/frame.inline.hpp openjdk/hotspot/src/share/vm/runtime/frame.inline.hpp
++index b80b042..f6e1b0e 100644
++--- openjdk.orig/hotspot/src/share/vm/runtime/frame.inline.hpp
+++++ openjdk/hotspot/src/share/vm/runtime/frame.inline.hpp
++@@ -46,6 +46,9 @@
++ #ifdef TARGET_ARCH_ppc
++ # include "jniTypes_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "jniTypes_aarch64.hpp"
+++#endif
++ #ifdef ZERO
++ #ifdef TARGET_ARCH_zero
++ # include "entryFrame_zero.hpp"
++@@ -100,6 +103,9 @@ inline bool frame::is_first_frame() const {
++ #ifdef TARGET_ARCH_ppc
++ # include "frame_ppc.inline.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "frame_aarch64.inline.hpp"
+++#endif
++
++
++ #endif // SHARE_VM_RUNTIME_FRAME_INLINE_HPP
++diff --git openjdk.orig/hotspot/src/share/vm/runtime/globals.hpp openjdk/hotspot/src/share/vm/runtime/globals.hpp
++index 10d74cd..4cc5dfb 100644
++--- openjdk.orig/hotspot/src/share/vm/runtime/globals.hpp
+++++ openjdk/hotspot/src/share/vm/runtime/globals.hpp
++@@ -52,6 +52,9 @@
++ #ifdef TARGET_ARCH_ppc
++ # include "globals_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "globals_aarch64.hpp"
+++#endif
++ #ifdef TARGET_OS_FAMILY_linux
++ # include "globals_linux.hpp"
++ #endif
++@@ -88,6 +91,9 @@
++ #ifdef TARGET_OS_ARCH_linux_ppc
++ # include "globals_linux_ppc.hpp"
++ #endif
+++#ifdef TARGET_OS_ARCH_linux_aarch64
+++# include "globals_linux_aarch64.hpp"
+++#endif
++ #ifdef TARGET_OS_ARCH_bsd_x86
++ # include "globals_bsd_x86.hpp"
++ #endif
++@@ -107,6 +113,9 @@
++ #ifdef TARGET_ARCH_ppc
++ # include "c1_globals_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "c1_globals_aarch64.hpp"
+++#endif
++ #ifdef TARGET_OS_FAMILY_linux
++ # include "c1_globals_linux.hpp"
++ #endif
++@@ -130,6 +139,9 @@
++ #ifdef TARGET_ARCH_arm
++ # include "c2_globals_arm.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "c2_globals_aarch64.hpp"
+++#endif
++ #ifdef TARGET_OS_FAMILY_linux
++ # include "c2_globals_linux.hpp"
++ #endif
++diff --git openjdk.orig/hotspot/src/share/vm/runtime/icache.hpp openjdk/hotspot/src/share/vm/runtime/icache.hpp
++index d460a0f..9a3b9c8 100644
++--- openjdk.orig/hotspot/src/share/vm/runtime/icache.hpp
+++++ openjdk/hotspot/src/share/vm/runtime/icache.hpp
++@@ -83,6 +83,9 @@ class AbstractICache : AllStatic {
++ #ifdef TARGET_ARCH_ppc
++ # include "icache_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "icache_aarch64.hpp"
+++#endif
++
++
++
++diff --git openjdk.orig/hotspot/src/share/vm/runtime/java.cpp openjdk/hotspot/src/share/vm/runtime/java.cpp
++index fc3b67a..46794b0 100644
++--- openjdk.orig/hotspot/src/share/vm/runtime/java.cpp
+++++ openjdk/hotspot/src/share/vm/runtime/java.cpp
++@@ -78,6 +78,9 @@
++ #ifdef TARGET_ARCH_ppc
++ # include "vm_version_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "vm_version_aarch64.hpp"
+++#endif
++ #ifdef TARGET_OS_FAMILY_linux
++ # include "thread_linux.inline.hpp"
++ #endif
++diff --git openjdk.orig/hotspot/src/share/vm/runtime/javaCalls.hpp openjdk/hotspot/src/share/vm/runtime/javaCalls.hpp
++index d4f8595..bc2ca9b 100644
++--- openjdk.orig/hotspot/src/share/vm/runtime/javaCalls.hpp
+++++ openjdk/hotspot/src/share/vm/runtime/javaCalls.hpp
++@@ -45,6 +45,9 @@
++ #ifdef TARGET_ARCH_ppc
++ # include "jniTypes_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "jniTypes_aarch64.hpp"
+++#endif
++ #ifdef TARGET_OS_FAMILY_linux
++ # include "thread_linux.inline.hpp"
++ #endif
++diff --git openjdk.orig/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp openjdk/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp
++index 8374aa2..6be5f79 100644
++--- openjdk.orig/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp
+++++ openjdk/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp
++@@ -47,6 +47,9 @@
++ #ifdef TARGET_OS_ARCH_linux_arm
++ # include "orderAccess_linux_arm.inline.hpp"
++ #endif
+++#ifdef TARGET_OS_ARCH_linux_aarch64
+++# include "orderAccess_linux_aarch64.inline.hpp"
+++#endif
++ #ifdef TARGET_OS_ARCH_linux_ppc
++ # include "orderAccess_linux_ppc.inline.hpp"
++ #endif
++@@ -121,6 +124,9 @@ friend class JavaCallWrapper;
++ #ifdef TARGET_ARCH_ppc
++ # include "javaFrameAnchor_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "javaFrameAnchor_aarch64.hpp"
+++#endif
++
++
++ public:
++diff --git openjdk.orig/hotspot/src/share/vm/runtime/os.hpp openjdk/hotspot/src/share/vm/runtime/os.hpp
++index 5867deb..0f1fbb4 100644
++--- openjdk.orig/hotspot/src/share/vm/runtime/os.hpp
+++++ openjdk/hotspot/src/share/vm/runtime/os.hpp
++@@ -719,6 +719,9 @@ class os: AllStatic {
++ #ifdef TARGET_OS_ARCH_linux_ppc
++ # include "os_linux_ppc.hpp"
++ #endif
+++#ifdef TARGET_OS_ARCH_linux_aarch64
+++# include "os_linux_aarch64.hpp"
+++#endif
++ #ifdef TARGET_OS_ARCH_bsd_x86
++ # include "os_bsd_x86.hpp"
++ #endif
++diff --git openjdk.orig/hotspot/src/share/vm/runtime/registerMap.hpp openjdk/hotspot/src/share/vm/runtime/registerMap.hpp
++index 5dd677a..7bd425f 100644
++--- openjdk.orig/hotspot/src/share/vm/runtime/registerMap.hpp
+++++ openjdk/hotspot/src/share/vm/runtime/registerMap.hpp
++@@ -42,6 +42,9 @@
++ #ifdef TARGET_ARCH_ppc
++ # include "register_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "register_aarch64.hpp"
+++#endif
++
++ class JavaThread;
++
++@@ -150,6 +153,9 @@ class RegisterMap : public StackObj {
++ #ifdef TARGET_ARCH_ppc
++ # include "registerMap_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "registerMap_aarch64.hpp"
+++#endif
++
++ };
++
++diff --git openjdk.orig/hotspot/src/share/vm/runtime/relocator.hpp openjdk/hotspot/src/share/vm/runtime/relocator.hpp
++index c34866f..790bd80 100644
++--- openjdk.orig/hotspot/src/share/vm/runtime/relocator.hpp
+++++ openjdk/hotspot/src/share/vm/runtime/relocator.hpp
++@@ -42,6 +42,9 @@
++ #ifdef TARGET_ARCH_ppc
++ # include "bytes_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "bytes_aarch64.hpp"
+++#endif
++
++ // This code has been converted from the 1.1E java virtual machine
++ // Thanks to the JavaTopics group for using the code
++diff --git openjdk.orig/hotspot/src/share/vm/runtime/safepoint.cpp openjdk/hotspot/src/share/vm/runtime/safepoint.cpp
++index c29d257..a842bb3 100644
++--- openjdk.orig/hotspot/src/share/vm/runtime/safepoint.cpp
+++++ openjdk/hotspot/src/share/vm/runtime/safepoint.cpp
++@@ -70,6 +70,10 @@
++ # include "nativeInst_ppc.hpp"
++ # include "vmreg_ppc.inline.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "nativeInst_aarch64.hpp"
+++# include "vmreg_aarch64.inline.hpp"
+++#endif
++ #ifdef TARGET_OS_FAMILY_linux
++ # include "thread_linux.inline.hpp"
++ #endif
++diff --git openjdk.orig/hotspot/src/share/vm/runtime/sharedRuntime.cpp openjdk/hotspot/src/share/vm/runtime/sharedRuntime.cpp
++index c25dcfe..aa7caff 100644
++--- openjdk.orig/hotspot/src/share/vm/runtime/sharedRuntime.cpp
+++++ openjdk/hotspot/src/share/vm/runtime/sharedRuntime.cpp
++@@ -76,6 +76,10 @@
++ # include "nativeInst_ppc.hpp"
++ # include "vmreg_ppc.inline.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "nativeInst_aarch64.hpp"
+++# include "vmreg_aarch64.inline.hpp"
+++#endif
++ #ifdef COMPILER1
++ #include "c1/c1_Runtime1.hpp"
++ #endif
++diff --git openjdk.orig/hotspot/src/share/vm/runtime/stackValueCollection.cpp openjdk/hotspot/src/share/vm/runtime/stackValueCollection.cpp
++index 110f712..779f994 100644
++--- openjdk.orig/hotspot/src/share/vm/runtime/stackValueCollection.cpp
+++++ openjdk/hotspot/src/share/vm/runtime/stackValueCollection.cpp
++@@ -39,6 +39,9 @@
++ #ifdef TARGET_ARCH_ppc
++ # include "jniTypes_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "jniTypes_aarch64.hpp"
+++#endif
++
++ jint StackValueCollection::int_at(int slot) const {
++ intptr_t val = at(slot)->get_int();
++diff --git openjdk.orig/hotspot/src/share/vm/runtime/statSampler.cpp openjdk/hotspot/src/share/vm/runtime/statSampler.cpp
++index 0b24def..c82a214 100644
++--- openjdk.orig/hotspot/src/share/vm/runtime/statSampler.cpp
+++++ openjdk/hotspot/src/share/vm/runtime/statSampler.cpp
++@@ -48,6 +48,9 @@
++ #ifdef TARGET_ARCH_ppc
++ # include "vm_version_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "vm_version_aarch64.hpp"
+++#endif
++
++ // --------------------------------------------------------
++ // StatSamplerTask
++diff --git openjdk.orig/hotspot/src/share/vm/runtime/stubCodeGenerator.cpp openjdk/hotspot/src/share/vm/runtime/stubCodeGenerator.cpp
++index b6068a5..4ef7e38 100644
++--- openjdk.orig/hotspot/src/share/vm/runtime/stubCodeGenerator.cpp
+++++ openjdk/hotspot/src/share/vm/runtime/stubCodeGenerator.cpp
++@@ -42,6 +42,9 @@
++ #ifdef TARGET_ARCH_ppc
++ # include "assembler_ppc.inline.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "assembler_aarch64.inline.hpp"
+++#endif
++
++
++ // Implementation of StubCodeDesc
++diff --git openjdk.orig/hotspot/src/share/vm/runtime/stubRoutines.hpp openjdk/hotspot/src/share/vm/runtime/stubRoutines.hpp
++index 8481dce..f233b56 100644
++--- openjdk.orig/hotspot/src/share/vm/runtime/stubRoutines.hpp
+++++ openjdk/hotspot/src/share/vm/runtime/stubRoutines.hpp
++@@ -46,6 +46,9 @@
++ #ifdef TARGET_ARCH_ppc
++ # include "nativeInst_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "nativeInst_aarch64.hpp"
+++#endif
++
++ // StubRoutines provides entry points to assembly routines used by
++ // compiled code and the run-time system. Platform-specific entry
++@@ -116,6 +119,9 @@ class StubRoutines: AllStatic {
++ #endif
++ #ifdef TARGET_ARCH_MODEL_ppc
++ # include "stubRoutines_ppc.hpp"
+++#endif
+++#ifdef TARGET_ARCH_MODEL_aarch64
+++# include "stubRoutines_aarch64.hpp"
++ #endif
++
++
++diff --git openjdk.orig/hotspot/src/share/vm/runtime/thread.hpp openjdk/hotspot/src/share/vm/runtime/thread.hpp
++index 7846cc0..6964c22 100644
++--- openjdk.orig/hotspot/src/share/vm/runtime/thread.hpp
+++++ openjdk/hotspot/src/share/vm/runtime/thread.hpp
++@@ -1651,6 +1651,9 @@ public:
++ #ifdef TARGET_OS_ARCH_linux_ppc
++ # include "thread_linux_ppc.hpp"
++ #endif
+++#ifdef TARGET_OS_ARCH_linux_aarch64
+++# include "thread_linux_aarch64.hpp"
+++#endif
++ #ifdef TARGET_OS_ARCH_bsd_x86
++ # include "thread_bsd_x86.hpp"
++ #endif
++diff --git openjdk.orig/hotspot/src/share/vm/runtime/threadLocalStorage.hpp openjdk/hotspot/src/share/vm/runtime/threadLocalStorage.hpp
++index c2f7a9e..26ef559 100644
++--- openjdk.orig/hotspot/src/share/vm/runtime/threadLocalStorage.hpp
+++++ openjdk/hotspot/src/share/vm/runtime/threadLocalStorage.hpp
++@@ -68,6 +68,9 @@ class ThreadLocalStorage : AllStatic {
++ #ifdef TARGET_OS_ARCH_linux_ppc
++ # include "threadLS_linux_ppc.hpp"
++ #endif
+++#ifdef TARGET_OS_ARCH_linux_aarch64
+++# include "threadLS_linux_aarch64.hpp"
+++#endif
++ #ifdef TARGET_OS_ARCH_bsd_x86
++ # include "threadLS_bsd_x86.hpp"
++ #endif
++diff --git openjdk.orig/hotspot/src/share/vm/runtime/vmStructs.cpp openjdk/hotspot/src/share/vm/runtime/vmStructs.cpp
++index 8afd933..359f9fc 100644
++--- openjdk.orig/hotspot/src/share/vm/runtime/vmStructs.cpp
+++++ openjdk/hotspot/src/share/vm/runtime/vmStructs.cpp
++@@ -125,6 +125,9 @@
++ #ifdef TARGET_ARCH_ppc
++ # include "vmStructs_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "vmStructs_aarch64.hpp"
+++#endif
++ #ifdef TARGET_OS_FAMILY_linux
++ # include "thread_linux.inline.hpp"
++ #endif
++@@ -161,6 +164,9 @@
++ #ifdef TARGET_OS_ARCH_linux_ppc
++ # include "vmStructs_linux_ppc.hpp"
++ #endif
+++#ifdef TARGET_OS_ARCH_linux_aarch64
+++# include "vmStructs_linux_aarch64.hpp"
+++#endif
++ #ifdef TARGET_OS_ARCH_bsd_x86
++ # include "vmStructs_bsd_x86.hpp"
++ #endif
++@@ -221,6 +227,9 @@
++ #ifdef TARGET_ARCH_MODEL_ppc
++ # include "adfiles/adGlobals_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_MODEL_aarch64
+++# include "adfiles/adGlobals_aarch64.hpp"
+++#endif
++ #endif
++
++ // Note: the cross-product of (c1, c2, product, nonproduct, ...),
++diff --git openjdk.orig/hotspot/src/share/vm/runtime/vm_version.cpp openjdk/hotspot/src/share/vm/runtime/vm_version.cpp
++index 2d51b67..bba9b01 100644
++--- openjdk.orig/hotspot/src/share/vm/runtime/vm_version.cpp
+++++ openjdk/hotspot/src/share/vm/runtime/vm_version.cpp
++@@ -41,6 +41,9 @@
++ #ifdef TARGET_ARCH_ppc
++ # include "vm_version_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "vm_version_aarch64.hpp"
+++#endif
++
++ const char* Abstract_VM_Version::_s_vm_release = Abstract_VM_Version::vm_release();
++ const char* Abstract_VM_Version::_s_internal_vm_info_string = Abstract_VM_Version::internal_vm_info_string();
++@@ -185,6 +188,7 @@ const char* Abstract_VM_Version::jre_release_version() {
++ AMD64_ONLY("amd64") \
++ ARM_ONLY("arm") \
++ PPC_ONLY("ppc") \
+++ AARCH64_ONLY("aarch64") \
++ SPARC_ONLY("sparc")
++ #endif // ZERO
++
++diff --git openjdk.orig/hotspot/src/share/vm/utilities/copy.hpp openjdk/hotspot/src/share/vm/utilities/copy.hpp
++index 3dcbfee..198590f 100644
++--- openjdk.orig/hotspot/src/share/vm/utilities/copy.hpp
+++++ openjdk/hotspot/src/share/vm/utilities/copy.hpp
++@@ -337,6 +337,9 @@ class Copy : AllStatic {
++ #ifdef TARGET_ARCH_ppc
++ # include "copy_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "copy_aarch64.hpp"
+++#endif
++
++ };
++
++diff --git openjdk.orig/hotspot/src/share/vm/utilities/globalDefinitions.hpp openjdk/hotspot/src/share/vm/utilities/globalDefinitions.hpp
++index b55b0ac..5d11e26 100644
++--- openjdk.orig/hotspot/src/share/vm/utilities/globalDefinitions.hpp
+++++ openjdk/hotspot/src/share/vm/utilities/globalDefinitions.hpp
++@@ -346,6 +346,9 @@ extern int LogMinObjAlignmentInBytes;
++ #ifdef TARGET_ARCH_ppc
++ # include "globalDefinitions_ppc.hpp"
++ #endif
+++#ifdef TARGET_ARCH_aarch64
+++# include "globalDefinitions_aarch64.hpp"
+++#endif
++
++
++ // The byte alignment to be used by Arena::Amalloc. See bugid 4169348.
++diff --git openjdk.orig/hotspot/src/share/vm/utilities/macros.hpp openjdk/hotspot/src/share/vm/utilities/macros.hpp
++index 003f2af..2aa7f87 100644
++--- openjdk.orig/hotspot/src/share/vm/utilities/macros.hpp
+++++ openjdk/hotspot/src/share/vm/utilities/macros.hpp
++@@ -261,6 +261,14 @@
++ #define NOT_ARM(code) code
++ #endif
++
+++#ifdef AARCH64
+++#define AARCH64_ONLY(code) code
+++#define NOT_AARCH64(code)
+++#else
+++#define AARCH64_ONLY(code)
+++#define NOT_AARCH64(code) code
+++#endif
+++
++ #ifdef JAVASE_EMBEDDED
++ #define EMBEDDED_ONLY(code) code
++ #define NOT_EMBEDDED(code)
+--
+2.26.2
+
diff --git a/gnu/packages/patches/icedtea-6-hotspot-gcc-segfault-workaround.patch b/gnu/packages/patches/icedtea-6-hotspot-gcc-segfault-workaround.patch
deleted file mode 100644
index ef090e0ec9..0000000000
--- a/gnu/packages/patches/icedtea-6-hotspot-gcc-segfault-workaround.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-# HG changeset patch
-# User Gábor Boskovits <boskovits@gmail.com>
-# Date 1530519413 -7200
-# Mon Jul 02 10:16:53 2018 +0200
-# Node ID 77e5bc9e238a28d17e097647badc04ed67a6a452
-# Parent 1ae05a34e052d1672b4a7894ddf5fc2f662eb861
-Fix gcc segfault.
-
-diff -r 1ae05a34e052 -r 77e5bc9e238a src/share/vm/opto/output.cpp
---- a/src/share/vm/opto/output.cpp Sun Dec 25 23:52:13 2016 +0000
-+++ b/src/share/vm/opto/output.cpp Mon Jul 02 10:16:53 2018 +0200
-@@ -1758,6 +1758,8 @@
-
- // Initializer for class Scheduling
-
-+volatile const void *eePointer = Pipeline_Use::elaborated_elements;
-+
- Scheduling::Scheduling(Arena *arena, Compile &compile)
- : _arena(arena),
- _cfg(compile.cfg()),
-@@ -1802,8 +1804,8 @@
-
- // Clear the bundling information
- memcpy(_bundle_use_elements,
-- Pipeline_Use::elaborated_elements,
-- sizeof(Pipeline_Use::elaborated_elements));
-+ (void *)eePointer,
-+ 11*sizeof(Pipeline_Use_Element));
-
- // Get the last node
- Block *bb = _cfg->_blocks[_cfg->_blocks.size()-1];
-@@ -1854,8 +1856,8 @@
- _bundle_use.reset();
-
- memcpy(_bundle_use_elements,
-- Pipeline_Use::elaborated_elements,
-- sizeof(Pipeline_Use::elaborated_elements));
-+ (void *)eePointer,
-+ 11*sizeof(Pipeline_Use_Element));
- }
-
- //------------------------------ScheduleAndBundle------------------------------
diff --git a/gnu/packages/patches/icedtea-7-hotspot-aarch64-use-c++98.patch b/gnu/packages/patches/icedtea-7-hotspot-aarch64-use-c++98.patch
new file mode 100644
index 0000000000..7ad215f975
--- /dev/null
+++ b/gnu/packages/patches/icedtea-7-hotspot-aarch64-use-c++98.patch
@@ -0,0 +1,33 @@
+From 919dd016be1abd213b3a7d0e9a3b79e3286ef6ad Mon Sep 17 00:00:00 2001
+From: Simon South <simon@simonsouth.net>
+Date: Wed, 10 Jun 2020 13:02:09 -0400
+Subject: [PATCH] aarch64: Use only C++98
+
+This patch removes an unneeded C++ template that causes the build to
+fail for aarch64 using gcc 7.5.0 and its default support for only the
+C++98 standard.
+
+It is based on original work by Severin Gehwolf <sgehwolf@redhat.com>.
+See: https://bugzilla.redhat.com/show_bug.cgi?id=1307224
+---
+ src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp b/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp
+index 0bc0a2b..6f73ca0 100644
+--- a/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp
++++ b/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp
+@@ -194,10 +194,6 @@ static int reg2offset_out(VMReg r) {
+ return (r->reg2stack() + SharedRuntime::out_preserve_stack_slots()) * VMRegImpl::stack_slot_size;
+ }
+
+-template <class T> static const T& min (const T& a, const T& b) {
+- return (a > b) ? b : a;
+-}
+-
+ // ---------------------------------------------------------------------------
+ // Read the array of BasicTypes from a signature, and compute where the
+ // arguments should go. Values in the VMRegPair regs array refer to 4-byte
+--
+2.26.2
+
diff --git a/gnu/packages/patches/icedtea-7-hotspot-gcc-segfault-workaround.patch b/gnu/packages/patches/icedtea-7-hotspot-gcc-segfault-workaround.patch
deleted file mode 100644
index 35cfe38152..0000000000
--- a/gnu/packages/patches/icedtea-7-hotspot-gcc-segfault-workaround.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From 2f0ef2c69e99e1096a2a72c7a29025a736b044b4 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?G=C3=A1bor=20Boskovits?= <boskovits@gmail.com>
-Date: Mon, 2 Jul 2018 23:37:25 +0200
-Subject: [PATCH] Fix gcc segfault.
-
----
- src/share/vm/opto/output.cpp | 8 +++++---
- 1 file changed, 5 insertions(+), 3 deletions(-)
-
-diff --git a/src/share/vm/opto/output.cpp b/src/share/vm/opto/output.cpp
-index d46cb87..0eb9eda 100644
---- a/src/share/vm/opto/output.cpp
-+++ b/src/share/vm/opto/output.cpp
-@@ -1787,6 +1787,8 @@ uint Scheduling::_total_instructions_per_bundle[Pipeline::_max_instrs_per_cycle+
-
- // Initializer for class Scheduling
-
-+volatile const void *eePointer = Pipeline_Use::elaborated_elements;
-+
- Scheduling::Scheduling(Arena *arena, Compile &compile)
- : _arena(arena),
- _cfg(compile.cfg()),
-@@ -1829,7 +1831,7 @@ Scheduling::Scheduling(Arena *arena, Compile &compile)
- memset(_current_latency, 0, node_max * sizeof(unsigned short));
-
- // Clear the bundling information
-- memcpy(_bundle_use_elements, Pipeline_Use::elaborated_elements, sizeof(Pipeline_Use::elaborated_elements));
-+ memcpy(_bundle_use_elements, (void *)eePointer, 11*sizeof(Pipeline_Use_Element));
-
- // Get the last node
- Block* block = _cfg->get_block(_cfg->number_of_blocks() - 1);
-@@ -1880,8 +1882,8 @@ void Scheduling::step_and_clear() {
- _bundle_use.reset();
-
- memcpy(_bundle_use_elements,
-- Pipeline_Use::elaborated_elements,
-- sizeof(Pipeline_Use::elaborated_elements));
-+ (void *)eePointer,
-+ 11*sizeof(Pipeline_Use_Element));
- }
-
- // Perform instruction scheduling and bundling over the sequence of
---
-2.18.0
-
diff --git a/gnu/packages/patches/jamvm-1.5.1-aarch64-support.patch b/gnu/packages/patches/jamvm-1.5.1-aarch64-support.patch
new file mode 100644
index 0000000000..8867d4f191
--- /dev/null
+++ b/gnu/packages/patches/jamvm-1.5.1-aarch64-support.patch
@@ -0,0 +1,572 @@
+From 9c83c3d3f443eb92f87dc87c7dcfe95577b95621 Mon Sep 17 00:00:00 2001
+From: Simon South <simon@simonsouth.net>
+Date: Thu, 28 May 2020 14:29:55 -0400
+Subject: [PATCH] Add support for aarch64 on GNU/Linux
+
+---
+ configure.ac | 10 +-
+ src/arch/Makefile.am | 2 +-
+ src/arch/aarch64.h | 110 ++++++++++++++++
+ src/os/linux/Makefile.am | 2 +-
+ src/os/linux/aarch64/Makefile.am | 28 ++++
+ src/os/linux/aarch64/callNative.S | 212 ++++++++++++++++++++++++++++++
+ src/os/linux/aarch64/dll_md.c | 59 +++++++++
+ src/os/linux/aarch64/init.c | 51 +++++++
+ 8 files changed, 469 insertions(+), 5 deletions(-)
+ create mode 100644 src/arch/aarch64.h
+ create mode 100644 src/os/linux/aarch64/Makefile.am
+ create mode 100644 src/os/linux/aarch64/callNative.S
+ create mode 100644 src/os/linux/aarch64/dll_md.c
+ create mode 100644 src/os/linux/aarch64/init.c
+
+diff --git a/configure.ac b/configure.ac
+index ccd530f..707f281 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -43,6 +43,7 @@ amd64-*-freebsd*) host_os=bsd libdl_needed=no ;;
+ arm*-*-linux*) host_cpu=arm host_os=linux ;;
+ arm*-*-openbsd*) host_cpu=arm host_os=bsd libdl_needed=no ;;
+ arm*-*-freebsd*) host_cpu=arm host_os=bsd libdl_needed=no ;;
++aarch64*-*-linux*) host_cpu=aarch64 host_os=linux ;;
+ powerpc*-*-linux*) host_cpu=powerpc host_os=linux ;;
+ powerpc*-*-openbsd*) host_cpu=powerpc host_os=bsd libdl_needed=no ;;
+ powerpc*-*-freebsd*) host_cpu=powerpc host_os=bsd libdl_needed=no ;;
+@@ -149,9 +150,11 @@ AC_ARG_ENABLE(runtime-reloc-checks,
+
+ AC_ARG_ENABLE(int-inlining,
+ [AS_HELP_STRING(--enable-int-inlining,enable inline threaded version of the interpreter
+- (by default enabled on x86_64, i386 and powerpc, disabled otherwise))],,
+- [if test "$host_cpu" = x86_64 -o "$host_cpu" = i386 -o "$host_cpu" = powerpc && \
+- test "$cross_compiling" = no -o "$enable_runtime_reloc_checks" != no; then
++ (by default enabled on x86_64, i386, powerpc and aarch64,
++ disabled otherwise))],,
++ [if test "$host_cpu" = x86_64 -o "$host_cpu" = i386 -o "$host_cpu" = powerpc -o \
++ "$host_cpu" = aarch64 && test "$cross_compiling" = no -o \
++ "$enable_runtime_reloc_checks" != no; then
+ enable_int_inlining=yes
+ else
+ enable_int_inlining=no
+@@ -298,6 +301,7 @@ AC_CONFIG_FILES(
+ src/os/linux/x86_64/Makefile \
+ src/os/linux/parisc/Makefile \
+ src/os/linux/mips/Makefile \
++ src/os/linux/aarch64/Makefile \
+ src/os/darwin/i386/Makefile \
+ src/os/darwin/arm/Makefile \
+ src/os/darwin/powerpc/Makefile \
+diff --git a/src/arch/Makefile.am b/src/arch/Makefile.am
+index 078c1de..afb26d1 100644
+--- a/src/arch/Makefile.am
++++ b/src/arch/Makefile.am
+@@ -19,4 +19,4 @@
+ ## Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ ##
+
+-EXTRA_DIST = powerpc.h arm.h i386.h x86_64.h parisc.h mips.h
++EXTRA_DIST = powerpc.h arm.h i386.h x86_64.h parisc.h mips.h aarch64.h
+diff --git a/src/arch/aarch64.h b/src/arch/aarch64.h
+new file mode 100644
+index 0000000..c96aa9f
+--- /dev/null
++++ b/src/arch/aarch64.h
+@@ -0,0 +1,110 @@
++/*
++ * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008
++ * Robert Lougher <rob@lougher.org.uk>.
++ * Copyright (C) 2020 Simon South <simon@simonsouth.net>.
++ *
++ * This file is part of JamVM.
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License
++ * as published by the Free Software Foundation; either version 2,
++ * or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
++ */
++
++#include <stdint.h>
++
++#define OS_ARCH "aarch64"
++
++#define HANDLER_TABLE_T static const void
++#define DOUBLE_1_BITS 0x3ff0000000000000LL
++
++#define READ_DBL(v,p,l) v = ((u8)p[0]<<56)|((u8)p[1]<<48)|((u8)p[2]<<40) \
++ |((u8)p[3]<<32)|((u8)p[4]<<24)|((u8)p[5]<<16) \
++ |((u8)p[6]<<8)|(u8)p[7]; p+=8
++
++/* Needed for i386 -- empty here */
++#define FPU_HACK
++
++#define COMPARE_AND_SWAP_64(addr, old_val, new_val) \
++({ \
++ int result, read_val; \
++ __asm__ __volatile__ (" \
++ 1: ldaxr %2, %1; \
++ cmp %2, %3; \
++ b.ne 2f; \
++ stlxr %w0, %4, %1; \
++ cmp %w0, wzr; \
++ b.ne 1b; \
++ 2: cset %w0, eq;" \
++ : "=&r" (result), "+Q" (*addr), "=&r" (read_val) \
++ : "r" (old_val), "r" (new_val) \
++ : "cc"); \
++ result; \
++})
++
++#define COMPARE_AND_SWAP(addr, old_val, new_val) \
++ COMPARE_AND_SWAP_64(addr, old_val, new_val)
++
++#define LOCKWORD_READ(addr) \
++({ \
++ uintptr_t result; \
++ __asm__ __volatile__ (" \
++ ldar %0, %1;" \
++ : "=r" (result) \
++ : "Q" (*addr) \
++ : "cc"); \
++ result; \
++})
++
++#define LOCKWORD_WRITE(addr, value) \
++({ \
++ __asm__ __volatile__ (" \
++ stlr %1, %0;" \
++ : "=Q" (*addr) \
++ : "r" (value) \
++ : "cc"); \
++})
++
++#define LOCKWORD_COMPARE_AND_SWAP(addr, old_val, new_val) \
++ COMPARE_AND_SWAP_64(addr, old_val, new_val)
++
++#define FLUSH_CACHE(addr, length) \
++{ \
++ uintptr_t start = (uintptr_t) (addr); \
++ uintptr_t end = start + length; \
++ uintptr_t i; \
++ \
++ for(i = start & aarch64_data_cache_line_mask; \
++ i < end; \
++ i += aarch64_data_cache_line_len) \
++ __asm__ ("dc cvau, %0" :: "r" (i)); \
++ \
++ __asm__ ("dsb ish"); \
++ \
++ for(i = start & aarch64_instruction_cache_line_mask; \
++ i < end; \
++ i += aarch64_instruction_cache_line_len) \
++ __asm__ ("ic ivau, %0" :: "r" (i)); \
++ \
++ __asm__ ("dsb ish; isb"); \
++}
++
++#define MBARRIER() __asm__ ("dmb ish" ::: "memory")
++#define UNLOCK_MBARRIER() __asm__ ("dmb ish" ::: "memory")
++#define JMM_LOCK_MBARRIER() __asm__ ("dmb ish" ::: "memory")
++#define JMM_UNLOCK_MBARRIER() JMM_LOCK_MBARRIER()
++
++/* Defined in src/os/linux/aarch64/init.c */
++extern unsigned char aarch64_data_cache_line_len;
++extern uintptr_t aarch64_data_cache_line_mask;
++extern unsigned char aarch64_instruction_cache_line_len;
++extern uintptr_t aarch64_instruction_cache_line_mask;
+diff --git a/src/os/linux/Makefile.am b/src/os/linux/Makefile.am
+index aa29be1..d582b97 100644
+--- a/src/os/linux/Makefile.am
++++ b/src/os/linux/Makefile.am
+@@ -20,7 +20,7 @@
+ ##
+
+ SUBDIRS = @arch@
+-DIST_SUBDIRS = powerpc arm i386 x86_64 parisc mips
++DIST_SUBDIRS = powerpc arm i386 x86_64 parisc mips aarch64
+
+ noinst_LTLIBRARIES = libos.la
+ libos_la_SOURCES = os.c
+diff --git a/src/os/linux/aarch64/Makefile.am b/src/os/linux/aarch64/Makefile.am
+new file mode 100644
+index 0000000..1024c3a
+--- /dev/null
++++ b/src/os/linux/aarch64/Makefile.am
+@@ -0,0 +1,28 @@
++##
++## Copyright (C) 2003, 2004, 2005, 2006, 2007, 2010, 2011, 2012
++## Robert Lougher <rob@lougher.org.uk>.
++##
++## File added by Simon South <simon@simonsouth.net>.
++##
++## This file is part of JamVM.
++##
++## This program is free software; you can redistribute it and/or
++## modify it under the terms of the GNU General Public License
++## as published by the Free Software Foundation; either version 2,
++## or (at your option) any later version.
++##
++## This program is distributed in the hope that it will be useful,
++## but WITHOUT ANY WARRANTY; without even the implied warranty of
++## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++## GNU General Public License for more details.
++##
++## You should have received a copy of the GNU General Public License
++## along with this program; if not, write to the Free Software
++## Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
++##
++
++noinst_LTLIBRARIES = libnative.la
++libnative_la_SOURCES = init.c dll_md.c callNative.S
++
++AM_CPPFLAGS = -I$(top_builddir)/src -I$(top_srcdir)/src
++AM_CCASFLAGS = -I$(top_builddir)/src
+diff --git a/src/os/linux/aarch64/callNative.S b/src/os/linux/aarch64/callNative.S
+new file mode 100644
+index 0000000..e067c4f
+--- /dev/null
++++ b/src/os/linux/aarch64/callNative.S
+@@ -0,0 +1,212 @@
++/*
++ * Copyright (C) 2008, 2009, 2011, 2012 Robert Lougher <rob@jamvm.org.uk>.
++ * Copyright (C) 2020 Simon South <simon@simonsouth.net>.
++ *
++ * This file is part of JamVM.
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License
++ * as published by the Free Software Foundation; either version 2,
++ * or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
++ */
++
++#include "config.h"
++
++#ifndef USE_FFI
++ .text
++ .arch armv8-a
++ .align 2
++ .global callJNIMethod
++ .type callJNIMethod,function
++
++/*
++ * Arguments passed in:
++ *
++ * x0 JNIEnv
++ * x1 class or NULL
++ * x2 sig
++ * w3 extra arg
++ * x4 ostack
++ * x5 function pntr
++ * w6 args count
++ */
++
++/* Register usage:
++ *
++ * x20 ostack
++ * x19 sig pntr
++ * x16 function pntr
++ * x15 ostack pntr
++ * x14 args pntr
++ * x13 float/double handler
++ * x12 int/long handler
++ * w11 fp regs remaining
++ * w10 int regs remaining
++ * x9 scratch
++ * x2-x7 outgoing int args
++ * x1 outgoing class or this pntr
++ * x0 outgoing JNIEnv (as passed in)
++ *
++ * d0 - d7 outgoing float args
++ */
++
++callJNIMethod:
++ stp x29, x30, [sp, #-32]!
++ mov x29, sp
++ stp x19, x20, [x29, #16]
++
++ sub sp, sp, w3 /* allocate room for stacked args */
++ mov x14, sp
++
++ mov x20, x4 /* preserve ostack */
++ add x19, x2, #1 /* init sig pntr -- skipping '(' */
++
++ mov x16, x5 /* save function pntr */
++ mov x15, x20 /* init ostack pntr */
++
++ adr x13, fp_reg_handlers-8
++ adr x12, int_reg_handlers-8
++
++ mov w11, #8 /* fp regs remaining */
++ mov w10, #6 /* int regs remaining */
++
++ cbnz x1, scan_sig /* is method non-static? */
++ ldr x1, [x15], #8 /* yes, load x1 with "this" */
++
++scan_sig:
++ ldrb w9, [x19], #1 /* get next sig char */
++
++ cmp w9, #41 /* ')' */
++ b.eq done
++
++ cmp w9, #74 /* 'J' */
++ b.eq long
++
++ cmp w9, #70 /* 'F' */
++ b.eq float
++
++ cmp w9, #68 /* 'D' */
++ b.eq double
++
++skip_brackets:
++ cmp w9, #91 /* '[' */
++ b.ne 1f
++ ldrb w9, [x19], #1
++ b skip_brackets
++1:
++ cmp w9, #76 /* 'L' */
++ b.ne int
++
++skip_ref:
++ ldrb w9, [x19], #1
++ cmp w9, #59 /* ';' */
++ b.ne skip_ref
++
++int:
++ ldr x9, [x15], #8
++ cbz w10, stack_push
++
++load_int_reg:
++ sub w10, w10, #1
++ add x12, x12, #8
++ br x12
++
++int_reg_handlers:
++ mov x2, x9
++ b scan_sig
++ mov x3, x9
++ b scan_sig
++ mov x4, x9
++ b scan_sig
++ mov x5, x9
++ b scan_sig
++ mov x6, x9
++ b scan_sig
++ mov x7, x9
++ b scan_sig
++
++long:
++ ldr x9, [x15], #16
++ cbz w10, stack_push
++ b load_int_reg
++
++float:
++ ldr w9, [x15], #8
++ cbz w11, stack_push
++ b load_fp_reg
++
++double:
++ ldr x9, [x15], #16
++ cbz w11, stack_push
++
++load_fp_reg:
++ sub w11, w11, #1
++ add x13, x13, #8
++ br x13
++
++fp_reg_handlers:
++ fmov d0, x9
++ b scan_sig
++ fmov d1, x9
++ b scan_sig
++ fmov d2, x9
++ b scan_sig
++ fmov d3, x9
++ b scan_sig
++ fmov d4, x9
++ b scan_sig
++ fmov d5, x9
++ b scan_sig
++ fmov d6, x9
++ b scan_sig
++ fmov d7, x9
++ b scan_sig
++
++stack_push:
++ str x9, [x14], #8
++ b scan_sig
++
++done:
++ /* Call the function */
++ blr x16
++
++ mov sp, x29 /* Pop argument area */
++
++ ldrb w9, [x19] /* Return type */
++
++ cmp w9, #86 /* 'V' */
++ b.eq return
++
++ cmp w9, #68 /* 'D' */
++ b.ne 2f
++ str d0, [x20], #16
++ b return
++2:
++ cmp w9, #70 /* 'F' */
++ b.ne 3f
++ str s0, [x20], #8
++ b return
++3:
++ cmp w9, #74 /* 'J' */
++ b.ne 4f
++ str x0, [x20], #16
++ b return
++4:
++ str x0, [x20], #8
++
++return:
++ mov x0, x20 /* return ostack */
++
++ ldp x19, x20, [x29, #16]
++ ldp x29, x30, [sp], #32
++ ret
++#endif
+diff --git a/src/os/linux/aarch64/dll_md.c b/src/os/linux/aarch64/dll_md.c
+new file mode 100644
+index 0000000..189f8a8
+--- /dev/null
++++ b/src/os/linux/aarch64/dll_md.c
+@@ -0,0 +1,59 @@
++/*
++ * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2011
++ * Robert Lougher <rob@jamvm.org.uk>.
++ * Copyright (C) 2020 Simon South <simon@simonsouth.net>.
++ *
++ * This file is part of JamVM.
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License
++ * as published by the Free Software Foundation; either version 2,
++ * or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
++ */
++
++#include "jam.h"
++
++#ifndef USE_FFI
++
++int nativeExtraArg(MethodBlock *mb) {
++ char *sig = mb->type;
++ int stack_args = 0;
++ int int_args = 6;
++ int fp_args = 8;
++
++ while(*++sig != ')')
++ switch(*sig) {
++ case 'F':
++ case 'D':
++ if(fp_args == 0)
++ stack_args += 8;
++ else
++ fp_args--;
++
++ default:
++ if(int_args == 0)
++ stack_args += 8;
++ else
++ int_args--;
++
++ if(*sig == '[')
++ while(*++sig == '[');
++ if(*sig == 'L')
++ while(*++sig != ';');
++ break;
++ }
++
++ /* Ensure the stack remains 16 byte aligned. */
++ return (stack_args + 15) & ~15;
++}
++
++#endif
+diff --git a/src/os/linux/aarch64/init.c b/src/os/linux/aarch64/init.c
+new file mode 100644
+index 0000000..e03b446
+--- /dev/null
++++ b/src/os/linux/aarch64/init.c
+@@ -0,0 +1,51 @@
++/*
++ * Copyright (C) 2003, 2004, 2005, 2006, 2007
++ * Robert Lougher <rob@lougher.org.uk>.
++ * Copyright (C) 2020 Simon South <simon@simonsouth.net>.
++ *
++ * This file is part of JamVM.
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License
++ * as published by the Free Software Foundation; either version 2,
++ * or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
++ */
++
++#include "arch/aarch64.h"
++
++/* Length in bytes of the smallest line in the host system's data cache */
++unsigned char aarch64_data_cache_line_len;
++
++/* Mask used to align a virtual address to a line in the data cache */
++uintptr_t aarch64_data_cache_line_mask;
++
++/* Length in bytes of the smallest line in the host system's instruction
++ cache */
++unsigned char aarch64_instruction_cache_line_len;
++
++/* Mask used to align a virtual address to a line in the instruction cache */
++uintptr_t aarch64_instruction_cache_line_mask;
++
++void initialisePlatform() {
++ unsigned int cache_type;
++
++ /* Extract information from the cache-type register, which describes aspects
++ of the host's cache configuration */
++ __asm__ ("mrs %0, ctr_el0" : "=r" (cache_type));
++
++ aarch64_data_cache_line_len = 4 << ((cache_type >> 16) & 0x0f);
++ aarch64_data_cache_line_mask = ~(aarch64_data_cache_line_len - 1);
++
++ aarch64_instruction_cache_line_len = 4 << (cache_type & 0x0f);
++ aarch64_instruction_cache_line_mask =
++ ~(aarch64_instruction_cache_line_len - 1);
++}
+--
+2.26.2
+
diff --git a/gnu/packages/patches/jamvm-arm.patch b/gnu/packages/patches/jamvm-1.5.1-armv7-support.patch
index 9e998e18db..9e998e18db 100644
--- a/gnu/packages/patches/jamvm-arm.patch
+++ b/gnu/packages/patches/jamvm-1.5.1-armv7-support.patch
diff --git a/gnu/packages/patches/jamvm-2.0.0-aarch64-support.patch b/gnu/packages/patches/jamvm-2.0.0-aarch64-support.patch
new file mode 100644
index 0000000000..b67d8b4584
--- /dev/null
+++ b/gnu/packages/patches/jamvm-2.0.0-aarch64-support.patch
@@ -0,0 +1,645 @@
+From a44154f7a18496cc3e5fc0b1b2ea69523ebc623a Mon Sep 17 00:00:00 2001
+From: Simon South <simon@simonsouth.net>
+Date: Mon, 1 Jun 2020 07:09:34 -0400
+Subject: [PATCH] Add support for aarch64 on GNU/Linux
+
+---
+ AUTHORS | 1 +
+ README | 2 +-
+ configure.ac | 7 +-
+ src/arch/Makefile.am | 2 +-
+ src/arch/aarch64.h | 147 +++++++++++++++++++++
+ src/jam.c | 3 +-
+ src/os/linux/Makefile.am | 2 +-
+ src/os/linux/aarch64/Makefile.am | 28 ++++
+ src/os/linux/aarch64/callNative.S | 212 ++++++++++++++++++++++++++++++
+ src/os/linux/aarch64/dll_md.c | 59 +++++++++
+ src/os/linux/aarch64/init.c | 51 +++++++
+ 11 files changed, 508 insertions(+), 6 deletions(-)
+ create mode 100644 src/arch/aarch64.h
+ create mode 100644 src/os/linux/aarch64/Makefile.am
+ create mode 100644 src/os/linux/aarch64/callNative.S
+ create mode 100644 src/os/linux/aarch64/dll_md.c
+ create mode 100644 src/os/linux/aarch64/init.c
+
+diff --git a/AUTHORS b/AUTHORS
+index e1334fe..6fd0eeb 100644
+--- a/AUTHORS
++++ b/AUTHORS
+@@ -1 +1,2 @@
+ Robert Lougher <rob@jamvm.org.uk>
++Simon South <simon@simonsouth.net>
+diff --git a/README b/README
+index c9d80bb..0e93d00 100644
+--- a/README
++++ b/README
+@@ -77,7 +77,7 @@ versions of JamVM also includes stubs for common method signatures.
+ The following platforms/architectures are recognised by configure. Those
+ marked with * must be configured to use libffi.
+
+-- Linux: x86, x86_64, ARM, PowerPC, PowerPC64(*), MIPS, HPPA
++- Linux: x86, x86_64, ARM, ARM64, PowerPC, PowerPC64(*), MIPS, HPPA
+ - FreeBSD: x86, x86_64, ARM, PowerPC, PowerPC64(*), SPARC(*)
+ - OpenBSD: x86, x86_64, ARM, PowerPC, PowerPC64(*), SPARC(*)
+ - Mac OS X/Darwin: x86, x86_64, ARM, PowerPC, PowerPC64
+diff --git a/configure.ac b/configure.ac
+index 138b7e6..e7051d7 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -46,6 +46,7 @@ x86_64-*-freebsd*) host_os=bsd libdl_needed=no ;;
+ arm*-*-linux*) host_cpu=arm host_os=linux interp_cflags=-marm ;;
+ arm*-*-openbsd*) host_cpu=arm host_os=bsd libdl_needed=no ;;
+ arm*-*-freebsd*) host_cpu=arm host_os=bsd libdl_needed=no ;;
++aarch64*-*-linux*) host_cpu=aarch64 host_os=linux ;;
+ powerpc*-*-linux*) host_cpu=powerpc host_os=linux ;;
+ powerpc*-*-openbsd*) host_cpu=powerpc host_os=bsd libdl_needed=no ;;
+ powerpc*-*-freebsd*) host_cpu=powerpc host_os=bsd libdl_needed=no ;;
+@@ -155,10 +156,11 @@ AC_ARG_ENABLE(runtime-reloc-checks,
+
+ AC_ARG_ENABLE(int-inlining,
+ [AS_HELP_STRING(--enable-int-inlining,enable inline threaded version of the interpreter
+- (by default enabled on x86_64, i386, powerpc, mips and arm,
++ (by default enabled on x86_64, i386, powerpc, mips, arm and aarch64,
+ disabled otherwise))],,
+ [if test "$host_cpu" = x86_64 -o "$host_cpu" = i386 -o "$host_cpu" = x86 -o \
+- "$host_cpu" = powerpc -o "$host_cpu" = arm -o "$host_cpu" = mips; then
++ "$host_cpu" = powerpc -o "$host_cpu" = arm -o "$host_cpu" = mips -o \
++ "$host_cpu" = aarch64; then
+ enable_int_inlining=yes
+ else
+ enable_int_inlining=no
+@@ -407,6 +409,7 @@ AC_CONFIG_FILES(
+ src/os/linux/x86_64/Makefile \
+ src/os/linux/parisc/Makefile \
+ src/os/linux/mips/Makefile \
++ src/os/linux/aarch64/Makefile \
+ src/os/darwin/i386/Makefile \
+ src/os/darwin/arm/Makefile \
+ src/os/darwin/powerpc/Makefile \
+diff --git a/src/arch/Makefile.am b/src/arch/Makefile.am
+index 7580a1b..4e2a4f9 100644
+--- a/src/arch/Makefile.am
++++ b/src/arch/Makefile.am
+@@ -19,4 +19,4 @@
+ ## Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ ##
+
+-EXTRA_DIST = powerpc.h arm.h i386.h x86_64.h parisc.h mips.h sparc.h
++EXTRA_DIST = powerpc.h arm.h i386.h x86_64.h parisc.h mips.h sparc.h aarch64.h
+diff --git a/src/arch/aarch64.h b/src/arch/aarch64.h
+new file mode 100644
+index 0000000..1912e79
+--- /dev/null
++++ b/src/arch/aarch64.h
+@@ -0,0 +1,147 @@
++/*
++ * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008
++ * Robert Lougher <rob@jamvm.org.uk>.
++ * Copyright (C) 2020 Simon South <simon@simonsouth.net>.
++ *
++ * This file is part of JamVM.
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License
++ * as published by the Free Software Foundation; either version 2,
++ * or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
++ */
++
++#include <stdint.h>
++
++#define OS_ARCH "aarch64"
++
++#define HANDLER_TABLE_T static const void
++#define DOUBLE_1_BITS 0x3ff0000000000000LL
++
++#define READ_DBL(v,p,l) v = ((u8)p[0]<<56)|((u8)p[1]<<48)|((u8)p[2]<<40) \
++ |((u8)p[3]<<32)|((u8)p[4]<<24)|((u8)p[5]<<16) \
++ |((u8)p[6]<<8)|(u8)p[7]; p+=8
++
++/* Needed for i386 -- empty here */
++#define FPU_HACK
++
++#define COMPARE_AND_SWAP_64(addr, old_val, new_val) \
++({ \
++ int result, read_val; \
++ __asm__ __volatile__ (" \
++ 1: ldaxr %2, %1; \
++ cmp %2, %3; \
++ b.ne 2f; \
++ stlxr %w0, %4, %1; \
++ cmp %w0, wzr; \
++ b.ne 1b; \
++ 2: cset %w0, eq;" \
++ : "=&r" (result), "+Q" (*addr), "=&r" (read_val) \
++ : "r" (old_val), "r" (new_val) \
++ : "cc"); \
++ result; \
++})
++
++#define COMPARE_AND_SWAP_32(addr, old_val, new_val) \
++({ \
++ int result, read_val; \
++ __asm__ __volatile__ (" \
++ 1: ldaxr %w2, %1; \
++ cmp %w2, %w3; \
++ b.ne 2f; \
++ stlxr %w0, %w4, %1; \
++ cmp %w0, wzr; \
++ b.ne 1b; \
++ 2: cset %w0, eq;" \
++ : "=&r" (result), "+Q" (*addr), "=&r" (read_val) \
++ : "r" (old_val), "r" (new_val) \
++ : "cc"); \
++ result; \
++})
++
++#define COMPARE_AND_SWAP(addr, old_val, new_val) \
++ COMPARE_AND_SWAP_64(addr, old_val, new_val)
++
++#define LOCKWORD_READ(addr) \
++({ \
++ uintptr_t result; \
++ __asm__ __volatile__ (" \
++ ldar %0, %1;" \
++ : "=r" (result) \
++ : "Q" (*addr) \
++ : "cc"); \
++ result; \
++})
++
++#define LOCKWORD_WRITE(addr, value) \
++({ \
++ __asm__ __volatile__ (" \
++ stlr %1, %0;" \
++ : "=Q" (*addr) \
++ : "r" (value) \
++ : "cc"); \
++})
++
++#define LOCKWORD_COMPARE_AND_SWAP(addr, old_val, new_val) \
++ COMPARE_AND_SWAP_64(addr, old_val, new_val)
++
++#define FLUSH_CACHE(addr, length) \
++{ \
++ uintptr_t start = (uintptr_t) (addr); \
++ uintptr_t end = start + length; \
++ uintptr_t i; \
++ \
++ for(i = start & aarch64_data_cache_line_mask; \
++ i < end; \
++ i += aarch64_data_cache_line_len) \
++ __asm__ ("dc cvau, %0" :: "r" (i)); \
++ \
++ __asm__ ("dsb ish"); \
++ \
++ for(i = start & aarch64_instruction_cache_line_mask; \
++ i < end; \
++ i += aarch64_instruction_cache_line_len) \
++ __asm__ ("ic ivau, %0" :: "r" (i)); \
++ \
++ __asm__ ("dsb ish; isb"); \
++}
++
++#define GEN_REL_JMP(target_addr, patch_addr, patch_size) \
++({ \
++ int patched = FALSE; \
++ \
++ if(patch_size >= 4) { \
++ /* Guard against the pointer difference being \
++ larger than the signed range */ \
++ long long offset = (uintptr_t)(target_addr) - \
++ (uintptr_t)(patch_addr); \
++ \
++ if(offset >= -1<<28 && offset < 1<<28) { \
++ *(uint32_t*)(patch_addr) = offset>>2 & 0x03ffffff \
++ | 0x14000000; \
++ patched = TRUE; \
++ } \
++ } \
++ patched; \
++})
++
++#define MBARRIER() __asm__ ("dmb ish" ::: "memory")
++#define RMBARRIER() __asm__ ("dmb ishld" ::: "memory")
++#define WMBARRIER() __asm__ ("dmb ishst" ::: "memory")
++#define JMM_LOCK_MBARRIER() __asm__ ("dmb ish" ::: "memory")
++#define JMM_UNLOCK_MBARRIER() JMM_LOCK_MBARRIER()
++
++/* Defined in src/os/linux/aarch64/init.c */
++extern unsigned char aarch64_data_cache_line_len;
++extern uintptr_t aarch64_data_cache_line_mask;
++extern unsigned char aarch64_instruction_cache_line_len;
++extern uintptr_t aarch64_instruction_cache_line_mask;
+diff --git a/src/jam.c b/src/jam.c
+index 052f84a..c97524a 100644
+--- a/src/jam.c
++++ b/src/jam.c
+@@ -98,7 +98,8 @@ void showUsage(char *name) {
+ void showVersionAndCopyright() {
+ printf("java version \"%s\"\n", JAVA_COMPAT_VERSION);
+ printf("JamVM version %s\n", VERSION);
+- printf("Copyright (C) 2003-2014 Robert Lougher <rob@jamvm.org.uk>\n\n");
++ printf("Copyright (C) 2003-2014 Robert Lougher <rob@jamvm.org.uk>\n");
++ printf("Portions Copyright (C) 2020 Simon South <simon@simonsouth.net>\n\n");
+ printf("This program is free software; you can redistribute it and/or\n");
+ printf("modify it under the terms of the GNU General Public License\n");
+ printf("as published by the Free Software Foundation; either version 2,\n");
+diff --git a/src/os/linux/Makefile.am b/src/os/linux/Makefile.am
+index 542094e..83e7dfe 100644
+--- a/src/os/linux/Makefile.am
++++ b/src/os/linux/Makefile.am
+@@ -20,7 +20,7 @@
+ ##
+
+ SUBDIRS = @arch@
+-DIST_SUBDIRS = powerpc arm i386 x86_64 parisc mips
++DIST_SUBDIRS = powerpc arm i386 x86_64 parisc mips aarch64
+
+ noinst_LTLIBRARIES = libos.la
+ libos_la_SOURCES = os.c
+diff --git a/src/os/linux/aarch64/Makefile.am b/src/os/linux/aarch64/Makefile.am
+new file mode 100644
+index 0000000..0e5134f
+--- /dev/null
++++ b/src/os/linux/aarch64/Makefile.am
+@@ -0,0 +1,28 @@
++##
++## Copyright (C) 2003, 2004, 2005, 2006, 2007, 2010, 2011, 2012
++## Robert Lougher <rob@jamvm.org.uk>.
++##
++## File added by Simon South <simon@simonsouth.net>.
++##
++## This file is part of JamVM.
++##
++## This program is free software; you can redistribute it and/or
++## modify it under the terms of the GNU General Public License
++## as published by the Free Software Foundation; either version 2,
++## or (at your option) any later version.
++##
++## This program is distributed in the hope that it will be useful,
++## but WITHOUT ANY WARRANTY; without even the implied warranty of
++## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++## GNU General Public License for more details.
++##
++## You should have received a copy of the GNU General Public License
++## along with this program; if not, write to the Free Software
++## Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
++##
++
++noinst_LTLIBRARIES = libnative.la
++libnative_la_SOURCES = init.c dll_md.c callNative.S
++
++AM_CPPFLAGS = -I$(top_builddir)/src -I$(top_srcdir)/src
++AM_CCASFLAGS = -I$(top_builddir)/src
+diff --git a/src/os/linux/aarch64/callNative.S b/src/os/linux/aarch64/callNative.S
+new file mode 100644
+index 0000000..e067c4f
+--- /dev/null
++++ b/src/os/linux/aarch64/callNative.S
+@@ -0,0 +1,212 @@
++/*
++ * Copyright (C) 2008, 2009, 2011, 2012 Robert Lougher <rob@jamvm.org.uk>.
++ * Copyright (C) 2020 Simon South <simon@simonsouth.net>.
++ *
++ * This file is part of JamVM.
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License
++ * as published by the Free Software Foundation; either version 2,
++ * or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
++ */
++
++#include "config.h"
++
++#ifndef USE_FFI
++ .text
++ .arch armv8-a
++ .align 2
++ .global callJNIMethod
++ .type callJNIMethod,function
++
++/*
++ * Arguments passed in:
++ *
++ * x0 JNIEnv
++ * x1 class or NULL
++ * x2 sig
++ * w3 extra arg
++ * x4 ostack
++ * x5 function pntr
++ * w6 args count
++ */
++
++/* Register usage:
++ *
++ * x20 ostack
++ * x19 sig pntr
++ * x16 function pntr
++ * x15 ostack pntr
++ * x14 args pntr
++ * x13 float/double handler
++ * x12 int/long handler
++ * w11 fp regs remaining
++ * w10 int regs remaining
++ * x9 scratch
++ * x2-x7 outgoing int args
++ * x1 outgoing class or this pntr
++ * x0 outgoing JNIEnv (as passed in)
++ *
++ * d0 - d7 outgoing float args
++ */
++
++callJNIMethod:
++ stp x29, x30, [sp, #-32]!
++ mov x29, sp
++ stp x19, x20, [x29, #16]
++
++ sub sp, sp, w3 /* allocate room for stacked args */
++ mov x14, sp
++
++ mov x20, x4 /* preserve ostack */
++ add x19, x2, #1 /* init sig pntr -- skipping '(' */
++
++ mov x16, x5 /* save function pntr */
++ mov x15, x20 /* init ostack pntr */
++
++ adr x13, fp_reg_handlers-8
++ adr x12, int_reg_handlers-8
++
++ mov w11, #8 /* fp regs remaining */
++ mov w10, #6 /* int regs remaining */
++
++ cbnz x1, scan_sig /* is method non-static? */
++ ldr x1, [x15], #8 /* yes, load x1 with "this" */
++
++scan_sig:
++ ldrb w9, [x19], #1 /* get next sig char */
++
++ cmp w9, #41 /* ')' */
++ b.eq done
++
++ cmp w9, #74 /* 'J' */
++ b.eq long
++
++ cmp w9, #70 /* 'F' */
++ b.eq float
++
++ cmp w9, #68 /* 'D' */
++ b.eq double
++
++skip_brackets:
++ cmp w9, #91 /* '[' */
++ b.ne 1f
++ ldrb w9, [x19], #1
++ b skip_brackets
++1:
++ cmp w9, #76 /* 'L' */
++ b.ne int
++
++skip_ref:
++ ldrb w9, [x19], #1
++ cmp w9, #59 /* ';' */
++ b.ne skip_ref
++
++int:
++ ldr x9, [x15], #8
++ cbz w10, stack_push
++
++load_int_reg:
++ sub w10, w10, #1
++ add x12, x12, #8
++ br x12
++
++int_reg_handlers:
++ mov x2, x9
++ b scan_sig
++ mov x3, x9
++ b scan_sig
++ mov x4, x9
++ b scan_sig
++ mov x5, x9
++ b scan_sig
++ mov x6, x9
++ b scan_sig
++ mov x7, x9
++ b scan_sig
++
++long:
++ ldr x9, [x15], #16
++ cbz w10, stack_push
++ b load_int_reg
++
++float:
++ ldr w9, [x15], #8
++ cbz w11, stack_push
++ b load_fp_reg
++
++double:
++ ldr x9, [x15], #16
++ cbz w11, stack_push
++
++load_fp_reg:
++ sub w11, w11, #1
++ add x13, x13, #8
++ br x13
++
++fp_reg_handlers:
++ fmov d0, x9
++ b scan_sig
++ fmov d1, x9
++ b scan_sig
++ fmov d2, x9
++ b scan_sig
++ fmov d3, x9
++ b scan_sig
++ fmov d4, x9
++ b scan_sig
++ fmov d5, x9
++ b scan_sig
++ fmov d6, x9
++ b scan_sig
++ fmov d7, x9
++ b scan_sig
++
++stack_push:
++ str x9, [x14], #8
++ b scan_sig
++
++done:
++ /* Call the function */
++ blr x16
++
++ mov sp, x29 /* Pop argument area */
++
++ ldrb w9, [x19] /* Return type */
++
++ cmp w9, #86 /* 'V' */
++ b.eq return
++
++ cmp w9, #68 /* 'D' */
++ b.ne 2f
++ str d0, [x20], #16
++ b return
++2:
++ cmp w9, #70 /* 'F' */
++ b.ne 3f
++ str s0, [x20], #8
++ b return
++3:
++ cmp w9, #74 /* 'J' */
++ b.ne 4f
++ str x0, [x20], #16
++ b return
++4:
++ str x0, [x20], #8
++
++return:
++ mov x0, x20 /* return ostack */
++
++ ldp x19, x20, [x29, #16]
++ ldp x29, x30, [sp], #32
++ ret
++#endif
+diff --git a/src/os/linux/aarch64/dll_md.c b/src/os/linux/aarch64/dll_md.c
+new file mode 100644
+index 0000000..189f8a8
+--- /dev/null
++++ b/src/os/linux/aarch64/dll_md.c
+@@ -0,0 +1,59 @@
++/*
++ * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2011
++ * Robert Lougher <rob@jamvm.org.uk>.
++ * Copyright (C) 2020 Simon South <simon@simonsouth.net>.
++ *
++ * This file is part of JamVM.
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License
++ * as published by the Free Software Foundation; either version 2,
++ * or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
++ */
++
++#include "jam.h"
++
++#ifndef USE_FFI
++
++int nativeExtraArg(MethodBlock *mb) {
++ char *sig = mb->type;
++ int stack_args = 0;
++ int int_args = 6;
++ int fp_args = 8;
++
++ while(*++sig != ')')
++ switch(*sig) {
++ case 'F':
++ case 'D':
++ if(fp_args == 0)
++ stack_args += 8;
++ else
++ fp_args--;
++
++ default:
++ if(int_args == 0)
++ stack_args += 8;
++ else
++ int_args--;
++
++ if(*sig == '[')
++ while(*++sig == '[');
++ if(*sig == 'L')
++ while(*++sig != ';');
++ break;
++ }
++
++ /* Ensure the stack remains 16 byte aligned. */
++ return (stack_args + 15) & ~15;
++}
++
++#endif
+diff --git a/src/os/linux/aarch64/init.c b/src/os/linux/aarch64/init.c
+new file mode 100644
+index 0000000..b21dc55
+--- /dev/null
++++ b/src/os/linux/aarch64/init.c
+@@ -0,0 +1,51 @@
++/*
++ * Copyright (C) 2003, 2004, 2005, 2006, 2007
++ * Robert Lougher <rob@jamvm.org.uk>.
++ * Copyright (C) 2020 Simon South <simon@simonsouth.net>.
++ *
++ * This file is part of JamVM.
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License
++ * as published by the Free Software Foundation; either version 2,
++ * or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
++ */
++
++#include "arch/aarch64.h"
++
++/* Length in bytes of the smallest line in the host system's data cache */
++unsigned char aarch64_data_cache_line_len;
++
++/* Mask used to align a virtual address to a line in the data cache */
++uintptr_t aarch64_data_cache_line_mask;
++
++/* Length in bytes of the smallest line in the host system's instruction
++ cache */
++unsigned char aarch64_instruction_cache_line_len;
++
++/* Mask used to align a virtual address to a line in the instruction cache */
++uintptr_t aarch64_instruction_cache_line_mask;
++
++void initialisePlatform() {
++ unsigned int cache_type;
++
++ /* Extract information from the cache-type register, which describes aspects
++ of the host's cache configuration */
++ __asm__ ("mrs %0, ctr_el0" : "=r" (cache_type));
++
++ aarch64_data_cache_line_len = 4 << ((cache_type >> 16) & 0x0f);
++ aarch64_data_cache_line_mask = ~(aarch64_data_cache_line_len - 1);
++
++ aarch64_instruction_cache_line_len = 4 << (cache_type & 0x0f);
++ aarch64_instruction_cache_line_mask =
++ ~(aarch64_instruction_cache_line_len - 1);
++}
+--
+2.26.2
+
diff --git a/gnu/packages/patches/jamvm-2.0.0-opcode-guard.patch b/gnu/packages/patches/jamvm-2.0.0-opcode-guard.patch
new file mode 100644
index 0000000000..5415c27a62
--- /dev/null
+++ b/gnu/packages/patches/jamvm-2.0.0-opcode-guard.patch
@@ -0,0 +1,35 @@
+From ca11b53896365c948426974cb90e8f71c70d123b Mon Sep 17 00:00:00 2001
+From: Simon South <simon@simonsouth.net>
+Date: Sun, 31 May 2020 20:36:43 -0400
+Subject: [PATCH] Guard floating-point opcodes with explicit memory barrier
+
+---
+ src/interp/engine/interp-inlining.h | 11 ++++++++++-
+ 1 file changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/src/interp/engine/interp-inlining.h b/src/interp/engine/interp-inlining.h
+index 3339b0e..4ee5c5a 100644
+--- a/src/interp/engine/interp-inlining.h
++++ b/src/interp/engine/interp-inlining.h
+@@ -78,8 +78,17 @@
+ 4.3, we need to insert a label, and ensure its address
+ is taken (to stop it being optimised out). However,
+ this reduces performance on PowerPC by approx 1 - 2%.
++
++ With gcc 5 and newer an asm statement with a "memory"
++ clobber argument explicitly sets a memory barrier for the
++ compiler, preventing it from reordering memory accesses
++ in a way that breaks decaching.
+ */
+-#if (__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)
++#if (__GNUC__ > 4)
++#define DEF_GUARD_TABLE(level) /* none */
++#define GUARD(opcode, level) __asm__("" ::: "memory");
++#define GUARD_TBLS /* none */
++#elif (__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)
+ #define DEF_GUARD_TABLE(level) DEF_HANDLER_TABLE(level, GUARD)
+ #define GUARD(opcode, level) label(opcode, level, GUARD)
+ #define GUARD_TBLS , HNDLR_TBLS(GUARD)
+--
+2.26.2
+
diff --git a/gnu/packages/patches/java-tunnelvisionlabs-antlr-code-too-large.patch b/gnu/packages/patches/java-tunnelvisionlabs-antlr-code-too-large.patch
new file mode 100644
index 0000000000..7bdf05eb9c
--- /dev/null
+++ b/gnu/packages/patches/java-tunnelvisionlabs-antlr-code-too-large.patch
@@ -0,0 +1,87 @@
+From 56ae699a27eca52cc0bb14cbc9944b62136be52b Mon Sep 17 00:00:00 2001
+From: Julien Lepiller <julien@lepiller.eu>
+Date: Sun, 20 Sep 2020 21:07:29 +0200
+Subject: [PATCH] Separate addPropertyAliases in two methods
+
+The quantity of data used to generate addPropertyAliases creates a big
+method, that is too big for java and results in "error: code too large".
+This is most likely due to added data between the expected version of
+icu and the actual version of icu in Guix.
+---
+ .../org/antlr/v4/tool/templates/unicodedata.st | 15 ++++++++++++---
+ .../unicode/UnicodeDataTemplateController.java | 18 ++++++++++--------
+ 2 files changed, 22 insertions(+), 11 deletions(-)
+
+diff --git a/tool/resources/org/antlr/v4/tool/templates/unicodedata.st b/tool/resources/org/antlr/v4/tool/templates/unicodedata.st
+index f5052b7..125d15b 100644
+--- a/tool/resources/org/antlr/v4/tool/templates/unicodedata.st
++++ b/tool/resources/org/antlr/v4/tool/templates/unicodedata.st
+@@ -1,4 +1,4 @@
+-unicodedata(propertyCodePointRanges, propertyAliases) ::= <<
++unicodedata(propertyCodePointRanges, propertyAliasesA, propertyAliasesB) ::= <<
+ package org.antlr.v4.unicode;
+
+ import java.util.Arrays;
+@@ -17,7 +17,7 @@ public enum UnicodeData {
+ ;
+
+ private static final Map\<String, IntervalSet\> propertyCodePointRanges = new HashMap\<String, IntervalSet\>(<length(propertyCodePointRanges)>);
+- private static final Map\<String, String\> propertyAliases = new HashMap\<String, String\>(<length(propertyAliases)>);
++ private static final Map\<String, String\> propertyAliases = new HashMap\<String, String\>(<length(propertyAliasesA)> + <length(propertyAliasesB)>);
+
+ // Work around Java 64k bytecode method limit by splitting up static
+ // initialization into one method per Unicode property
+@@ -33,8 +33,17 @@ static private void addProperty<i>() {
+ \}}; separator="\n\n">
+
+ // Property aliases
++ static private void addPropertyAliasesA() {
++ <propertyAliasesA.keys:{ k | propertyAliases.put("<k>".toLowerCase(Locale.US), "<propertyAliasesA.(k)>".toLowerCase(Locale.US)); }; separator="\n">
++ }
++
++ static private void addPropertyAliasesB() {
++ <propertyAliasesB.keys:{ k | propertyAliases.put("<k>".toLowerCase(Locale.US), "<propertyAliasesB.(k)>".toLowerCase(Locale.US)); }; separator="\n">
++ }
++
+ static private void addPropertyAliases() {
+- <propertyAliases.keys:{ k | propertyAliases.put("<k>".toLowerCase(Locale.US), "<propertyAliases.(k)>".toLowerCase(Locale.US)); }; separator="\n">
++ addPropertyAliasesA();
++ addPropertyAliasesB();
+ }
+
+ // Put it all together
+diff --git a/tool/src/org/antlr/v4/unicode/UnicodeDataTemplateController.java b/tool/src/org/antlr/v4/unicode/UnicodeDataTemplateController.java
+index 570190c..692cee0 100644
+--- a/tool/src/org/antlr/v4/unicode/UnicodeDataTemplateController.java
++++ b/tool/src/org/antlr/v4/unicode/UnicodeDataTemplateController.java
+@@ -74,17 +74,19 @@ public abstract class UnicodeDataTemplateController {
+ addTR35ExtendedPictographicPropertyCodesToCodePointRanges(propertyCodePointRanges);
+ addEmojiPresentationPropertyCodesToCodePointRanges(propertyCodePointRanges);
+
+- Map<String, String> propertyAliases = new LinkedHashMap<String, String>();
+- addUnicodeCategoryCodesToNames(propertyAliases);
+- addUnicodeBinaryPropertyCodesToNames(propertyAliases);
+- addUnicodeScriptCodesToNames(propertyAliases);
+- addUnicodeBlocksToNames(propertyAliases);
+- addUnicodeIntPropertyCodesToNames(propertyAliases);
+- propertyAliases.put("EP", "Extended_Pictographic");
++ Map<String, String> propertyAliasesA = new LinkedHashMap<String, String>();
++ Map<String, String> propertyAliasesB = new LinkedHashMap<String, String>();
++ addUnicodeCategoryCodesToNames(propertyAliasesA);
++ addUnicodeBinaryPropertyCodesToNames(propertyAliasesA);
++ addUnicodeScriptCodesToNames(propertyAliasesA);
++ addUnicodeBlocksToNames(propertyAliasesB);
++ addUnicodeIntPropertyCodesToNames(propertyAliasesB);
++ propertyAliasesB.put("EP", "Extended_Pictographic");
+
+ Map<String, Object> properties = new LinkedHashMap<String, Object>();
+ properties.put("propertyCodePointRanges", propertyCodePointRanges);
+- properties.put("propertyAliases", propertyAliases);
++ properties.put("propertyAliasesA", propertyAliasesA);
++ properties.put("propertyAliasesB", propertyAliasesB);
+ return properties;
+ }
+
+--
+2.28.0
+
diff --git a/gnu/packages/patches/libcyaml-libyaml-compat.patch b/gnu/packages/patches/libcyaml-libyaml-compat.patch
new file mode 100644
index 0000000000..dcb8cb51b8
--- /dev/null
+++ b/gnu/packages/patches/libcyaml-libyaml-compat.patch
@@ -0,0 +1,51 @@
+Fix build against libyaml 0.2.5.
+
+Taken from upstream:
+https://github.com/tlsa/libcyaml/commit/0e947264b947f51f7ea785068637c4bfce5d4171
+
+diff --git a/test/units/save.c b/test/units/save.c
+--- a/test/units/save.c
++++ b/test/units/save.c
+@@ -3476,7 +3476,7 @@ static bool test_save_sequence_null_values_int(
+ ttest_report_ctx_t *report,
+ const cyaml_config_t *config)
+ {
+- static const unsigned char ref[] =
++ static const unsigned char ref1[] =
+ "---\n"
+ "- 7\n"
+ "- 6\n"
+@@ -3487,6 +3487,18 @@ static bool test_save_sequence_null_values_int(
+ "- \n"
+ "- 0\n"
+ "...\n";
++ /* As of libyaml 0.2.5, trailing spaces are not emitted. */
++ static const unsigned char ref2[] =
++ "---\n"
++ "- 7\n"
++ "- 6\n"
++ "- 5\n"
++ "-\n"
++ "- 3\n"
++ "- 2\n"
++ "-\n"
++ "- 0\n"
++ "...\n";
+ static const int d[] = { 7, 6, 5, 4, 3, 2, 1, 0 };
+ static const int *data[] = { d + 0, d + 1, d + 2, NULL,
+ d + 4, d + 5, NULL, d + 7, };
+@@ -3515,11 +3527,12 @@ static bool test_save_sequence_null_values_int(
+ return ttest_fail(&tc, cyaml_strerror(err));
+ }
+
+- if (len != YAML_LEN(ref) || memcmp(ref, buffer, len) != 0) {
++ if ((len != YAML_LEN(ref1) || memcmp(ref1, buffer, len) != 0) &&
++ (len != YAML_LEN(ref2) || memcmp(ref2, buffer, len) != 0)) {
+ return ttest_fail(&tc, "Bad data:\n"
+ "EXPECTED (%zu):\n\n%.*s\n\n"
+ "GOT (%zu):\n\n%.*s\n",
+- YAML_LEN(ref), YAML_LEN(ref), ref,
++ YAML_LEN(ref1), YAML_LEN(ref1), ref1,
+ len, len, buffer);
+ }
+
diff --git a/gnu/packages/patches/libdrm-realpath-virtio.patch b/gnu/packages/patches/libdrm-realpath-virtio.patch
deleted file mode 100644
index b7d85160b4..0000000000
--- a/gnu/packages/patches/libdrm-realpath-virtio.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-Only check for for relative path on virtio devices. Otherwise it could
-break driver loading in some circumstances, notably the IceCat sandbox.
-
-https://gitlab.freedesktop.org/mesa/drm/-/issues/39
-
-Taken from upstream:
-https://gitlab.freedesktop.org/mesa/drm/-/commit/57df07572ce45a1b60bae6fb89770388d3abd6dd
-
-diff --git a/xf86drm.c b/xf86drm.c
---- a/xf86drm.c
-+++ b/xf86drm.c
-@@ -3103,15 +3103,18 @@ static int drmParseSubsystemType(int maj, int min)
- int subsystem_type;
-
- snprintf(path, sizeof(path), "/sys/dev/char/%d:%d/device", maj, min);
-- if (!realpath(path, real_path))
-- return -errno;
-- snprintf(path, sizeof(path), "%s", real_path);
-
- subsystem_type = get_subsystem_type(path);
-+ /* Try to get the parent (underlying) device type */
- if (subsystem_type == DRM_BUS_VIRTIO) {
-+ /* Assume virtio-pci on error */
-+ if (!realpath(path, real_path))
-+ return DRM_BUS_VIRTIO;
- strncat(path, "/..", PATH_MAX);
- subsystem_type = get_subsystem_type(path);
-- }
-+ if (subsystem_type < 0)
-+ return DRM_BUS_VIRTIO;
-+ }
- return subsystem_type;
- #elif defined(__OpenBSD__) || defined(__DragonFly__) || defined(__FreeBSD__)
- return DRM_BUS_PCI;
-@@ -3920,6 +3923,7 @@ process_device(drmDevicePtr *device, const char *d_name,
-
- switch (subsystem_type) {
- case DRM_BUS_PCI:
-+ case DRM_BUS_VIRTIO:
- return drmProcessPciDevice(device, node, node_type, maj, min,
- fetch_deviceinfo, flags);
- case DRM_BUS_USB:
diff --git a/gnu/packages/patches/libsndfile-CVE-2017-12562.patch b/gnu/packages/patches/libsndfile-CVE-2017-12562.patch
deleted file mode 100644
index 58cb242b10..0000000000
--- a/gnu/packages/patches/libsndfile-CVE-2017-12562.patch
+++ /dev/null
@@ -1,97 +0,0 @@
-Fix CVE-2017-12562:
-
-https://github.com/erikd/libsndfile/issues/292
-https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-12562
-
-Patch copied from upstream source repository:
-
-https://github.com/erikd/libsndfile/commit/cf7a8182c2642c50f1cf90dddea9ce96a8bad2e8
-
-From cf7a8182c2642c50f1cf90dddea9ce96a8bad2e8 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?J=C3=B6rn=20Heusipp?= <osmanx@problemloesungsmaschine.de>
-Date: Wed, 14 Jun 2017 12:25:40 +0200
-Subject: [PATCH] src/common.c: Fix heap buffer overflows when writing strings
- in binheader
-
-Fixes the following problems:
- 1. Case 's' only enlarges the buffer by 16 bytes instead of size bytes.
- 2. psf_binheader_writef() enlarges the header buffer (if needed) prior to the
- big switch statement by an amount (16 bytes) which is enough for all cases
- where only a single value gets added. Cases 's', 'S', 'p' however
- additionally write an arbitrary length block of data and again enlarge the
- buffer to the required amount. However, the required space calculation does
- not take into account the size of the length field which gets output before
- the data.
- 3. Buffer size requirement calculation in case 'S' does not account for the
- padding byte ("size += (size & 1) ;" happens after the calculation which
- uses "size").
- 4. Case 'S' can overrun the header buffer by 1 byte when no padding is
- involved
- ("memcpy (&(psf->header.ptr [psf->header.indx]), strptr, size + 1) ;" while
- the buffer is only guaranteed to have "size" space available).
- 5. "psf->header.ptr [psf->header.indx] = 0 ;" in case 'S' always writes 1 byte
- beyond the space which is guaranteed to be allocated in the header buffer.
- 6. Case 's' can overrun the provided source string by 1 byte if padding is
- involved ("memcpy (&(psf->header.ptr [psf->header.indx]), strptr, size) ;"
- where "size" is "strlen (strptr) + 1" (which includes the 0 terminator,
- plus optionally another 1 which is padding and not guaranteed to be
- readable via the source string pointer).
-
-Closes: https://github.com/erikd/libsndfile/issues/292
----
- src/common.c | 15 +++++++--------
- 1 file changed, 7 insertions(+), 8 deletions(-)
-
-diff --git a/src/common.c b/src/common.c
-index 1a6204ca..6b2a2ee9 100644
---- a/src/common.c
-+++ b/src/common.c
-@@ -681,16 +681,16 @@ psf_binheader_writef (SF_PRIVATE *psf, const char *format, ...)
- /* Write a C string (guaranteed to have a zero terminator). */
- strptr = va_arg (argptr, char *) ;
- size = strlen (strptr) + 1 ;
-- size += (size & 1) ;
-
-- if (psf->header.indx + (sf_count_t) size >= psf->header.len && psf_bump_header_allocation (psf, 16))
-+ if (psf->header.indx + 4 + (sf_count_t) size + (sf_count_t) (size & 1) > psf->header.len && psf_bump_header_allocation (psf, 4 + size + (size & 1)))
- return count ;
-
- if (psf->rwf_endian == SF_ENDIAN_BIG)
-- header_put_be_int (psf, size) ;
-+ header_put_be_int (psf, size + (size & 1)) ;
- else
-- header_put_le_int (psf, size) ;
-+ header_put_le_int (psf, size + (size & 1)) ;
- memcpy (&(psf->header.ptr [psf->header.indx]), strptr, size) ;
-+ size += (size & 1) ;
- psf->header.indx += size ;
- psf->header.ptr [psf->header.indx - 1] = 0 ;
- count += 4 + size ;
-@@ -703,16 +703,15 @@ psf_binheader_writef (SF_PRIVATE *psf, const char *format, ...)
- */
- strptr = va_arg (argptr, char *) ;
- size = strlen (strptr) ;
-- if (psf->header.indx + (sf_count_t) size > psf->header.len && psf_bump_header_allocation (psf, size))
-+ if (psf->header.indx + 4 + (sf_count_t) size + (sf_count_t) (size & 1) > psf->header.len && psf_bump_header_allocation (psf, 4 + size + (size & 1)))
- return count ;
- if (psf->rwf_endian == SF_ENDIAN_BIG)
- header_put_be_int (psf, size) ;
- else
- header_put_le_int (psf, size) ;
-- memcpy (&(psf->header.ptr [psf->header.indx]), strptr, size + 1) ;
-+ memcpy (&(psf->header.ptr [psf->header.indx]), strptr, size + (size & 1)) ;
- size += (size & 1) ;
- psf->header.indx += size ;
-- psf->header.ptr [psf->header.indx] = 0 ;
- count += 4 + size ;
- break ;
-
-@@ -724,7 +723,7 @@ psf_binheader_writef (SF_PRIVATE *psf, const char *format, ...)
- size = (size & 1) ? size : size + 1 ;
- size = (size > 254) ? 254 : size ;
-
-- if (psf->header.indx + (sf_count_t) size > psf->header.len && psf_bump_header_allocation (psf, size))
-+ if (psf->header.indx + 1 + (sf_count_t) size > psf->header.len && psf_bump_header_allocation (psf, 1 + size))
- return count ;
-
- header_put_byte (psf, size) ;
diff --git a/gnu/packages/patches/libsndfile-CVE-2017-8361-8363-8365.patch b/gnu/packages/patches/libsndfile-CVE-2017-8361-8363-8365.patch
deleted file mode 100644
index 5f63231af0..0000000000
--- a/gnu/packages/patches/libsndfile-CVE-2017-8361-8363-8365.patch
+++ /dev/null
@@ -1,77 +0,0 @@
-Fix CVE-2017-{8361,8363,8365}:
-
-https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-8361
-https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-8363
-https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-8365
-
-Patch copied from upstream source repository:
-
-https://github.com/erikd/libsndfile/commit/fd0484aba8e51d16af1e3a880f9b8b857b385eb3
-
-From fd0484aba8e51d16af1e3a880f9b8b857b385eb3 Mon Sep 17 00:00:00 2001
-From: Erik de Castro Lopo <erikd@mega-nerd.com>
-Date: Wed, 12 Apr 2017 19:45:30 +1000
-Subject: [PATCH] FLAC: Fix a buffer read overrun
-
-Buffer read overrun occurs when reading a FLAC file that switches
-from 2 channels to one channel mid-stream. Only option is to
-abort the read.
-
-Closes: https://github.com/erikd/libsndfile/issues/230
----
- src/common.h | 1 +
- src/flac.c | 13 +++++++++++++
- src/sndfile.c | 1 +
- 3 files changed, 15 insertions(+)
-
-diff --git a/src/common.h b/src/common.h
-index 0bd810c3..e2669b6a 100644
---- a/src/common.h
-+++ b/src/common.h
-@@ -725,6 +725,7 @@ enum
- SFE_FLAC_INIT_DECODER,
- SFE_FLAC_LOST_SYNC,
- SFE_FLAC_BAD_SAMPLE_RATE,
-+ SFE_FLAC_CHANNEL_COUNT_CHANGED,
- SFE_FLAC_UNKOWN_ERROR,
-
- SFE_WVE_NOT_WVE,
-diff --git a/src/flac.c b/src/flac.c
-index 84de0e26..986a7b8f 100644
---- a/src/flac.c
-+++ b/src/flac.c
-@@ -434,6 +434,19 @@ sf_flac_meta_callback (const FLAC__StreamDecoder * UNUSED (decoder), const FLAC_
-
- switch (metadata->type)
- { case FLAC__METADATA_TYPE_STREAMINFO :
-+ if (psf->sf.channels > 0 && psf->sf.channels != (int) metadata->data.stream_info.channels)
-+ { psf_log_printf (psf, "Error: FLAC stream changed from %d to %d channels\n"
-+ "Nothing to be but to error out.\n" ,
-+ psf->sf.channels, metadata->data.stream_info.channels) ;
-+ psf->error = SFE_FLAC_CHANNEL_COUNT_CHANGED ;
-+ return ;
-+ } ;
-+
-+ if (psf->sf.channels > 0 && psf->sf.samplerate != (int) metadata->data.stream_info.sample_rate)
-+ { psf_log_printf (psf, "Warning: FLAC stream changed sample rates from %d to %d.\n"
-+ "Carrying on as if nothing happened.",
-+ psf->sf.samplerate, metadata->data.stream_info.sample_rate) ;
-+ } ;
- psf->sf.channels = metadata->data.stream_info.channels ;
- psf->sf.samplerate = metadata->data.stream_info.sample_rate ;
- psf->sf.frames = metadata->data.stream_info.total_samples ;
-diff --git a/src/sndfile.c b/src/sndfile.c
-index 41875610..e2a87be8 100644
---- a/src/sndfile.c
-+++ b/src/sndfile.c
-@@ -245,6 +245,7 @@ ErrorStruct SndfileErrors [] =
- { SFE_FLAC_INIT_DECODER , "Error : problem with initialization of the flac decoder." },
- { SFE_FLAC_LOST_SYNC , "Error : flac decoder lost sync." },
- { SFE_FLAC_BAD_SAMPLE_RATE, "Error : flac does not support this sample rate." },
-+ { SFE_FLAC_CHANNEL_COUNT_CHANGED, "Error : flac channel changed mid stream." },
- { SFE_FLAC_UNKOWN_ERROR , "Error : unknown error in flac decoder." },
-
- { SFE_WVE_NOT_WVE , "Error : not a WVE file." },
---
-2.12.2
-
diff --git a/gnu/packages/patches/libsndfile-CVE-2017-8362.patch b/gnu/packages/patches/libsndfile-CVE-2017-8362.patch
deleted file mode 100644
index 5fc52a377a..0000000000
--- a/gnu/packages/patches/libsndfile-CVE-2017-8362.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-Fix CVE-2017-8362:
-
-https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-8362
-
-Patch copied from upstream source repository:
-
-https://github.com/erikd/libsndfile/commit/ef1dbb2df1c0e741486646de40bd638a9c4cd808
-
-From ef1dbb2df1c0e741486646de40bd638a9c4cd808 Mon Sep 17 00:00:00 2001
-From: Erik de Castro Lopo <erikd@mega-nerd.com>
-Date: Fri, 14 Apr 2017 15:19:16 +1000
-Subject: [PATCH] src/flac.c: Fix a buffer read overflow
-
-A file (generated by a fuzzer) which increased the number of channels
-from one frame to the next could cause a read beyond the end of the
-buffer provided by libFLAC. Only option is to abort the read.
-
-Closes: https://github.com/erikd/libsndfile/issues/231
----
- src/flac.c | 11 +++++++++--
- 1 file changed, 9 insertions(+), 2 deletions(-)
-
-diff --git a/src/flac.c b/src/flac.c
-index 5a4f8c21..e4f9aaa0 100644
---- a/src/flac.c
-+++ b/src/flac.c
-@@ -169,6 +169,14 @@ flac_buffer_copy (SF_PRIVATE *psf)
- const int32_t* const *buffer = pflac->wbuffer ;
- unsigned i = 0, j, offset, channels, len ;
-
-+ if (psf->sf.channels != (int) frame->header.channels)
-+ { psf_log_printf (psf, "Error: FLAC frame changed from %d to %d channels\n"
-+ "Nothing to do but to error out.\n" ,
-+ psf->sf.channels, frame->header.channels) ;
-+ psf->error = SFE_FLAC_CHANNEL_COUNT_CHANGED ;
-+ return 0 ;
-+ } ;
-+
- /*
- ** frame->header.blocksize is variable and we're using a constant blocksize
- ** of FLAC__MAX_BLOCK_SIZE.
-@@ -202,7 +210,6 @@ flac_buffer_copy (SF_PRIVATE *psf)
- return 0 ;
- } ;
-
--
- len = SF_MIN (pflac->len, frame->header.blocksize) ;
-
- if (pflac->remain % channels != 0)
-@@ -436,7 +443,7 @@ sf_flac_meta_callback (const FLAC__StreamDecoder * UNUSED (decoder), const FLAC_
- { case FLAC__METADATA_TYPE_STREAMINFO :
- if (psf->sf.channels > 0 && psf->sf.channels != (int) metadata->data.stream_info.channels)
- { psf_log_printf (psf, "Error: FLAC stream changed from %d to %d channels\n"
-- "Nothing to be but to error out.\n" ,
-+ "Nothing to do but to error out.\n" ,
- psf->sf.channels, metadata->data.stream_info.channels) ;
- psf->error = SFE_FLAC_CHANNEL_COUNT_CHANGED ;
- return ;
---
-2.12.2
-
diff --git a/gnu/packages/patches/libsndfile-armhf-type-checks.patch b/gnu/packages/patches/libsndfile-armhf-type-checks.patch
deleted file mode 100644
index 7e0c71c3f6..0000000000
--- a/gnu/packages/patches/libsndfile-armhf-type-checks.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-This is a regression in 1.0.28 that causes a test failure on armhf.
-
-Upstream bug URL:
-
-https://github.com/erikd/libsndfile/issues/229
-
-Patch copied from upstream source repository:
-
-https://github.com/erikd/libsndfile/commit/9d470ee5577d3ccedb1c28c7e0a7295ba17feaf5
-
-From 9d470ee5577d3ccedb1c28c7e0a7295ba17feaf5 Mon Sep 17 00:00:00 2001
-From: Erik de Castro Lopo <erikd@mega-nerd.com>
-Date: Sun, 16 Apr 2017 17:54:17 +1000
-Subject: [PATCH] src/rf64.c: Fix varargs related bug
-
-C's <stargs.h> functionality isn't type checked so that passing an
-`sf_count_t` (64 bits) by mistake in place of a `unit32_t` can cause
-errors. This would be fine if it was an error on every architecture
-and platform, but its not. This particular problem only manifested
-on armhf and some other Arm architectures. It was not an issue on
-32 bit x86.
-
-I have now fixed variants of this same bug several times.
-
-Closes: https://github.com/erikd/libsndfile/issues/229
----
- src/rf64.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/rf64.c b/src/rf64.c
-index b3d637f..02dd904 100644
---- a/src/rf64.c
-+++ b/src/rf64.c
-@@ -742,7 +742,7 @@ rf64_write_header (SF_PRIVATE *psf, int calc_length)
-
- pad_size = psf->dataoffset - 16 - psf->header.indx ;
- if (pad_size >= 0)
-- psf_binheader_writef (psf, "m4z", PAD_MARKER, pad_size, make_size_t (pad_size)) ;
-+ psf_binheader_writef (psf, "m4z", PAD_MARKER, (unsigned int) pad_size, make_size_t (pad_size)) ;
-
- if (wpriv->rf64_downgrade && (psf->filelength < RIFF_DOWNGRADE_BYTES))
- psf_binheader_writef (psf, "tm8", data_MARKER, psf->datalength) ;
diff --git a/gnu/packages/patches/mariadb-client-test-32bit.patch b/gnu/packages/patches/mariadb-client-test-32bit.patch
deleted file mode 100644
index 02017e324d..0000000000
--- a/gnu/packages/patches/mariadb-client-test-32bit.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From 93efa48a7b972fc463406603574a4d508eefe792 Mon Sep 17 00:00:00 2001
-From: Sergei Golubchik <serg@mariadb.org>
-Date: Sun, 13 May 2018 18:50:21 +0200
-Subject: [PATCH] fix failing main.mysql_client_test test on 32bit
-
-in `ulonglong=ulong*uint` multiplication
-is done in ulong, wrapping around on 32bit.
-
-This became visible after C/C changed the
-default charset to utf8, thus changing
-mbmaxlem from 1 to 3.
----
- tests/mysql_client_fw.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/tests/mysql_client_fw.c b/tests/mysql_client_fw.c
-index f69eb28a2871..4d036887629a 100644
---- a/tests/mysql_client_fw.c
-+++ b/tests/mysql_client_fw.c
-@@ -768,7 +768,7 @@ static void do_verify_prepare_field(MYSQL_RES *result,
- {
- MYSQL_FIELD *field;
- CHARSET_INFO *cs;
-- ulonglong expected_field_length;
-+ ulonglong expected_field_length= length;
-
- if (!(field= mysql_fetch_field_direct(result, no)))
- {
-@@ -777,7 +777,7 @@ static void do_verify_prepare_field(MYSQL_RES *result,
- }
- cs= get_charset(field->charsetnr, 0);
- DIE_UNLESS(cs);
-- if ((expected_field_length= length * cs->mbmaxlen) > UINT_MAX32)
-+ if ((expected_field_length*= cs->mbmaxlen) > UINT_MAX32)
- expected_field_length= UINT_MAX32;
- if (!opt_silent)
- {
diff --git a/gnu/packages/patches/nss-pkgconfig.patch b/gnu/packages/patches/nss-pkgconfig.patch
deleted file mode 100644
index e3145aa4cf..0000000000
--- a/gnu/packages/patches/nss-pkgconfig.patch
+++ /dev/null
@@ -1,225 +0,0 @@
-Description: Create nss.pc and nss-config
-Author: Lars Wendler <polynomial-c@gentoo.org>
-Source: http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-libs/nss/files/nss-3.17.1-gentoo-fixups.patch
-
-Modifications:
- Change libdir from ${prefix}/lib64 to ${prefix}/lib/nss.
- Remove optional patching in nss/Makefile.
- Include -L$libdir in output from "nss-config --libs".
-
-Later adapted to apply cleanly to nss-3.21.
-
---- nss-3.21/nss/config/Makefile
-+++ nss-3.21/nss/config/Makefile
-@@ -0,0 +1,40 @@
-+CORE_DEPTH = ..
-+DEPTH = ..
-+
-+include $(CORE_DEPTH)/coreconf/config.mk
-+
-+NSS_MAJOR_VERSION = `grep "NSS_VMAJOR" ../lib/nss/nss.h | awk '{print $$3}'`
-+NSS_MINOR_VERSION = `grep "NSS_VMINOR" ../lib/nss/nss.h | awk '{print $$3}'`
-+NSS_PATCH_VERSION = `grep "NSS_VPATCH" ../lib/nss/nss.h | awk '{print $$3}'`
-+PREFIX = /usr
-+
-+all: export libs
-+
-+export:
-+ # Create the nss.pc file
-+ mkdir -p $(DIST)/lib/pkgconfig
-+ sed -e "s,@prefix@,$(PREFIX)," \
-+ -e "s,@exec_prefix@,\$${prefix}," \
-+ -e "s,@libdir@,\$${prefix}/lib/nss," \
-+ -e "s,@includedir@,\$${prefix}/include/nss," \
-+ -e "s,@NSS_MAJOR_VERSION@,$(NSS_MAJOR_VERSION),g" \
-+ -e "s,@NSS_MINOR_VERSION@,$(NSS_MINOR_VERSION)," \
-+ -e "s,@NSS_PATCH_VERSION@,$(NSS_PATCH_VERSION)," \
-+ nss.pc.in > nss.pc
-+ chmod 0644 nss.pc
-+ cp nss.pc $(DIST)/lib/pkgconfig
-+
-+ # Create the nss-config script
-+ mkdir -p $(DIST)/bin
-+ sed -e "s,@prefix@,$(PREFIX)," \
-+ -e "s,@NSS_MAJOR_VERSION@,$(NSS_MAJOR_VERSION)," \
-+ -e "s,@NSS_MINOR_VERSION@,$(NSS_MINOR_VERSION)," \
-+ -e "s,@NSS_PATCH_VERSION@,$(NSS_PATCH_VERSION)," \
-+ nss-config.in > nss-config
-+ chmod 0755 nss-config
-+ cp nss-config $(DIST)/bin
-+
-+libs:
-+
-+dummy: all export libs
-+
---- nss-3.21/nss/config/nss-config.in
-+++ nss-3.21/nss/config/nss-config.in
-@@ -0,0 +1,145 @@
-+#!/bin/sh
-+
-+prefix=@prefix@
-+
-+major_version=@NSS_MAJOR_VERSION@
-+minor_version=@NSS_MINOR_VERSION@
-+patch_version=@NSS_PATCH_VERSION@
-+
-+usage()
-+{
-+ cat <<EOF
-+Usage: nss-config [OPTIONS] [LIBRARIES]
-+Options:
-+ [--prefix[=DIR]]
-+ [--exec-prefix[=DIR]]
-+ [--includedir[=DIR]]
-+ [--libdir[=DIR]]
-+ [--version]
-+ [--libs]
-+ [--cflags]
-+Dynamic Libraries:
-+ nss
-+ ssl
-+ smime
-+ nssutil
-+EOF
-+ exit $1
-+}
-+
-+if test $# -eq 0; then
-+ usage 1 1>&2
-+fi
-+
-+lib_ssl=yes
-+lib_smime=yes
-+lib_nss=yes
-+lib_nssutil=yes
-+
-+while test $# -gt 0; do
-+ case "$1" in
-+ -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
-+ *) optarg= ;;
-+ esac
-+
-+ case $1 in
-+ --prefix=*)
-+ prefix=$optarg
-+ ;;
-+ --prefix)
-+ echo_prefix=yes
-+ ;;
-+ --exec-prefix=*)
-+ exec_prefix=$optarg
-+ ;;
-+ --exec-prefix)
-+ echo_exec_prefix=yes
-+ ;;
-+ --includedir=*)
-+ includedir=$optarg
-+ ;;
-+ --includedir)
-+ echo_includedir=yes
-+ ;;
-+ --libdir=*)
-+ libdir=$optarg
-+ ;;
-+ --libdir)
-+ echo_libdir=yes
-+ ;;
-+ --version)
-+ echo ${major_version}.${minor_version}.${patch_version}
-+ ;;
-+ --cflags)
-+ echo_cflags=yes
-+ ;;
-+ --libs)
-+ echo_libs=yes
-+ ;;
-+ ssl)
-+ lib_ssl=yes
-+ ;;
-+ smime)
-+ lib_smime=yes
-+ ;;
-+ nss)
-+ lib_nss=yes
-+ ;;
-+ nssutil)
-+ lib_nssutil=yes
-+ ;;
-+ *)
-+ usage 1 1>&2
-+ ;;
-+ esac
-+ shift
-+done
-+
-+# Set variables that may be dependent upon other variables
-+if test -z "$exec_prefix"; then
-+ exec_prefix=`pkg-config --variable=exec_prefix nss`
-+fi
-+if test -z "$includedir"; then
-+ includedir=`pkg-config --variable=includedir nss`
-+fi
-+if test -z "$libdir"; then
-+ libdir=`pkg-config --variable=libdir nss`
-+fi
-+
-+if test "$echo_prefix" = "yes"; then
-+ echo $prefix
-+fi
-+
-+if test "$echo_exec_prefix" = "yes"; then
-+ echo $exec_prefix
-+fi
-+
-+if test "$echo_includedir" = "yes"; then
-+ echo $includedir
-+fi
-+
-+if test "$echo_libdir" = "yes"; then
-+ echo $libdir
-+fi
-+
-+if test "$echo_cflags" = "yes"; then
-+ echo -I$includedir
-+fi
-+
-+if test "$echo_libs" = "yes"; then
-+ libdirs=-L$libdir
-+ if test -n "$lib_ssl"; then
-+ libdirs="$libdirs -lssl${major_version}"
-+ fi
-+ if test -n "$lib_smime"; then
-+ libdirs="$libdirs -lsmime${major_version}"
-+ fi
-+ if test -n "$lib_nss"; then
-+ libdirs="$libdirs -lnss${major_version}"
-+ fi
-+ if test -n "$lib_nssutil"; then
-+ libdirs="$libdirs -lnssutil${major_version}"
-+ fi
-+ echo $libdirs
-+fi
-+
---- nss-3.21/nss/config/nss.pc.in
-+++ nss-3.21/nss/config/nss.pc.in
-@@ -0,0 +1,12 @@
-+prefix=@prefix@
-+exec_prefix=@exec_prefix@
-+libdir=@libdir@
-+includedir=@includedir@
-+
-+Name: NSS
-+Description: Network Security Services
-+Version: @NSS_MAJOR_VERSION@.@NSS_MINOR_VERSION@.@NSS_PATCH_VERSION@
-+Requires: nspr >= 4.8
-+Libs: -L${libdir} -lssl3 -lsmime3 -lnss3 -lnssutil3
-+Cflags: -I${includedir}
-+
---- nss-3.21/nss/manifest.mn
-+++ nss-3.21/nss/manifest.mn
-@@ -10,4 +10,4 @@
-
- RELEASE = nss
-
--DIRS = coreconf lib cmd cpputil gtests
-+DIRS = coreconf lib cmd cpputil gtests config
diff --git a/gnu/packages/patches/python-gst-fix-build-with-python-3.8.patch b/gnu/packages/patches/python-gst-fix-build-with-python-3.8.patch
deleted file mode 100644
index affa0e1317..0000000000
--- a/gnu/packages/patches/python-gst-fix-build-with-python-3.8.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-Fix build with Python 3.8 by also checking for python-3.X-embed.pc. Since
-Python 3.8 the normal checks don't include the Python libraries anymore and
-linking of the gst-python module would fail.
-
-See also https://github.com/mesonbuild/meson/issues/5629
-Fixes https://gitlab.freedesktop.org/gstreamer/gst-python/issues/28
-
-Patch based on upstream commit:
-
-https://gitlab.freedesktop.org/gstreamer/gst-python/-/commit/10707f437f2fc3632067c6a0efa4432f7ebaf362
-
-diff --git a/meson.build b/meson.build
-index 5f13b48..d7c7e66 100644
---- a/meson.build
-+++ b/meson.build
-@@ -23,7 +23,17 @@ pygobject_dep = dependency('pygobject-3.0', fallback: ['pygobject', 'pygobject_d
-
- pymod = import('python')
- python = pymod.find_installation(get_option('python'))
--python_dep = python.dependency(required : true)
-+pythonver = python.language_version()
-+if pythonver.version_compare('<3.0')
-+ error('Python2 is not supported anymore, please port your code to python3 (@0@ specified)'.format(python.language_version()))
-+endif
-+
-+# Workaround for https://github.com/mesonbuild/meson/issues/5629
-+# https://gitlab.freedesktop.org/gstreamer/gst-python/issues/28
-+python_dep = dependency('python-@0@-embed'.format(pythonver), version: '>=3', required: false)
-+if not python_dep.found()
-+ python_dep = python.dependency(required : true)
-+endif
-
- python_abi_flags = python.get_variable('ABIFLAGS', '')
- pylib_loc = get_option('libpython-dir')
---
-2.26.2
diff --git a/gnu/packages/patches/sbcl-graph-asdf-definitions.patch b/gnu/packages/patches/sbcl-graph-asdf-definitions.patch
deleted file mode 100644
index ec17949675..0000000000
--- a/gnu/packages/patches/sbcl-graph-asdf-definitions.patch
+++ /dev/null
@@ -1,70 +0,0 @@
-commit 52ebece1243ae6900e414b6248b5145a28348eef
-Author: Guillaume Le Vaillant <glv@posteo.net>
-Date: Fri Oct 18 15:41:23 2019 +0200
-
- Use basic ASDF system definitions instead of package-inferred-system
-
-diff --git a/graph.asd b/graph.asd
-index 193b6e3..56afc8f 100644
---- a/graph.asd
-+++ b/graph.asd
-@@ -3,12 +3,10 @@
- :version "0.0.0"
- :author ("Eric Schulte <schulte.eric@gmail.com>" "Thomas Dye")
- :licence "GPL V3"
-- :class :package-inferred-system
-- :defsystem-depends-on (:asdf-package-system)
-+ :in-order-to ((test-op (test-op graph-test)))
- :depends-on (alexandria
- metabang-bind
- named-readtables
- curry-compose-reader-macros
-- graph/graph))
--
--(register-system-packages "femlisp-matlisp" '(:fl.matlisp))
-+ cl-heap)
-+ :components ((:file "graph")))
-diff --git a/graph-dot.asd b/graph-dot.asd
-new file mode 100644
-index 0000000..12aec7e
---- /dev/null
-+++ b/graph-dot.asd
-@@ -0,0 +1,8 @@
-+(defsystem :graph-dot
-+ :depends-on (alexandria
-+ metabang-bind
-+ named-readtables
-+ curry-compose-reader-macros
-+ cl-ppcre
-+ graph)
-+ :components ((:file "dot")))
-diff --git a/graph-json.asd b/graph-json.asd
-new file mode 100644
-index 0000000..e7d091f
---- /dev/null
-+++ b/graph-json.asd
-@@ -0,0 +1,8 @@
-+(defsystem :graph-json
-+ :depends-on (alexandria
-+ metabang-bind
-+ named-readtables
-+ curry-compose-reader-macros
-+ yason
-+ graph)
-+ :components ((:file "json")))
-diff --git a/graph-test.asd b/graph-test.asd
-new file mode 100644
-index 0000000..1e811e1
---- /dev/null
-+++ b/graph-test.asd
-@@ -0,0 +1,10 @@
-+(defsystem :graph-test
-+ :depends-on (alexandria
-+ metabang-bind
-+ named-readtables
-+ curry-compose-reader-macros
-+ graph
-+ stefil)
-+ :perform (test-op (o s)
-+ (uiop:symbol-call :graph/test 'test))
-+ :components ((:file "test")))