aboutsummaryrefslogtreecommitdiffstats
path: root/community/java-snappy/add-linux-aarch64-support.patch
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2016-09-02 17:19:13 +0000
committerJakub Jirutka <jakub@jirutka.cz>2016-09-02 17:23:53 +0200
commit0d06290e3f50302e84798c172004e73cbf125311 (patch)
tree0dedf23de27625921f123c36eacd47599f154076 /community/java-snappy/add-linux-aarch64-support.patch
parent95f6b80bcb3cebeb58eb7b441981cf1d10ce5526 (diff)
downloadaports-0d06290e3f50302e84798c172004e73cbf125311.tar.bz2
aports-0d06290e3f50302e84798c172004e73cbf125311.tar.xz
community/java-snappy: fix build on aarch64 and enable on all archs
Diffstat (limited to 'community/java-snappy/add-linux-aarch64-support.patch')
-rw-r--r--community/java-snappy/add-linux-aarch64-support.patch75
1 files changed, 75 insertions, 0 deletions
diff --git a/community/java-snappy/add-linux-aarch64-support.patch b/community/java-snappy/add-linux-aarch64-support.patch
new file mode 100644
index 0000000000..63b92f5694
--- /dev/null
+++ b/community/java-snappy/add-linux-aarch64-support.patch
@@ -0,0 +1,75 @@
+From cfb114f92f720ab13966eef71f11644ba9dfa5d3 Mon Sep 17 00:00:00 2001
+From: "Santiago M. Mola" <santi@mola.io>
+Date: Mon, 7 Mar 2016 21:03:54 +0100
+Subject: [PATCH] Add Linux aarch64 support.
+
+diff --git a/Makefile.common b/Makefile.common
+index e152b68..d198b1f 100755
+--- a/Makefile.common
++++ b/Makefile.common
+@@ -42,7 +42,7 @@ endif
+
+ # os=Default is meant to be generic unix/linux
+
+-known_os_archs := Linux-x86 Linux-x86_64 Linux-arm Linux-armhf Linux-ppc Linux-ppc64 Linux-s390 Linux-s390x Mac-x86 Mac-x86_64 FreeBSD-x86_64 Windows-x86 Windows-x86_64 SunOS-x86 SunOS-sparc SunOS-x86_64 AIX-ppc AIX-ppc64
++known_os_archs := Linux-x86 Linux-x86_64 Linux-arm Linux-armhf Linux-aarch64 Linux-ppc Linux-ppc64 Linux-s390 Linux-s390x Mac-x86 Mac-x86_64 FreeBSD-x86_64 Windows-x86 Windows-x86_64 SunOS-x86 SunOS-sparc SunOS-x86_64 AIX-ppc AIX-ppc64
+ os_arch := $(OS_NAME)-$(OS_ARCH)
+ IBM_JDK_7 := $(findstring IBM, $(shell $(JAVA) -version 2>&1 | grep IBM | grep "JRE 1.7"))
+
+@@ -200,6 +200,13 @@ Linux-armhf_LINKFLAGS := -shared -static-libgcc
+ Linux-armhf_LIBNAME := libsnappyjava.so
+ Linux-armhf_SNAPPY_FLAGS:=
+
++Linux-aarch64_CXX := $(CROSS_PREFIX)g++
++Linux-aarch64_STRIP := $(CROSS_PREFIX)strip
++Linux-aarch64_CXXFLAGS := -include lib/inc_linux/jni_md.h -I$(JAVA_HOME)/include -O2 -fPIC -fvisibility=hidden
++Linux-aarch64_LINKFLAGS := -shared -static-libgcc
++Linux-aarch64_LIBNAME := libsnappyjava.so
++Linux-aarch64_SNAPPY_FLAGS:=
++
+ Mac-x86_CXX := g++ -arch i386
+ Mac-x86_STRIP := strip -x
+ Mac-x86_CXXFLAGS := -Ilib/inc_mac -I$(JAVA_HOME)/include -O2 -fPIC -mmacosx-version-min=10.4 -fvisibility=hidden
+diff --git a/README.md b/README.md
+index 89b40ec..977af0d 100755
+--- a/README.md
++++ b/README.md
+@@ -146,7 +146,7 @@ Older snapshots of snappy contain a buggy config.h.in that does not work properl
+ ## Cross-compiling for other platforms
+ The Makefile contains rules for cross-compiling the native library for other platforms so that the snappy-java JAR can support multiple platforms. For example, to build the native libraries for x86 Linux, x86 and x86-64 Windows, and soft- and hard-float ARM:
+
+- $ make linux32 win32 win64 linux-arm linux-armhf
++ $ make linux32 win32 win64 linux-arm linux-armhf linux-aarch64
+
+ If you append `snappy` to the line above, it will also build the native library for the current platform and then build the snappy-java JAR (containing all native libraries built so far).
+
+@@ -157,6 +157,7 @@ Of course, you must first have the necessary cross-compilers and development lib
+ * win64: `sudo apt-get install g++-mingw-w64-x86-64`
+ * arm: `sudo apt-get install g++-arm-linux-gnueabi`
+ * armhf: `sudo apt-get install g++-arm-linux-gnueabihf`
++ * aarch64: `sudo apt-get install g++-aarch64-linux`
+
+ Unfortunately, cross-compiling for Mac OS X is not currently possible; you must compile within OS X.
+
+diff --git a/src/main/java/org/xerial/snappy/OSInfo.java b/src/main/java/org/xerial/snappy/OSInfo.java
+index ff366fa..cf6b0bc 100755
+--- a/src/main/java/org/xerial/snappy/OSInfo.java
++++ b/src/main/java/org/xerial/snappy/OSInfo.java
+@@ -45,6 +45,7 @@
+ public static final String PPC64 = "ppc64";
+ public static final String IBMZ = "s390";
+ public static final String IBMZ_64 = "s390x";
++ public static final String AARCH_64 = "aarch64";
+
+ static {
+ // x86 mappings
+@@ -88,6 +89,9 @@
+
+ // IBM z 64-bit mappings
+ archMapping.put(IBMZ_64, IBMZ_64);
++
++ // Aarch64 mappings
++ archMapping.put(AARCH_64, AARCH_64);
+ }
+
+ public static void main(String[] args)