All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH for 6.1 v3 0/3] tricore fixes
@ 2021-07-20 11:40 Alex Bennée
  2021-07-20 11:40 ` [PATCH v3 1/3] hw/tricore: fix inclusion of tricore_testboard Alex Bennée
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Alex Bennée @ 2021-07-20 11:40 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alex Bennée, f4bug

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(-)

-- 
2.32.0.264.g75ae10bc75



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH  v3 1/3] hw/tricore: fix inclusion of tricore_testboard
  2021-07-20 11:40 [PATCH for 6.1 v3 0/3] tricore fixes Alex Bennée
@ 2021-07-20 11:40 ` Alex Bennée
  2021-07-20 11:40 ` [PATCH v3 2/3] tests/tcg/configure.sh: add handling for assembler only builds Alex Bennée
  2021-07-20 11:40 ` [PATCH v3 3/3] gitlab: enable a very minimal build with the tricore container Alex Bennée
  2 siblings, 0 replies; 4+ messages in thread
From: Alex Bennée @ 2021-07-20 11:40 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Richard Henderson, Alex Bennée, f4bug,
	Bastian Koppelmann

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")
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

---
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(-)

diff --git a/configs/devices/tricore-softmmu/default.mak b/configs/devices/tricore-softmmu/default.mak
index 5cc91cebce..cb8fc286eb 100644
--- a/configs/devices/tricore-softmmu/default.mak
+++ b/configs/devices/tricore-softmmu/default.mak
@@ -1 +1,2 @@
+CONFIG_TRICORE_TESTBOARD=y
 CONFIG_TRIBOARD=y
diff --git a/hw/tricore/Kconfig b/hw/tricore/Kconfig
index 506e6183c1..33c1e852c3 100644
--- a/hw/tricore/Kconfig
+++ b/hw/tricore/Kconfig
@@ -1,9 +1,8 @@
-config TRICORE
+config TRICORE_TESTBOARD
     bool
 
 config TRIBOARD
     bool
-    select TRICORE
     select TC27X_SOC
 
 config TC27X_SOC
diff --git a/hw/tricore/meson.build b/hw/tricore/meson.build
index 47e36bb077..7e3585daf8 100644
--- a/hw/tricore/meson.build
+++ b/hw/tricore/meson.build
@@ -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'))
 
-- 
2.32.0.264.g75ae10bc75



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v3 2/3] tests/tcg/configure.sh: add handling for assembler only builds
  2021-07-20 11:40 [PATCH for 6.1 v3 0/3] tricore fixes Alex Bennée
  2021-07-20 11:40 ` [PATCH v3 1/3] hw/tricore: fix inclusion of tricore_testboard Alex Bennée
@ 2021-07-20 11:40 ` Alex Bennée
  2021-07-20 11:40 ` [PATCH v3 3/3] gitlab: enable a very minimal build with the tricore container Alex Bennée
  2 siblings, 0 replies; 4+ messages in thread
From: Alex Bennée @ 2021-07-20 11:40 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alex Bennée, f4bug

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.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 tests/tcg/configure.sh | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/tests/tcg/configure.sh b/tests/tcg/configure.sh
index aa7c24328a..1f985ccfc0 100755
--- a/tests/tcg/configure.sh
+++ b/tests/tcg/configure.sh
@@ -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
-- 
2.32.0.264.g75ae10bc75



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v3 3/3] gitlab: enable a very minimal build with the tricore container
  2021-07-20 11:40 [PATCH for 6.1 v3 0/3] tricore fixes Alex Bennée
  2021-07-20 11:40 ` [PATCH v3 1/3] hw/tricore: fix inclusion of tricore_testboard Alex Bennée
  2021-07-20 11:40 ` [PATCH v3 2/3] tests/tcg/configure.sh: add handling for assembler only builds Alex Bennée
@ 2021-07-20 11:40 ` Alex Bennée
  2 siblings, 0 replies; 4+ messages in thread
From: Alex Bennée @ 2021-07-20 11:40 UTC (permalink / raw)
  To: qemu-devel
  Cc: Willian Rampazzo, Thomas Huth, Alex Bennée, f4bug,
	Wainer dos Santos Moschetta

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.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

---
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(-)

diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml
index 89df51517c..48cb45a783 100644
--- a/.gitlab-ci.d/buildtest.yml
+++ b/.gitlab-ci.d/buildtest.yml
@@ -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:
diff --git a/tests/docker/dockerfiles/debian-tricore-cross.docker b/tests/docker/dockerfiles/debian-tricore-cross.docker
index 985925134c..d8df2c6117 100644
--- a/tests/docker/dockerfiles/debian-tricore-cross.docker
+++ b/tests/docker/dockerfiles/debian-tricore-cross.docker
@@ -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é <f4bug@amsat.org>
 
+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
-- 
2.32.0.264.g75ae10bc75



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-07-20 12:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-20 11:40 [PATCH for 6.1 v3 0/3] tricore fixes Alex Bennée
2021-07-20 11:40 ` [PATCH v3 1/3] hw/tricore: fix inclusion of tricore_testboard Alex Bennée
2021-07-20 11:40 ` [PATCH v3 2/3] tests/tcg/configure.sh: add handling for assembler only builds Alex Bennée
2021-07-20 11:40 ` [PATCH v3 3/3] gitlab: enable a very minimal build with the tricore container Alex Bennée

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.