Skip to content

Commit 09f2217

Browse files
committed
Add cross-compilation for TS provider
The TS provider is currently excluded from the cross-compilation tests. However, `libts` can be cross-compiled for aarch64-linux-gnu targets. The `trusted-service-provider` feature is added here to cross-compilation for the appropriate target only. Signed-off-by: Ionut Mihalcea <[email protected]>
1 parent e6e97db commit 09f2217

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

e2e_tests/docker_image/parsec-service-test-cross-compile.Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,26 @@
22
# SPDX-License-Identifier: Apache-2.0
33
FROM ghcr.io/parallaxsecond/parsec-service-test-all
44

5+
# Install aarch64-none-linux-gnu cross compilation toolchain
6+
RUN wget https://developer.arm.com/-/media/Files/downloads/gnu-a/9.2-2019.12/binrel/gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu.tar.xz?revision=61c3be5d-5175-4db6-9030-b565aae9f766 -O aarch64-gcc.tar.xz
7+
RUN tar --strip-components=1 -C /usr/ -xvf aarch64-gcc.tar.xz
8+
RUN rm aarch64-gcc.tar.xz
9+
10+
# Install Trusted Services lib compiled for aarch64
11+
# Setup git config for patching dependencies
12+
RUN git config --global user.email "[email protected]"
13+
RUN git config --global user.name "Parsec Team"
14+
RUN git clone https://git.trustedfirmware.org/TS/trusted-services.git --branch integration \
15+
&& cd trusted-services \
16+
&& git reset --hard 389b50624f25dae860bbbf8b16f75b32f1589c8d
17+
# Install correct python dependencies
18+
RUN pip3 install -r trusted-services/requirements.txt
19+
RUN cd trusted-services/deployments/libts/arm-linux/ \
20+
&& cmake . \
21+
&& make \
22+
&& cp libts.so* /usr/local/lib/
23+
RUN rm -rf trusted-services
24+
525
# Install cross-compilers
626
RUN apt install -y gcc-multilib
727
RUN apt install -y gcc-arm-linux-gnueabihf

test/cross-compile.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ cargo build --features "pkcs11-provider, mbed-crypto-provider, tpm-provider, uni
2222

2323
export SYSROOT=/tmp/aarch64-linux-gnu
2424
export RUSTFLAGS="-lcrypto -L/tmp/aarch64-linux-gnu/lib"
25-
cargo build --features "pkcs11-provider, mbed-crypto-provider, tpm-provider, unix-peer-credentials-authenticator, direct-authenticator" --target aarch64-unknown-linux-gnu
25+
# Pull in the TS code
26+
git submodule update --init
27+
cargo build --features "pkcs11-provider, mbed-crypto-provider, tpm-provider, trusted-service-provider, unix-peer-credentials-authenticator, direct-authenticator" --target aarch64-unknown-linux-gnu
2628

2729
# This is needed because for some reason the i686/i386 libs aren't picked up if we don't toss them around just before...
2830
apt install -y libc6-dev-i386-amd64-cross

0 commit comments

Comments
 (0)