Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux arm64 #221

Merged
merged 7 commits into from
May 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 25 additions & 29 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,17 @@ jobs:
steps:
- restore_cache:
key: base-assets-{{ .Revision }}
# Image build currently broken. See #209
#- run:
#name: linux-arm64 build
#no_output_timeout: 1.5h
#command: |
#docker load -i ~/docker/base.tar
#make linux-arm64
#docker save -o ~/docker/linux-arm64.tar dockcross/linux-arm64:latest
#- run:
#name: linux-arm64 test
#command: |
#make linux-arm64.test
- run:
name: linux-arm64 build
no_output_timeout: 1.5h
command: |
docker load -i ~/docker/base.tar
make linux-arm64
docker save -o ~/docker/linux-arm64.tar dockcross/linux-arm64:latest
- run:
name: linux-arm64 test
command: |
make linux-arm64.test
- save_cache:
key: linux-arm64-assets-{{ .Revision }}
paths: ~/docker/linux-arm64.tar
Expand Down Expand Up @@ -377,17 +376,16 @@ jobs:
docker login -u $DOCKER_USER -p $DOCKER_PASS
docker push dockcross/browser-asmjs:latest
fi
# Image build currently broken. See #209
#- restore_cache:
#key: linux-arm64-assets-{{ .Revision }}
#- deploy:
#name: Deploy linux-arm64
#command: |
#docker load -i ~/docker/linux-arm64.tar
#if [ "${CIRCLE_BRANCH}" == "master" ]; then
#docker login -u $DOCKER_USER -p $DOCKER_PASS
#docker push dockcross/linux-arm64:latest
#fi
- restore_cache:
key: linux-arm64-assets-{{ .Revision }}
- deploy:
name: Deploy linux-arm64
command: |
docker load -i ~/docker/linux-arm64.tar
if [ "${CIRCLE_BRANCH}" == "master" ]; then
docker login -u $DOCKER_USER -p $DOCKER_PASS
docker push dockcross/linux-arm64:latest
fi
# Image build currently broken. See #209
#- restore_cache:
#key: linux-armv5-assets-{{ .Revision }}
Expand Down Expand Up @@ -527,10 +525,9 @@ workflows:
- browser-asmjs:
requires:
- base
# Image build currently broken. See #209
#- linux-arm64:
#requires:
#- base
- linux-arm64:
requires:
- base
# Image build currently broken. See #209
#- linux-armv5:
#requires:
Expand Down Expand Up @@ -577,8 +574,7 @@ workflows:
- android-arm
- android-arm64
- browser-asmjs
# Image build currently broken. See #209
#- linux-arm64
- linux-arm64
#- linux-armv5
- linux-armv6
# Image build currently broken. See #209
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ BIN = ./bin
STANDARD_IMAGES = linux-s390x android-arm android-arm64 linux-x86 linux-x64 linux-arm64 linux-armv5 linux-armv6 linux-armv7 linux-mips linux-mipsel linux-ppc64le windows-x86 windows-x64

# Generated Dockerfiles.
GEN_IMAGES = linux-s390x linux-mips manylinux-x86 manylinux-x64 browser-asmjs
GEN_IMAGES = linux-s390x linux-mips manylinux-x86 manylinux-x64 browser-asmjs linux-arm64
GEN_IMAGE_DOCKERFILES = $(addsuffix /Dockerfile,$(GEN_IMAGES))

# These images are expected to have explicit rules for *both* build and testing
Expand Down
39 changes: 20 additions & 19 deletions linux-arm64/Dockerfile → linux-arm64/Dockerfile.in
Original file line number Diff line number Diff line change
@@ -1,38 +1,37 @@
FROM dockcross/base:latest
MAINTAINER Matt McCormick "matt.mccormick@kitware.com"

# Add the cross compiler sources
RUN echo "deb http://emdebian.org/tools/debian/ jessie main" >> /etc/apt/sources.list && \
dpkg --add-architecture arm64 && \
curl http://emdebian.org/tools/debian/emdebian-toolchain-archive.key | apt-key add -

RUN apt-get update && apt-get install -y \
crossbuild-essential-arm64 \
gfortran-aarch64-linux-gnu \

# Add sources.list
COPY sources.list /etc/apt/sources.list
RUN dpkg --add-architecture arm64 ; apt-get update ; apt-get -y upgrade ; apt-get update ;
RUN apt-get install -y \
libbz2-dev:arm64 \
libexpat1-dev:arm64 \
ncurses-dev:arm64 \
libssl-dev:arm64
libssl-dev:arm64 \
python-dev

