Skip to contentSkip to conversation

tricore fixes

PATCH Superseded Alex Bennée 2 participants 6 messages Jul 19, 2021 – Jul 20, 2021 Arm/Amlogic Meson SoC support

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 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. New for v2: actually works and isn't an unholy mash of two docker container definitions.

Please review:

- gitlab: enable a very minimal build with the tricore container
- hw/tricore: fix inclusion of tricore_testboard

Alex Bennée (2):
hw/tricore: fix inclusion of tricore_testboard
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   | 40 ++++++++++++++++---
 5 files changed, 50 insertions(+), 9 deletions(-)
Signature · 1 line
2.32.0.264.g75ae10bc75
#1 lore raw

PATCH v2 1/2 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")
---
 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..724cb85de7 100644
@@ -1 +1,2 @@
+CONFIG_TRITEST=y
 CONFIG_TRIBOARD=y
hw/tricore/Kconfig +1 -2
index 506e6183c1..a1b2438d99 100644
@@ -1,9 +1,8 @@
-config TRICORE
+config TRITEST
     bool
 
 config TRIBOARD
     bool
-    select TRICORE
     select TC27X_SOC
 
 config TC27X_SOC
hw/tricore/meson.build +2 -2
index 47e36bb077..692a4708ba 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_TRITEST', if_true: files('tricore_testboard.c'))
+tricore_ss.add(when: 'CONFIG_TRITEST', 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
Reviewed-by on v2 1/2
#2 lore raw

Re: [PATCH v2 1/2] hw/tricore: fix inclusion of tricore_testboard

Quoted 10 lines · Alex Bennée

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")
---
  configs/devices/tricore-softmmu/default.mak | 1 +
  hw/tricore/Kconfig                          | 3 +--
  hw/tricore/meson.build                      | 4 ++--
  3 files changed, 4 insertions(+), 4 deletions(-)

r~

#3 lore raw

PATCH v2 2/2 gitlab: enable a very minimal build with the tricore container

In reply to Alex Bennée

We do the same thing as hexagon and do a two stage build that provides the minimal dependencies to build qemu-tricore-system and its check-tcg tests.

---
 .gitlab-ci.d/buildtest.yml                    | 11 +++++
 .../dockerfiles/debian-tricore-cross.docker   | 40 ++++++++++++++++---
 2 files changed, 46 insertions(+), 5 deletions(-)
.gitlab-ci.d/buildtest.yml +11 -0
index 89df51517c..5198b79deb 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 --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 +35 -5
index 985925134c..4ea9112289 100644
@@ -15,9 +15,39 @@ 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 && \
-    make && make install && \
-    rm -rf /usr/src/binutils
+    CFLAGS=-w ./configure --prefix=/usr/local --disable-nls --target=tricore && \
+    make && make install
 
-# This image isn't designed for building QEMU but building tests
-ENV QEMU_CONFIGURE_OPTS --disable-system --disable-user
+FROM debian:buster-slim
+# Duplicate deb line as deb-src
+RUN cat /etc/apt/sources.list | sed "s/^deb\ /deb-src /" >> /etc/apt/sources.list
+# Install very minimal QEMU build deps for use in CI
+# $ lcitool variables debian-10 qemu+minimal
+RUN apt update && \
+    DEBIAN_FRONTEND=noninteractive apt install -yy eatmydata && \
+    DEBIAN_FRONTEND=noninteractive eatmydata apt install -yy \
+       bzip2 \
+       ca-certificates \
+       ccache \
+       g++ \
+       gcc \
+       git \
+       libcapstone-dev \
+       libfdt-dev \
+       libglib2.0-dev \
+       libpixman-1-dev \
+       libtest-harness-perl \
+       locales \
+       make \
+       ninja-build \
+       perl-base \
+       pkgconf \
+       python3-pip \
+       python3-setuptools \
+       python3-wheel
+COPY --from=0 /usr/local /usr/local
+ENV PATH $PATH:/usr/local/bin/
+
+# 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
Signature · 1 line
2.32.0.264.g75ae10bc75
#4 lore raw

Re: [PATCH v2 2/2] gitlab: enable a very minimal build with the tricore container

Quoted 12 lines · Alex Bennée
tests/docker/dockerfiles/debian-tricore-cross.docker +1 -3
index 985925134c..4ea9112289 100644
@@ -15,9 +15,39 @@ 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 && \
-    make && make install && \
-    rm -rf /usr/src/binutils
+    CFLAGS=-w ./configure --prefix=/usr/local --disable-nls --target=tricore && \

tests/docker/dockerfiles/debian-tricore-cross.docker RUN git clone --single-branch \ · line 26

Quoted 10 lines
tests/docker/dockerfiles/debian-tricore-cross.docker +7 -2
+    make && make install
 
-# This image isn't designed for building QEMU but building tests
-ENV QEMU_CONFIGURE_OPTS --disable-system --disable-user
+FROM debian:buster-slim
+# Duplicate deb line as deb-src
+RUN cat /etc/apt/sources.list | sed "s/^deb\ /deb-src /" >> /etc/apt/sources.list
+# Install very minimal QEMU build deps for use in CI
+# $ lcitool variables debian-10 qemu+minimal
+RUN apt update && \

Is there really an advantage here above basing this on debian-amd64?

r~

#5 lore raw

Re: [PATCH v2 2/2] gitlab: enable a very minimal build with the tricore container

Quoted 16 lines · Richard Henderson
Quoted 15 lines · Alex Bennée
tests/docker/dockerfiles/debian-tricore-cross.docker +2 -4
index 985925134c..4ea9112289 100644
@@ -15,9 +15,39 @@ 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 && \
-    make && make install && \
-    rm -rf /usr/src/binutils
+    CFLAGS=-w ./configure --prefix=/usr/local --disable-nls --target=tricore && \
+    make && make install
  -# This image isn't designed for building QEMU but building tests
-ENV QEMU_CONFIGURE_OPTS --disable-system --disable-user
Quoted 8 lines

tests/docker/dockerfiles/debian-tricore-cross.docker RUN git clone --single-branch \ · line 26

Quoted 6 lines
tests/docker/dockerfiles/debian-tricore-cross.docker +6 -0
+FROM debian:buster-slim
+# Duplicate deb line as deb-src
+RUN cat /etc/apt/sources.list | sed "s/^deb\ /deb-src /" >> /etc/apt/sources.list
+# Install very minimal QEMU build deps for use in CI
+# $ lcitool variables debian-10 qemu+minimal
+RUN apt update && \

Is there really an advantage here above basing this on debian-amd64?

It's mostly about reducing size. The current qemu/debian10 based image takes:

794Mb

and can't even build a simple qemu because of missing dev libraries. Where as the split build approach results in an image that is:

604Mb

However if I build the whole thing as one I can get it down to:

580MB

#
# Docker TriCore cross-compiler target
#
# 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 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/local --disable-nls --target=tricore && \
    make && make install && \
    rm -rf /usr/src/binutils

# 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

Quoted 3 lines

r~

Signature · 1 line
Alex Bennée