forked from scream3r/java-simple-serial-connector
-
Notifications
You must be signed in to change notification settings - Fork 54
Cross Compilation
Tres Finocchiaro edited this page Jul 23, 2021
·
14 revisions
This builds the library based on the G++ compiler and its supplemental packages.
This will allow you to build native binaries for
-
Windows:
x86
,x86_64
using mingw-w64 -
Linux:
arm
,arm64
(aarch64) andppc64
Starting point: A clean Ubuntu install with latest patches applied, one of:
- Ubunutu 14.04 Trusty Tahr
- Ubunutu 16.04 Xenial Xerus
- Ubunutu 20.04 Focal Fossa
(other platforms will work, but the package names and commands may vary)
- Install dependencies
sudo apt-get install mingw-w64 binutils-mingw-w64-i686
- Cross-compile using
mingw32
toolchain
mvn -P mingw32
- Install dependencies
sudo apt-get install mingw-w64
- Cross-compile using
mingw32
toolchain
mvn -P mingw64
Note: Glibc 2.7+ required (Ubuntu 20.04+)
- Install dependencies
mkdir -p "$HOME/llvm-mingw" && wget -qO- 'https://github.com/mstorsjo/llvm-mingw/releases/download/20201020/llvm-mingw-20201020-msvcrt-ubuntu-18.04.tar.xz' | tar xJvf - --strip 1 -C "$HOME/llvm-mingw"
sudo apt-get install clang
- Cross-compile using
mingwaarch64
toolchain
mvn -P mingwaarch64
- Install dependencies
sudo apt-get install g++-arm-linux-gnueabihf
- Cross-compile using
armhf
toolchain
mvn -P armhf
- Install dependencies
sudo apt-get install g++-aarch64-linux-gnu
- Cross-compile using
aarch64
toolchain
mvn -P linux-aarch64
- Install dependencies
sudo apt-get install g++-powerpc64le-linux-gnu
- Cross-compile using
ppc64
toolchain
mvn -P ppc64