Skip to contentSkip to conversation

tricore fixes

PATCH New Alex Bennée 1 participant 4 messages Jul 20, 2021 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

v3 cover tricore fixes

Hi,

This fixes check-tcg for tricore and adds a test to the gitlab matrix so we don't miss it breaking again.

v3
- added new patch for configure.sh
- changed symbol for board

The following need review:

- gitlab: enable a very minimal build with the tricore container
- tests/tcg/configure.sh: add handling for assembler only builds

Alex Bennée (3):
hw/tricore: fix inclusion of tricore_testboard tests/tcg/configure.sh: add handling for assembler only builds
gitlab: enable a very minimal build with the tricore container

 configs/devices/tricore-softmmu/default.mak   |  1 +
 .gitlab-ci.d/buildtest.yml                    | 11 ++++++
 hw/tricore/Kconfig                            |  3 +-
 hw/tricore/meson.build                        |  4 +--
 .../dockerfiles/debian-tricore-cross.docker   | 34 ++++++++++++++++---
 tests/tcg/configure.sh                        | 18 ++++++++++
 6 files changed, 62 insertions(+), 9 deletions(-)
Signature · 1 line
2.32.0.264.g75ae10bc75
#1 lore raw

PATCH v3 1/3 hw/tricore: fix inclusion of tricore_testboard

We inadvertently added a symbol clash causing the build not to include the testboard needed for check-tcg.

Fixes f4063f9c31 ("meson: Introduce target-specific Kconfig")

---
v3
- rename to CONFIG_TRICORE_TESTBOARD

---
 configs/devices/tricore-softmmu/default.mak | 1 +
 hw/tricore/Kconfig                          | 3 +--
 hw/tricore/meson.build                      | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)
configs/devices/tricore-softmmu/default.mak +1 -0
index 5cc91cebce..cb8fc286eb 100644
@@ -1 +1,2 @@
+CONFIG_TRICORE_TESTBOARD=y
 CONFIG_TRIBOARD=y
hw/tricore/Kconfig +1 -2
index 506e6183c1..33c1e852c3 100644
@@ -1,9 +1,8 @@
-config TRICORE
+config TRICORE_TESTBOARD
     bool
 
 config TRIBOARD
     bool
-    select TRICORE
     select TC27X_SOC
 
 config TC27X_SOC
hw/tricore/meson.build +2 -2
index 47e36bb077..7e3585daf8 100644
@@ -1,6 +1,6 @@
 tricore_ss = ss.source_set()
-tricore_ss.add(when: 'CONFIG_TRICORE', if_true: files('tricore_testboard.c'))
-tricore_ss.add(when: 'CONFIG_TRICORE', if_true: files('tricore_testdevice.c'))
+tricore_ss.add(when: 'CONFIG_TRICORE_TESTBOARD', if_true: files('tricore_testboard.c'))
+tricore_ss.add(when: 'CONFIG_TRICORE_TESTBOARD', if_true: files('tricore_testdevice.c'))
 tricore_ss.add(when: 'CONFIG_TRIBOARD', if_true: files('triboard.c'))
 tricore_ss.add(when: 'CONFIG_TC27X_SOC', if_true: files('tc27x_soc.c'))
 
Signature · 1 line
2.32.0.264.g75ae10bc75
#2 lore raw

PATCH v3 2/3 tests/tcg/configure.sh: add handling for assembler only builds

In reply to Alex Bennée

Up until this point we only handled local compilers or assumed we had everything in the container. This falls down when we are building QEMU inside the container.

This special handling only affects tricore for now but I put it in a case just in case we add any other "special" targets. Setting CROSS_CC_GUEST is a bit of a hack just to ensure the test runs as we gate on a detected compiler even though the Makefile won't actually use it. It also means we display something sane in the configure output.

---
 tests/tcg/configure.sh | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
tests/tcg/configure.sh +18 -0
index aa7c24328a..1f985ccfc0 100755
@@ -72,6 +72,10 @@ fi
 : ${cross_cc_x86_64="x86_64-linux-gnu-gcc"}
 : ${cross_cc_cflags_x86_64="-m64"}
 
+# tricore is special as it doesn't have a compiler
+: ${cross_as_tricore="tricore-as"}
+: ${cross_ld_tricore="tricore-ld"}
+
 for target in $target_list; do
   arch=${target%%-*}
 
@@ -247,6 +251,20 @@ for target in $target_list; do
               fi
           fi
       fi
