All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC PATCH 0/2] docker: Add gentoo-mipsr5900el-cross image
@ 2018-11-18 20:33 Philippe Mathieu-Daudé
  2018-11-18 20:33 ` [Qemu-devel] [RFC PATCH 1/2] " Philippe Mathieu-Daudé
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-11-18 20:33 UTC (permalink / raw)
  To: Fredrik Noring, Alex Bennée, Fam Zheng
  Cc: Philippe Mathieu-Daudé, qemu-devel, Mike Frysinger

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

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

* [Qemu-devel] [RFC PATCH 1/2] docker: Add gentoo-mipsr5900el-cross image
  2018-11-18 20:33 [Qemu-devel] [RFC PATCH 0/2] docker: Add gentoo-mipsr5900el-cross image Philippe Mathieu-Daudé
@ 2018-11-18 20:33 ` Philippe Mathieu-Daudé
  2018-11-19 10:25   ` Philippe Mathieu-Daudé
                     ` (3 more replies)
  2018-11-18 20:33 ` [Qemu-devel] [RFC PATCH 2/2] shippable: Add the mipsr5900el linux-user target Philippe Mathieu-Daudé
                   ` (2 subsequent siblings)
  3 siblings, 4 replies; 13+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-11-18 20:33 UTC (permalink / raw)
  To: Fredrik Noring, Alex Bennée, Fam Zheng
  Cc: Philippe Mathieu-Daudé, qemu-devel, Mike Frysinger

This image is based on Gentoo and the toolchain is built using crossdev.

Recipe from:
  https://lists.gnu.org/archive/html/qemu-devel/2018-09/msg03944.html

Suggested-by: Fredrik Noring <noring@nocrew.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
TODO:
- Add Fredrik Noring S-o-b in his patches
- Check patch merged upstream

 tests/docker/Makefile.include                 |   6 +
 .../gentoo-mipsr5900el-cross.docker           |  39 ++++
 .../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 ++++++++++++++++++
 6 files changed, 328 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

diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
index 9467e9d088..6ca615206f 100644
--- a/tests/docker/Makefile.include
+++ b/tests/docker/Makefile.include
@@ -119,6 +119,12 @@ docker-image-debian-sparc64-cross: docker-image-debian-sid
 docker-image-debian-mips64-cross: docker-image-debian-sid
 docker-image-debian-riscv64-cross: docker-image-debian-sid
 docker-image-debian-powerpc-cross: docker-image-debian-sid
+docker-image-gentoo-mipsr5900el-cross: EXTRA_FILES:=$(addprefix \
+			$(SRC_PATH)/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/,\
+				crossdev.conf \
+				binutils-v2.30-ps2-llsc.patch \
+				gcc-v7.2.0-ps2.patch \
+				gcc-v7.2.0-ps2-llsc.patch)
 docker-image-travis: NOUSER=1
 
 # Specialist build images, sometimes very limited tools
