mirror of
https://github.com/bensuperpc/dockcross.git
synced 2025-06-18 08:59:25 +02:00
Compare commits
16 Commits
add_tinycc
...
add_new_te
Author | SHA1 | Date | |
---|---|---|---|
95c12a3a87 | |||
713ebf0491 | |||
434877cfe1 | |||
428fa38a94 | |||
a4cb929bef | |||
84cab46099 | |||
4481ba2a8e | |||
da8d9a8208 | |||
f84173c7e4 | |||
29ccbad9aa | |||
5c45f72a87 | |||
526cab12a8 | |||
92102d9138 | |||
5b175f9eac | |||
b5dc5e6488 | |||
fd49a1de52 |
6
.github/workflows/main.yml
vendored
6
.github/workflows/main.yml
vendored
@ -53,9 +53,9 @@ jobs:
|
|||||||
linux-x64-clang, linux-s390x, linux-x64, linux-x86,
|
linux-x64-clang, linux-s390x, linux-x64, linux-x86,
|
||||||
linux-mips, linux-ppc64le, web-wasm,
|
linux-mips, linux-ppc64le, web-wasm,
|
||||||
manylinux2014-x64, manylinux2014-x86,
|
manylinux2014-x64, manylinux2014-x86,
|
||||||
windows-static-x64, windows-static-x64-posix, windows-static-x86,
|
windows-static-x64, windows-static-x64-posix, windows-static-x86, windows-armv7,
|
||||||
windows-shared-x64, windows-shared-x64-posix, windows-shared-x86,
|
windows-shared-x64, windows-shared-x64-posix, windows-shared-x86, windows-arm64,
|
||||||
linux-riscv64, linux-riscv32, linux-m68k-uclibc, linux-x64-tinycc, linux-xtensa-uclibc]
|
linux-riscv64, linux-riscv32, linux-m68k-uclibc, linux-xtensa-uclibc, linux-x64-tinycc]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/download-artifact@v2
|
- uses: actions/download-artifact@v2
|
||||||
|
6
Makefile
6
Makefile
@ -19,14 +19,14 @@ STANDARD_IMAGES = android-arm android-arm64 android-x86 android-x86_64 \
|
|||||||
linux-armv6 linux-armv6-lts linux-armv6-musl \
|
linux-armv6 linux-armv6-lts linux-armv6-musl \
|
||||||
linux-armv7l-musl linux-armv7 linux-armv7a \
|
linux-armv7l-musl linux-armv7 linux-armv7a \
|
||||||
linux-mips linux-ppc64le linux-riscv64 linux-riscv32 linux-xtensa-uclibc \
|
linux-mips linux-ppc64le linux-riscv64 linux-riscv32 linux-xtensa-uclibc \
|
||||||
windows-static-x86 windows-static-x64 windows-static-x64-posix \
|
windows-static-x86 windows-static-x64 windows-static-x64-posix windows-armv7 \
|
||||||
windows-shared-x86 windows-shared-x64 windows-shared-x64-posix
|
windows-shared-x86 windows-shared-x64 windows-shared-x64-posix windows-arm64
|
||||||
|
|
||||||
# Generated Dockerfiles.
|
# Generated Dockerfiles.
|
||||||
GEN_IMAGES = android-arm android-arm64 \
|
GEN_IMAGES = android-arm android-arm64 \
|
||||||
linux-x86 linux-x64 linux-x64-clang linux-arm64 linux-arm64-musl linux-arm64-full \
|
linux-x86 linux-x64 linux-x64-clang linux-arm64 linux-arm64-musl linux-arm64-full \
|
||||||
manylinux2014-x64 manylinux2014-x86 \
|
manylinux2014-x64 manylinux2014-x86 \
|
||||||
web-wasm linux-mips \
|
web-wasm linux-mips windows-arm64 windows-armv7 \
|
||||||
windows-static-x86 windows-static-x64 windows-static-x64-posix \
|
windows-static-x86 windows-static-x64 windows-static-x64-posix \
|
||||||
windows-shared-x86 windows-shared-x64 windows-shared-x64-posix \
|
windows-shared-x86 windows-shared-x64 windows-shared-x64-posix \
|
||||||
linux-armv7 linux-armv7a linux-armv7l-musl \
|
linux-armv7 linux-armv7a linux-armv7l-musl \
|
||||||
|
48
README.md
48
README.md
@ -13,13 +13,14 @@ Cross compiling toolchains in Docker images.
|
|||||||
- Most images also contain an emulator for the target system.
|
- Most images also contain an emulator for the target system.
|
||||||
- Clean separation of build tools, source code, and build artifacts.
|
- Clean separation of build tools, source code, and build artifacts.
|
||||||
- Commands in the container are run as the calling user, so that any created files have the expected ownership, (i.e. not root).
|
- Commands in the container are run as the calling user, so that any created files have the expected ownership, (i.e. not root).
|
||||||
- Make variables **CC**, **CXX**, **LD** etc) are set to point to the appropriate tools in the container.
|
- Make variables **CC**, **CXX**, **LD**, **AS** etc) are set to point to the appropriate tools in the container.
|
||||||
- Recent [CMake](https://cmake.org) and ninja are precompiled.
|
- Recent [CMake](https://cmake.org) and ninja are precompiled.
|
||||||
- [Conan.io](https://www.conan.io) can be used as a package manager.
|
- [Conan.io](https://www.conan.io) can be used as a package manager.
|
||||||
- Toolchain files configured for CMake.
|
- Toolchain files configured for CMake.
|
||||||
- Current directory is mounted as the container\'s workdir, `/work`.
|
- Current directory is mounted as the container\'s workdir, `/work`.
|
||||||
- Works with the [Docker for Mac](https://docs.docker.com/docker-for-mac/) and [Docker for Windows](https://docs.docker.com/docker-for-windows/).
|
- Works with the [Docker for Mac](https://docs.docker.com/docker-for-mac/) and [Docker for Windows](https://docs.docker.com/docker-for-windows/).
|
||||||
- Support using alternative container executor by setting **OCI_EXE** environment variable. By default, it searches for [docker](https://www.docker.com) and [podman](https://podman.io) executable.
|
- Support using alternative container executor by setting **OCI_EXE** environment variable. By default, it searches for [docker](https://www.docker.com) and [podman](https://podman.io) executable.
|
||||||
|
- [crosstool-ng](https://github.com/crosstool-ng/crosstool-ng) and [buildroot](https://github.com/buildroot/buildroot) configuration files.
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
@ -40,26 +41,32 @@ This image does not need to be run manually. Instead, there is a helper script t
|
|||||||
|
|
||||||
To install the helper script, run one of the images with no arguments, and redirect the output to a file:
|
To install the helper script, run one of the images with no arguments, and redirect the output to a file:
|
||||||
|
|
||||||
|
```bash
|
||||||
docker run --rm CROSS_COMPILER_IMAGE_NAME > ./dockcross
|
docker run --rm CROSS_COMPILER_IMAGE_NAME > ./dockcross
|
||||||
chmod +x ./dockcross
|
chmod +x ./dockcross
|
||||||
mv ./dockcross ~/bin/
|
mv ./dockcross ~/bin/
|
||||||
|
```
|
||||||
|
|
||||||
Where **CROSS_COMPILER_IMAGE_NAME** is the name of the cross-compiler toolchain Docker instance, e.g: **dockcross/linux-armv7**.
|
Where **CROSS_COMPILER_IMAGE_NAME** is the name of the cross-compiler toolchain Docker instance, e.g: **dockcross/linux-armv7**.
|
||||||
|
|
||||||
Only 64-bit x86_64 images are provided; a 64-bit x86_64 host system is required.
|
Only 64-bit x86_64 images are provided, a 64-bit x86_64 host system is required.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
For the impatient, here\'s how to compile a hello world for armv7:
|
For the impatient, here\'s how to compile a hello world for armv7:
|
||||||
|
|
||||||
|
```bash
|
||||||
cd ~/src/dockcross
|
cd ~/src/dockcross
|
||||||
docker run --rm dockcross/linux-armv7 > ./dockcross-linux-armv7
|
docker run --rm dockcross/linux-armv7 > ./dockcross-linux-armv7
|
||||||
chmod +x ./dockcross-linux-armv7
|
chmod +x ./dockcross-linux-armv7
|
||||||
./dockcross-linux-armv7 bash -c '$CC test/C/hello.c -o hello_arm'
|
./dockcross-linux-armv7 bash -c '$CC test/C/hello.c -o hello_arm'
|
||||||
|
```
|
||||||
|
|
||||||
Note how invoking any toolchain command (make, gcc, etc.) is just a matter of prepending the **dockcross** script on the commandline:
|
Note how invoking any toolchain command (make, gcc, etc.) is just a matter of prepending the **dockcross** script on the commandline:
|
||||||
|
|
||||||
|
```bash
|
||||||
./dockcross-linux-armv7 [command] [args...]
|
./dockcross-linux-armv7 [command] [args...]
|
||||||
|
```
|
||||||
|
|
||||||
The dockcross script will execute the given command-line inside the container, along with all arguments passed after the command. Commands that evaluate environmental variables in the image, like **$CC** or **$CXX** above, should be executed in [bash -c]. The present working directory is mounted within the image, which can be used to make source code available in the Docker container.
|
The dockcross script will execute the given command-line inside the container, along with all arguments passed after the command. Commands that evaluate environmental variables in the image, like **$CC** or **$CXX** above, should be executed in [bash -c]. The present working directory is mounted within the image, which can be used to make source code available in the Docker container.
|
||||||
|
|
||||||
@ -73,6 +80,7 @@ The dockcross script will execute the given command-line inside the container, a
|
|||||||
| dockcross/android-x86 | x86 | Clang | Android |
|
| dockcross/android-x86 | x86 | Clang | Android |
|
||||||
| dockcross/android-x86_64 | x86_64 | Clang | Android |
|
| dockcross/android-x86_64 | x86_64 | Clang | Android |
|
||||||
| dockcross/linux-arm64 | ARMv8 | GCC | Linux |
|
| dockcross/linux-arm64 | ARMv8 | GCC | Linux |
|
||||||
|
| dockcross/linux-arm64-full | ARMv8 | GCC | Linux |
|
||||||
| dockcross/linux-arm64-musl | ARMv8 | GCC + musl | Linux |
|
| dockcross/linux-arm64-musl | ARMv8 | GCC + musl | Linux |
|
||||||
| dockcross/linux-armv5 | ARMv5 | GCC | Linux |
|
| dockcross/linux-armv5 | ARMv5 | GCC | Linux |
|
||||||
| dockcross/linux-armv5-musl | ARMv5 | GCC + musl | Linux |
|
| dockcross/linux-armv5-musl | ARMv5 | GCC + musl | Linux |
|
||||||
@ -94,6 +102,7 @@ The dockcross script will execute the given command-line inside the container, a
|
|||||||
| dockcross/linux-x86 | x86 | GCC | Linux |
|
| dockcross/linux-x86 | x86 | GCC | Linux |
|
||||||
| dockcross/linux-x64 | x86_64 | GCC | Linux |
|
| dockcross/linux-x64 | x86_64 | GCC | Linux |
|
||||||
| dockcross/linux-x64-clang | x86_64 | Clang | Linux |
|
| dockcross/linux-x64-clang | x86_64 | Clang | Linux |
|
||||||
|
| dockcross/linux-x64-tinycc | x86_64 | tcc + GCC | Linux |
|
||||||
| dockcross/web-wasm | JS | LLVM | Web (JS) |
|
| dockcross/web-wasm | JS | LLVM | Web (JS) |
|
||||||
| dockcross/windows-shared-x86 | x86 | GCC | Windows |
|
| dockcross/windows-shared-x86 | x86 | GCC | Windows |
|
||||||
| dockcross/windows-shared-x64 | x86_64 | GCC | Windows |
|
| dockcross/windows-shared-x64 | x86_64 | GCC | Windows |
|
||||||
@ -101,6 +110,8 @@ The dockcross script will execute the given command-line inside the container, a
|
|||||||
| dockcross/windows-static-x86 | x86 | GCC | Windows |
|
| dockcross/windows-static-x86 | x86 | GCC | Windows |
|
||||||
| dockcross/windows-static-x64 | x86_64 | GCC | Windows |
|
| dockcross/windows-static-x64 | x86_64 | GCC | Windows |
|
||||||
| dockcross/windows-static-x64-posix | x86_64 | GCC | Windows |
|
| dockcross/windows-static-x64-posix | x86_64 | GCC | Windows |
|
||||||
|
| dockcross/windows-armv7 | ARMv7 | Clang | Windows |
|
||||||
|
| dockcross/windows-arm64 | ARMv8 | Clang | Windows |
|
||||||
|
|
||||||
## Cross compilers
|
## Cross compilers
|
||||||
|
|
||||||
@ -140,6 +151,12 @@ The Android NDK standalone toolchain for the x86_64 architecture.
|
|||||||
|
|
||||||
Cross compiler for the 64-bit ARM platform on Linux, also known as AArch64.
|
Cross compiler for the 64-bit ARM platform on Linux, also known as AArch64.
|
||||||
|
|
||||||
|
### dockcross/linux-arm64-full
|
||||||
|
|
||||||
|
 
|
||||||
|
|
||||||
|
Cross compiler for the 64-bit ARM platform on Linux, with cross-libs: SDL2, OpenSSL, Boost, OpenCV and Qt5 (minimal).
|
||||||
|
|
||||||
### dockcross/linux-arm64-musl
|
### dockcross/linux-arm64-musl
|
||||||
|
|
||||||
 
|
 
|
||||||
@ -255,6 +272,12 @@ Linux clang x86_64/amd64 compiler. Since the Docker image is natively x86_64, th
|
|||||||
|
|
||||||
Linux i686 cross compiler.
|
Linux i686 cross compiler.
|
||||||
|
|
||||||
|
### dockcross/linux-x64-tinycc
|
||||||
|
|
||||||
|
 
|
||||||
|
|
||||||
|
Linux tcc compiler for C compiler, and GCC for C++ compiler, for linux x86_64/amd64 arch.
|
||||||
|
|
||||||
### dockcross/manylinux2014-x64
|
### dockcross/manylinux2014-x64
|
||||||
|
|
||||||
 
|
 
|
||||||
@ -311,6 +334,18 @@ linking.
|
|||||||
|
|
||||||
32-bit Windows cross-compiler based on [MXE/MinGW-w64](https://mxe.cc/) with win32 threads and dynamic linking.
|
32-bit Windows cross-compiler based on [MXE/MinGW-w64](https://mxe.cc/) with win32 threads and dynamic linking.
|
||||||
|
|
||||||
|
### dockcross/windows-armv7
|
||||||
|
|
||||||
|
 
|
||||||
|
|
||||||
|
ARMv7 32-bit Windows cross-compiler based on [LLVM/MinGW-w64](https://github.com/mstorsjo/llvm-mingw)
|
||||||
|
|
||||||
|
### dockcross/windows-arm64
|
||||||
|
|
||||||
|
 
|
||||||
|
|
||||||
|
ARMv8 64-bit Windows cross-compiler based on [llvm-mingw](https://github.com/mstorsjo/llvm-mingw)
|
||||||
|
|
||||||
## Summary legacy cross compilers
|
## Summary legacy cross compilers
|
||||||
|
|
||||||
The list of docker images that are no longer supported or broken
|
The list of docker images that are no longer supported or broken
|
||||||
@ -349,12 +384,13 @@ cross-compiler Docker image or the dockcross script itself.
|
|||||||
|
|
||||||
To easily download all images, the convenience target `display_images`
|
To easily download all images, the convenience target `display_images`
|
||||||
could be used:
|
could be used:
|
||||||
|
```bash
|
||||||
curl https://raw.githubusercontent.com/dockcross/dockcross/master/Makefile -o dockcross-Makefile
|
curl https://raw.githubusercontent.com/dockcross/dockcross/master/Makefile -o dockcross-Makefile
|
||||||
for image in $(make -f dockcross-Makefile display_images); do
|
for image in $(make -f dockcross-Makefile display_images); do
|
||||||
echo "Pulling dockcross/$image"
|
echo "Pulling dockcross/$image"
|
||||||
docker pull dockcross/$image
|
docker pull dockcross/$image
|
||||||
done
|
done
|
||||||
|
```
|
||||||
|
|
||||||
## Install all dockcross scripts
|
## Install all dockcross scripts
|
||||||
|
|
||||||
@ -362,6 +398,7 @@ To automatically install in `~/bin` the dockcross scripts for each
|
|||||||
images already downloaded, the convenience target `display_images` could
|
images already downloaded, the convenience target `display_images` could
|
||||||
be used:
|
be used:
|
||||||
|
|
||||||
|
```bash
|
||||||
curl https://raw.githubusercontent.com/dockcross/dockcross/master/Makefile -o dockcross-Makefile
|
curl https://raw.githubusercontent.com/dockcross/dockcross/master/Makefile -o dockcross-Makefile
|
||||||
for image in $(make -f dockcross-Makefile display_images); do
|
for image in $(make -f dockcross-Makefile display_images); do
|
||||||
if [[ $(docker images -q dockcross/$image) == "" ]]; then
|
if [[ $(docker images -q dockcross/$image) == "" ]]; then
|
||||||
@ -372,6 +409,7 @@ be used:
|
|||||||
docker run dockcross/$image > ~/bin/dockcross-$image && \
|
docker run dockcross/$image > ~/bin/dockcross-$image && \
|
||||||
chmod u+x ~/bin/dockcross-$image
|
chmod u+x ~/bin/dockcross-$image
|
||||||
done
|
done
|
||||||
|
```
|
||||||
|
|
||||||
## Dockcross configuration
|
## Dockcross configuration
|
||||||
|
|
||||||
@ -416,17 +454,21 @@ In order to extend Dockcross images with your own commands, one must:
|
|||||||
|
|
||||||
An example Dockerfile would be:
|
An example Dockerfile would be:
|
||||||
|
|
||||||
|
```
|
||||||
FROM dockcross/linux-armv7
|
FROM dockcross/linux-armv7
|
||||||
|
|
||||||
ENV DEFAULT_DOCKCROSS_IMAGE my_cool_image
|
ENV DEFAULT_DOCKCROSS_IMAGE my_cool_image
|
||||||
RUN apt-get install nano
|
RUN apt-get install nano
|
||||||
|
```
|
||||||
|
|
||||||
And then in the shell:
|
And then in the shell:
|
||||||
|
|
||||||
|
```
|
||||||
docker build -t my_cool_image . ## Builds the dockcross image.
|
docker build -t my_cool_image . ## Builds the dockcross image.
|
||||||
docker run my_cool_image > linux-armv7 ## Creates a helper script named linux-armv7.
|
docker run my_cool_image > linux-armv7 ## Creates a helper script named linux-armv7.
|
||||||
chmod +x linux-armv7 ## Gives the script execution permission.
|
chmod +x linux-armv7 ## Gives the script execution permission.
|
||||||
./linux-armv7 bash ## Runs the helper script with the argument "bash", which starts an interactive container using your extended image.
|
./linux-armv7 bash ## Runs the helper script with the argument "bash", which starts an interactive container using your extended image.
|
||||||
|
```
|
||||||
|
|
||||||
## What is the difference between **dockcross** and **dockbuild** ?
|
## What is the difference between **dockcross** and **dockbuild** ?
|
||||||
|
|
||||||
|
23
tools/dockcross-make-builder.sh
Executable file
23
tools/dockcross-make-builder.sh
Executable file
@ -0,0 +1,23 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
if (( $# >= 1 )); then
|
||||||
|
image=$1
|
||||||
|
build_file=build-${image%:*}
|
||||||
|
shift 1
|
||||||
|
|
||||||
|
make_arg=$*
|
||||||
|
echo "make arg: $make_arg"
|
||||||
|
|
||||||
|
#echo "Pulling dockcross/$image"
|
||||||
|
#docker pull dockcross/"$image"
|
||||||
|
|
||||||
|
echo "Make script dockcross-$image"
|
||||||
|
docker run --rm dockcross/"$image" > ./dockcross-"$image"
|
||||||
|
chmod +x ./dockcross-"$image"
|
||||||
|
|
||||||
|
echo "Build $build_file"
|
||||||
|
./dockcross-"$image" bash -c 'make CXX=${CXX} CC=${CC} AR=${AR} AS=${AS} LD=${LD} CPP=${CPP} FC=${FC} '"$make_arg"
|
||||||
|
else
|
||||||
|
echo "Usage: ${0##*/} <docker imag (ex: linux-x64/linux-x64-clang/linux-arm64/windows-shared-x64/windows-static-x64...)> <make arg.>"
|
||||||
|
exit 1
|
||||||
|
fi
|
28
windows-arm64/Dockerfile.in
Normal file
28
windows-arm64/Dockerfile.in
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
FROM dockcross/base:latest
|
||||||
|
MAINTAINER Matt McCormick "matt.mccormick@kitware.com"
|
||||||
|
|
||||||
|
ENV XCC_PREFIX /usr/xcc
|
||||||
|
ENV CROSS_TRIPLE aarch64-w64-mingw32
|
||||||
|
ENV CROSS_ROOT ${XCC_PREFIX}/${CROSS_TRIPLE}-cross
|
||||||
|
|
||||||
|
ARG DOWNLOAD_URL=https://github.com/mstorsjo/llvm-mingw/releases/download/20210423/llvm-mingw-20210423-msvcrt-ubuntu-18.04-x86_64.tar.xz
|
||||||
|
ENV DOWNLOAD_URL=${DOWNLOAD_URL}
|
||||||
|
|
||||||
|
RUN mkdir -p ${CROSS_ROOT} && wget -qO- "${DOWNLOAD_URL}" | tar xJvf - --strip 1 -C ${CROSS_ROOT}/ > /dev/null
|
||||||
|
|
||||||
|
ENV AS=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-as \
|
||||||
|
AR=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-ar \
|
||||||
|
CC=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-gcc \
|
||||||
|
CXX=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-g++ \
|
||||||
|
LD=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-ld \
|
||||||
|
FC=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-gfortran
|
||||||
|
|
||||||
|
COPY Toolchain.cmake ${CROSS_ROOT}/
|
||||||
|
ENV CMAKE_TOOLCHAIN_FILE ${CROSS_ROOT}/Toolchain.cmake
|
||||||
|
|
||||||
|
# Linux kernel cross compilation variables
|
||||||
|
ENV PATH ${PATH}:${CROSS_ROOT}/bin
|
||||||
|
ENV CROSS_COMPILE ${CROSS_TRIPLE}-
|
||||||
|
ENV ARCH arm64
|
||||||
|
|
||||||
|
#include "common.label-and-env"
|
19
windows-arm64/Toolchain.cmake
Normal file
19
windows-arm64/Toolchain.cmake
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
set(CMAKE_SYSTEM_NAME Linux)
|
||||||
|
set(CMAKE_SYSTEM_VERSION 1)
|
||||||
|
set(CMAKE_SYSTEM_PROCESSOR aarch64)
|
||||||
|
|
||||||
|
set(cross_triple $ENV{CROSS_TRIPLE})
|
||||||
|
set(cross_root $ENV{CROSS_ROOT})
|
||||||
|
|
||||||
|
set(CMAKE_C_COMPILER $ENV{CC})
|
||||||
|
set(CMAKE_CXX_COMPILER $ENV{CXX})
|
||||||
|
set(CMAKE_Fortran_COMPILER $ENV{FC})
|
||||||
|
|
||||||
|
set(CMAKE_CXX_FLAGS "-I ${cross_root}/include/")
|
||||||
|
|
||||||
|
set(CMAKE_FIND_ROOT_PATH ${cross_root} ${cross_root}/${cross_triple})
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH)
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH)
|
||||||
|
|
||||||
|
set(CMAKE_CROSSCOMPILING_EMULATOR /usr/bin/qemu-aarch64)
|
28
windows-armv7/Dockerfile.in
Normal file
28
windows-armv7/Dockerfile.in
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
FROM dockcross/base:latest
|
||||||
|
MAINTAINER Matt McCormick "matt.mccormick@kitware.com"
|
||||||
|
|
||||||
|
ENV XCC_PREFIX /usr/xcc
|
||||||
|
ENV CROSS_TRIPLE armv7-w64-mingw32
|
||||||
|
ENV CROSS_ROOT ${XCC_PREFIX}/${CROSS_TRIPLE}-cross
|
||||||
|
|
||||||
|
ARG DOWNLOAD_URL=https://github.com/mstorsjo/llvm-mingw/releases/download/20210423/llvm-mingw-20210423-msvcrt-ubuntu-18.04-x86_64.tar.xz
|
||||||
|
ENV DOWNLOAD_URL=${DOWNLOAD_URL}
|
||||||
|
|
||||||
|
RUN mkdir -p ${CROSS_ROOT} && wget -qO- "${DOWNLOAD_URL}" | tar xJvf - --strip 1 -C ${CROSS_ROOT}/ > /dev/null
|
||||||
|
|
||||||
|
ENV AS=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-as \
|
||||||
|
AR=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-ar \
|
||||||
|
CC=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-gcc \
|
||||||
|
CXX=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-g++ \
|
||||||
|
LD=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-ld \
|
||||||
|
FC=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-gfortran
|
||||||
|
|
||||||
|
COPY Toolchain.cmake ${CROSS_ROOT}/
|
||||||
|
ENV CMAKE_TOOLCHAIN_FILE ${CROSS_ROOT}/Toolchain.cmake
|
||||||
|
|
||||||
|
# Linux kernel cross compilation variables
|
||||||
|
ENV PATH ${PATH}:${CROSS_ROOT}/bin
|
||||||
|
ENV CROSS_COMPILE ${CROSS_TRIPLE}-
|
||||||
|
ENV ARCH arm
|
||||||
|
|
||||||
|
#include "common.label-and-env"
|
19
windows-armv7/Toolchain.cmake
Normal file
19
windows-armv7/Toolchain.cmake
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
set(CMAKE_SYSTEM_NAME Linux)
|
||||||
|
set(CMAKE_SYSTEM_VERSION 1)
|
||||||
|
set(CMAKE_SYSTEM_PROCESSOR arm)
|
||||||
|
|
||||||
|
set(cross_triple $ENV{CROSS_TRIPLE})
|
||||||
|
set(cross_root $ENV{CROSS_ROOT})
|
||||||
|
|
||||||
|
set(CMAKE_C_COMPILER $ENV{CC})
|
||||||
|
set(CMAKE_CXX_COMPILER $ENV{CXX})
|
||||||
|
set(CMAKE_Fortran_COMPILER $ENV{FC})
|
||||||
|
|
||||||
|
set(CMAKE_CXX_FLAGS "-I ${cross_root}/include/")
|
||||||
|
|
||||||
|
set(CMAKE_FIND_ROOT_PATH ${cross_root} ${cross_root}/${cross_triple})
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH)
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH)
|
||||||
|
|
||||||
|
set(CMAKE_CROSSCOMPILING_EMULATOR /usr/bin/qemu-arm)
|
Reference in New Issue
Block a user