+
+      # Special handling for assembler only tests
+      eval "target_as=\"\${cross_as_$arch}\""
+      eval "target_ld=\"\${cross_ld_$arch}\""
+      if has $target_as && has $target_ld; then
+          case $target in
+              tricore-softmmu)
+                  echo "CROSS_CC_GUEST=$target_as" >> $config_target_mak
+                  echo "CROSS_AS_GUEST=$target_as" >> $config_target_mak
+                  echo "CROSS_LD_GUEST=$target_ld" >> $config_target_mak
+                  got_cross_cc=yes
+                  ;;
+          esac
+      fi
   fi
 
   if test $got_cross_cc = yes; then
Signature · 1 line
2.32.0.264.g75ae10bc75
#3 lore raw

PATCH v3 3/3 gitlab: enable a very minimal build with the tricore container

In reply to Alex Bennée

Rather than base of the shared Debian 10 container which would require us to bring in even more dependencies just bring in what is needed for building tricore-softmmu in GitLab. We don't even remove the container from the DOCKER_PARTIAL_IMAGES lest we cause more confusion.

---
v3
- make a uni-container (but not based from common code)

---
 .gitlab-ci.d/buildtest.yml                    | 11 ++++++
 .../dockerfiles/debian-tricore-cross.docker   | 34 ++++++++++++++++---
 2 files changed, 40 insertions(+), 5 deletions(-)
.gitlab-ci.d/buildtest.yml +11 -0
index 89df51517c..48cb45a783 100644
@@ -354,6 +354,17 @@ build-some-softmmu:
     TARGETS: xtensa-softmmu arm-softmmu aarch64-softmmu alpha-softmmu
     MAKE_CHECK_ARGS: check-tcg
 
+# We build tricore in a very minimal tricore only container
+build-tricore-softmmu:
+  extends: .native_build_job_template
+  needs:
+    job: tricore-debian-cross-container
+  variables:
+    IMAGE: debian-tricore-cross
+    CONFIGURE_ARGS: --disable-tools --disable-fdt --enable-debug
+    TARGETS: tricore-softmmu
+    MAKE_CHECK_ARGS: check-tcg
+
 clang-system:
   extends: .native_build_job_template
   needs:
tests/docker/dockerfiles/debian-tricore-cross.docker +29 -5
index 985925134c..d8df2c6117 100644
@@ -1,23 +1,47 @@
 #
 # Docker TriCore cross-compiler target
 #
-# This docker target builds on the debian Stretch base image.
+# This docker target builds on the Debian Buster base image but
+# doesn't inherit from the common one to avoid bringing in unneeded
+# dependencies.
 #
 # Copyright (c) 2018 Philippe Mathieu-Daudé
 #
 # SPDX-License-Identifier: GPL-2.0-or-later
 #
-FROM qemu/debian10
+FROM docker.io/library/debian:buster-slim
 
 MAINTAINER Philippe Mathieu-Daudé <[email protected]>
 
+RUN apt update && \
+    DEBIAN_FRONTEND=noninteractive apt install -yy eatmydata && \
+    DEBIAN_FRONTEND=noninteractive eatmydata apt install -yy \
+       bzip2 \
+       ca-certificates \
+       ccache \
+       g++ \
+       gcc \
+       git \
+       libglib2.0-dev \
+       libpixman-1-dev \
+       libtest-harness-perl \
+       locales \
+       make \
+       ninja-build \
+       perl-base \
+       pkgconf \
+       python3-pip \
+       python3-setuptools \
+       python3-wheel
+
 RUN git clone --single-branch \
         https://github.com/bkoppelmann/tricore-binutils.git \
         /usr/src/binutils && \
     cd /usr/src/binutils && chmod +x missing && \
-    CFLAGS=-w ./configure --prefix=/usr --disable-nls --target=tricore && \
+    CFLAGS=-w ./configure --prefix=/usr/local --disable-nls --target=tricore && \
     make && make install && \
     rm -rf /usr/src/binutils
 
-# This image isn't designed for building QEMU but building tests
-ENV QEMU_CONFIGURE_OPTS --disable-system --disable-user
+# This image can only build a very minimal QEMU as well as the tests
+ENV DEF_TARGET_LIST tricore-softmmu
+ENV QEMU_CONFIGURE_OPTS --disable-user --disable-tools --disable-fdt
Signature · 1 line
2.32.0.264.g75ae10bc75