Skip to content

Commit 7c26457

Browse files
committed
CI: FIH: Update FIH tests to use recent TFM; bump toolchain to 14.2
- Update FIH tests to reference and work with the recent Trusted Firmware-M (TFM) version. - Update Docker image to use toolchain version 14.2 for compatibility. - Fix compatibility issues encountered with new TFM/toolchain. Signed-off-by: Maulik Patel <maulik.patel@arm.com> Change-Id: Ibc9234cb6932ba8e7beb5ce8e0591c4ab91dbecb
1 parent 713b98b commit 7c26457

File tree

2 files changed

+52
-1
lines changed

2 files changed

+52
-1
lines changed

ci/fih-tests_run.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,14 @@
1717
set -e
1818

1919
source $(dirname "$0")/fih-tests_version.sh
20+
TFM_TAG="1329d18c7f90329452c79393c0a5bc045fb2c1d2"
2021

2122
# Note that we are pulling from a github mirror of these repos, not direct upstream. If the sha
2223
# checked out below changes, the mirrors might need to be updated.
2324
pushd ..
2425
git clone https://github.com/mcu-tools/trusted-firmware-m
2526
pushd trusted-firmware-m
26-
git checkout eb8ff0db7d657b77abcd0262d5bf7f38eb1e1cdc
27+
git checkout $TFM_TAG
2728
source lib/ext/tf-m-tests/version.txt
2829
popd
2930
git clone https://github.com/mcu-tools/tf-m-tests.git

ci/fih_test_docker/execute_test.sh

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,63 @@
1616

1717
set -e
1818

19+
# Function to update/install native GCC inside the Docker container
20+
update_native_gcc() {
21+
REQUIRED_MAJOR=12
22+
INSTALLED_MAJOR=$(gcc -dumpversion | cut -d. -f1 || echo 0)
23+
24+
if [[ "$INSTALLED_MAJOR" -lt "$REQUIRED_MAJOR" ]]; then
25+
echo "Installing native GCC $REQUIRED_MAJOR..."
26+
apt-get update
27+
apt-get install -y --no-install-recommends gcc-$REQUIRED_MAJOR g++-$REQUIRED_MAJOR \
28+
cpp-$REQUIRED_MAJOR libgcc-$REQUIRED_MAJOR-dev libstdc++-$REQUIRED_MAJOR-dev
29+
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-$REQUIRED_MAJOR 60
30+
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-$REQUIRED_MAJOR 60
31+
rm -rf /var/lib/apt/lists/*
32+
else
33+
echo "Native GCC is already version $INSTALLED_MAJOR; skipping installation."
34+
fi
35+
}
36+
37+
# Function to update/install ARM Embedded GCC inside the Docker container
38+
update_cross_gcc() {
39+
ARM_GCC_URL="https://developer.arm.com/-/media/Files/downloads/gnu/14.2.rel1/binrel/arm-gnu-toolchain-14.2.rel1-x86_64-arm-none-eabi.tar.xz"
40+
TOOLCHAIN_DIR="/opt/arm-gcc"
41+
42+
# Install prerequisites
43+
echo "Installing prerequisites for ARM toolchain..."
44+
apt-get update
45+
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
46+
curl libncurses5 xz-utils file
47+
rm -rf /var/lib/apt/lists/*
48+
49+
# Download and extract
50+
echo "Downloading and extracting ARM Embedded GCC..."
51+
mkdir -p "$TOOLCHAIN_DIR"
52+
curl -SLf "$ARM_GCC_URL" -o /tmp/arm-gcc.tar.xz
53+
tar -xJf /tmp/arm-gcc.tar.xz -C "$TOOLCHAIN_DIR" --strip-components=1
54+
rm -f /tmp/arm-gcc.tar.xz
55+
56+
# Symlink into PATH
57+
echo "Symlinking ARM toolchain into /usr/local/bin..."
58+
ln -sf "$TOOLCHAIN_DIR/bin/"* /usr/local/bin/
59+
}
60+
61+
# Ensure we have the proper compiler before running tests
62+
update_native_gcc
63+
update_cross_gcc
64+
1965
source $(dirname "$0")/paths.sh
2066

2167
SKIP_SIZE=$1
2268
BUILD_TYPE=$2
2369
DAMAGE_TYPE=$3
2470
FIH_LEVEL=$4
2571

72+
# Required for git am to apply patches under TF-M
73+
git config --global user.email "docker@fih-test.com"
74+
git config --global user.name "fih-test docker"
75+
2676
if test -z "$FIH_LEVEL"; then
2777
# Use the default level
2878
CMAKE_FIH_LEVEL=""

0 commit comments

Comments
 (0)