-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
416 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
**/*.tar.xz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/usr/bin/env bash | ||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# SPDX-License-Identifier: Apache-2.0 OR ISC | ||
|
||
set -ex | ||
|
||
# Requires: | ||
# * Install qemu-user-static | ||
|
||
# Note: | ||
# On Linux, you can see which architectures that qemu is registered for by looking | ||
# under `/proc/sys/fs/binfmt_misc`. | ||
|
||
# If needed, you can clear these entries using the following command: | ||
# `sudo find /proc/sys/fs/binfmt_misc -type f -name 'qemu-*' -exec sh -c 'echo -1 > {}' \;` | ||
|
||
# Log Docker hub limit https://docs.docker.com/docker-hub/download-rate-limit/#how-can-i-check-my-current-rate | ||
TOKEN=$(curl "https://auth.docker.io/token?service=registry.docker.io&scope=repository:ratelimitpreview/test:pull" | jq -r .token) | ||
curl --head -H "Authorization: Bearer $TOKEN" https://registry-1.docker.io/v2/ratelimitpreview/test/manifests/latest | ||
|
||
SCRIPT_DIR=$(dirname "$(readlink -f "${0}")") | ||
|
||
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes | ||
|
||
ARCH_NAME=loongarch64 | ||
|
||
X_TOOLS_FILE=${ARCH_NAME}-x-tools | ||
if [ ! -f "./ubuntu-x-tools/${X_TOOLS_FILE}.tar.xz" ]; then | ||
if ! aws sts get-caller-identity &> /dev/null; then | ||
echo "AWS credentials are invalid. Please verify AWS credentials and try again." | ||
exit 1 | ||
fi | ||
aws s3 cp "s3://aws-libcrypto/cross-compile-toolchains/host-x86_64-pc-linux-gnu/${X_TOOLS_FILE}.tar.xz" ./ubuntu-x-tools/ | ||
fi | ||
|
||
BUILDER_NAME=${ARCH_NAME}-builder | ||
if ! docker buildx inspect ${BUILDER_NAME}; then | ||
docker buildx create --name ${BUILDER_NAME} --use | ||
fi | ||
|
||
docker buildx build -t ubuntu-${ARCH_NAME}:x-tools "${SCRIPT_DIR}"/ubuntu-x-tools --load | ||
|
||
docker buildx rm ${BUILDER_NAME} |
39 changes: 39 additions & 0 deletions
39
tests/docker_images/linux-loongarch64/ubuntu-x-tools/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# SPDX-License-Identifier: Apache-2.0 OR ISC | ||
|
||
FROM ubuntu:latest | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
git cmake golang gdb gdbserver valgrind \ | ||
libclang1 \ | ||
build-essential \ | ||
ssh \ | ||
rsync \ | ||
tar \ | ||
python3 \ | ||
xz-utils \ | ||
ninja-build | ||
|
||
# Not yet available | ||
#RUN apt-get install -y \ | ||
# qemu-system-loongarch64 | ||
|
||
RUN apt-get clean | ||
|
||
COPY loongarch64-x-tools.tar.xz / | ||
RUN tar Jxvf loongarch64-x-tools.tar.xz -C / && rm /loongarch64-x-tools.tar.xz | ||
COPY loongarch64.cmake / | ||
|
||
EXPOSE 1234 | ||
|
||
ENV GOCACHE=/tmp \ | ||
CMAKE_TOOLCHAIN_FILE=/loongarch64.cmake \ | ||
CMAKE_SYSTEM_NAME=Linux \ | ||
CMAKE_SYSTEM_PROCESSOR=loongarch64 \ | ||
PATH="${PATH}:/loongarch64-unknown-linux-gnu/bin/" \ | ||
CMAKE_C_COMPILER=/loongarch64-unknown-linux-gnu/bin/loongarch64-unknown-linux-gnu-gcc \ | ||
CMAKE_CXX_COMPILER=/loongarch64-unknown-linux-gnu/bin/loongarch64-unknown-linux-gnu-g++ \ | ||
CMAKE_SYSROOT=/loongarch64-unknown-linux-gnu/loongarch64-unknown-linux-gnu/sysroot \ | ||
CMAKE_GENERATOR=Ninja | ||
|
||
CMD ["/bin/bash"] |
11 changes: 11 additions & 0 deletions
11
tests/docker_images/linux-loongarch64/ubuntu-x-tools/loongarch64.cmake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Specify the target system | ||
set(CMAKE_SYSTEM_NAME Linux) | ||
set(CMAKE_SYSTEM_PROCESSOR loongarch64) | ||
|
||
# Specify the cross-compiler | ||
set(CMAKE_C_COMPILER /loongarch64-unknown-linux-gnu/bin/loongarch64-unknown-linux-gnu-gcc) | ||
set(CMAKE_CXX_COMPILER /loongarch64-unknown-linux-gnu/bin/loongarch64-unknown-linux-gnu-g++) | ||
|
||
# Specify the sysroot for the target system | ||
set(CMAKE_SYSROOT /loongarch64-unknown-linux-gnu/loongarch64-unknown-linux-gnu/sysroot) | ||
set(CMAKE_GENERATOR Ninja) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/usr/bin/env bash | ||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# SPDX-License-Identifier: Apache-2.0 OR ISC | ||
|
||
set -ex | ||
|
||
# Requires: | ||
# * Install qemu-user-static | ||
|
||
# Note: | ||
# On Linux, you can see which architectures that qemu is registered for by looking | ||
# under `/proc/sys/fs/binfmt_misc`. | ||
|
||
# If needed, you can clear these entries using the following command: | ||
# `sudo find /proc/sys/fs/binfmt_misc -type f -name 'qemu-*' -exec sh -c 'echo -1 > {}' \;` | ||
|
||
# Log Docker hub limit https://docs.docker.com/docker-hub/download-rate-limit/#how-can-i-check-my-current-rate | ||
TOKEN=$(curl "https://auth.docker.io/token?service=registry.docker.io&scope=repository:ratelimitpreview/test:pull" | jq -r .token) | ||
curl --head -H "Authorization: Bearer $TOKEN" https://registry-1.docker.io/v2/ratelimitpreview/test/manifests/latest | ||
|
||
SCRIPT_DIR=$(dirname "$(readlink -f "${0}")") | ||
|
||
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes | ||
|
||
ARCH_NAME=ppc | ||
|
||
X_TOOLS_FILE=${ARCH_NAME}-x-tools | ||
if [ ! -f "./ubuntu-x-tools/${X_TOOLS_FILE}.tar.xz" ]; then | ||
if ! aws sts get-caller-identity &> /dev/null; then | ||
echo "AWS credentials are invalid. Please verify AWS credentials and try again." | ||
exit 1 | ||
fi | ||
aws s3 cp "s3://aws-libcrypto/cross-compile-toolchains/host-x86_64-pc-linux-gnu/${X_TOOLS_FILE}.tar.xz" ./ubuntu-x-tools/ | ||
fi | ||
|
||
BUILDER_NAME=${ARCH_NAME}-builder | ||
if ! docker buildx inspect ${BUILDER_NAME}; then | ||
docker buildx create --name ${BUILDER_NAME} --use | ||
fi | ||
|
||
docker buildx build -t ubuntu-${ARCH_NAME}:x-tools "${SCRIPT_DIR}"/ubuntu-x-tools --load | ||
|
||
docker buildx rm ${BUILDER_NAME} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# SPDX-License-Identifier: Apache-2.0 OR ISC | ||
|
||
FROM ubuntu:latest | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
git cmake golang gdb gdbserver valgrind \ | ||
libclang1 \ | ||
build-essential \ | ||
ssh \ | ||
rsync \ | ||
tar \ | ||
python3 \ | ||
xz-utils \ | ||
ninja-build | ||
|
||
RUN apt-get install -y \ | ||
qemu-system-ppc | ||
|
||
RUN apt-get clean | ||
|
||
COPY ppc-x-tools.tar.xz / | ||
RUN tar Jxvf ppc-x-tools.tar.xz -C / && rm /ppc-x-tools.tar.xz | ||
COPY ppc.cmake / | ||
|
||
EXPOSE 1234 | ||
|
||
ENV GOCACHE=/tmp \ | ||
CMAKE_TOOLCHAIN_FILE=/ppc.cmake \ | ||
CMAKE_SYSTEM_NAME=Linux \ | ||
CMAKE_SYSTEM_PROCESSOR=ppc \ | ||
PATH="${PATH}:/powerpc-unknown-linux-gnu/bin/" \ | ||
CMAKE_C_COMPILER=/powerpc-unknown-linux-gnu/bin/powerpc-unknown-linux-gnu-gcc \ | ||
CMAKE_CXX_COMPILER=/powerpc-unknown-linux-gnu/bin/powerpc-unknown-linux-gnu-g++ \ | ||
CMAKE_SYSROOT=/powerpc-unknown-linux-gnu/powerpc-unknown-linux-gnu/sysroot \ | ||
CMAKE_GENERATOR=Ninja | ||
|
||
CMD ["/bin/bash"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Specify the target system | ||
set(CMAKE_SYSTEM_NAME Linux) | ||
set(CMAKE_SYSTEM_PROCESSOR ppc) | ||
|
||
# Specify the cross-compiler | ||
set(CMAKE_C_COMPILER /powerpc-unknown-linux-gnu/bin/powerpc-unknown-linux-gnu-gcc) | ||
set(CMAKE_CXX_COMPILER /powerpc-unknown-linux-gnu/bin/powerpc-unknown-linux-gnu-g++) | ||
|
||
# Specify the sysroot for the target system | ||
set(CMAKE_SYSROOT /powerpc-unknown-linux-gnu/powerpc-unknown-linux-gnu/sysroot) | ||
set(CMAKE_GENERATOR Ninja) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# SPDX-License-Identifier: Apache-2.0 OR ISC | ||
|
||
FROM ubuntu:latest | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
git cmake golang gdb gdbserver valgrind \ | ||
libclang1 \ | ||
build-essential \ | ||
ssh \ | ||
rsync \ | ||
tar \ | ||
python3 \ | ||
xz-utils \ | ||
ninja-build | ||
|
||
RUN apt-get install -y \ | ||
qemu-system-ppc | ||
|
||
RUN apt-get clean | ||
|
||
COPY ppc64-x-tools.tar.xz / | ||
RUN tar Jxvf ppc64-x-tools.tar.xz -C / && rm /ppc64-x-tools.tar.xz | ||
COPY ppc64.cmake / | ||
|
||
EXPOSE 1234 | ||
|
||
ENV GOCACHE=/tmp \ | ||
CMAKE_TOOLCHAIN_FILE=/ppc64.cmake \ | ||
CMAKE_SYSTEM_NAME=Linux \ | ||
CMAKE_SYSTEM_PROCESSOR=ppc64 \ | ||
PATH="${PATH}:/powerpc64-linux-gnu/bin/" \ | ||
CMAKE_C_COMPILER=/powerpc64-linux-gnu/bin/powerpc64-unknown-linux-gnu-gcc \ | ||
CMAKE_CXX_COMPILER=/powerpc64-linux-gnu/bin/powerpc64-unknown-linux-gnu-g++ \ | ||
CMAKE_SYSROOT=/powerpc64-linux-gnu/powerpc64-unknown-linux-gnu/sysroot \ | ||
CMAKE_GENERATOR=Ninja | ||
|
||
CMD ["/bin/bash"] |
11 changes: 11 additions & 0 deletions
11
tests/docker_images/linux-ppc64/ubuntu-x-tools/ppc64.cmake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Specify the target system | ||
set(CMAKE_SYSTEM_NAME Linux) | ||
set(CMAKE_SYSTEM_PROCESSOR ppc64) | ||
|
||
# Specify the cross-compiler | ||
set(CMAKE_C_COMPILER /powerpc64-linux-gnu/bin/powerpc64-unknown-linux-gnu-gcc) | ||
set(CMAKE_CXX_COMPILER /powerpc64-linux-gnu/bin/powerpc64-unknown-linux-gnu-g++) | ||
|
||
# Specify the sysroot for the target system | ||
set(CMAKE_SYSROOT /powerpc64-linux-gnu/powerpc64-unknown-linux-gnu/sysroot) | ||
set(CMAKE_GENERATOR Ninja) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.