[Qemu-devel] [RFC PATCH 0/2] docker: Add gentoo-mipsr5900el-cross image

Philippe Mathieu-Daudé posted 2 patches 5 years, 5 months ago
Test asan passed
Test checkpatch failed
Test docker-quick@centos7 passed
Test docker-mingw@fedora passed
Test docker-clang@ubuntu passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20181118203312.5376-1-f4bug@amsat.org
.shippable.yml                                |   2 +
tests/docker/Makefile.include                 |   6 +
.../gentoo-mipsr5900el-cross.docker           |  42 ++++
.../binutils-v2.30-ps2-llsc.patch             |  36 +++
.../crossdev.conf                             |   5 +
.../gcc-v7.2.0-ps2-llsc.patch                 |  23 ++
.../gcc-v7.2.0-ps2.patch                      | 219 ++++++++++++++++++
7 files changed, 333 insertions(+)
create mode 100644 tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker
create mode 100644 tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/binutils-v2.30-ps2-llsc.patch
create mode 100644 tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/crossdev.conf
create mode 100644 tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/gcc-v7.2.0-ps2-llsc.patch
create mode 100644 tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/gcc-v7.2.0-ps2.patch
[Qemu-devel] [RFC PATCH 0/2] docker: Add gentoo-mipsr5900el-cross image
Posted by Philippe Mathieu-Daudé 5 years, 5 months ago
Hi,

The first patch adds a cross toolchain for the R5900 MIPS.
It is working correctly but the patches provided by Fredrik in [1] don't
have proper S-o-b, thus it is tagged RFC.
Fredrik: any update on the status of those patches upstream?
I setup this image to try Fredrik's TCG tests in [2].

The second patch intents to have Shippable CI build the image and run the
TCG tests.
Since current idea of the Shippable tests is to cross-build QEMU for the
target, it does not work (and makes sense) here. I don't think there is
interest in running cross-compiled QEMU on a PS2... But we never know ;)
The failure I have is pkg-config using an incorrect path. I suppose I
am not using the CROSSDEV_OVERLAY path correctly.
Help from Gentoo developers would be appreciated!

I run the tests using:

$ docker-image-gentoo-mipsr5900el-cross
$ docker run --rm -it -v $PWD:$PWD \
    -w $PWD/tests/tcg/mips/mipsr5900 qemu:gentoo-mipsr5900el-cross \
    make all
$ make -C $PWD/tests/tcg/mips/mipsr5900 \
    check \
    SIM=$PWD/build/mipsel-softmmu/qemu-system-mipsel

With this minor modification:
-- >8 --
diff --git a/tests/tcg/mips/mipsr5900/Makefile b/tests/tcg/mips/mipsr5900/Makefile
@@ -5 +5 @@ CROSS=mipsr5900el-unknown-linux-gnu-
-SIM=qemu-mipsel
+SIM?=qemu-mipsel
---

Regards,

Phil.

[1]  https://lists.gnu.org/archive/html/qemu-devel/2018-09/msg03944.html
[2] https://lists.gnu.org/archive/html/qemu-devel/2018-11/msg01284.html

Philippe Mathieu-Daudé (2):
  docker: Add gentoo-mipsr5900el-cross image
  shippable: Add the mipsr5900el linux-user target

 .shippable.yml                                |   2 +
 tests/docker/Makefile.include                 |   6 +
 .../gentoo-mipsr5900el-cross.docker           |  42 ++++
 .../binutils-v2.30-ps2-llsc.patch             |  36 +++
 .../crossdev.conf                             |   5 +
 .../gcc-v7.2.0-ps2-llsc.patch                 |  23 ++
 .../gcc-v7.2.0-ps2.patch                      | 219 ++++++++++++++++++
 7 files changed, 333 insertions(+)
 create mode 100644 tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker
 create mode 100644 tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/binutils-v2.30-ps2-llsc.patch
 create mode 100644 tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/crossdev.conf
 create mode 100644 tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/gcc-v7.2.0-ps2-llsc.patch
 create mode 100644 tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/gcc-v7.2.0-ps2.patch

-- 
2.17.2


Re: [Qemu-devel] [RFC PATCH 0/2] docker: Add gentoo-mipsr5900el-cross image
Posted by no-reply@patchew.org 5 years, 5 months ago
Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Message-id: 20181118203312.5376-1-f4bug@amsat.org
Subject: [Qemu-devel] [RFC PATCH 0/2] docker: Add gentoo-mipsr5900el-cross image

=== TEST SCRIPT BEGIN ===
#!/bin/bash

BASE=base
n=1
total=$(git log --oneline $BASE.. | wc -l)
failed=0

git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram

commits="$(git log --format=%H --reverse $BASE..)"
for c in $commits; do
    echo "Checking PATCH $n/$total: $(git log -n 1 --format=%s $c)..."
    if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then
        failed=1
        echo
    fi
    n=$((n+1))
done

