diff options
author | Eric Anholt <[email protected]> | 2020-05-14 10:38:12 -0700 |
---|---|---|
committer | Eric Engestrom <[email protected]> | 2020-07-08 19:31:15 +0200 |
commit | 742c8515d5f9a4df5584c11238f75cd00d3c2f29 (patch) | |
tree | 1f05241c4aa61a25ddbce1c7e1941d1318db4a3a /.gitlab-ci | |
parent | b6792a5e1e238e7a3a1b04929468993c9eaf595d (diff) |
ci: Make cmake toolchain file for deqp cross build setup.
This adds a few more variables that we found we needed for x86-to-arm dEQP
cross builds. Also note that we're now fixed to use ccache in the dEQP
builds.
Reviewed-by: Christian Gmeiner <[email protected]>
Reviewed-by: Tomeu Vizoso <[email protected]>
(cherry picked from commit 588ea3184ceb928cbc11e99ba3a7cfae2aa61773)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5548>
Diffstat (limited to '.gitlab-ci')
-rw-r--r-- | .gitlab-ci/container/lava_arm.sh | 2 | ||||
-rwxr-xr-x | .gitlab-ci/create-cross-file.sh | 21 |
2 files changed, 22 insertions, 1 deletions
diff --git a/.gitlab-ci/container/lava_arm.sh b/.gitlab-ci/container/lava_arm.sh index 15feb76f69a..fcaf9052418 100644 --- a/.gitlab-ci/container/lava_arm.sh +++ b/.gitlab-ci/container/lava_arm.sh @@ -20,6 +20,7 @@ fi # Determine if we're in a cross build. if [[ -e /cross_file-$DEBIAN_ARCH.txt ]]; then EXTRA_MESON_ARGS="--cross-file /cross_file-$DEBIAN_ARCH.txt" + EXTRA_CMAKE_ARGS="-DCMAKE_TOOLCHAIN_FILE=/toolchain-$DEBIAN_ARCH.cmake" export ARCH=${KERNEL_ARCH} export CROSS_COMPILE="${GCC_ARCH}-" @@ -32,7 +33,6 @@ mv /usr/local/bin/deqp-runner /lava-files/rootfs-${DEBIAN_ARCH}/usr/bin/. ############### Build dEQP -EXTRA_CMAKE_ARGS="-DCMAKE_C_COMPILER=${GCC_ARCH}-gcc -DCMAKE_CXX_COMPILER=${GCC_ARCH}-g++" STRIP_CMD="${GCC_ARCH}-strip" . .gitlab-ci/build-deqp-gl.sh mv /deqp /lava-files/rootfs-${DEBIAN_ARCH}/. diff --git a/.gitlab-ci/create-cross-file.sh b/.gitlab-ci/create-cross-file.sh index de2fba5f4dd..ba63812ca41 100755 --- a/.gitlab-ci/create-cross-file.sh +++ b/.gitlab-ci/create-cross-file.sh @@ -11,3 +11,24 @@ if [ "$arch" = "i386" ]; then fi # Rely on qemu-user being configured in binfmt_misc on the host sed -i -e '/\[properties\]/a\' -e "needs_exe_wrapper = False" "$cross_file" + +# Set up cmake cross compile toolchain file for dEQP builds +toolchain_file="/toolchain-$arch.cmake" +if [[ "$arch" = "arm64" ]]; then + GCC_ARCH="aarch64-linux-gnu" + DE_CPU="DE_CPU_ARM_64" + CMAKE_ARCH=arm +elif [[ "$arch" = "armhf" ]]; then + GCC_ARCH="arm-linux-gnueabihf" + DE_CPU="DE_CPU_ARM" + CMAKE_ARCH=arm +fi + +if [[ -n "$GCC_ARCH" ]]; then + echo "set(CMAKE_SYSTEM_NAME Linux)" > "$toolchain_file" + echo "set(CMAKE_SYSTEM_PROCESSOR arm)" >> "$toolchain_file" + echo "set(CMAKE_C_COMPILER /usr/lib/ccache/$GCC_ARCH-gcc)" >> "$toolchain_file" + echo "set(CMAKE_CXX_COMPILER /usr/lib/ccache/$GCC_ARCH-g++)" >> "$toolchain_file" + echo "set(ENV{PKG_CONFIG} \"/usr/bin/$GCC_ARCH-pkg-config\")" >> "$toolchain_file" + echo "set(DE_CPU $DE_CPU)" >> "$toolchain_file" +fi |