From 30cfd8acd70112e7180385e444da80d7ed231303 Mon Sep 17 00:00:00 2001 From: "Taro L. Saito" Date: Tue, 23 May 2023 11:09:15 -0700 Subject: [PATCH 01/11] Feature: Windows arm64, armv7 support --- Makefile | 8 +++++++- Makefile.common | 21 ++++++++++++++++++++- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 4156e568..5f180967 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 def82d14..6325cbcc 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 From dfe9dd4e7d29a6069ad7f9a86123bc7a9ac9b67e Mon Sep 17 00:00:00 2001 From: "Taro L. Saito" Date: Tue, 23 May 2023 11:10:05 -0700 Subject: [PATCH 02/11] Add build scritps --- docker/dockcross-windows-arm64 | 278 +++++++++++++++++++++++++++++++++ docker/dockcross-windows-armv7 | 278 +++++++++++++++++++++++++++++++++ 2 files changed, 556 insertions(+) create mode 100644 docker/dockcross-windows-arm64 create mode 100644 docker/dockcross-windows-armv7 diff --git a/docker/dockcross-windows-arm64 b/docker/dockcross-windows-arm64 new file mode 100644 index 00000000..d5037d1a --- /dev/null +++ b/docker/dockcross-windows-arm64 @@ -0,0 +1,278 @@ +#!/usr/bin/env bash + +DEFAULT_DOCKCROSS_IMAGE=dockcross/windows-arm64:20230422-a0eaff4 + +#------------------------------------------------------------------------------ +# Helpers +# +err() { + echo -e >&2 "ERROR: $*\n" +} + +die() { + err "$*" + exit 1 +} + +has() { + # eg. has command update + local kind=$1 + local name=$2 + + type -t $kind:$name | grep -q function +} + +# If OCI_EXE is not already set, search for a container executor (OCI stands for "Open Container Initiative") +if [ -z "$OCI_EXE" ]; then + if which podman >/dev/null 2>/dev/null; then + OCI_EXE=podman + elif which docker >/dev/null 2>/dev/null; then + OCI_EXE=docker + else + die "Cannot find a container executor. Search for docker and podman." + fi +fi + +#------------------------------------------------------------------------------ +# Command handlers +# +command:update-image() { + $OCI_EXE pull $FINAL_IMAGE +} + +help:update-image() { + echo "Pull the latest $FINAL_IMAGE ." +} + +command:update-script() { + if cmp -s <( $OCI_EXE run --rm $FINAL_IMAGE ) $0; then + echo "$0 is up to date" + else + echo -n "Updating $0 ... " + $OCI_EXE run --rm $FINAL_IMAGE > $0 && echo ok + fi +} + +help:update-script() { + echo "Update $0 from $FINAL_IMAGE ." +} + +command:update() { + command:update-image + command:update-script +} + +help:update() { + echo "Pull the latest $FINAL_IMAGE, and then update $0 from that." +} + +command:help() { + if [[ $# != 0 ]]; then + if ! has command $1; then + err \"$1\" is not an dockcross command + command:help + elif ! has help $1; then + err No help found for \"$1\" + else + help:$1 + fi + else + cat >&2 < +ENDHELP + exit 1 + fi +} + +#------------------------------------------------------------------------------ +# Option processing +# +special_update_command='' +while [[ $# != 0 ]]; do + case $1 in + + --) + shift + break + ;; + + --args|-a) + ARG_ARGS="$2" + shift 2 + ;; + + --config|-c) + ARG_CONFIG="$2" + shift 2 + ;; + + --image|-i) + ARG_IMAGE="$2" + shift 2 + ;; + update|update-image|update-script) + special_update_command=$1 + break + ;; + -*) + err Unknown option \"$1\" + command:help + exit + ;; + + *) + break + ;; + + esac +done + +# The precedence for options is: +# 1. command-line arguments +# 2. environment variables +# 3. defaults + +# Source the config file if it exists +DEFAULT_DOCKCROSS_CONFIG=~/.dockcross +FINAL_CONFIG=${ARG_CONFIG-${DOCKCROSS_CONFIG-$DEFAULT_DOCKCROSS_CONFIG}} + +[[ -f "$FINAL_CONFIG" ]] && source "$FINAL_CONFIG" + +# Set the docker image +FINAL_IMAGE=${ARG_IMAGE-${DOCKCROSS_IMAGE-$DEFAULT_DOCKCROSS_IMAGE}} + +# Handle special update command +if [ "$special_update_command" != "" ]; then + case $special_update_command in + + update) + command:update + exit $? + ;; + + update-image) + command:update-image + exit $? + ;; + + update-script) + command:update-script + exit $? + ;; + + esac +fi + +# Set the docker run extra args (if any) +FINAL_ARGS=${ARG_ARGS-${DOCKCROSS_ARGS}} + +# Bash on Ubuntu on Windows +UBUNTU_ON_WINDOWS=$([ -e /proc/version ] && grep -l Microsoft /proc/version || echo "") +# MSYS, Git Bash, etc. +MSYS=$([ -e /proc/version ] && grep -l MINGW /proc/version || echo "") +# CYGWIN +CYGWIN=$([ -e /proc/version ] && grep -l CYGWIN /proc/version || echo "") + +if [ -z "$UBUNTU_ON_WINDOWS" -a -z "$MSYS" -a "$OCI_EXE" != "podman" ]; then + USER_IDS=(-e BUILDER_UID="$( id -u )" -e BUILDER_GID="$( id -g )" -e BUILDER_USER="$( id -un )" -e BUILDER_GROUP="$( id -gn )") +fi + +# Change the PWD when working in Docker on Windows +if [ -n "$UBUNTU_ON_WINDOWS" ]; then + WSL_ROOT="/mnt/" + CFG_FILE=/etc/wsl.conf + if [ -f "$CFG_FILE" ]; then + CFG_CONTENT=$(cat $CFG_FILE | sed -r '/[^=]+=[^=]+/!d' | sed -r 's/\s+=\s/=/g') + eval "$CFG_CONTENT" + if [ -n "$root" ]; then + WSL_ROOT=$root + fi + fi + HOST_PWD=`pwd -P` + HOST_PWD=${HOST_PWD/$WSL_ROOT//} +elif [ -n "$MSYS" ]; then + HOST_PWD=$PWD + HOST_PWD=${HOST_PWD/\//} + HOST_PWD=${HOST_PWD/\//:\/} +elif [ -n "$CYGWIN" ]; then + for f in pwd readlink cygpath ; do + test -n "$(type "${f}" )" || { echo >&2 "Missing functionality (${f}) (in cygwin)." ; exit 1 ; } ; + done ; + HOST_PWD="$( cygpath -w "$( readlink -f "$( pwd ;)" ; )" ; )" ; +else + HOST_PWD=$PWD + [ -L $HOST_PWD ] && HOST_PWD=$(readlink $HOST_PWD) +fi + +# Mount Additional Volumes +if [ -z "$SSH_DIR" ]; then + SSH_DIR="$HOME/.ssh" +fi + +HOST_VOLUMES= +if [ -e "$SSH_DIR" -a -z "$MSYS" ]; then + if test -n "${CYGWIN}" ; then + HOST_VOLUMES+="-v $(cygpath -w ${SSH_DIR} ; ):/home/$(id -un)/.ssh" ; + else + HOST_VOLUMES+="-v $SSH_DIR:/home/$(id -un)/.ssh" ; + fi ; +fi + +#------------------------------------------------------------------------------ +# Now, finally, run the command in a container +# +TTY_ARGS= +tty -s && [ -z "$MSYS" ] && TTY_ARGS=-ti +CONTAINER_NAME=dockcross_$RANDOM +$OCI_EXE run $TTY_ARGS --name $CONTAINER_NAME \ + -v "$HOST_PWD":/work \ + $HOST_VOLUMES \ + "${USER_IDS[@]}" \ + $FINAL_ARGS \ + $FINAL_IMAGE "$@" +run_exit_code=$? + +# Attempt to delete container +rm_output=$($OCI_EXE rm -f $CONTAINER_NAME 2>&1) +rm_exit_code=$? +if [[ $rm_exit_code != 0 ]]; then + if [[ "$CIRCLECI" == "true" ]] && [[ $rm_output == *"Driver btrfs failed to remove"* ]]; then + : # Ignore error because of https://circleci.com/docs/docker-btrfs-error/ + else + echo "$rm_output" + exit $rm_exit_code + fi +fi + +exit $run_exit_code + +################################################################################ +# +# This image is not intended to be run manually. +# +# To create a dockcross helper script for the +# dockcross/windows-arm64:20230422-a0eaff4 image, run: +# +# docker run --rm dockcross/windows-arm64:20230422-a0eaff4 > dockcross-windows-arm64-20230422-a0eaff4 +# chmod +x dockcross-windows-arm64-20230422-a0eaff4 +# +# You may then wish to move the dockcross script to your PATH. +# +################################################################################ diff --git a/docker/dockcross-windows-armv7 b/docker/dockcross-windows-armv7 new file mode 100644 index 00000000..85b79308 --- /dev/null +++ b/docker/dockcross-windows-armv7 @@ -0,0 +1,278 @@ +#!/usr/bin/env bash + +DEFAULT_DOCKCROSS_IMAGE=dockcross/windows-armv7:20230422-a0eaff4 + +#------------------------------------------------------------------------------ +# Helpers +# +err() { + echo -e >&2 "ERROR: $*\n" +} + +die() { + err "$*" + exit 1 +} + +has() { + # eg. has command update + local kind=$1 + local name=$2 + + type -t $kind:$name | grep -q function +} + +# If OCI_EXE is not already set, search for a container executor (OCI stands for "Open Container Initiative") +if [ -z "$OCI_EXE" ]; then + if which podman >/dev/null 2>/dev/null; then + OCI_EXE=podman + elif which docker >/dev/null 2>/dev/null; then + OCI_EXE=docker + else + die "Cannot find a container executor. Search for docker and podman." + fi +fi + +#------------------------------------------------------------------------------ +# Command handlers +# +command:update-image() { + $OCI_EXE pull $FINAL_IMAGE +} + +help:update-image() { + echo "Pull the latest $FINAL_IMAGE ." +} + +command:update-script() { + if cmp -s <( $OCI_EXE run --rm $FINAL_IMAGE ) $0; then + echo "$0 is up to date" + else + echo -n "Updating $0 ... " + $OCI_EXE run --rm $FINAL_IMAGE > $0 && echo ok + fi +} + +help:update-script() { + echo "Update $0 from $FINAL_IMAGE ." +} + +command:update() { + command:update-image + command:update-script +} + +help:update() { + echo "Pull the latest $FINAL_IMAGE, and then update $0 from that." +} + +command:help() { + if [[ $# != 0 ]]; then + if ! has command $1; then + err \"$1\" is not an dockcross command + command:help + elif ! has help $1; then + err No help found for \"$1\" + else + help:$1 + fi + else + cat >&2 < +ENDHELP + exit 1 + fi +} + +#------------------------------------------------------------------------------ +# Option processing +# +special_update_command='' +while [[ $# != 0 ]]; do + case $1 in + + --) + shift + break + ;; + + --args|-a) + ARG_ARGS="$2" + shift 2 + ;; + + --config|-c) + ARG_CONFIG="$2" + shift 2 + ;; + + --image|-i) + ARG_IMAGE="$2" + shift 2 + ;; + update|update-image|update-script) + special_update_command=$1 + break + ;; + -*) + err Unknown option \"$1\" + command:help + exit + ;; + + *) + break + ;; + + esac +done + +# The precedence for options is: +# 1. command-line arguments +# 2. environment variables +# 3. defaults + +# Source the config file if it exists +DEFAULT_DOCKCROSS_CONFIG=~/.dockcross +FINAL_CONFIG=${ARG_CONFIG-${DOCKCROSS_CONFIG-$DEFAULT_DOCKCROSS_CONFIG}} + +[[ -f "$FINAL_CONFIG" ]] && source "$FINAL_CONFIG" + +# Set the docker image +FINAL_IMAGE=${ARG_IMAGE-${DOCKCROSS_IMAGE-$DEFAULT_DOCKCROSS_IMAGE}} + +# Handle special update command +if [ "$special_update_command" != "" ]; then + case $special_update_command in + + update) + command:update + exit $? + ;; + + update-image) + command:update-image + exit $? + ;; + + update-script) + command:update-script + exit $? + ;; + + esac +fi + +# Set the docker run extra args (if any) +FINAL_ARGS=${ARG_ARGS-${DOCKCROSS_ARGS}} + +# Bash on Ubuntu on Windows +UBUNTU_ON_WINDOWS=$([ -e /proc/version ] && grep -l Microsoft /proc/version || echo "") +# MSYS, Git Bash, etc. +MSYS=$([ -e /proc/version ] && grep -l MINGW /proc/version || echo "") +# CYGWIN +CYGWIN=$([ -e /proc/version ] && grep -l CYGWIN /proc/version || echo "") + +if [ -z "$UBUNTU_ON_WINDOWS" -a -z "$MSYS" -a "$OCI_EXE" != "podman" ]; then + USER_IDS=(-e BUILDER_UID="$( id -u )" -e BUILDER_GID="$( id -g )" -e BUILDER_USER="$( id -un )" -e BUILDER_GROUP="$( id -gn )") +fi + +# Change the PWD when working in Docker on Windows +if [ -n "$UBUNTU_ON_WINDOWS" ]; then + WSL_ROOT="/mnt/" + CFG_FILE=/etc/wsl.conf + if [ -f "$CFG_FILE" ]; then + CFG_CONTENT=$(cat $CFG_FILE | sed -r '/[^=]+=[^=]+/!d' | sed -r 's/\s+=\s/=/g') + eval "$CFG_CONTENT" + if [ -n "$root" ]; then + WSL_ROOT=$root + fi + fi + HOST_PWD=`pwd -P` + HOST_PWD=${HOST_PWD/$WSL_ROOT//} +elif [ -n "$MSYS" ]; then + HOST_PWD=$PWD + HOST_PWD=${HOST_PWD/\//} + HOST_PWD=${HOST_PWD/\//:\/} +elif [ -n "$CYGWIN" ]; then + for f in pwd readlink cygpath ; do + test -n "$(type "${f}" )" || { echo >&2 "Missing functionality (${f}) (in cygwin)." ; exit 1 ; } ; + done ; + HOST_PWD="$( cygpath -w "$( readlink -f "$( pwd ;)" ; )" ; )" ; +else + HOST_PWD=$PWD + [ -L $HOST_PWD ] && HOST_PWD=$(readlink $HOST_PWD) +fi + +# Mount Additional Volumes +if [ -z "$SSH_DIR" ]; then + SSH_DIR="$HOME/.ssh" +fi + +HOST_VOLUMES= +if [ -e "$SSH_DIR" -a -z "$MSYS" ]; then + if test -n "${CYGWIN}" ; then + HOST_VOLUMES+="-v $(cygpath -w ${SSH_DIR} ; ):/home/$(id -un)/.ssh" ; + else + HOST_VOLUMES+="-v $SSH_DIR:/home/$(id -un)/.ssh" ; + fi ; +fi + +#------------------------------------------------------------------------------ +# Now, finally, run the command in a container +# +TTY_ARGS= +tty -s && [ -z "$MSYS" ] && TTY_ARGS=-ti +CONTAINER_NAME=dockcross_$RANDOM +$OCI_EXE run $TTY_ARGS --name $CONTAINER_NAME \ + -v "$HOST_PWD":/work \ + $HOST_VOLUMES \ + "${USER_IDS[@]}" \ + $FINAL_ARGS \ + $FINAL_IMAGE "$@" +run_exit_code=$? + +# Attempt to delete container +rm_output=$($OCI_EXE rm -f $CONTAINER_NAME 2>&1) +rm_exit_code=$? +if [[ $rm_exit_code != 0 ]]; then + if [[ "$CIRCLECI" == "true" ]] && [[ $rm_output == *"Driver btrfs failed to remove"* ]]; then + : # Ignore error because of https://circleci.com/docs/docker-btrfs-error/ + else + echo "$rm_output" + exit $rm_exit_code + fi +fi + +exit $run_exit_code + +################################################################################ +# +# This image is not intended to be run manually. +# +# To create a dockcross helper script for the +# dockcross/windows-armv7:20230422-a0eaff4 image, run: +# +# docker run --rm dockcross/windows-armv7:20230422-a0eaff4 > dockcross-windows-armv7-20230422-a0eaff4 +# chmod +x dockcross-windows-armv7-20230422-a0eaff4 +# +# You may then wish to move the dockcross script to your PATH. +# +################################################################################ From d17eca6ffc30262b9fff096e44cad72a0a510b3b Mon Sep 17 00:00:00 2001 From: "Taro L. Saito" Date: Tue, 23 May 2023 11:10:55 -0700 Subject: [PATCH 03/11] Add opts --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 5f180967..de7dd758 100644 --- a/Makefile +++ b/Makefile @@ -187,7 +187,7 @@ 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' + ./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 SNAPPY_CMAKE_OPTS="-DHAVE_SYS_UIO_H=0"' 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"' From a2be004d965e59eea4e81b597a6b4809b86048b6 Mon Sep 17 00:00:00 2001 From: "Taro L. Saito" Date: Tue, 23 May 2023 11:12:23 -0700 Subject: [PATCH 04/11] Add target --- Makefile.common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.common b/Makefile.common index 6325cbcc..5931e995 100755 --- a/Makefile.common +++ b/Makefile.common @@ -50,13 +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 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")) From af65668729d33582a3ca429f8e9b860ea943d92a Mon Sep 17 00:00:00 2001 From: "Taro L. Saito" Date: Tue, 23 May 2023 11:20:33 -0700 Subject: [PATCH 05/11] Fix scripts --- Makefile | 4 ++-- docker/dockcross-windows-arm64 | 0 docker/dockcross-windows-armv7 | 0 3 files changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 docker/dockcross-windows-arm64 mode change 100644 => 100755 docker/dockcross-windows-armv7 diff --git a/Makefile b/Makefile index de7dd758..1655bc53 100644 --- a/Makefile +++ b/Makefile @@ -189,8 +189,8 @@ win64: jni-header 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 SNAPPY_CMAKE_OPTS="-DHAVE_SYS_UIO_H=0"' -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"' +win-aarch64: 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=aarch64 SNAPPY_CMAKE_OPTS="-DHAVE_SYS_UIO_H=0"' # deprecated mac32: jni-header diff --git a/docker/dockcross-windows-arm64 b/docker/dockcross-windows-arm64 old mode 100644 new mode 100755 diff --git a/docker/dockcross-windows-armv7 b/docker/dockcross-windows-armv7 old mode 100644 new mode 100755 From 9688dba439d44a941935a29691873e1d3601b345 Mon Sep 17 00:00:00 2001 From: "Taro L. Saito" Date: Tue, 23 May 2023 11:21:22 -0700 Subject: [PATCH 06/11] Fix target --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1655bc53..a7bcb5f2 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 win-armv7 win-arm64 linux32 linux64 linux-ppc64le linux-riscv64 linux-s390x +native-all: native native-arm clean-docker mac64 win32 win64 win-armv7 win-aarch64 linux32 linux64 linux-ppc64le linux-riscv64 linux-s390x ifdef CI # Clean docker images within CI to avoid no space left error From 023f50724087d78d53952b426d2d77ca0160a79a Mon Sep 17 00:00:00 2001 From: "Taro L. Saito" Date: Tue, 23 May 2023 11:37:55 -0700 Subject: [PATCH 07/11] Fix script --- Makefile | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index a7bcb5f2..0903dc27 100644 --- a/Makefile +++ b/Makefile @@ -186,12 +186,6 @@ 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 SNAPPY_CMAKE_OPTS="-DHAVE_SYS_UIO_H=0"' - -win-aarch64: 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=aarch64 SNAPPY_CMAKE_OPTS="-DHAVE_SYS_UIO_H=0"' - # deprecated mac32: jni-header $(MAKE) native OS_NAME=Mac OS_ARCH=x86 @@ -209,7 +203,17 @@ freebsd64: $(MAKE) native OS_NAME=FreeBSD OS_ARCH=x86_64 # For ARM +<<<<<<< HEAD native-arm: linux-arm64 linux-android-arm linux-android-aarch64 linux-arm linux-armv6 linux-armv7 +======= +native-arm: win-armv7 win-aarch64 linux-arm64 linux-android-arm linux-arm linux-armv6 linux-armv7 + +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 SNAPPY_CMAKE_OPTS="-DHAVE_SYS_UIO_H=0"' + +win-aarch64: 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=aarch64 SNAPPY_CMAKE_OPTS="-DHAVE_SYS_UIO_H=0"' +>>>>>>> 5426196 (Fix script) # TODO: CROSS_PREFIX can be replaced with ${CROSS_ROOT}/bin/${CROSS_TRIPLE}- in Makefile.common From c726d85a4b45c035b5e63af54748180f2289ac31 Mon Sep 17 00:00:00 2001 From: "Taro L. Saito" Date: Tue, 23 May 2023 12:17:22 -0700 Subject: [PATCH 08/11] Simplify scritps --- Makefile | 15 +++++---------- Makefile.common | 8 ++++---- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index 0903dc27..9895cd47 100644 --- a/Makefile +++ b/Makefile @@ -181,10 +181,10 @@ DOCKER_RUN_OPTS:=--rm win32: jni-header - ./docker/dockcross-windows-x86 -a $(DOCKER_RUN_OPTS) bash -c 'make clean-native snappy-header native CROSS_PREFIX=i686-w64-mingw32.static- OS_NAME=Windows OS_ARCH=x86 SNAPPY_CMAKE_OPTS="-DHAVE_SYS_UIO_H=0"' + ./docker/dockcross-windows-x86 -a $(DOCKER_RUN_OPTS) bash -c 'make clean-native native CROSS_PREFIX=i686-w64-mingw32.static- OS_NAME=Windows OS_ARCH=x86 SNAPPY_CMAKE_OPTS="-DHAVE_SYS_UIO_H=0"' 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"' + ./docker/dockcross-windows-x64 -a $(DOCKER_RUN_OPTS) bash -c 'make clean-native native CROSS_PREFIX=x86_64-w64-mingw32.static- OS_NAME=Windows OS_ARCH=x86_64 SNAPPY_CMAKE_OPTS="-DHAVE_SYS_UIO_H=0"' # deprecated mac32: jni-header @@ -203,18 +203,13 @@ freebsd64: $(MAKE) native OS_NAME=FreeBSD OS_ARCH=x86_64 # For ARM -<<<<<<< HEAD -native-arm: linux-arm64 linux-android-arm linux-android-aarch64 linux-arm linux-armv6 linux-armv7 -======= -native-arm: win-armv7 win-aarch64 linux-arm64 linux-android-arm linux-arm linux-armv6 linux-armv7 +native-arm: win-armv7 win-aarch64 linux-arm64 linux-android-arm linux-android-aarch64 linux-arm linux-armv6 linux-armv7 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 SNAPPY_CMAKE_OPTS="-DHAVE_SYS_UIO_H=0"' + ./docker/dockcross-windows-armv7 -a $(DOCKER_RUN_OPTS) bash -c 'make clean-native native OS_NAME=Windows OS_ARCH=armv7' win-aarch64: 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=aarch64 SNAPPY_CMAKE_OPTS="-DHAVE_SYS_UIO_H=0"' ->>>>>>> 5426196 (Fix script) - + ./docker/dockcross-windows-arm64 -a $(DOCKER_RUN_OPTS) bash -c 'make clean-native native OS_NAME=Windows OS_ARCH=aarch64' # TODO: CROSS_PREFIX can be replaced with ${CROSS_ROOT}/bin/${CROSS_TRIPLE}- in Makefile.common linux-arm: jni-header diff --git a/Makefile.common b/Makefile.common index 5931e995..ecbc9636 100755 --- a/Makefile.common +++ b/Makefile.common @@ -295,15 +295,15 @@ 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_CXX := ${CROSS_ROOT}/bin/${CROSS_TRIPLE}-g++ +Windows-armv7_STRIP := ${CROSS_ROOT}/bin/${CROSS_TRIPLE}-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_CXX := ${CROSS_ROOT}/bin/${CROSS_TRIPLE}-g++ +Windows-aarch64_STRIP := ${CROSS_ROOT}/bin/${CROSS_TRIPLE}-strip Windows-aarch64_CXXFLAGS := -Ilib/inc_win -O2 -std=c++11 Windows-aarch64_LINKFLAGS := -Wl,--kill-at -shared -static Windows-aarch64_LIBNAME := snappyjava.dll From 35621b29fe04d646ae39c47948222359f3844941 Mon Sep 17 00:00:00 2001 From: "Taro L. Saito" Date: Sat, 23 Sep 2023 22:29:34 -0700 Subject: [PATCH 09/11] Use a newer snappy version --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 9895cd47..8ec07ed6 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ SNAPPY_SRC_DIR:=$(TARGET)/snappy-$(SNAPPY_VERSION) SNAPPY_SRC:=$(addprefix $(SNAPPY_SRC_DIR)/,$(SNAPPY_CC)) SNAPPY_GIT_REPO_URL:=https://github.com/google/snappy # Change this variable to use a specific git commit -SNAPPY_GIT_REV:=$(SNAPPY_VERSION) +SNAPPY_GIT_REV:=00aa9ac61d37194cffb0913d9b7d71611eb05a4b # $(SNAPPY_VERSION) SNAPPY_UNPACKED:=$(TARGET)/snappy-extracted.log SNAPPY_GIT_UNPACKED:=$(TARGET)/snappy-git-extracted.log SNAPPY_CMAKE_CACHE=$(SNAPPY_OUT)/CMakeCache.txt From a508100b9f8bc09b214b4b7c39a3f0a655852013 Mon Sep 17 00:00:00 2001 From: "Taro L. Saito" Date: Sat, 23 Sep 2023 23:39:03 -0700 Subject: [PATCH 10/11] Try clang++ --- Makefile | 2 +- Makefile.common | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 8ec07ed6..9895cd47 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ SNAPPY_SRC_DIR:=$(TARGET)/snappy-$(SNAPPY_VERSION) SNAPPY_SRC:=$(addprefix $(SNAPPY_SRC_DIR)/,$(SNAPPY_CC)) SNAPPY_GIT_REPO_URL:=https://github.com/google/snappy # Change this variable to use a specific git commit -SNAPPY_GIT_REV:=00aa9ac61d37194cffb0913d9b7d71611eb05a4b # $(SNAPPY_VERSION) +SNAPPY_GIT_REV:=$(SNAPPY_VERSION) SNAPPY_UNPACKED:=$(TARGET)/snappy-extracted.log SNAPPY_GIT_UNPACKED:=$(TARGET)/snappy-git-extracted.log SNAPPY_CMAKE_CACHE=$(SNAPPY_OUT)/CMakeCache.txt diff --git a/Makefile.common b/Makefile.common index ecbc9636..043883aa 100755 --- a/Makefile.common +++ b/Makefile.common @@ -295,14 +295,14 @@ Windows-x86_64_LINKFLAGS := -Wl,--kill-at -shared -static Windows-x86_64_LIBNAME := snappyjava.dll Windows-x86_64_SNAPPY_FLAGS := -Windows-armv7_CXX := ${CROSS_ROOT}/bin/${CROSS_TRIPLE}-g++ +Windows-armv7_CXX := ${CROSS_ROOT}/bin/${CROSS_TRIPLE}-clang++ Windows-armv7_STRIP := ${CROSS_ROOT}/bin/${CROSS_TRIPLE}-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_ROOT}/bin/${CROSS_TRIPLE}-g++ +Windows-aarch64_CXX := ${CROSS_ROOT}/bin/${CROSS_TRIPLE}-clang++ Windows-aarch64_STRIP := ${CROSS_ROOT}/bin/${CROSS_TRIPLE}-strip Windows-aarch64_CXXFLAGS := -Ilib/inc_win -O2 -std=c++11 Windows-aarch64_LINKFLAGS := -Wl,--kill-at -shared -static From 5f583d374b411638971b196fba3e6918f5504087 Mon Sep 17 00:00:00 2001 From: "Taro L. Saito" Date: Sat, 23 Sep 2023 23:55:45 -0700 Subject: [PATCH 11/11] Fix --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 9895cd47..5212046b 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 win-armv7 win-aarch64 linux32 linux64 linux-ppc64le linux-riscv64 linux-s390x +native-all: native native-arm clean-docker mac64 win32 win64 linux32 linux64 linux-ppc64le linux-riscv64 linux-s390x ifdef CI # Clean docker images within CI to avoid no space left error @@ -203,7 +203,7 @@ freebsd64: $(MAKE) native OS_NAME=FreeBSD OS_ARCH=x86_64 # For ARM -native-arm: win-armv7 win-aarch64 linux-arm64 linux-android-arm linux-android-aarch64 linux-arm linux-armv6 linux-armv7 +native-arm: win-aarch64 win-armv7 linux-arm64 linux-android-arm linux-android-aarch64 linux-arm linux-armv6 linux-armv7 win-armv7: jni-header ./docker/dockcross-windows-armv7 -a $(DOCKER_RUN_OPTS) bash -c 'make clean-native native OS_NAME=Windows OS_ARCH=armv7'