exit $failed
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
Switched to a new branch 'test'
d530ff5 shippable: Add the mipsr5900el linux-user target
0da782d docker: Add gentoo-mipsr5900el-cross image

=== OUTPUT BEGIN ===
Checking PATCH 1/2: docker: Add gentoo-mipsr5900el-cross image...
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#36: 
new file mode 100644

ERROR: trailing whitespace
#161: FILE: tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/gcc-v7.2.0-ps2-llsc.patch:23:
+ $

ERROR: trailing whitespace
#181: FILE: tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/gcc-v7.2.0-ps2.patch:14:
+ $

ERROR: trailing whitespace
#357: FILE: tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/gcc-v7.2.0-ps2.patch:190:
+ $

ERROR: trailing whitespace
#385: FILE: tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/gcc-v7.2.0-ps2.patch:218:
+ $

total: 4 errors, 1 warnings, 334 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

Checking PATCH 2/2: shippable: Add the mipsr5900el linux-user target...
=== OUTPUT END ===

Test command exited with code: 1


---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
Re: [Qemu-devel] [RFC PATCH 0/2] docker: Add gentoo-mipsr5900el-cross image
Posted by Fredrik Noring 5 years, 5 months ago
Many thanks, Philippe!

> The first patch adds a cross toolchain for the R5900 MIPS.
> It is working correctly but the patches provided by Fredrik in [1] don't
> have proper S-o-b, thus it is tagged RFC.
> Fredrik: any update on the status of those patches upstream?

With GCC 8.2.0 and a current Gentoo this is even simpler. You should
only need commit d728eb9085d8 ("MIPS: Default to --with-llsc for the
R5900 Linux target as well"):

https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=d728eb9085d8

For the o32 ABI with Glibc, only commit 8e3c00db16fc ("MIPS: Use `.set
mips2' to emulate LL/SC for the R5900 too") is needed:

https://sourceware.org/git/?p=glibc.git;a=commit;h=8e3c00db16fc

Eventually, with a future GCC/Glibc release, no patches will be needed.
[ I recommend removing the changelog part of the commits above, since
they might conflict with other GCC/Glibc versions; I've attached them
to this email for easy reference. ]

> I setup this image to try Fredrik's TCG tests in [2].

Nice! Would you like to test the n32 ABI in addition to the o32 ABI? It's
very easy to set that up as well.

> I don't think there is
> interest in running cross-compiled QEMU on a PS2... But we never know ;)

I wouldn't rule that out. ;)

> The failure I have is pkg-config using an incorrect path. I suppose I
> am not using the CROSSDEV_OVERLAY path correctly.
> Help from Gentoo developers would be appreciated!

Hmm... Did you follow the guide on how to configure the overlay?

Fredrik
Re: [Qemu-devel] [RFC PATCH 0/2] docker: Add gentoo-mipsr5900el-cross image
Posted by Maciej W. Rozycki 5 years, 5 months ago
On Mon, 19 Nov 2018, Fredrik Noring wrote:

> > The first patch adds a cross toolchain for the R5900 MIPS.
> > It is working correctly but the patches provided by Fredrik in [1] don't
> > have proper S-o-b, thus it is tagged RFC.
> > Fredrik: any update on the status of those patches upstream?
> 
> With GCC 8.2.0 and a current Gentoo this is even simpler. You should
> only need commit d728eb9085d8 ("MIPS: Default to --with-llsc for the
> R5900 Linux target as well"):
> 
> https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=d728eb9085d8

 Of course you can instead just set the default manually by using 
`--with-llsc' when configuring GCC or specify `-mllsc' explicitly in 
CFLAGS with a compiler that has been already built without that set by 
default.

> For the o32 ABI with Glibc, only commit 8e3c00db16fc ("MIPS: Use `.set
> mips2' to emulate LL/SC for the R5900 too") is needed:
> 
> https://sourceware.org/git/?p=glibc.git;a=commit;h=8e3c00db16fc
> 
> Eventually, with a future GCC/Glibc release, no patches will be needed.

 For the record the glibc change will be available with upcoming glibc 
2.29, currently scheduled Feb 1st, 2019, and the GCC change will appear in 
GCC 9.1.0, currently scheduled Mar-Apr 2019.

 FWIW,

  Maciej

Re: [Qemu-devel] [RFC PATCH 0/2] docker: Add gentoo-mipsr5900el-cross image
Posted by Fredrik Noring 5 years, 5 months ago
Hi Maciej,

>  Of course you can instead just set the default manually by using 
> `--with-llsc' when configuring GCC or specify `-mllsc' explicitly in 
> CFLAGS with a compiler that has been already built without that set by 
> default.

There are ways to pass such flags to the crossdev command, but I found
that method somewhat fiddly, perhaps because I was just about to learn
crossdev but also because there are multiple compiler stages involved
that sometimes need different options (floating point support and other
things were broken back then too). So patches seemed simpler and more
reliable to me. :)

Fredrik