From 30cfd8acd70112e7180385e444da80d7ed231303 Mon Sep 17 00:00:00 2001 From: "Taro L. Saito" Date: Tue, 23 May 2023 11:09:15 -0700 Subject: [PATCH] Feature: Windows arm64, armv7 support --- Makefile | 8 +++++++- Makefile.common | 21 ++++++++++++++++++++- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 4156e56..5f18096 100644 --- a/Makefile +++ b/Makefile @@ -151,7 +151,7 @@ native: jni-header snappy-header $(NATIVE_DLL) native-nocmake: jni-header $(NATIVE_DLL) snappy: native $(TARGET)/$(snappy-jar-version).jar -native-all: native native-arm clean-docker mac64 win32 win64 linux32 linux64 linux-ppc64le linux-riscv64 linux-s390x +native-all: native native-arm clean-docker mac64 win32 win64 win-armv7 win-arm64 linux32 linux64 linux-ppc64le linux-riscv64 linux-s390x ifdef CI # Clean docker images within CI to avoid no space left error @@ -186,6 +186,12 @@ win32: jni-header win64: jni-header ./docker/dockcross-windows-x64 -a $(DOCKER_RUN_OPTS) bash -c 'make clean-native snappy-header native CROSS_PREFIX=x86_64-w64-mingw32.static- OS_NAME=Windows OS_ARCH=x86_64 SNAPPY_CMAKE_OPTS="-DHAVE_SYS_UIO_H=0"' +win-armv7: jni-header + ./docker/dockcross-windows-armv7 -a $(DOCKER_RUN_OPTS) bash -c 'make clean-native snappy-header native CROSS_PREFIX=armv7-w64-mingw32- OS_NAME=Windows OS_ARCH=armv7' + +win-arm64: jni-header + ./docker/dockcross-windows-arm64 -a $(DOCKER_RUN_OPTS) bash -c 'make clean-native snappy-header native CROSS_PREFIX=aarch64-w64-mingw32- OS_NAME=Windows OS_ARCH=arm64 SNAPPY_CMAKE_OPTS="-DHAVE_SYS_UIO_H=0"' + # deprecated mac32: jni-header $(MAKE) native OS_NAME=Mac OS_ARCH=x86 diff --git a/Makefile.common b/Makefile.common index def82d1..6325cbc 100755 --- a/Makefile.common +++ b/Makefile.common @@ -50,8 +50,13 @@ endif # os=Default is meant to be generic unix/linux +<<<<<<< HEAD # To support new CPU architecture, add a new target name here -known_os_archs := Linux-x86 Linux-x86_64 Linux-arm Linux-armv6 Linux-armv7 Linux-android-arm Linux-android-aarch64 Linux-aarch64 Linux-ppc Linux-ppc64 Linux-ppc64le Linux-s390 Linux-s390x Mac-x86 Mac-x86_64 Mac-aarch64 FreeBSD-x86_64 Windows-x86 Windows-x86_64 SunOS-x86 SunOS-sparc SunOS-x86_64 AIX-ppc AIX-ppc64 Linux-riscv Linux-riscv64 +known_os_archs := Linux-x86 Linux-x86_64 Linux-arm Linux-armv6 Linux-armv7 Linux-android-arm Linux-android-aarch64 Linux-aarch64 \ +Linux-ppc Linux-ppc64 Linux-ppc64le Linux-s390 Linux-s390x \ +Mac-x86 Mac-x86_64 Mac-aarch64 FreeBSD-x86_64 \ +Windows-x86 Windows-x86_64 Windows-aarch64 Windows-armv7 \ +SunOS-x86 SunOS-sparc SunOS-x86_64 AIX-ppc AIX-ppc64 Linux-riscv Linux-riscv64 os_arch := $(OS_NAME)-$(OS_ARCH) IBM_JDK_7 := $(findstring IBM, $(shell $(JAVA) -version 2>&1 | grep IBM | grep "JRE 1.7")) @@ -290,6 +295,20 @@ Windows-x86_64_LINKFLAGS := -Wl,--kill-at -shared -static Windows-x86_64_LIBNAME := snappyjava.dll Windows-x86_64_SNAPPY_FLAGS := +Windows-armv7_CXX := $(CROSS_PREFIX)g++ +Windows-armv7_STRIP := $(CROSS_PREFIX)strip +Windows-armv7_CXXFLAGS := -Ilib/inc_win -O2 -std=c++11 +Windows-armv7_LINKFLAGS := -Wl,--kill-at -shared -static +Windows-armv7_LIBNAME := snappyjava.dll +Windows-armv7_SNAPPY_FLAGS := + +Windows-aarch64_CXX := $(CROSS_PREFIX)g++ +Windows-aarch64_STRIP := $(CROSS_PREFIX)strip +Windows-aarch64_CXXFLAGS := -Ilib/inc_win -O2 -std=c++11 +Windows-aarch64_LINKFLAGS := -Wl,--kill-at -shared -static +Windows-aarch64_LIBNAME := snappyjava.dll +Windows-aarch64_SNAPPY_FLAGS := + Linux-riscv_CXX := $(CROSS_PREFIX)g++ Linux-riscv_STRIP := $(CROSS_PREFIX)strip Linux-riscv_CXXFLAGS := -Ilib/inc_linux -I$(JAVA_HOME)/include -O2 -fPIC -fvisibility=hidden -std=c++11