diff --git a/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker b/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker
new file mode 100644
index 0000000000..dbc2eb007b
--- /dev/null
+++ b/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker
@@ -0,0 +1,39 @@
+#
+# Docker mipsel (r5900) cross-compiler target
+#
+# Using multi-stage builds, this image requires docker-17.05.0 or later.
+# (See: https://github.com/gentoo/gentoo-docker-images)
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+# name the portage image
+FROM gentoo/portage:latest as portage
+
+# image is based on stage3-amd64
+FROM gentoo/stage3-amd64:latest
+
+# copy the entire portage volume in
+COPY --from=portage /usr/portage /usr/portage
+
+MAINTAINER Philippe Mathieu-Daudé <f4bug@amsat.org>
+
+# continue with image build ...
+RUN emerge -qv sys-devel/crossdev
+
+# set CROSSDEV_OVERLAY to /usr/local/portage-crossdev
+RUN mkdir -p /usr/local/portage-crossdev/{profiles,metadata} && \
+    echo 'crossdev' > /usr/local/portage-crossdev/profiles/repo_name && \
+    echo 'masters = gentoo' > /usr/local/portage-crossdev/metadata/layout.conf && \
+    chown -R portage:portage /usr/local/portage-crossdev && \
+    mkdir -p /etc/portage/repos.conf
+ADD crossdev.conf /etc/portage/repos.conf/crossdev.conf
+
+# Fredrik's patches
+RUN mkdir -p /etc/portage/patches/cross-mipsr5900el-unknown-linux-gnu/{binutils,gcc}
+ADD binutils-v2.30-ps2-llsc.patch /etc/portage/patches/cross-mipsr5900el-unknown-linux-gnu/binutils
+ADD gcc-v7.2.0-ps2.patch /etc/portage/patches/cross-mipsr5900el-unknown-linux-gnu/gcc
+ADD gcc-v7.2.0-ps2-llsc.patch /etc/portage/patches/cross-mipsr5900el-unknown-linux-gnu/gcc
+
+RUN crossdev -s3 -t mipsr5900el-unknown-linux-gnu --binutils ">=2.30" --gcc ">=7.2.0"
+
+ENV QEMU_CONFIGURE_OPTS --cross-prefix=mipsr5900el-unknown-linux-gnu-
diff --git a/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/binutils-v2.30-ps2-llsc.patch b/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/binutils-v2.30-ps2-llsc.patch
new file mode 100644
index 0000000000..62ecc3267a
--- /dev/null
+++ b/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/binutils-v2.30-ps2-llsc.patch
@@ -0,0 +1,36 @@
+diff --git a/opcodes/mips-opc.c b/opcodes/mips-opc.c
+index 1cbcbc6..0986b0a 100644
+--- a/opcodes/mips-opc.c
++++ b/opcodes/mips-opc.c
+@@ -1280,11 +1280,11 @@ const struct mips_opcode mips_builtin_opcodes[] =
+ {"li.s",		"t,f",		0,    (int) M_LI_S,	INSN_MACRO,		INSN2_M_FP_S,	I1,		0,	0 },
+ {"li.s",		"T,l",		0,    (int) M_LI_SS,	INSN_MACRO,		INSN2_M_FP_S,	I1,		0,	0 },
+ {"ll",			"t,+j(b)",	0x7c000036, 0xfc00007f, WR_1|RD_3|LM,		0,		I37,		0,	0 },
+-{"ll",			"t,o(b)",	0xc0000000, 0xfc000000, WR_1|RD_3|LM,		0,		I2,		0,	EE|I37 },
+-{"ll",			"t,A(b)",	0,    (int) M_LL_AB,	INSN_MACRO,		0,		I2,		0,	EE },
++{"ll",			"t,o(b)",	0xc0000000, 0xfc000000, WR_1|RD_3|LM,		0,		I2,		0,	I37 },
++{"ll",			"t,A(b)",	0,    (int) M_LL_AB,	INSN_MACRO,		0,		I2,		0,	0 },
+ {"lld",			"t,+j(b)",	0x7c000037, 0xfc00007f, WR_1|RD_3|LM,		0,		I69,		0,	0 },
+-{"lld",			"t,o(b)",	0xd0000000, 0xfc000000, WR_1|RD_3|LM,		0,		I3,		0,	EE|I69 },
+-{"lld",			"t,A(b)",	0,    (int) M_LLD_AB,	INSN_MACRO,		0,		I3,		0,	EE },
++{"lld",			"t,o(b)",	0xd0000000, 0xfc000000, WR_1|RD_3|LM,		0,		I3,		0,	I69 },
++{"lld",			"t,A(b)",	0,    (int) M_LLD_AB,	INSN_MACRO,		0,		I3,		0,	0 },
+ {"lq",			"t,o(b)",	0x78000000, 0xfc000000, WR_1|RD_3|LM,		0,		MMI,		0,	0 },
+ {"lq",			"t,A(b)",	0,    (int) M_LQ_AB,	INSN_MACRO,		0,		MMI,		0,	0 },
+ {"lqc2",		"+7,o(b)",	0xd8000000, 0xfc000000,	RD_3|WR_C2|LM,		0,		EE,		0,	0 },
+@@ -1810,11 +1810,11 @@ const struct mips_opcode mips_builtin_opcodes[] =
+ {"sb",			"t,o(b)",	0xa0000000, 0xfc000000,	RD_1|RD_3|SM,		0,		I1,		0,	0 },
+ {"sb",			"t,A(b)",	0,    (int) M_SB_AB,	INSN_MACRO,		0,		I1,		0,	0 },
+ {"sc",			"t,+j(b)",	0x7c000026, 0xfc00007f, MOD_1|RD_3|SM,		0,		I37,		0,	0 },
+-{"sc",			"t,o(b)",	0xe0000000, 0xfc000000, MOD_1|RD_3|SM,		0,		I2,		0,	EE|I37 },
+-{"sc",			"t,A(b)",	0,    (int) M_SC_AB,	INSN_MACRO,		0,		I2,		0,	EE },
++{"sc",			"t,o(b)",	0xe0000000, 0xfc000000, MOD_1|RD_3|SM,		0,		I2,		0,	I37 },
++{"sc",			"t,A(b)",	0,    (int) M_SC_AB,	INSN_MACRO,		0,		I2,		0,	0 },
+ {"scd",			"t,+j(b)",	0x7c000027, 0xfc00007f, MOD_1|RD_3|SM,		0,		I69,		0,	0 },
+-{"scd",			"t,o(b)",	0xf0000000, 0xfc000000, MOD_1|RD_3|SM,		0,		I3,		0,	EE|I69 },
+-{"scd",			"t,A(b)",	0,    (int) M_SCD_AB,	INSN_MACRO,		0,		I3,		0,	EE },
++{"scd",			"t,o(b)",	0xf0000000, 0xfc000000, MOD_1|RD_3|SM,		0,		I3,		0,	I69 },
++{"scd",			"t,A(b)",	0,    (int) M_SCD_AB,	INSN_MACRO,		0,		I3,		0,	0 },
+ /* The macro has to be first to handle o32 correctly.  */
+ {"sd",			"t,A(b)",	0,    (int) M_SD_AB,	INSN_MACRO,		0,		I1,		0,	0 },
+ {"sd",			"t,o(b)",	0xfc000000, 0xfc000000,	RD_1|RD_3|SM,		0,		I3,		0,	0 },
diff --git a/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/crossdev.conf b/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/crossdev.conf
new file mode 100644
index 0000000000..b8fa368c1c
--- /dev/null
+++ b/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/crossdev.conf
@@ -0,0 +1,5 @@
+[crossdev]
+location = /usr/local/portage-crossdev
+priority = 10
+masters = gentoo
+auto-sync = no
diff --git a/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/gcc-v7.2.0-ps2-llsc.patch b/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/gcc-v7.2.0-ps2-llsc.patch
new file mode 100644
index 0000000000..59bc0e6e83
--- /dev/null
+++ b/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/gcc-v7.2.0-ps2-llsc.patch
@@ -0,0 +1,23 @@
+diff --git a/gcc/config.gcc b/gcc/config.gcc
+index a9196cd..5b497f6 100644
+--- a/gcc/config.gcc
++++ b/gcc/config.gcc
+@@ -3558,14 +3558,14 @@ fi
+ # Infer a default setting for --with-llsc.
+ if test x$with_llsc = x; then
+   case ${target} in
+-    mips64r5900-*-* | mips64r5900el-*-* | mipsr5900-*-* | mipsr5900el-*-*)
+-      # The R5900 doesn't support LL(D) and SC(D).
+-      with_llsc=no
+-      ;;
+     mips*-*-linux*)
+       # The kernel emulates LL and SC where necessary.
+       with_llsc=yes
+       ;;
++    mips64r5900-*-* | mips64r5900el-*-* | mipsr5900-*-* | mipsr5900el-*-*)
++      # The R5900 doesn't support LL(D) and SC(D).
++      with_llsc=no
++      ;;
+   esac
+ fi
+ 
diff --git a/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/gcc-v7.2.0-ps2.patch b/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/gcc-v7.2.0-ps2.patch
new file mode 100644
index 0000000000..a3337dbf61
--- /dev/null
+++ b/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/gcc-v7.2.0-ps2.patch
@@ -0,0 +1,219 @@
+commit ff785b9af62d5dfe1c0e3d3cf0052e7b5cf281ad
+Author: Rick Gaiser <rgaiser@gmail.com>
+Date:   Thu Apr 26 22:30:11 2018 +0200
+
+    Apply gcc-7.2.0-libgcc.patch from uyjulian
+
+diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
+index 6bfd86a..2996ebc 100644
+--- a/gcc/config/mips/mips.c
++++ b/gcc/config/mips/mips.c
+@@ -19747,6 +19747,11 @@ mips_option_override (void)
+     error ("unsupported combination: %s",
+ 	   "-march=r5900 -mhard-float -mdouble-float");
+ 
++  /* The R5900 does not support some MIPS16 instructions.  */
++  if (TARGET_MIPS5900 && ((mips_base_compression_flags & MASK_MIPS16) != 0))
++	  error("unsupported combination: %s",
++		  "-march=r5900 -mips16");
++
+   /* If a -mlong* option was given, check that it matches the ABI,
+      otherwise infer the -mlong* setting from the other options.  */
+   if ((target_flags_explicit & MASK_LONG64) != 0)
+diff --git a/libgcc/config.host b/libgcc/config.host
+index bedcf10..4a85a15 100644
+--- a/libgcc/config.host
++++ b/libgcc/config.host
+@@ -144,7 +144,11 @@ mips*-*-*)
+ 	cpu_type=mips
+ 	tmake_file="mips/t-mips"
+ 	if test "${libgcc_cv_mips_hard_float}" = yes; then
++	    if test "${libgcc_cv_mips_single_float}" = yes; then
++                tmake_file="${tmake_file} t-hardfp-sf t-hardfp"
++	    else
+ 		tmake_file="${tmake_file} t-hardfp-sfdf t-hardfp"
++	    fi
+ 	else
+ 		tmake_file="${tmake_file} t-softfp-sfdf"
+ 	fi
+@@ -858,19 +862,16 @@ mips*-*-netbsd*)			# NetBSD/mips, either endian.
+ mips*-*-linux*)				# Linux MIPS, either endian.
+ 	extra_parts="$extra_parts crtfastmath.o"
+ 	tmake_file="${tmake_file} t-crtfm"
+-	case ${host} in
+-	  mips64r5900* | mipsr5900*)
+-	    # The MIPS16 support code uses floating point
+-	    # instructions that are not supported on r5900.
+-	    ;;
+-	  *)
++    if test "${libgcc_cv_mips16}" = yes; then
+ 	    tmake_file="${tmake_file} mips/t-mips16 t-slibgcc-libgcc"
+-	    ;;
+-	esac
++    fi
+ 	md_unwind_header=mips/linux-unwind.h
+ 	;;
+ mips*-sde-elf*)
+-	tmake_file="$tmake_file mips/t-crtstuff mips/t-mips16"
++	tmake_file="$tmake_file mips/t-crtstuff"
++    if test "${libgcc_cv_mips16}" = yes; then
++	  tmake_file="${tmake_file} mips/t-mips16"
++    fi
+ 	case "${with_newlib}" in
+ 	  yes)
+ 	    # newlib / libgloss.
+@@ -900,7 +901,10 @@ mipsisa64sb1-*-elf* | mipsisa64sb1el-*-elf*)
+ 	extra_parts="$extra_parts crti.o crtn.o"
+ 	;;
+ mips-*-elf* | mipsel-*-elf*)
+-	tmake_file="$tmake_file mips/t-elf mips/t-crtstuff mips/t-mips16"
++	tmake_file="$tmake_file mips/t-elf mips/t-crtstuff"
++    if test "${libgcc_cv_mips16}" = yes; then
++	  tmake_file="${tmake_file} mips/t-mips16"
++    fi
+ 	extra_parts="$extra_parts crti.o crtn.o"
+ 	;;
+ mipsr5900-*-elf* | mipsr5900el-*-elf*)
+@@ -908,7 +912,10 @@ mipsr5900-*-elf* | mipsr5900el-*-elf*)
+ 	extra_parts="$extra_parts crti.o crtn.o"
+ 	;;
+ mips64-*-elf* | mips64el-*-elf*)
+-	tmake_file="$tmake_file mips/t-elf mips/t-crtstuff mips/t-mips16"
++	tmake_file="$tmake_file mips/t-elf mips/t-crtstuff"
++    if test "${libgcc_cv_mips16}" = yes; then
++	  tmake_file="${tmake_file} mips/t-mips16"
++    fi
+ 	extra_parts="$extra_parts crti.o crtn.o"
+ 	;;
+ mips64r5900-*-elf* | mips64r5900el-*-elf*)
+@@ -924,7 +931,10 @@ mips64orion-*-elf* | mips64orionel-*-elf*)
+ 	extra_parts="$extra_parts crti.o crtn.o"
+ 	;;
+ mips*-*-rtems*)
+-	tmake_file="$tmake_file mips/t-elf mips/t-crtstuff mips/t-mips16"
++	tmake_file="$tmake_file mips/t-elf mips/t-crtstuff"
++    if test "${libgcc_cv_mips16}" = yes; then
++	  tmake_file="${tmake_file} mips/t-mips16"
++    fi
+ 	extra_parts="$extra_parts crti.o crtn.o"
+ 	;;
+ mips-wrs-vxworks)
+diff --git a/libgcc/config/t-hardfp-sf b/libgcc/config/t-hardfp-sf
+new file mode 100644
+index 0000000..e63ad47
+--- /dev/null
++++ b/libgcc/config/t-hardfp-sf
+@@ -0,0 +1,32 @@
++# Copyright (C) 2014-2015 Free Software Foundation, Inc.
++
++# This file is part of GCC.
++
++# GCC is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3, or (at your option)
++# any later version.
++
++# GCC is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++
++# You should have received a copy of the GNU General Public License
++# along with GCC; see the file COPYING3.  If not see
++# <http://www.gnu.org/licenses/>.
++
++hardfp_float_modes := sf
++# di and ti are provided by libgcc2.c where needed.
++hardfp_int_modes := si
++hardfp_extensions :=
++hardfp_truncations :=
++
++# Emulate 64 bit float:
++FPBIT = true
++DPBIT = true
++# Don't build functions handled by 32 bit hardware:
++LIB2FUNCS_EXCLUDE = _addsub_sf _mul_sf _div_sf \
++    _fpcmp_parts_sf _compare_sf _eq_sf _ne_sf _gt_sf _ge_sf \
++    _lt_sf _le_sf _unord_sf _si_to_sf _sf_to_si _negate_sf \
++    _thenan_sf _sf_to_usi _usi_to_sf
+diff --git a/libgcc/configure b/libgcc/configure
+index 42dda7f..716bba9 100644
+--- a/libgcc/configure
++++ b/libgcc/configure
+@@ -4871,6 +4871,48 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgcc_cv_mips_hard_float" >&5
+ $as_echo "$libgcc_cv_mips_hard_float" >&6; }
++  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the target is single-float" >&5
++$as_echo_n "checking whether the target is single-float... " >&6; }
++if test "${libgcc_cv_mips_single_float+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h.  */
++#ifndef __mips_single_float
++     #error FOO
++     #endif
++_ACEOF
++if ac_fn_c_try_compile "$LINENO"; then :
++  libgcc_cv_mips_single_float=yes
++else
++  libgcc_cv_mips_single_float=no
++fi
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgcc_cv_mips_single_float" >&5
++$as_echo "$libgcc_cv_mips_single_float" >&6; }
++  # Some targets (i.e. R5900) don't support some MIPS16 instructions.
++  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the target supports the MIPS16 ASE" >&5
++$as_echo_n "checking whether the target supports MIPS16 ASE... " >&6; }
++if test "${libgcc_cv_mips16+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  CFLAGS_hold=$CFLAGS
++		 CFLAGS="$CFLAGS -mips16"
++		 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h.  */
++int i;
++_ACEOF
++if ac_fn_c_try_compile "$LINENO"; then :
++  libgcc_cv_mips16=yes
++else
++  libgcc_cv_mips16=no
++fi
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
++	CFLAGS=$CFLAGS_hold
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgcc_cv_mips16" >&5
++$as_echo "$libgcc_cv_mips16" >&6; }
+ esac
+ 
+ case ${host} in
+diff --git a/libgcc/configure.ac b/libgcc/configure.ac
+index 6bcaad6..5bce467 100644
+--- a/libgcc/configure.ac
++++ b/libgcc/configure.ac
+@@ -292,6 +292,23 @@ mips*-*-*)
+      #endif],
+     [libgcc_cv_mips_hard_float=yes],
+     [libgcc_cv_mips_hard_float=no])])
++  AC_CACHE_CHECK([whether the target is single-float],
++		 [libgcc_cv_mips_single_float],
++		 [AC_COMPILE_IFELSE(
++    [#ifndef __mips_single_float
++     #error FOO
++     #endif],
++    [libgcc_cv_mips_single_float=yes],
++    [libgcc_cv_mips_single_float=no])])
++  # Some targets (i.e. R5900) don't support some MIPS16 instructions.
++  AC_CACHE_CHECK([whether the target supports the MIPS16 ASE],
++		 [libgcc_cv_mips16],
++		 [CFLAGS_hold=$CFLAGS
++		 CFLAGS="$CFLAGS -mips16"
++		 AC_COMPILE_IFELSE([[int i;]],
++    [libgcc_cv_mips16=yes],
++    [libgcc_cv_mips16=no])
++	CFLAGS=$CFLAGS_hold])
+ esac
+ 
+ case ${host} in
-- 
2.17.2

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

* [Qemu-devel] [RFC PATCH 2/2] shippable: Add the mipsr5900el linux-user target
  2018-11-18 20:33 [Qemu-devel] [RFC PATCH 0/2] docker: Add gentoo-mipsr5900el-cross image Philippe Mathieu-Daudé
  2018-11-18 20:33 ` [Qemu-devel] [RFC PATCH 1/2] " Philippe Mathieu-Daudé
@ 2018-11-18 20:33 ` Philippe Mathieu-Daudé
  2018-11-18 21:03 ` [Qemu-devel] [RFC PATCH 0/2] docker: Add gentoo-mipsr5900el-cross image no-reply
  2018-11-19 15:29 ` Fredrik Noring
  3 siblings, 0 replies; 13+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-11-18 20:33 UTC (permalink / raw)
  To: Fredrik Noring, Alex Bennée, Fam Zheng
  Cc: Philippe Mathieu-Daudé, qemu-devel, Mike Frysinger

Shippable node pool must be updated to use at lease v5.8.2:

  http://docs.shippable.com/platform/runtime/machine-image/ami-v582/

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 .shippable.yml                                           | 2 ++
 tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker | 3 +++
 2 files changed, 5 insertions(+)

diff --git a/.shippable.yml b/.shippable.yml
index f74a3de3ff..bd3316df91 100644
--- a/.shippable.yml
+++ b/.shippable.yml
@@ -25,6 +25,8 @@ env:
       TARGET_LIST=mips64el-softmmu,mips64el-linux-user
     - IMAGE=debian-ppc64el-cross
       TARGET_LIST=ppc64-softmmu,ppc64-linux-user,ppc64abi32-linux-user
+    - IMAGE=gentoo-mipsr5900el-cross
+      TARGET_LIST=mips64el-linux-user
 build:
   pre_ci:
     - make docker-image-${IMAGE} V=1
diff --git a/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker b/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker
index dbc2eb007b..b35f779718 100644
--- a/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker
+++ b/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker
@@ -37,3 +37,8 @@ ADD gcc-v7.2.0-ps2-llsc.patch /etc/portage/patches/cross-mipsr5900el-unknown-lin
 RUN crossdev -s3 -t mipsr5900el-unknown-linux-gnu --binutils ">=2.30" --gcc ">=7.2.0"
 
 ENV QEMU_CONFIGURE_OPTS --cross-prefix=mipsr5900el-unknown-linux-gnu-
+
+# kludge for Shippable which checks clang available.
+RUN ln -s /bin/true /usr/bin/clang
+
+RUN emerge -qv dev-vcs/git ">=dev-libs/glib-2.0" sys-libs/zlib dev-lang/python
-- 
2.17.2

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

* Re: [Qemu-devel] [RFC PATCH 0/2] docker: Add gentoo-mipsr5900el-cross image
  2018-11-18 20:33 [Qemu-devel] [RFC PATCH 0/2] docker: Add gentoo-mipsr5900el-cross image Philippe Mathieu-Daudé
  2018-11-18 20:33 ` [Qemu-devel] [RFC PATCH 1/2] " Philippe Mathieu-Daudé
  2018-11-18 20:33 ` [Qemu-devel] [RFC PATCH 2/2] shippable: Add the mipsr5900el linux-user target Philippe Mathieu-Daudé
@ 2018-11-18 21:03 ` no-reply
  2018-11-19 15:29 ` Fredrik Noring
  3 siblings, 0 replies; 13+ messages in thread
From: no-reply @ 2018-11-18 21:03 UTC (permalink / raw)
  To: f4bug; +Cc: famz, noring, alex.bennee

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

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

* Re: [Qemu-devel] [RFC PATCH 1/2] docker: Add gentoo-mipsr5900el-cross image
  2018-11-18 20:33 ` [Qemu-devel] [RFC PATCH 1/2] " Philippe Mathieu-Daudé
@ 2018-11-19 10:25   ` Philippe Mathieu-Daudé
  2018-11-19 12:23   ` Alex Bennée
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 13+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-11-19 10:25 UTC (permalink / raw)
  To: Fredrik Noring, Alex Bennée, Fam Zheng
  Cc: qemu-devel@nongnu.org Developers, Mike Frysinger

On Sun, Nov 18, 2018 at 9:33 PM Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>
> This image is based on Gentoo and the toolchain is built using crossdev.
>
> Recipe from:
>   https://lists.gnu.org/archive/html/qemu-devel/2018-09/msg03944.html
>
> Suggested-by: Fredrik Noring <noring@nocrew.org>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> TODO:
> - Add Fredrik Noring S-o-b in his patches
> - Check patch merged upstream
>
>  tests/docker/Makefile.include                 |   6 +
>  .../gentoo-mipsr5900el-cross.docker           |  39 ++++
>  .../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 ++++++++++++++++++
>  6 files changed, 328 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
>
> diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
> index 9467e9d088..6ca615206f 100644
> --- a/tests/docker/Makefile.include
> +++ b/tests/docker/Makefile.include
> @@ -119,6 +119,12 @@ docker-image-debian-sparc64-cross: docker-image-debian-sid
>  docker-image-debian-mips64-cross: docker-image-debian-sid
>  docker-image-debian-riscv64-cross: docker-image-debian-sid
>  docker-image-debian-powerpc-cross: docker-image-debian-sid
> +docker-image-gentoo-mipsr5900el-cross: EXTRA_FILES:=$(addprefix \
> +                       $(SRC_PATH)/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/,\
> +                               crossdev.conf \
> +                               binutils-v2.30-ps2-llsc.patch \
> +                               gcc-v7.2.0-ps2.patch \
> +                               gcc-v7.2.0-ps2-llsc.patch)
>  docker-image-travis: NOUSER=1
>
>  # Specialist build images, sometimes very limited tools
> diff --git a/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker b/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker
> new file mode 100644
> index 0000000000..dbc2eb007b
> --- /dev/null
> +++ b/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker
> @@ -0,0 +1,39 @@
> +#
> +# Docker mipsel (r5900) cross-compiler target
> +#
> +# Using multi-stage builds, this image requires docker-17.05.0 or later.
> +# (See: https://github.com/gentoo/gentoo-docker-images)
> +#
> +# SPDX-License-Identifier: GPL-2.0-or-later
> +
> +# name the portage image
> +FROM gentoo/portage:latest as portage
> +
> +# image is based on stage3-amd64
> +FROM gentoo/stage3-amd64:latest
> +
> +# copy the entire portage volume in
> +COPY --from=portage /usr/portage /usr/portage
> +
> +MAINTAINER Philippe Mathieu-Daudé <f4bug@amsat.org>
> +
> +# continue with image build ...
> +RUN emerge -qv sys-devel/crossdev
> +
> +# set CROSSDEV_OVERLAY to /usr/local/portage-crossdev
> +RUN mkdir -p /usr/local/portage-crossdev/{profiles,metadata} && \
> +    echo 'crossdev' > /usr/local/portage-crossdev/profiles/repo_name && \
> +    echo 'masters = gentoo' > /usr/local/portage-crossdev/metadata/layout.conf && \
> +    chown -R portage:portage /usr/local/portage-crossdev && \
> +    mkdir -p /etc/portage/repos.conf
> +ADD crossdev.conf /etc/portage/repos.conf/crossdev.conf
> +
> +# Fredrik's patches
> +RUN mkdir -p /etc/portage/patches/cross-mipsr5900el-unknown-linux-gnu/{binutils,gcc}
> +ADD binutils-v2.30-ps2-llsc.patch /etc/portage/patches/cross-mipsr5900el-unknown-linux-gnu/binutils
> +ADD gcc-v7.2.0-ps2.patch /etc/portage/patches/cross-mipsr5900el-unknown-linux-gnu/gcc
> +ADD gcc-v7.2.0-ps2-llsc.patch /etc/portage/patches/cross-mipsr5900el-unknown-linux-gnu/gcc
> +
> +RUN crossdev -s3 -t mipsr5900el-unknown-linux-gnu --binutils ">=2.30" --gcc ">=7.2.0"
> +

I'll add here the same comment included in the Tricore image:

"# This image isn't designed for building QEMU but building tests"

> +ENV QEMU_CONFIGURE_OPTS --cross-prefix=mipsr5900el-unknown-linux-gnu-
> diff --git a/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/binutils-v2.30-ps2-llsc.patch b/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/binutils-v2.30-ps2-llsc.patch
> new file mode 100644
> index 0000000000..62ecc3267a
> --- /dev/null
> +++ b/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/binutils-v2.30-ps2-llsc.patch
> @@ -0,0 +1,36 @@
> +diff --git a/opcodes/mips-opc.c b/opcodes/mips-opc.c
> +index 1cbcbc6..0986b0a 100644
> +--- a/opcodes/mips-opc.c
> ++++ b/opcodes/mips-opc.c
> +@@ -1280,11 +1280,11 @@ const struct mips_opcode mips_builtin_opcodes[] =
> + {"li.s",              "t,f",          0,    (int) M_LI_S,     INSN_MACRO,             INSN2_M_FP_S,   I1,             0,      0 },
> + {"li.s",              "T,l",          0,    (int) M_LI_SS,    INSN_MACRO,             INSN2_M_FP_S,   I1,             0,      0 },
> + {"ll",                        "t,+j(b)",      0x7c000036, 0xfc00007f, WR_1|RD_3|LM,           0,              I37,            0,      0 },
> +-{"ll",                        "t,o(b)",       0xc0000000, 0xfc000000, WR_1|RD_3|LM,           0,              I2,             0,      EE|I37 },
> +-{"ll",                        "t,A(b)",       0,    (int) M_LL_AB,    INSN_MACRO,             0,              I2,             0,      EE },
> ++{"ll",                        "t,o(b)",       0xc0000000, 0xfc000000, WR_1|RD_3|LM,           0,              I2,             0,      I37 },
> ++{"ll",                        "t,A(b)",       0,    (int) M_LL_AB,    INSN_MACRO,             0,              I2,             0,      0 },
> + {"lld",                       "t,+j(b)",      0x7c000037, 0xfc00007f, WR_1|RD_3|LM,           0,              I69,            0,      0 },
> +-{"lld",                       "t,o(b)",       0xd0000000, 0xfc000000, WR_1|RD_3|LM,           0,              I3,             0,      EE|I69 },
> +-{"lld",                       "t,A(b)",       0,    (int) M_LLD_AB,   INSN_MACRO,             0,              I3,             0,      EE },
> ++{"lld",                       "t,o(b)",       0xd0000000, 0xfc000000, WR_1|RD_3|LM,           0,              I3,             0,      I69 },
> ++{"lld",                       "t,A(b)",       0,    (int) M_LLD_AB,   INSN_MACRO,             0,              I3,             0,      0 },
> + {"lq",                        "t,o(b)",       0x78000000, 0xfc000000, WR_1|RD_3|LM,           0,              MMI,            0,      0 },
> + {"lq",                        "t,A(b)",       0,    (int) M_LQ_AB,    INSN_MACRO,             0,              MMI,            0,      0 },
> + {"lqc2",              "+7,o(b)",      0xd8000000, 0xfc000000, RD_3|WR_C2|LM,          0,              EE,             0,      0 },
> +@@ -1810,11 +1810,11 @@ const struct mips_opcode mips_builtin_opcodes[] =
> + {"sb",                        "t,o(b)",       0xa0000000, 0xfc000000, RD_1|RD_3|SM,           0,              I1,             0,      0 },
> + {"sb",                        "t,A(b)",       0,    (int) M_SB_AB,    INSN_MACRO,             0,              I1,             0,      0 },
> + {"sc",                        "t,+j(b)",      0x7c000026, 0xfc00007f, MOD_1|RD_3|SM,          0,              I37,            0,      0 },
> +-{"sc",                        "t,o(b)",       0xe0000000, 0xfc000000, MOD_1|RD_3|SM,          0,              I2,             0,      EE|I37 },
> +-{"sc",                        "t,A(b)",       0,    (int) M_SC_AB,    INSN_MACRO,             0,              I2,             0,      EE },
> ++{"sc",                        "t,o(b)",       0xe0000000, 0xfc000000, MOD_1|RD_3|SM,          0,              I2,             0,      I37 },
> ++{"sc",                        "t,A(b)",       0,    (int) M_SC_AB,    INSN_MACRO,             0,              I2,             0,      0 },
> + {"scd",                       "t,+j(b)",      0x7c000027, 0xfc00007f, MOD_1|RD_3|SM,          0,              I69,            0,      0 },
> +-{"scd",                       "t,o(b)",       0xf0000000, 0xfc000000, MOD_1|RD_3|SM,          0,              I3,             0,      EE|I69 },
> +-{"scd",                       "t,A(b)",       0,    (int) M_SCD_AB,   INSN_MACRO,             0,              I3,             0,      EE },
> ++{"scd",                       "t,o(b)",       0xf0000000, 0xfc000000, MOD_1|RD_3|SM,          0,              I3,             0,      I69 },
> ++{"scd",                       "t,A(b)",       0,    (int) M_SCD_AB,   INSN_MACRO,             0,              I3,             0,      0 },
> + /* The macro has to be first to handle o32 correctly.  */
> + {"sd",                        "t,A(b)",       0,    (int) M_SD_AB,    INSN_MACRO,             0,              I1,             0,      0 },
> + {"sd",                        "t,o(b)",       0xfc000000, 0xfc000000, RD_1|RD_3|SM,           0,              I3,             0,      0 },
> diff --git a/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/crossdev.conf b/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/crossdev.conf
> new file mode 100644
> index 0000000000..b8fa368c1c
> --- /dev/null
> +++ b/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/crossdev.conf
> @@ -0,0 +1,5 @@
> +[crossdev]
> +location = /usr/local/portage-crossdev
> +priority = 10
> +masters = gentoo
> +auto-sync = no
> diff --git a/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/gcc-v7.2.0-ps2-llsc.patch b/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/gcc-v7.2.0-ps2-llsc.patch
> new file mode 100644
> index 0000000000..59bc0e6e83
> --- /dev/null
> +++ b/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/gcc-v7.2.0-ps2-llsc.patch
> @@ -0,0 +1,23 @@
> +diff --git a/gcc/config.gcc b/gcc/config.gcc
> +index a9196cd..5b497f6 100644
> +--- a/gcc/config.gcc
> ++++ b/gcc/config.gcc
> +@@ -3558,14 +3558,14 @@ fi
> + # Infer a default setting for --with-llsc.
> + if test x$with_llsc = x; then
> +   case ${target} in
> +-    mips64r5900-*-* | mips64r5900el-*-* | mipsr5900-*-* | mipsr5900el-*-*)
> +-      # The R5900 doesn't support LL(D) and SC(D).
> +-      with_llsc=no
> +-      ;;
> +     mips*-*-linux*)
> +       # The kernel emulates LL and SC where necessary.
> +       with_llsc=yes
> +       ;;
> ++    mips64r5900-*-* | mips64r5900el-*-* | mipsr5900-*-* | mipsr5900el-*-*)
> ++      # The R5900 doesn't support LL(D) and SC(D).
> ++      with_llsc=no
> ++      ;;
> +   esac
> + fi
> +
> diff --git a/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/gcc-v7.2.0-ps2.patch b/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/gcc-v7.2.0-ps2.patch
> new file mode 100644
> index 0000000000..a3337dbf61
> --- /dev/null
> +++ b/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/gcc-v7.2.0-ps2.patch
> @@ -0,0 +1,219 @@
> +commit ff785b9af62d5dfe1c0e3d3cf0052e7b5cf281ad
> +Author: Rick Gaiser <rgaiser@gmail.com>
> +Date:   Thu Apr 26 22:30:11 2018 +0200
> +
> +    Apply gcc-7.2.0-libgcc.patch from uyjulian
> +
> +diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
> +index 6bfd86a..2996ebc 100644
> +--- a/gcc/config/mips/mips.c
> ++++ b/gcc/config/mips/mips.c
> +@@ -19747,6 +19747,11 @@ mips_option_override (void)
> +     error ("unsupported combination: %s",
> +          "-march=r5900 -mhard-float -mdouble-float");
> +
> ++  /* The R5900 does not support some MIPS16 instructions.  */
> ++  if (TARGET_MIPS5900 && ((mips_base_compression_flags & MASK_MIPS16) != 0))
> ++        error("unsupported combination: %s",
> ++                "-march=r5900 -mips16");
> ++
> +   /* If a -mlong* option was given, check that it matches the ABI,
> +      otherwise infer the -mlong* setting from the other options.  */
> +   if ((target_flags_explicit & MASK_LONG64) != 0)
> +diff --git a/libgcc/config.host b/libgcc/config.host
> +index bedcf10..4a85a15 100644
> +--- a/libgcc/config.host
> ++++ b/libgcc/config.host
> +@@ -144,7 +144,11 @@ mips*-*-*)
> +       cpu_type=mips
> +       tmake_file="mips/t-mips"
> +       if test "${libgcc_cv_mips_hard_float}" = yes; then
> ++          if test "${libgcc_cv_mips_single_float}" = yes; then
> ++                tmake_file="${tmake_file} t-hardfp-sf t-hardfp"
> ++          else
> +               tmake_file="${tmake_file} t-hardfp-sfdf t-hardfp"
> ++          fi
> +       else
> +               tmake_file="${tmake_file} t-softfp-sfdf"
> +       fi
> +@@ -858,19 +862,16 @@ mips*-*-netbsd*)                 # NetBSD/mips, either endian.
> + mips*-*-linux*)                               # Linux MIPS, either endian.
> +       extra_parts="$extra_parts crtfastmath.o"
> +       tmake_file="${tmake_file} t-crtfm"
> +-      case ${host} in
> +-        mips64r5900* | mipsr5900*)
> +-          # The MIPS16 support code uses floating point
> +-          # instructions that are not supported on r5900.
> +-          ;;
> +-        *)
> ++    if test "${libgcc_cv_mips16}" = yes; then
> +           tmake_file="${tmake_file} mips/t-mips16 t-slibgcc-libgcc"
> +-          ;;
> +-      esac
> ++    fi
> +       md_unwind_header=mips/linux-unwind.h
> +       ;;
> + mips*-sde-elf*)
> +-      tmake_file="$tmake_file mips/t-crtstuff mips/t-mips16"
> ++      tmake_file="$tmake_file mips/t-crtstuff"
> ++    if test "${libgcc_cv_mips16}" = yes; then
> ++        tmake_file="${tmake_file} mips/t-mips16"
> ++    fi
> +       case "${with_newlib}" in
> +         yes)
> +           # newlib / libgloss.
> +@@ -900,7 +901,10 @@ mipsisa64sb1-*-elf* | mipsisa64sb1el-*-elf*)
> +       extra_parts="$extra_parts crti.o crtn.o"
> +       ;;
> + mips-*-elf* | mipsel-*-elf*)
> +-      tmake_file="$tmake_file mips/t-elf mips/t-crtstuff mips/t-mips16"
> ++      tmake_file="$tmake_file mips/t-elf mips/t-crtstuff"
> ++    if test "${libgcc_cv_mips16}" = yes; then
> ++        tmake_file="${tmake_file} mips/t-mips16"
> ++    fi
> +       extra_parts="$extra_parts crti.o crtn.o"
> +       ;;
> + mipsr5900-*-elf* | mipsr5900el-*-elf*)
> +@@ -908,7 +912,10 @@ mipsr5900-*-elf* | mipsr5900el-*-elf*)
> +       extra_parts="$extra_parts crti.o crtn.o"
> +       ;;
> + mips64-*-elf* | mips64el-*-elf*)
> +-      tmake_file="$tmake_file mips/t-elf mips/t-crtstuff mips/t-mips16"
> ++      tmake_file="$tmake_file mips/t-elf mips/t-crtstuff"
> ++    if test "${libgcc_cv_mips16}" = yes; then
> ++        tmake_file="${tmake_file} mips/t-mips16"
> ++    fi
> +       extra_parts="$extra_parts crti.o crtn.o"
> +       ;;
> + mips64r5900-*-elf* | mips64r5900el-*-elf*)
> +@@ -924,7 +931,10 @@ mips64orion-*-elf* | mips64orionel-*-elf*)
> +       extra_parts="$extra_parts crti.o crtn.o"
> +       ;;
> + mips*-*-rtems*)
> +-      tmake_file="$tmake_file mips/t-elf mips/t-crtstuff mips/t-mips16"
> ++      tmake_file="$tmake_file mips/t-elf mips/t-crtstuff"
> ++    if test "${libgcc_cv_mips16}" = yes; then
> ++        tmake_file="${tmake_file} mips/t-mips16"
> ++    fi
> +       extra_parts="$extra_parts crti.o crtn.o"
> +       ;;
> + mips-wrs-vxworks)
> +diff --git a/libgcc/config/t-hardfp-sf b/libgcc/config/t-hardfp-sf
> +new file mode 100644
> +index 0000000..e63ad47
> +--- /dev/null
> ++++ b/libgcc/config/t-hardfp-sf
> +@@ -0,0 +1,32 @@
> ++# Copyright (C) 2014-2015 Free Software Foundation, Inc.
> ++
> ++# This file is part of GCC.
> ++
> ++# GCC is free software; you can redistribute it and/or modify
> ++# it under the terms of the GNU General Public License as published by
> ++# the Free Software Foundation; either version 3, or (at your option)
> ++# any later version.
> ++
> ++# GCC is distributed in the hope that it will be useful,
> ++# but WITHOUT ANY WARRANTY; without even the implied warranty of
> ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> ++# GNU General Public License for more details.
> ++
> ++# You should have received a copy of the GNU General Public License
> ++# along with GCC; see the file COPYING3.  If not see
> ++# <http://www.gnu.org/licenses/>.
> ++
> ++hardfp_float_modes := sf
> ++# di and ti are provided by libgcc2.c where needed.
> ++hardfp_int_modes := si
> ++hardfp_extensions :=
> ++hardfp_truncations :=
> ++
> ++# Emulate 64 bit float:
> ++FPBIT = true
> ++DPBIT = true
> ++# Don't build functions handled by 32 bit hardware:
> ++LIB2FUNCS_EXCLUDE = _addsub_sf _mul_sf _div_sf \
> ++    _fpcmp_parts_sf _compare_sf _eq_sf _ne_sf _gt_sf _ge_sf \
> ++    _lt_sf _le_sf _unord_sf _si_to_sf _sf_to_si _negate_sf \
> ++    _thenan_sf _sf_to_usi _usi_to_sf
> +diff --git a/libgcc/configure b/libgcc/configure
> +index 42dda7f..716bba9 100644
> +--- a/libgcc/configure
> ++++ b/libgcc/configure
> +@@ -4871,6 +4871,48 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
> + fi
> + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgcc_cv_mips_hard_float" >&5
> + $as_echo "$libgcc_cv_mips_hard_float" >&6; }
> ++  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the target is single-float" >&5
> ++$as_echo_n "checking whether the target is single-float... " >&6; }
> ++if test "${libgcc_cv_mips_single_float+set}" = set; then :
> ++  $as_echo_n "(cached) " >&6
> ++else
> ++  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
> ++/* end confdefs.h.  */
> ++#ifndef __mips_single_float
> ++     #error FOO
> ++     #endif
> ++_ACEOF
> ++if ac_fn_c_try_compile "$LINENO"; then :
> ++  libgcc_cv_mips_single_float=yes
> ++else
> ++  libgcc_cv_mips_single_float=no
> ++fi
> ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
> ++fi
> ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgcc_cv_mips_single_float" >&5
> ++$as_echo "$libgcc_cv_mips_single_float" >&6; }
> ++  # Some targets (i.e. R5900) don't support some MIPS16 instructions.
> ++  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the target supports the MIPS16 ASE" >&5
> ++$as_echo_n "checking whether the target supports MIPS16 ASE... " >&6; }
> ++if test "${libgcc_cv_mips16+set}" = set; then :
> ++  $as_echo_n "(cached) " >&6
> ++else
> ++  CFLAGS_hold=$CFLAGS
> ++               CFLAGS="$CFLAGS -mips16"
> ++               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
> ++/* end confdefs.h.  */
> ++int i;
> ++_ACEOF
> ++if ac_fn_c_try_compile "$LINENO"; then :
> ++  libgcc_cv_mips16=yes
> ++else
> ++  libgcc_cv_mips16=no
> ++fi
> ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
> ++      CFLAGS=$CFLAGS_hold
> ++fi
> ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgcc_cv_mips16" >&5
> ++$as_echo "$libgcc_cv_mips16" >&6; }
> + esac
> +
> + case ${host} in
> +diff --git a/libgcc/configure.ac b/libgcc/configure.ac
> +index 6bcaad6..5bce467 100644
> +--- a/libgcc/configure.ac
> ++++ b/libgcc/configure.ac
> +@@ -292,6 +292,23 @@ mips*-*-*)
> +      #endif],
> +     [libgcc_cv_mips_hard_float=yes],
> +     [libgcc_cv_mips_hard_float=no])])
> ++  AC_CACHE_CHECK([whether the target is single-float],
> ++               [libgcc_cv_mips_single_float],
> ++               [AC_COMPILE_IFELSE(
> ++    [#ifndef __mips_single_float
> ++     #error FOO
> ++     #endif],
> ++    [libgcc_cv_mips_single_float=yes],
> ++    [libgcc_cv_mips_single_float=no])])
> ++  # Some targets (i.e. R5900) don't support some MIPS16 instructions.
> ++  AC_CACHE_CHECK([whether the target supports the MIPS16 ASE],
> ++               [libgcc_cv_mips16],
> ++               [CFLAGS_hold=$CFLAGS
> ++               CFLAGS="$CFLAGS -mips16"
> ++               AC_COMPILE_IFELSE([[int i;]],
> ++    [libgcc_cv_mips16=yes],
> ++    [libgcc_cv_mips16=no])
> ++      CFLAGS=$CFLAGS_hold])
> + esac
> +
> + case ${host} in
> --
> 2.17.2
>

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

* Re: [Qemu-devel] [RFC PATCH 1/2] docker: Add gentoo-mipsr5900el-cross image
  2018-11-18 20:33 ` [Qemu-devel] [RFC PATCH 1/2] " Philippe Mathieu-Daudé
  2018-11-19 10:25   ` Philippe Mathieu-Daudé
@ 2018-11-19 12:23   ` Alex Bennée
  2018-11-19 14:11     ` Philippe Mathieu-Daudé
  2018-11-19 15:55     ` Fredrik Noring
  2018-11-19 13:44   ` Alex Bennée
  2018-11-19 15:34   ` Alex Bennée
  3 siblings, 2 replies; 13+ messages in thread
From: Alex Bennée @ 2018-11-19 12:23 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Fredrik Noring, Fam Zheng, qemu-devel, Mike Frysinger


Philippe Mathieu-Daudé <f4bug@amsat.org> writes:

> This image is based on Gentoo and the toolchain is built using crossdev.
>
> Recipe from:
>   https://lists.gnu.org/archive/html/qemu-devel/2018-09/msg03944.html
>
> Suggested-by: Fredrik Noring <noring@nocrew.org>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> TODO:
> - Add Fredrik Noring S-o-b in his patches
> - Check patch merged upstream
>
>  tests/docker/Makefile.include                 |   6 +
>  .../gentoo-mipsr5900el-cross.docker           |  39 ++++
>  .../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 ++++++++++++++++++
>  6 files changed, 328 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
>
> diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
> index 9467e9d088..6ca615206f 100644
> --- a/tests/docker/Makefile.include
> +++ b/tests/docker/Makefile.include
> @@ -119,6 +119,12 @@ docker-image-debian-sparc64-cross: docker-image-debian-sid
>  docker-image-debian-mips64-cross: docker-image-debian-sid
>  docker-image-debian-riscv64-cross: docker-image-debian-sid
>  docker-image-debian-powerpc-cross: docker-image-debian-sid
> +docker-image-gentoo-mipsr5900el-cross: EXTRA_FILES:=$(addprefix \
> +			$(SRC_PATH)/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/,\
> +				crossdev.conf \
> +				binutils-v2.30-ps2-llsc.patch \
> +				gcc-v7.2.0-ps2.patch \
> +				gcc-v7.2.0-ps2-llsc.patch)
>  docker-image-travis: NOUSER=1
>
>  # Specialist build images, sometimes very limited tools
> diff --git a/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker b/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker
> new file mode 100644
> index 0000000000..dbc2eb007b
> --- /dev/null
> +++ b/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker
> @@ -0,0 +1,39 @@
> +#
> +# Docker mipsel (r5900) cross-compiler target
> +#
> +# Using multi-stage builds, this image requires docker-17.05.0 or later.
> +# (See: https://github.com/gentoo/gentoo-docker-images)
> +#
> +# SPDX-License-Identifier: GPL-2.0-or-later
> +
> +# name the portage image
> +FROM gentoo/portage:latest as portage

This is going to be a rolling state of portage which may be why it broke.

> +
> +# image is based on stage3-amd64
> +FROM gentoo/stage3-amd64:latest
> +
> +# copy the entire portage volume in
> +COPY --from=portage /usr/portage /usr/portage
> +
> +MAINTAINER Philippe Mathieu-Daudé <f4bug@amsat.org>
> +
> +# continue with image build ...
> +RUN emerge -qv sys-devel/crossdev
> +
> +# set CROSSDEV_OVERLAY to /usr/local/portage-crossdev
> +RUN mkdir -p /usr/local/portage-crossdev/{profiles,metadata} && \
> +    echo 'crossdev' > /usr/local/portage-crossdev/profiles/repo_name && \
> +    echo 'masters = gentoo' > /usr/local/portage-crossdev/metadata/layout.conf && \
> +    chown -R portage:portage /usr/local/portage-crossdev && \
> +    mkdir -p /etc/portage/repos.conf
> +ADD crossdev.conf /etc/portage/repos.conf/crossdev.conf
> +
> +# Fredrik's patches
> +RUN mkdir -p /etc/portage/patches/cross-mipsr5900el-unknown-linux-gnu/{binutils,gcc}
> +ADD binutils-v2.30-ps2-llsc.patch /etc/portage/patches/cross-mipsr5900el-unknown-linux-gnu/binutils
> +ADD gcc-v7.2.0-ps2.patch /etc/portage/patches/cross-mipsr5900el-unknown-linux-gnu/gcc
> +ADD gcc-v7.2.0-ps2-llsc.patch /etc/portage/patches/cross-mipsr5900el-unknown-linux-gnu/gcc
> +
> +RUN crossdev -s3 -t mipsr5900el-unknown-linux-gnu --binutils ">=2.30" --gcc ">=7.2.0"
> +

This fails to build glibc, but doesn't exactly give much info:

   * Log: /var/log/portage/cross-mipsr5900el-unknown-linux-gnu-binutils.log
   * Emerging cross-binutils ...                                            [ ok ]
   * Log: /var/log/portage/cross-mipsr5900el-unknown-linux-gnu-linux-headers-quick.log
   * Emerging cross-linux-headers-quick ...                                 [ ok ]
   * Log: /var/log/portage/cross-mipsr5900el-unknown-linux-gnu-glibc-headers.log
   * Emerging cross-glibc-headers ...

   * error: glibc failed :(
   *
   * If you file a bug, please attach the following logfiles:
   * /var/log/portage/cross-mipsr5900el-unknown-linux-gnu-info.log
   * /var/log/portage/cross-mipsr5900el-unknown-linux-gnu-glibc-headers.log.xz
   * /var/tmp/portage/cross-mipsr5900el-unknown-linux-gnu/glibc*/temp/glibc-config.logs.tar.xz
  The command '/bin/sh -c crossdev -s3 -t mipsr5900el-unknown-linux-gnu --binutils ">=2.30" --gcc ">=7.2.0"' returned a non-zero code: 1

But running in a container I did get:

  >>> Running pre-merge checks for cross-mipsr5900el-unknown-linux-gnu/glibc-2.27-r6
   * Checking general environment sanity.
   * Your //etc/nsswitch.conf is out of date.
   * Please make sure you have 'files' entries for
   * 'passwd:', 'group:' and 'shadow:' databases.
   * For more details see:
   *   https://wiki.gentoo.org/wiki/Project:Toolchain/nsswitch.conf_in_glibc-2.26
   * ERROR: cross-mipsr5900el-unknown-linux-gnu/glibc-2.27-r6::crossdev failed (pretend phase):
   *   nsswitch.conf has no 'files' provider in 'passwd'.
   *
   * Call stack:
   *              ebuild.sh, line 115:  Called pkg_pretend
   *   glibc-2.27-r6.ebuild, line 723:  Called sanity_prechecks
   *   glibc-2.27-r6.ebuild, line 651:  Called die
   * The specific snippet of code:
   *                              die "nsswitch.conf has no 'files' provider in '${entry}'."
   *
   * If you need support, post the output of `emerge --info '=cross-mipsr5900el-unknown-linux-gnu/glibc-2.27-r6::crossdev'`,
   * the complete build log and the output of `emerge -pqv '=cross-mipsr5900el-unknown-linux-gnu/glibc-2.27-r6::crossdev'`.
   * The complete build log is located at '/var/tmp/portage/cross-mipsr5900el-unknown-linux-gnu/glibc-2.27-r6/temp/build.log'.
   * The ebuild environment file is located at '/var/tmp/portage/cross-mipsr5900el-unknown-linux-gnu/glibc-2.27-r6/temp/die.env'.
   * Working directory: '/usr/lib64/python3.4/site-packages'
   * S: '/var/tmp/portage/cross-mipsr5900el-unknown-linux-gnu/glibc-2.27-r6/work/glibc-2.27'
   * Messages for package cross-mipsr5900el-unknown-linux-gnu/glibc-2.27-r6:
   * Your //etc/nsswitch.conf is out of date.
   * Please make sure you have 'files' entries for
   * 'passwd:', 'group:' and 'shadow:' databases.
   * For more details see:
   *   https://wiki.gentoo.org/wiki/Project:Toolchain/nsswitch.conf_in_glibc-2.26
   * ERROR: cross-mipsr5900el-unknown-linux-gnu/glibc-2.27-r6::crossdev failed (pretend phase):
   *   nsswitch.conf has no 'files' provider in 'passwd'.
   *
   * Call stack:
   *              ebuild.sh, line 115:  Called pkg_pretend
   *   glibc-2.27-r6.ebuild, line 723:  Called sanity_prechecks
   *   glibc-2.27-r6.ebuild, line 651:  Called die
   * The specific snippet of code:
   *                              die "nsswitch.conf has no 'files' provider in '${entry}'."

--
Alex Bennée

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

* Re: [Qemu-devel] [RFC PATCH 1/2] docker: Add gentoo-mipsr5900el-cross image
  2018-11-18 20:33 ` [Qemu-devel] [RFC PATCH 1/2] " Philippe Mathieu-Daudé
  2018-11-19 10:25   ` Philippe Mathieu-Daudé
  2018-11-19 12:23   ` Alex Bennée
@ 2018-11-19 13:44   ` Alex Bennée
  2018-11-19 15:34   ` Alex Bennée
  3 siblings, 0 replies; 13+ messages in thread
From: Alex Bennée @ 2018-11-19 13:44 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Fredrik Noring, Fam Zheng, qemu-devel, Mike Frysinger


Philippe Mathieu-Daudé <f4bug@amsat.org> writes:

> This image is based on Gentoo and the toolchain is built using crossdev.
>
> Recipe from:
>   https://lists.gnu.org/archive/html/qemu-devel/2018-09/msg03944.html
>
> Suggested-by: Fredrik Noring <noring@nocrew.org>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> TODO:
> - Add Fredrik Noring S-o-b in his patches
> - Check patch merged upstream
>
>  tests/docker/Makefile.include                 |   6 +
>  .../gentoo-mipsr5900el-cross.docker           |  39 ++++
>  .../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 ++++++++++++++++++
>  6 files changed, 328 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
>
> diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
> index 9467e9d088..6ca615206f 100644
> --- a/tests/docker/Makefile.include
> +++ b/tests/docker/Makefile.include
> @@ -119,6 +119,12 @@ docker-image-debian-sparc64-cross: docker-image-debian-sid
>  docker-image-debian-mips64-cross: docker-image-debian-sid
>  docker-image-debian-riscv64-cross: docker-image-debian-sid
>  docker-image-debian-powerpc-cross: docker-image-debian-sid
> +docker-image-gentoo-mipsr5900el-cross: EXTRA_FILES:=$(addprefix \
> +			$(SRC_PATH)/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/,\
> +				crossdev.conf \
> +				binutils-v2.30-ps2-llsc.patch \
> +				gcc-v7.2.0-ps2.patch \
> +				gcc-v7.2.0-ps2-llsc.patch)
>  docker-image-travis: NOUSER=1
>
>  # Specialist build images, sometimes very limited tools
> diff --git a/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker b/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker
> new file mode 100644
> index 0000000000..dbc2eb007b
> --- /dev/null
> +++ b/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker
> @@ -0,0 +1,39 @@
> +#
> +# Docker mipsel (r5900) cross-compiler target
> +#
> +# Using multi-stage builds, this image requires docker-17.05.0 or later.
> +# (See: https://github.com/gentoo/gentoo-docker-images)
> +#
> +# SPDX-License-Identifier: GPL-2.0-or-later
> +
> +# name the portage image
> +FROM gentoo/portage:latest as portage
> +
> +# image is based on stage3-amd64
> +FROM gentoo/stage3-amd64:latest
> +
> +# copy the entire portage volume in
> +COPY --from=portage /usr/portage /usr/portage

OK digging into this more I think the problem is the images are too old:

  bdb7b450deaa / # ls -l usr/lib/python-exec/python-exec2
  -rwxr-xr-x 1 root root 1461 Dec  8  2016 usr/lib/python-exec/python-exec2

To have a proper Gentoo environment you need to take the latest stage3,
sync the portage tree and update all the tools. It's a little odd
because the hub claims the last build was 18 hours ago but the portage
is still older than mine:

  13:37:45 [alex@danny:~/tmp] 1 $ ls -l /usr/lib/python-exec/python-exec2
  -rwxr-xr-x 1 root root 2302 Sep 10 14:09 /usr/lib/python-exec/python-exec2*

I'll have a dig into the stage tarballs.

--
Alex Bennée

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

* Re: [Qemu-devel] [RFC PATCH 1/2] docker: Add gentoo-mipsr5900el-cross image
  2018-11-19 12:23   ` Alex Bennée
@ 2018-11-19 14:11     ` Philippe Mathieu-Daudé
  2018-11-19 15:55     ` Fredrik Noring
  1 sibling, 0 replies; 13+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-11-19 14:11 UTC (permalink / raw)
  To: Alex Bennée
  Cc: Fredrik Noring, Fam Zheng, qemu-devel@nongnu.org Developers,
	Mike Frysinger

On Mon, Nov 19, 2018 at 1:23 PM Alex Bennée <alex.bennee@linaro.org> wrote:
> Philippe Mathieu-Daudé <f4bug@amsat.org> writes:
>
> > This image is based on Gentoo and the toolchain is built using crossdev.
> >
> > Recipe from:
> >   https://lists.gnu.org/archive/html/qemu-devel/2018-09/msg03944.html
> >
> > Suggested-by: Fredrik Noring <noring@nocrew.org>
> > Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> > ---
> > TODO:
> > - Add Fredrik Noring S-o-b in his patches
> > - Check patch merged upstream
> >
> >  tests/docker/Makefile.include                 |   6 +
> >  .../gentoo-mipsr5900el-cross.docker           |  39 ++++
> >  .../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 ++++++++++++++++++
> >  6 files changed, 328 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
> >
> > diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
> > index 9467e9d088..6ca615206f 100644
> > --- a/tests/docker/Makefile.include
> > +++ b/tests/docker/Makefile.include
> > @@ -119,6 +119,12 @@ docker-image-debian-sparc64-cross: docker-image-debian-sid
> >  docker-image-debian-mips64-cross: docker-image-debian-sid
> >  docker-image-debian-riscv64-cross: docker-image-debian-sid
> >  docker-image-debian-powerpc-cross: docker-image-debian-sid
> > +docker-image-gentoo-mipsr5900el-cross: EXTRA_FILES:=$(addprefix \
> > +                     $(SRC_PATH)/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/,\
> > +                             crossdev.conf \
> > +                             binutils-v2.30-ps2-llsc.patch \
> > +                             gcc-v7.2.0-ps2.patch \
> > +                             gcc-v7.2.0-ps2-llsc.patch)
> >  docker-image-travis: NOUSER=1
> >
> >  # Specialist build images, sometimes very limited tools
> > diff --git a/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker b/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker
> > new file mode 100644
> > index 0000000000..dbc2eb007b
> > --- /dev/null
> > +++ b/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker
> > @@ -0,0 +1,39 @@
> > +#
> > +# Docker mipsel (r5900) cross-compiler target
> > +#
> > +# Using multi-stage builds, this image requires docker-17.05.0 or later.
> > +# (See: https://github.com/gentoo/gentoo-docker-images)
> > +#
> > +# SPDX-License-Identifier: GPL-2.0-or-later
> > +
> > +# name the portage image
> > +FROM gentoo/portage:latest as portage
>
> This is going to be a rolling state of portage which may be why it broke.

Oh, same problem than Debian/unstable.
I'll see with Gentoo ppl how to fix this.

> > +
> > +# image is based on stage3-amd64
> > +FROM gentoo/stage3-amd64:latest
> > +
> > +# copy the entire portage volume in
> > +COPY --from=portage /usr/portage /usr/portage
> > +
> > +MAINTAINER Philippe Mathieu-Daudé <f4bug@amsat.org>
> > +
> > +# continue with image build ...
> > +RUN emerge -qv sys-devel/crossdev
> > +
> > +# set CROSSDEV_OVERLAY to /usr/local/portage-crossdev
> > +RUN mkdir -p /usr/local/portage-crossdev/{profiles,metadata} && \
> > +    echo 'crossdev' > /usr/local/portage-crossdev/profiles/repo_name && \
> > +    echo 'masters = gentoo' > /usr/local/portage-crossdev/metadata/layout.conf && \
> > +    chown -R portage:portage /usr/local/portage-crossdev && \
> > +    mkdir -p /etc/portage/repos.conf
> > +ADD crossdev.conf /etc/portage/repos.conf/crossdev.conf
> > +
> > +# Fredrik's patches
> > +RUN mkdir -p /etc/portage/patches/cross-mipsr5900el-unknown-linux-gnu/{binutils,gcc}
> > +ADD binutils-v2.30-ps2-llsc.patch /etc/portage/patches/cross-mipsr5900el-unknown-linux-gnu/binutils
> > +ADD gcc-v7.2.0-ps2.patch /etc/portage/patches/cross-mipsr5900el-unknown-linux-gnu/gcc
> > +ADD gcc-v7.2.0-ps2-llsc.patch /etc/portage/patches/cross-mipsr5900el-unknown-linux-gnu/gcc
> > +
> > +RUN crossdev -s3 -t mipsr5900el-unknown-linux-gnu --binutils ">=2.30" --gcc ">=7.2.0"
> > +
>
> This fails to build glibc, but doesn't exactly give much info:
>
>    * Log: /var/log/portage/cross-mipsr5900el-unknown-linux-gnu-binutils.log
>    * Emerging cross-binutils ...                                            [ ok ]
>    * Log: /var/log/portage/cross-mipsr5900el-unknown-linux-gnu-linux-headers-quick.log
>    * Emerging cross-linux-headers-quick ...                                 [ ok ]
>    * Log: /var/log/portage/cross-mipsr5900el-unknown-linux-gnu-glibc-headers.log
>    * Emerging cross-glibc-headers ...
>
>    * error: glibc failed :(
>    *
>    * If you file a bug, please attach the following logfiles:
>    * /var/log/portage/cross-mipsr5900el-unknown-linux-gnu-info.log
>    * /var/log/portage/cross-mipsr5900el-unknown-linux-gnu-glibc-headers.log.xz
>    * /var/tmp/portage/cross-mipsr5900el-unknown-linux-gnu/glibc*/temp/glibc-config.logs.tar.xz
>   The command '/bin/sh -c crossdev -s3 -t mipsr5900el-unknown-linux-gnu --binutils ">=2.30" --gcc ">=7.2.0"' returned a non-zero code: 1
>
> But running in a container I did get:
>
>   >>> Running pre-merge checks for cross-mipsr5900el-unknown-linux-gnu/glibc-2.27-r6
>    * Checking general environment sanity.
>    * Your //etc/nsswitch.conf is out of date.
>    * Please make sure you have 'files' entries for
>    * 'passwd:', 'group:' and 'shadow:' databases.
>    * For more details see:
>    *   https://wiki.gentoo.org/wiki/Project:Toolchain/nsswitch.conf_in_glibc-2.26
>    * ERROR: cross-mipsr5900el-unknown-linux-gnu/glibc-2.27-r6::crossdev failed (pretend phase):
>    *   nsswitch.conf has no 'files' provider in 'passwd'.
>    *
>    * Call stack:
>    *              ebuild.sh, line 115:  Called pkg_pretend
>    *   glibc-2.27-r6.ebuild, line 723:  Called sanity_prechecks
>    *   glibc-2.27-r6.ebuild, line 651:  Called die
>    * The specific snippet of code:
>    *                              die "nsswitch.conf has no 'files' provider in '${entry}'."
>    *
>    * If you need support, post the output of `emerge --info '=cross-mipsr5900el-unknown-linux-gnu/glibc-2.27-r6::crossdev'`,
>    * the complete build log and the output of `emerge -pqv '=cross-mipsr5900el-unknown-linux-gnu/glibc-2.27-r6::crossdev'`.
>    * The complete build log is located at '/var/tmp/portage/cross-mipsr5900el-unknown-linux-gnu/glibc-2.27-r6/temp/build.log'.
>    * The ebuild environment file is located at '/var/tmp/portage/cross-mipsr5900el-unknown-linux-gnu/glibc-2.27-r6/temp/die.env'.
>    * Working directory: '/usr/lib64/python3.4/site-packages'
>    * S: '/var/tmp/portage/cross-mipsr5900el-unknown-linux-gnu/glibc-2.27-r6/work/glibc-2.27'
>    * Messages for package cross-mipsr5900el-unknown-linux-gnu/glibc-2.27-r6:
>    * Your //etc/nsswitch.conf is out of date.
>    * Please make sure you have 'files' entries for
>    * 'passwd:', 'group:' and 'shadow:' databases.
>    * For more details see:
>    *   https://wiki.gentoo.org/wiki/Project:Toolchain/nsswitch.conf_in_glibc-2.26
>    * ERROR: cross-mipsr5900el-unknown-linux-gnu/glibc-2.27-r6::crossdev failed (pretend phase):
>    *   nsswitch.conf has no 'files' provider in 'passwd'.
>    *
>    * Call stack:
>    *              ebuild.sh, line 115:  Called pkg_pretend
>    *   glibc-2.27-r6.ebuild, line 723:  Called sanity_prechecks
>    *   glibc-2.27-r6.ebuild, line 651:  Called die
>    * The specific snippet of code:
>    *                              die "nsswitch.conf has no 'files' provider in '${entry}'."

You can see a successful build from Saturday here:
https://app.shippable.com/github/philmd/qemu/runs/268/1/console

...
Step 12/17 : RUN crossdev -s3 -t mipsr5900el-unknown-linux-gnu
--binutils ">=2.30" --gcc ">=7.2.0"
 ---> Running in b8016468d14f
-
 * crossdev version:      20171230
 * Host Portage ARCH:     amd64
 * Target Portage ARCH:   mips
 * Target System:         mipsr5900el-unknown-linux-gnu
 * Stage:                 3 (C compiler & libc)
 * ABIs:                  default
 * binutils:              >=binutils-2.30
 * gcc:                   >=gcc-7.2.0
 * headers:               linux-headers-[latest]
 * libc:                  glibc-[latest]
 * CROSSDEV_OVERLAY:      /usr/local/portage-crossdev
 * PORT_LOGDIR:           /var/log/portage
 * PORTAGE_CONFIGROOT:    /
 * Portage flags:

 * leaving metadata/layout.conf alone in /usr/local/portage-crossdev

 * Log: /var/log/portage/cross-mipsr5900el-unknown-linux-gnu-binutils.log
 * Emerging cross-binutils ...
                                            [ ok ]
 * Log: /var/log/portage/cross-mipsr5900el-unknown-linux-gnu-linux-headers-quick.log
 * Emerging cross-linux-headers-quick ...
                                 [ ok ]
 * Log: /var/log/portage/cross-mipsr5900el-unknown-linux-gnu-glibc-headers.log
 * Emerging cross-glibc-headers ...
                                       [ ok ]
 * Log: /var/log/portage/cross-mipsr5900el-unknown-linux-gnu-gcc-stage1.log
 * Emerging cross-gcc-stage1 ...
                                          [ ok ]
* Log: /var/log/portage/cross-mipsr5900el-unknown-linux-gnu-linux-headers.log
 * Emerging cross-linux-headers ...
                                       [ ok ]
 * Log: /var/log/portage/cross-mipsr5900el-unknown-linux-gnu-glibc.log
 * Emerging cross-glibc ...
                                               [ ok ]
 ---> a46540f0ffd1
Removing intermediate container b8016468d14f
Step 13/17 : ENV QEMU_CONFIGURE_OPTS
--cross-prefix=mipsr5900el-unknown-linux-gnu-
[...]
 ---> 77daccf424a7
Successfully built 77daccf424a7
Successfully tagged qemu:gentoo-mipsr5900el-cross

Thanks for giving this a try!

Phil.

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

* Re: [Qemu-devel] [RFC PATCH 0/2] docker: Add gentoo-mipsr5900el-cross image
  2018-11-18 20:33 [Qemu-devel] [RFC PATCH 0/2] docker: Add gentoo-mipsr5900el-cross image Philippe Mathieu-Daudé
                   ` (2 preceding siblings ...)
  2018-11-18 21:03 ` [Qemu-devel] [RFC PATCH 0/2] docker: Add gentoo-mipsr5900el-cross image no-reply
@ 2018-11-19 15:29 ` Fredrik Noring
  2018-11-19 15:46   ` Maciej W. Rozycki
  3 siblings, 1 reply; 13+ messages in thread
From: Fredrik Noring @ 2018-11-19 15:29 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Alex Bennée, Fam Zheng, qemu-devel, Mike Frysinger,
	Maciej W. Rozycki, Jürgen Urban

[-- Attachment #1: Type: text/plain, Size: 1486 bytes --]

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

[-- Attachment #2: gcc.git-d728eb9085d8.patch --]
[-- Type: text/x-diff, Size: 1362 bytes --]

>From d728eb9085d80b6c5ce1bc8b6f99859fe0f0aaa5 Mon Sep 17 00:00:00 2001
From: macro <macro@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Mon, 12 Nov 2018 23:16:40 +0000
Subject: [PATCH] MIPS: Default to --with-llsc for the R5900 Linux target as
 well

The Linux kernel requires and emulates LL and SC for the R5900 too.  The
special --without-llsc default for the R5900 is therefore not applicable
in that case.

Reviewed-by: Maciej W. Rozycki <macro@linux-mips.org>

2018-11-12  Fredrik Noring  <noring@nocrew.org>

	gcc/
	* config.gcc: Update with-llsc defaults for MIPS r5900.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@266038 138bc75d-0d04-0410-961f-82ee72b054a4

diff --git a/gcc/config.gcc b/gcc/config.gcc
index e2b9946..8525cb5 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -3795,14 +3795,14 @@ fi
 # Infer a default setting for --with-llsc.
 if test x$with_llsc = x; then
   case ${target} in
-    mips64r5900-*-* | mips64r5900el-*-* | mipsr5900-*-* | mipsr5900el-*-*)
-      # The R5900 doesn't support LL(D) and SC(D).
-      with_llsc=no
-      ;;
     mips*-*-linux*)
       # The kernel emulates LL and SC where necessary.
       with_llsc=yes
       ;;
+    mips64r5900-*-* | mips64r5900el-*-* | mipsr5900-*-* | mipsr5900el-*-*)
+      # The R5900 doesn't support LL(D) and SC(D).
+      with_llsc=no
+      ;;
   esac
 fi
 
-- 
2.9.3


[-- Attachment #3: glibc.git-8e3c00db16fc.patch --]
[-- Type: text/x-diff, Size: 1556 bytes --]

>From 8e3c00db16fcedea0ea47d93c2acb6d7d5ba9164 Mon Sep 17 00:00:00 2001
From: Fredrik Noring <noring@nocrew.org>
Date: Thu, 1 Nov 2018 14:36:48 +0000
Subject: [PATCH] MIPS: Use `.set mips2' to emulate LL/SC for the R5900 too

GAS treats the R5900 as MIPS III, with some modifications.  The MIPS III
designation means that the GNU C Library will try to assemble the LL and
SC instructions, even though they are not implemented in the R5900.  GAS
will therefore produce the following errors:

Error: opcode not supported on this processor: r5900 (mips3) `ll $2,0($4)'
Error: opcode not supported on this processor: r5900 (mips3) `sc $6,0($4)'

The MIPS II ISA override as used here enables the kernel to trap and
emulate the LL and SC instructions, as required.

This change has been tested by compiling the GNU C Library 2.27 with a
GCC 8.2.0 cross-compiler for mipsr5900el-unknown-linux-gnu under Gentoo.

	* sysdeps/mips/sys/tas.h (_test_and_set): Handle the R5900 CPU
	with the ISA override.

diff --git a/sysdeps/mips/sys/tas.h b/sysdeps/mips/sys/tas.h
index d5ed013..22cee94 100644
--- a/sysdeps/mips/sys/tas.h
+++ b/sysdeps/mips/sys/tas.h
@@ -38,10 +38,11 @@ __NTH (_test_and_set (int *__p, int __v))
 {
   int __r, __t;
 
+  /* The R5900 reports itself as MIPS III but it does not have LL/SC.  */
   __asm__ __volatile__
     ("/* Inline test and set */\n"
      ".set	push\n\t"
-#if _MIPS_SIM == _ABIO32 && __mips < 2
+#if _MIPS_SIM == _ABIO32 && (__mips < 2 || defined (_MIPS_ARCH_R5900))
      ".set	mips2\n\t"
 #endif
      "sync\n\t"
-- 
2.9.3


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

* Re: [Qemu-devel] [RFC PATCH 1/2] docker: Add gentoo-mipsr5900el-cross image
  2018-11-18 20:33 ` [Qemu-devel] [RFC PATCH 1/2] " Philippe Mathieu-Daudé
                     ` (2 preceding siblings ...)
  2018-11-19 13:44   ` Alex Bennée
@ 2018-11-19 15:34   ` Alex Bennée
  3 siblings, 0 replies; 13+ messages in thread
From: Alex Bennée @ 2018-11-19 15:34 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Fredrik Noring, Fam Zheng, qemu-devel, Mike Frysinger


Philippe Mathieu-Daudé <f4bug@amsat.org> writes:

> This image is based on Gentoo and the toolchain is built using crossdev.
>
> Recipe from:
>   https://lists.gnu.org/archive/html/qemu-devel/2018-09/msg03944.html
>
> Suggested-by: Fredrik Noring <noring@nocrew.org>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> TODO:
> - Add Fredrik Noring S-o-b in his patches
> - Check patch merged upstream
>
>  tests/docker/Makefile.include                 |   6 +
>  .../gentoo-mipsr5900el-cross.docker           |  39 ++++
>  .../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 ++++++++++++++++++
>  6 files changed, 328 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
>
> diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
> index 9467e9d088..6ca615206f 100644
> --- a/tests/docker/Makefile.include
> +++ b/tests/docker/Makefile.include
> @@ -119,6 +119,12 @@ docker-image-debian-sparc64-cross: docker-image-debian-sid
>  docker-image-debian-mips64-cross: docker-image-debian-sid
>  docker-image-debian-riscv64-cross: docker-image-debian-sid
>  docker-image-debian-powerpc-cross: docker-image-debian-sid
> +docker-image-gentoo-mipsr5900el-cross: EXTRA_FILES:=$(addprefix \
> +			$(SRC_PATH)/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/,\
> +				crossdev.conf \
> +				binutils-v2.30-ps2-llsc.patch \
> +				gcc-v7.2.0-ps2.patch \
> +				gcc-v7.2.0-ps2-llsc.patch)

Ahh also you need to either overload DOCKER_PARTIAL_IMAGES or add a new
mechanism so we don't attempt to build qemu on this.

>  docker-image-travis: NOUSER=1
>
>  # Specialist build images, sometimes very limited tools
> diff --git a/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker b/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker
> new file mode 100644
> index 0000000000..dbc2eb007b
> --- /dev/null
> +++ b/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker
> @@ -0,0 +1,39 @@
> +#
> +# Docker mipsel (r5900) cross-compiler target
> +#
> +# Using multi-stage builds, this image requires docker-17.05.0 or later.
> +# (See: https://github.com/gentoo/gentoo-docker-images)
> +#
> +# SPDX-License-Identifier: GPL-2.0-or-later
> +
> +# name the portage image
> +FROM gentoo/portage:latest as portage
> +
> +# image is based on stage3-amd64
> +FROM gentoo/stage3-amd64:latest
> +
> +# copy the entire portage volume in
> +COPY --from=portage /usr/portage /usr/portage
> +
> +MAINTAINER Philippe Mathieu-Daudé <f4bug@amsat.org>
> +
> +# continue with image build ...
> +RUN emerge -qv sys-devel/crossdev
> +
> +# set CROSSDEV_OVERLAY to /usr/local/portage-crossdev
> +RUN mkdir -p /usr/local/portage-crossdev/{profiles,metadata} && \
> +    echo 'crossdev' > /usr/local/portage-crossdev/profiles/repo_name && \
> +    echo 'masters = gentoo' > /usr/local/portage-crossdev/metadata/layout.conf && \
> +    chown -R portage:portage /usr/local/portage-crossdev && \
> +    mkdir -p /etc/portage/repos.conf
> +ADD crossdev.conf /etc/portage/repos.conf/crossdev.conf
> +
> +# Fredrik's patches
> +RUN mkdir -p /etc/portage/patches/cross-mipsr5900el-unknown-linux-gnu/{binutils,gcc}
> +ADD binutils-v2.30-ps2-llsc.patch /etc/portage/patches/cross-mipsr5900el-unknown-linux-gnu/binutils
> +ADD gcc-v7.2.0-ps2.patch /etc/portage/patches/cross-mipsr5900el-unknown-linux-gnu/gcc
> +ADD gcc-v7.2.0-ps2-llsc.patch /etc/portage/patches/cross-mipsr5900el-unknown-linux-gnu/gcc
> +
> +RUN crossdev -s3 -t mipsr5900el-unknown-linux-gnu --binutils ">=2.30" --gcc ">=7.2.0"
> +
> +ENV QEMU_CONFIGURE_OPTS --cross-prefix=mipsr5900el-unknown-linux-gnu-
> diff --git a/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/binutils-v2.30-ps2-llsc.patch b/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/binutils-v2.30-ps2-llsc.patch
> new file mode 100644
> index 0000000000..62ecc3267a
> --- /dev/null
> +++ b/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/binutils-v2.30-ps2-llsc.patch
> @@ -0,0 +1,36 @@
> +diff --git a/opcodes/mips-opc.c b/opcodes/mips-opc.c
> +index 1cbcbc6..0986b0a 100644
> +--- a/opcodes/mips-opc.c
> ++++ b/opcodes/mips-opc.c
> +@@ -1280,11 +1280,11 @@ const struct mips_opcode mips_builtin_opcodes[] =
> + {"li.s",		"t,f",		0,    (int) M_LI_S,	INSN_MACRO,		INSN2_M_FP_S,	I1,		0,	0 },
> + {"li.s",		"T,l",		0,    (int) M_LI_SS,	INSN_MACRO,		INSN2_M_FP_S,	I1,		0,	0 },
> + {"ll",			"t,+j(b)",	0x7c000036, 0xfc00007f, WR_1|RD_3|LM,		0,		I37,		0,	0 },
> +-{"ll",			"t,o(b)",	0xc0000000, 0xfc000000, WR_1|RD_3|LM,		0,		I2,		0,	EE|I37 },
> +-{"ll",			"t,A(b)",	0,    (int) M_LL_AB,	INSN_MACRO,		0,		I2,		0,	EE },
> ++{"ll",			"t,o(b)",	0xc0000000, 0xfc000000, WR_1|RD_3|LM,		0,		I2,		0,	I37 },
> ++{"ll",			"t,A(b)",	0,    (int) M_LL_AB,	INSN_MACRO,		0,		I2,		0,	0 },
> + {"lld",			"t,+j(b)",	0x7c000037, 0xfc00007f, WR_1|RD_3|LM,		0,		I69,		0,	0 },
> +-{"lld",			"t,o(b)",	0xd0000000, 0xfc000000, WR_1|RD_3|LM,		0,		I3,		0,	EE|I69 },
> +-{"lld",			"t,A(b)",	0,    (int) M_LLD_AB,	INSN_MACRO,		0,		I3,		0,	EE },
> ++{"lld",			"t,o(b)",	0xd0000000, 0xfc000000, WR_1|RD_3|LM,		0,		I3,		0,	I69 },
> ++{"lld",			"t,A(b)",	0,    (int) M_LLD_AB,	INSN_MACRO,		0,		I3,		0,	0 },
> + {"lq",			"t,o(b)",	0x78000000, 0xfc000000, WR_1|RD_3|LM,		0,		MMI,		0,	0 },
> + {"lq",			"t,A(b)",	0,    (int) M_LQ_AB,	INSN_MACRO,		0,		MMI,		0,	0 },
> + {"lqc2",		"+7,o(b)",	0xd8000000, 0xfc000000,	RD_3|WR_C2|LM,		0,		EE,		0,	0 },
> +@@ -1810,11 +1810,11 @@ const struct mips_opcode mips_builtin_opcodes[] =
> + {"sb",			"t,o(b)",	0xa0000000, 0xfc000000,	RD_1|RD_3|SM,		0,		I1,		0,	0 },
> + {"sb",			"t,A(b)",	0,    (int) M_SB_AB,	INSN_MACRO,		0,		I1,		0,	0 },
> + {"sc",			"t,+j(b)",	0x7c000026, 0xfc00007f, MOD_1|RD_3|SM,		0,		I37,		0,	0 },
> +-{"sc",			"t,o(b)",	0xe0000000, 0xfc000000, MOD_1|RD_3|SM,		0,		I2,		0,	EE|I37 },
> +-{"sc",			"t,A(b)",	0,    (int) M_SC_AB,	INSN_MACRO,		0,		I2,		0,	EE },
> ++{"sc",			"t,o(b)",	0xe0000000, 0xfc000000, MOD_1|RD_3|SM,		0,		I2,		0,	I37 },
> ++{"sc",			"t,A(b)",	0,    (int) M_SC_AB,	INSN_MACRO,		0,		I2,		0,	0 },
> + {"scd",			"t,+j(b)",	0x7c000027, 0xfc00007f, MOD_1|RD_3|SM,		0,		I69,		0,	0 },
> +-{"scd",			"t,o(b)",	0xf0000000, 0xfc000000, MOD_1|RD_3|SM,		0,		I3,		0,	EE|I69 },
> +-{"scd",			"t,A(b)",	0,    (int) M_SCD_AB,	INSN_MACRO,		0,		I3,		0,	EE },
> ++{"scd",			"t,o(b)",	0xf0000000, 0xfc000000, MOD_1|RD_3|SM,		0,		I3,		0,	I69 },
> ++{"scd",			"t,A(b)",	0,    (int) M_SCD_AB,	INSN_MACRO,		0,		I3,		0,	0 },
> + /* The macro has to be first to handle o32 correctly.  */
> + {"sd",			"t,A(b)",	0,    (int) M_SD_AB,	INSN_MACRO,		0,		I1,		0,	0 },
> + {"sd",			"t,o(b)",	0xfc000000, 0xfc000000,	RD_1|RD_3|SM,		0,		I3,		0,	0 },
> diff --git a/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/crossdev.conf b/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/crossdev.conf
> new file mode 100644
> index 0000000000..b8fa368c1c
> --- /dev/null
> +++ b/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/crossdev.conf
> @@ -0,0 +1,5 @@
> +[crossdev]
> +location = /usr/local/portage-crossdev
> +priority = 10
> +masters = gentoo
> +auto-sync = no
> diff --git a/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/gcc-v7.2.0-ps2-llsc.patch b/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/gcc-v7.2.0-ps2-llsc.patch
> new file mode 100644
> index 0000000000..59bc0e6e83
> --- /dev/null
> +++ b/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/gcc-v7.2.0-ps2-llsc.patch
> @@ -0,0 +1,23 @@
> +diff --git a/gcc/config.gcc b/gcc/config.gcc
> +index a9196cd..5b497f6 100644
> +--- a/gcc/config.gcc
> ++++ b/gcc/config.gcc
> +@@ -3558,14 +3558,14 @@ fi
> + # Infer a default setting for --with-llsc.
> + if test x$with_llsc = x; then
> +   case ${target} in
> +-    mips64r5900-*-* | mips64r5900el-*-* | mipsr5900-*-* | mipsr5900el-*-*)
> +-      # The R5900 doesn't support LL(D) and SC(D).
> +-      with_llsc=no
> +-      ;;
> +     mips*-*-linux*)
> +       # The kernel emulates LL and SC where necessary.
> +       with_llsc=yes
> +       ;;
> ++    mips64r5900-*-* | mips64r5900el-*-* | mipsr5900-*-* | mipsr5900el-*-*)
> ++      # The R5900 doesn't support LL(D) and SC(D).
> ++      with_llsc=no
> ++      ;;
> +   esac
> + fi
> +
> diff --git a/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/gcc-v7.2.0-ps2.patch b/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/gcc-v7.2.0-ps2.patch
> new file mode 100644
> index 0000000000..a3337dbf61
> --- /dev/null
> +++ b/tests/docker/dockerfiles/gentoo-mipsr5900el-cross.docker.d/gcc-v7.2.0-ps2.patch
> @@ -0,0 +1,219 @@
> +commit ff785b9af62d5dfe1c0e3d3cf0052e7b5cf281ad
> +Author: Rick Gaiser <rgaiser@gmail.com>
> +Date:   Thu Apr 26 22:30:11 2018 +0200
> +
> +    Apply gcc-7.2.0-libgcc.patch from uyjulian
> +
> +diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
> +index 6bfd86a..2996ebc 100644
> +--- a/gcc/config/mips/mips.c
> ++++ b/gcc/config/mips/mips.c
> +@@ -19747,6 +19747,11 @@ mips_option_override (void)
> +     error ("unsupported combination: %s",
> + 	   "-march=r5900 -mhard-float -mdouble-float");
> +
> ++  /* The R5900 does not support some MIPS16 instructions.  */
> ++  if (TARGET_MIPS5900 && ((mips_base_compression_flags & MASK_MIPS16) != 0))
> ++	  error("unsupported combination: %s",
> ++		  "-march=r5900 -mips16");
> ++
> +   /* If a -mlong* option was given, check that it matches the ABI,
> +      otherwise infer the -mlong* setting from the other options.  */
> +   if ((target_flags_explicit & MASK_LONG64) != 0)
> +diff --git a/libgcc/config.host b/libgcc/config.host
> +index bedcf10..4a85a15 100644
> +--- a/libgcc/config.host
> ++++ b/libgcc/config.host
> +@@ -144,7 +144,11 @@ mips*-*-*)
> + 	cpu_type=mips
> + 	tmake_file="mips/t-mips"
> + 	if test "${libgcc_cv_mips_hard_float}" = yes; then
> ++	    if test "${libgcc_cv_mips_single_float}" = yes; then
> ++                tmake_file="${tmake_file} t-hardfp-sf t-hardfp"
> ++	    else
> + 		tmake_file="${tmake_file} t-hardfp-sfdf t-hardfp"
> ++	    fi
> + 	else
> + 		tmake_file="${tmake_file} t-softfp-sfdf"
> + 	fi
> +@@ -858,19 +862,16 @@ mips*-*-netbsd*)			# NetBSD/mips, either endian.
> + mips*-*-linux*)				# Linux MIPS, either endian.
> + 	extra_parts="$extra_parts crtfastmath.o"
> + 	tmake_file="${tmake_file} t-crtfm"
> +-	case ${host} in
> +-	  mips64r5900* | mipsr5900*)
> +-	    # The MIPS16 support code uses floating point
> +-	    # instructions that are not supported on r5900.
> +-	    ;;
> +-	  *)
> ++    if test "${libgcc_cv_mips16}" = yes; then
> + 	    tmake_file="${tmake_file} mips/t-mips16 t-slibgcc-libgcc"
> +-	    ;;
> +-	esac
> ++    fi
> + 	md_unwind_header=mips/linux-unwind.h
> + 	;;
> + mips*-sde-elf*)
> +-	tmake_file="$tmake_file mips/t-crtstuff mips/t-mips16"
> ++	tmake_file="$tmake_file mips/t-crtstuff"
> ++    if test "${libgcc_cv_mips16}" = yes; then
> ++	  tmake_file="${tmake_file} mips/t-mips16"
> ++    fi
> + 	case "${with_newlib}" in
> + 	  yes)
> + 	    # newlib / libgloss.
> +@@ -900,7 +901,10 @@ mipsisa64sb1-*-elf* | mipsisa64sb1el-*-elf*)
> + 	extra_parts="$extra_parts crti.o crtn.o"
> + 	;;
> + mips-*-elf* | mipsel-*-elf*)
> +-	tmake_file="$tmake_file mips/t-elf mips/t-crtstuff mips/t-mips16"
> ++	tmake_file="$tmake_file mips/t-elf mips/t-crtstuff"
> ++    if test "${libgcc_cv_mips16}" = yes; then
> ++	  tmake_file="${tmake_file} mips/t-mips16"
> ++    fi
> + 	extra_parts="$extra_parts crti.o crtn.o"
> + 	;;
> + mipsr5900-*-elf* | mipsr5900el-*-elf*)
> +@@ -908,7 +912,10 @@ mipsr5900-*-elf* | mipsr5900el-*-elf*)
> + 	extra_parts="$extra_parts crti.o crtn.o"
> + 	;;
> + mips64-*-elf* | mips64el-*-elf*)
> +-	tmake_file="$tmake_file mips/t-elf mips/t-crtstuff mips/t-mips16"
> ++	tmake_file="$tmake_file mips/t-elf mips/t-crtstuff"
> ++    if test "${libgcc_cv_mips16}" = yes; then
> ++	  tmake_file="${tmake_file} mips/t-mips16"
> ++    fi
> + 	extra_parts="$extra_parts crti.o crtn.o"
> + 	;;
> + mips64r5900-*-elf* | mips64r5900el-*-elf*)
> +@@ -924,7 +931,10 @@ mips64orion-*-elf* | mips64orionel-*-elf*)
> + 	extra_parts="$extra_parts crti.o crtn.o"
> + 	;;
> + mips*-*-rtems*)
> +-	tmake_file="$tmake_file mips/t-elf mips/t-crtstuff mips/t-mips16"
> ++	tmake_file="$tmake_file mips/t-elf mips/t-crtstuff"
> ++    if test "${libgcc_cv_mips16}" = yes; then
> ++	  tmake_file="${tmake_file} mips/t-mips16"
> ++    fi
> + 	extra_parts="$extra_parts crti.o crtn.o"
> + 	;;
> + mips-wrs-vxworks)
> +diff --git a/libgcc/config/t-hardfp-sf b/libgcc/config/t-hardfp-sf
> +new file mode 100644
> +index 0000000..e63ad47
> +--- /dev/null
> ++++ b/libgcc/config/t-hardfp-sf
> +@@ -0,0 +1,32 @@
> ++# Copyright (C) 2014-2015 Free Software Foundation, Inc.
> ++
> ++# This file is part of GCC.
> ++
> ++# GCC is free software; you can redistribute it and/or modify
> ++# it under the terms of the GNU General Public License as published by
> ++# the Free Software Foundation; either version 3, or (at your option)
> ++# any later version.
> ++
> ++# GCC is distributed in the hope that it will be useful,
> ++# but WITHOUT ANY WARRANTY; without even the implied warranty of
> ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> ++# GNU General Public License for more details.
> ++
> ++# You should have received a copy of the GNU General Public License
> ++# along with GCC; see the file COPYING3.  If not see
> ++# <http://www.gnu.org/licenses/>.
> ++
> ++hardfp_float_modes := sf
> ++# di and ti are provided by libgcc2.c where needed.
> ++hardfp_int_modes := si
> ++hardfp_extensions :=
> ++hardfp_truncations :=
> ++
> ++# Emulate 64 bit float:
> ++FPBIT = true
> ++DPBIT = true
> ++# Don't build functions handled by 32 bit hardware:
> ++LIB2FUNCS_EXCLUDE = _addsub_sf _mul_sf _div_sf \
> ++    _fpcmp_parts_sf _compare_sf _eq_sf _ne_sf _gt_sf _ge_sf \
> ++    _lt_sf _le_sf _unord_sf _si_to_sf _sf_to_si _negate_sf \
> ++    _thenan_sf _sf_to_usi _usi_to_sf
> +diff --git a/libgcc/configure b/libgcc/configure
> +index 42dda7f..716bba9 100644
> +--- a/libgcc/configure
> ++++ b/libgcc/configure
> +@@ -4871,6 +4871,48 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
> + fi
> + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgcc_cv_mips_hard_float" >&5
> + $as_echo "$libgcc_cv_mips_hard_float" >&6; }
> ++  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the target is single-float" >&5
> ++$as_echo_n "checking whether the target is single-float... " >&6; }
> ++if test "${libgcc_cv_mips_single_float+set}" = set; then :
> ++  $as_echo_n "(cached) " >&6
> ++else
> ++  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
> ++/* end confdefs.h.  */
> ++#ifndef __mips_single_float
> ++     #error FOO
> ++     #endif
> ++_ACEOF
> ++if ac_fn_c_try_compile "$LINENO"; then :
> ++  libgcc_cv_mips_single_float=yes
> ++else
> ++  libgcc_cv_mips_single_float=no
> ++fi
> ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
> ++fi
> ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgcc_cv_mips_single_float" >&5
> ++$as_echo "$libgcc_cv_mips_single_float" >&6; }
> ++  # Some targets (i.e. R5900) don't support some MIPS16 instructions.
> ++  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the target supports the MIPS16 ASE" >&5
> ++$as_echo_n "checking whether the target supports MIPS16 ASE... " >&6; }
> ++if test "${libgcc_cv_mips16+set}" = set; then :
> ++  $as_echo_n "(cached) " >&6
> ++else
> ++  CFLAGS_hold=$CFLAGS
> ++		 CFLAGS="$CFLAGS -mips16"
> ++		 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
> ++/* end confdefs.h.  */
> ++int i;
> ++_ACEOF
> ++if ac_fn_c_try_compile "$LINENO"; then :
> ++  libgcc_cv_mips16=yes
> ++else
> ++  libgcc_cv_mips16=no
> ++fi
> ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
> ++	CFLAGS=$CFLAGS_hold
> ++fi
> ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgcc_cv_mips16" >&5
> ++$as_echo "$libgcc_cv_mips16" >&6; }
> + esac
> +
> + case ${host} in
> +diff --git a/libgcc/configure.ac b/libgcc/configure.ac
> +index 6bcaad6..5bce467 100644
> +--- a/libgcc/configure.ac
> ++++ b/libgcc/configure.ac
> +@@ -292,6 +292,23 @@ mips*-*-*)
> +      #endif],
> +     [libgcc_cv_mips_hard_float=yes],
> +     [libgcc_cv_mips_hard_float=no])])
> ++  AC_CACHE_CHECK([whether the target is single-float],
> ++		 [libgcc_cv_mips_single_float],
> ++		 [AC_COMPILE_IFELSE(
> ++    [#ifndef __mips_single_float
> ++     #error FOO
> ++     #endif],
> ++    [libgcc_cv_mips_single_float=yes],
> ++    [libgcc_cv_mips_single_float=no])])
> ++  # Some targets (i.e. R5900) don't support some MIPS16 instructions.
> ++  AC_CACHE_CHECK([whether the target supports the MIPS16 ASE],
> ++		 [libgcc_cv_mips16],
> ++		 [CFLAGS_hold=$CFLAGS
> ++		 CFLAGS="$CFLAGS -mips16"
> ++		 AC_COMPILE_IFELSE([[int i;]],
> ++    [libgcc_cv_mips16=yes],
> ++    [libgcc_cv_mips16=no])
> ++	CFLAGS=$CFLAGS_hold])
> + esac
> +
> + case ${host} in


--
Alex Bennée

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

* Re: [Qemu-devel] [RFC PATCH 0/2] docker: Add gentoo-mipsr5900el-cross image
  2018-11-19 15:29 ` Fredrik Noring
@ 2018-11-19 15:46   ` Maciej W. Rozycki
  2018-11-19 16:27     ` Fredrik Noring
  0 siblings, 1 reply; 13+ messages in thread
From: Maciej W. Rozycki @ 2018-11-19 15:46 UTC (permalink / raw)
  To: Fredrik Noring
  Cc: Philippe Mathieu-Daudé,
	Alex Bennée, Fam Zheng, qemu-devel, Mike Frysinger,
	Jürgen Urban

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

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

* Re: [Qemu-devel] [RFC PATCH 1/2] docker: Add gentoo-mipsr5900el-cross image
  2018-11-19 12:23   ` Alex Bennée
  2018-11-19 14:11     ` Philippe Mathieu-Daudé
@ 2018-11-19 15:55     ` Fredrik Noring
  1 sibling, 0 replies; 13+ messages in thread
From: Fredrik Noring @ 2018-11-19 15:55 UTC (permalink / raw)
  To: Alex Bennée
  Cc: Philippe Mathieu-Daudé,
	Fam Zheng, qemu-devel, Mike Frysinger, Maciej W. Rozycki,
	Jürgen Urban

Hi Alex,

> This fails to build glibc, but doesn't exactly give much info:
> 
>    * Log: /var/log/portage/cross-mipsr5900el-unknown-linux-gnu-binutils.log
>    * Emerging cross-binutils ...                                            [ ok ]
>    * Log: /var/log/portage/cross-mipsr5900el-unknown-linux-gnu-linux-headers-quick.log
>    * Emerging cross-linux-headers-quick ...                                 [ ok ]
>    * Log: /var/log/portage/cross-mipsr5900el-unknown-linux-gnu-glibc-headers.log
>    * Emerging cross-glibc-headers ...
> 
>    * error: glibc failed :(
>    *
>    * If you file a bug, please attach the following logfiles:
>    * /var/log/portage/cross-mipsr5900el-unknown-linux-gnu-info.log
>    * /var/log/portage/cross-mipsr5900el-unknown-linux-gnu-glibc-headers.log.xz
>    * /var/tmp/portage/cross-mipsr5900el-unknown-linux-gnu/glibc*/temp/glibc-config.logs.tar.xz
>   The command '/bin/sh -c crossdev -s3 -t mipsr5900el-unknown-linux-gnu --binutils ">=2.30" --gcc ">=7.2.0"' returned a non-zero code: 1

I would recommend using GCC 8.2.0, by omitting the --binutils and --gcc
options to crossdev, unless you would like to debug this particular
combination of GCC and Glibc (which I can confirm seems broke). Updated
and much simplified R5900 patches are available in my previous email:

http://lists.nongnu.org/archive/html/qemu-devel/2018-11/msg03649.html

Hopefully soon, with upcoming GCC and Gblic releases, no R5900 patches
are needed at all. Also, a new -mfix-r5900 option has been proposed to
both GAS and GCC:

http://www.sourceware.org/ml/binutils/2018-10/msg00301.html

https://gcc.gnu.org/ml/gcc-patches/2018-11/msg00773.html

With that option one can compile e.g. MIPS II or MIPS III that also
work with the R5900.

The R3900 and the R5900 could for example run the same programs then,
and I do hope that Philippe will be able to merge his R3900 series
eventually.

Fredrik

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

* Re: [Qemu-devel] [RFC PATCH 0/2] docker: Add gentoo-mipsr5900el-cross image
  2018-11-19 15:46   ` Maciej W. Rozycki
@ 2018-11-19 16:27     ` Fredrik Noring
  0 siblings, 0 replies; 13+ messages in thread
From: Fredrik Noring @ 2018-11-19 16:27 UTC (permalink / raw)
  To: Maciej W. Rozycki
  Cc: Philippe Mathieu-Daudé,
	Alex Bennée, Fam Zheng, qemu-devel, Mike Frysinger,
	Jürgen Urban

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

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

end of thread, other threads:[~2018-11-19 16:51 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-18 20:33 [Qemu-devel] [RFC PATCH 0/2] docker: Add gentoo-mipsr5900el-cross image Philippe Mathieu-Daudé
2018-11-18 20:33 ` [Qemu-devel] [RFC PATCH 1/2] " Philippe Mathieu-Daudé
2018-11-19 10:25   ` Philippe Mathieu-Daudé
2018-11-19 12:23   ` Alex Bennée
2018-11-19 14:11     ` Philippe Mathieu-Daudé
2018-11-19 15:55     ` Fredrik Noring
2018-11-19 13:44   ` Alex Bennée
2018-11-19 15:34   ` Alex Bennée
2018-11-18 20:33 ` [Qemu-devel] [RFC PATCH 2/2] shippable: Add the mipsr5900el linux-user target Philippe Mathieu-Daudé
2018-11-18 21:03 ` [Qemu-devel] [RFC PATCH 0/2] docker: Add gentoo-mipsr5900el-cross image no-reply
2018-11-19 15:29 ` Fredrik Noring
2018-11-19 15:46   ` Maciej W. Rozycki
2018-11-19 16:27     ` Fredrik Noring

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.