From: "Alex Bennée" <alex.bennee@linaro.org>
To: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Cc: qemu-devel@nongnu.org
Subject: Re: [PATCH v3 01/15] tests/tcg: Add docker_as and docker_ld cmds
Date: Wed, 14 Apr 2021 14:40:15 +0100 [thread overview]
Message-ID: <87tuo9km93.fsf@linaro.org> (raw)
In-Reply-To: <20210305170045.869437-2-kbastian@mail.uni-paderborn.de>
Bastian Koppelmann <kbastian@mail.uni-paderborn.de> writes:
> At least for the TriCore target no easily available c compiler exists.
> Thus we need to rely on "as" and "ld". This allows us to run them
> through the docker image as well as with locally installed tools.
>
> Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
> ---
> v2 -> v3:
> - emit CROSS_LD_GUEST/CROSS_AS_GUEST
>
> tests/tcg/Makefile.qemu | 15 +++++++++++++++
> tests/tcg/configure.sh | 20 ++++++++++++++++++++
> 2 files changed, 35 insertions(+)
>
> diff --git a/tests/tcg/Makefile.qemu b/tests/tcg/Makefile.qemu
> index a56564660c..fefb50903d 100644
> --- a/tests/tcg/Makefile.qemu
> +++ b/tests/tcg/Makefile.qemu
> @@ -22,6 +22,8 @@ quiet-@ = $(if $(V),,@)
> quiet-command = $(quiet-@)$(call quiet-command-run,$1,$2,$3)
>
> CROSS_CC_GUEST:=
> +CROSS_AS_GUEST:=
> +CROSS_LD_GUEST:=
> DOCKER_IMAGE:=
>
> -include tests/tcg/config-$(TARGET).mak
> @@ -42,6 +44,7 @@ cross-build-guest-tests:
> $(call quiet-command, \
> (mkdir -p tests/tcg/$(TARGET) && cd tests/tcg/$(TARGET) && \
> $(MAKE) -f $(TCG_MAKE) TARGET="$(TARGET)" CC="$(CROSS_CC_GUEST)" \
> + AS="$(CROSS_AS_GUEST) LD="$(CROSS_LD_GUEST)" \
> SRC_PATH="$(SRC_PATH)" BUILD_STATIC=$(CROSS_CC_GUEST_STATIC) \
> EXTRA_CFLAGS="$(CROSS_CC_GUEST_CFLAGS)"), \
> "BUILD","$(TARGET) guest-tests with $(CROSS_CC_GUEST)")
> @@ -59,11 +62,23 @@ DOCKER_COMPILE_CMD="$(DOCKER_SCRIPT) cc \
> -i qemu/$(DOCKER_IMAGE) \
> -s $(SRC_PATH) -- "
>
> +DOCKER_AS_CMD="$(DOCKER_SCRIPT) cc \
> + --cc $(DOCKER_CROSS_AS_GUEST) \
> + -i qemu/$(DOCKER_IMAGE) \
> + -s $(SRC_PATH) -- "
> +
> +DOCKER_LD_CMD="$(DOCKER_SCRIPT) cc \
> + --cc $(DOCKER_CROSS_LD_GUEST) \
> + -i qemu/$(DOCKER_IMAGE) \
> + -s $(SRC_PATH) -- "
> +
> +
> .PHONY: docker-build-guest-tests
> docker-build-guest-tests: docker-image-$(DOCKER_IMAGE)
> $(call quiet-command, \
> (mkdir -p tests/tcg/$(TARGET) && cd tests/tcg/$(TARGET) && \
> $(MAKE) -f $(TCG_MAKE) TARGET="$(TARGET)" CC=$(DOCKER_COMPILE_CMD) \
> + AS=$(DOCKER_AS_CMD) LD=$(DOCKER_LD_CMD) \
> SRC_PATH="$(SRC_PATH)" BUILD_STATIC=y \
> EXTRA_CFLAGS="$(CROSS_CC_GUEST_CFLAGS)"), \
> "BUILD","$(TARGET) guest-tests with docker qemu/$(DOCKER_IMAGE)")
> diff --git a/tests/tcg/configure.sh b/tests/tcg/configure.sh
> index 36b8a73a54..4da8c3fa12 100755
> --- a/tests/tcg/configure.sh
> +++ b/tests/tcg/configure.sh
> @@ -72,6 +72,12 @@ fi
> : ${cross_cc_x86_64="x86_64-pc-linux-gnu-gcc"}
> : ${cross_cc_cflags_x86_64="-m64"}
>
> +# cross as defaults, can be overridden with --cross-as-ARCH
> +: ${cross_as_tricore="tricore-as"}
> +
> +# cross ld defaults, can be overridden with --cross-ld-ARCH
> +: ${cross_as_tricore="tricore-ld"}
> +
These explicit defaults should be in a separate patch.
> for target in $target_list; do
> arch=${target%%-*}
> case $arch in
> @@ -228,6 +234,18 @@ for target in $target_list; do
> fi
> echo "CROSS_CC_GUEST=$target_compiler" >> $config_target_mak
>
> + eval "target_as=\${cross_as_$i}"
> + if has $target_as; then
> + echo "CROSS_AS_GUEST=$target_as" >> $config_target_mak
> + continue
> + fi
Should there be any attempt to verify the assembler will do something.
If you passed --cross-as-tricore=/bin/false to force the use of the
docker container it wouldn't work because we assume if it's there it
works.
> +
> + eval "target_ld=\${cross_ld_$i}"
> + if has $target_ld; then
> + echo "CROSS_LD_GUEST=$target_ld" >> $config_target_mak
> + continue
> + fi
> +
> # Test for compiler features for optional tests. We only do this
> # for cross compilers because ensuring the docker containers based
> # compilers is a requirememt for adding a new test that needs a
> @@ -261,5 +279,7 @@ for target in $target_list; do
> if test $got_cross_cc = no && test "$container" != no && test -n "$container_image"; then
> echo "DOCKER_IMAGE=$container_image" >> $config_target_mak
> echo "DOCKER_CROSS_CC_GUEST=$container_cross_cc" >> $config_target_mak
> + echo "DOCKER_CROSS_AS_GUEST=$container_cross_as" >> $config_target_mak
> + echo "DOCKER_CROSS_LD_GUEST=$container_cross_ld" >>
> $config_target_mak
Could we gate these on being defined please?
> fi
> done
--
Alex Bennée
next prev parent reply other threads:[~2021-04-14 13:54 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-05 17:00 [PATCH v3 00/15] tests/tcg: Add TriCore tests Bastian Koppelmann
2021-03-05 17:00 ` [PATCH v3 01/15] tests/tcg: Add docker_as and docker_ld cmds Bastian Koppelmann
2021-04-14 13:40 ` Alex Bennée [this message]
2021-04-14 14:58 ` Alex Bennée
2021-03-05 17:00 ` [PATCH v3 02/15] tests/tcg: Run timeout cmds using --foreground Bastian Koppelmann
2021-03-05 17:00 ` [PATCH v3 03/15] hw/tricore: Add testdevice for tests in tests/tcg/ Bastian Koppelmann
2021-03-05 17:00 ` [PATCH v3 04/15] tests/tcg/tricore: Add build infrastructure Bastian Koppelmann
2021-03-05 17:00 ` [PATCH v3 05/15] configure: Emit HOST_CC to config-host.mak Bastian Koppelmann
2021-03-05 17:00 ` [PATCH v3 06/15] tests/tcg/tricore: Add macros to create tests and first test 'abs' Bastian Koppelmann
2021-03-05 17:00 ` [PATCH v3 07/15] tests/tcg/tricore: Add bmerge test Bastian Koppelmann
2021-03-05 17:00 ` [PATCH v3 08/15] tests/tcg/tricore: Add clz test Bastian Koppelmann
2021-03-05 17:00 ` [PATCH v3 09/15] tests/tcg/tricore: Add dvstep test Bastian Koppelmann
2021-03-05 17:00 ` [PATCH v3 10/15] tests/tcg/tricore: Add fadd test Bastian Koppelmann
2021-03-05 17:00 ` [PATCH v3 11/15] tests/tcg/tricore: Add fmul test Bastian Koppelmann
2021-03-05 17:00 ` [PATCH v3 12/15] tests/tcg/tricore: Add ftoi test Bastian Koppelmann
2021-03-05 17:00 ` [PATCH v3 13/15] tests/tcg/tricore: Add madd test Bastian Koppelmann
2021-03-05 17:00 ` [PATCH v3 14/15] tests/tcg/tricore: Add msub test Bastian Koppelmann
2021-03-05 17:00 ` [PATCH v3 15/15] tests/tcg/tricore: Add muls test Bastian Koppelmann
2021-03-05 18:00 ` [PATCH v3 00/15] tests/tcg: Add TriCore tests no-reply
2021-04-06 10:36 ` Bastian Koppelmann
2021-04-06 18:03 ` Alex Bennée
2021-04-14 15:34 ` Alex Bennée
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87tuo9km93.fsf@linaro.org \
--to=alex.bennee@linaro.org \
--cc=kbastian@mail.uni-paderborn.de \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.