#include "common.crosstool"

WORKDIR /usr/src

RUN apt-get update && \
apt-get install -y libglib2.0-dev zlib1g-dev libpixman-1-dev && \
RUN apt-get install -y libglib2.0-dev zlib1g-dev libpixman-1-dev && \
curl -L http://wiki.qemu-project.org/download/qemu-2.6.0.tar.bz2 | tar xj && \
cd qemu-2.6.0 && \
./configure --target-list=aarch64-linux-user --prefix=/usr && \
make -j$(nproc) && \
make install && \
cd .. && rm -rf qemu-2.6.0

ENV CROSS_TRIPLE aarch64-linux-gnu
ENV CROSS_ROOT /usr/${CROSS_TRIPLE}
ENV AS=/usr/bin/${CROSS_TRIPLE}-as \
AR=/usr/bin/${CROSS_TRIPLE}-ar \
CC=/usr/bin/${CROSS_TRIPLE}-gcc \
CPP=/usr/bin/${CROSS_TRIPLE}-cpp-4.9 \
CXX=/usr/bin/${CROSS_TRIPLE}-g++ \
LD=/usr/bin/${CROSS_TRIPLE}-ld
ENV CROSS_TRIPLE aarch64-unknown-linux-gnueabi
ENV CROSS_ROOT /opt/x-tools/${CROSS_TRIPLE}
ENV AS=/opt/x-tools/${CROSS_TRIPLE}/bin/${CROSS_TRIPLE}-as \
AR=/opt/x-tools/${CROSS_TRIPLE}/bin/${CROSS_TRIPLE}-ar \
CC=/opt/x-tools/${CROSS_TRIPLE}/bin/${CROSS_TRIPLE}-gcc \
CPP=/opt/x-tools/${CROSS_TRIPLE}/bin/${CROSS_TRIPLE}-cpp \
CXX=/opt/x-tools/${CROSS_TRIPLE}/bin/${CROSS_TRIPLE}-g++ \
LD=/opt/x-tools/${CROSS_TRIPLE}/bin/${CROSS_TRIPLE}-ld

ENV DEFAULT_DOCKCROSS_IMAGE dockcross/linux-arm64
WORKDIR /work
Expand All @@ -53,3 +52,5 @@ LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url=$VCS_URL \
org.label-schema.schema-version="1.0"

ENV PKG_CONFIG_PATH /usr/lib/aarch64-linux-gnu/pkgconfig
20 changes: 13 additions & 7 deletions linux-arm64/Toolchain.cmake
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@

set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_VERSION 1)
set(CMAKE_SYSTEM_PROCESSOR aarch64)

set(cross_triple "aarch64-linux-gnu")
set(cross_triple "aarch64-unknown-linux-gnueabi")

set(CMAKE_C_COMPILER /opt/x-tools/aarch64-unknown-linux-gnueabi/bin/${cross_triple}-cc)
set(CMAKE_CXX_COMPILER /opt/x-tools/aarch64-unknown-linux-gnueabi/bin/${cross_triple}-c++)
set(CMAKE_Fortran_COMPILER /opt/x-tools/aarch64-unknown-linux-gnueabi/bin/${cross_triple}-gfortran)

set(CMAKE_C_COMPILER /usr/bin/${cross_triple}-cc)
set(CMAKE_CXX_COMPILER /usr/bin/${cross_triple}-c++)
set(CMAKE_Fortran_COMPILER /usr/bin/${cross_triple}-gfortran)
set(CMAKE_FIND_ROOT_PATH /opt/x-tools/aarch64-unknown-linux-gnueabi)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_SYSROOT /opt/x-tools/aarch64-unknown-linux-gnueabi/aarch64-unknown-linux-gnueabi/sysroot)

# Discard path returned by pkg-config and associated with HINTS in module
# like FindOpenSSL.
set(CMAKE_IGNORE_PATH /usr/lib/x86_64-linux-gnu/ /usr/lib/x86_64-linux-gnu/lib/)
set(CMAKE_CXX_FLAGS "-I /opt/x-tools/aarch64-unknown-linux-gnueabi/include")
set(ADDITIONAL_COMPILER_FLAGS "-L /usr/lib/aarch64-linux-gnu -Wl,-rpath-link,/usr/lib/aarch64-linux-gnu -Wl,-rpath-link,/lib/aarch64-linux-gnu")

set(CMAKE_CROSSCOMPILING_EMULATOR /usr/bin/qemu-aarch64)
Loading