diff mbox series

[v4,38/49] tests/tcg: enable building for Alpha

Message ID 20180517174718.10107-39-alex.bennee@linaro.org
State New
Headers show
Series fix building of tests/tcg | expand

Commit Message

Alex Bennée May 17, 2018, 5:47 p.m. UTC
We can't use our normal Debian based compilers as Alpha isn't an
officially supported architecture. However it is available as a port
and fortunately cross compilers for all these targets are included in
Debian Sid, the perpetual rolling/unstable/testing version of Debian.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 tests/docker/Makefile.include                 |  1 +
 .../dockerfiles/debian-alpha-cross.docker     | 12 +++++++
 .../dockerfiles/debian-cross-build.docker     | 36 +++++++++++++++++++
 tests/docker/dockerfiles/debian-sid.docker    | 23 ++++++++++++
 tests/tcg/alpha/Makefile.include              |  2 ++
 5 files changed, 74 insertions(+)
 create mode 100644 tests/docker/dockerfiles/debian-alpha-cross.docker
 create mode 100644 tests/docker/dockerfiles/debian-cross-build.docker
 create mode 100644 tests/docker/dockerfiles/debian-sid.docker
 create mode 100644 tests/tcg/alpha/Makefile.include

Comments

Philippe Mathieu-Daudé May 18, 2018, 2:21 p.m. UTC | #1
Hi Alex,

On 05/17/2018 02:47 PM, Alex Bennée wrote:
> We can't use our normal Debian based compilers as Alpha isn't an
> officially supported architecture. However it is available as a port
> and fortunately cross compilers for all these targets are included in
> Debian Sid, the perpetual rolling/unstable/testing version of Debian.

I see 2/3 commits at once here.

> 
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>  tests/docker/Makefile.include                 |  1 +
>  .../dockerfiles/debian-alpha-cross.docker     | 12 +++++++
>  .../dockerfiles/debian-cross-build.docker     | 36 +++++++++++++++++++
>  tests/docker/dockerfiles/debian-sid.docker    | 23 ++++++++++++
>  tests/tcg/alpha/Makefile.include              |  2 ++
>  5 files changed, 74 insertions(+)
>  create mode 100644 tests/docker/dockerfiles/debian-alpha-cross.docker

^ Alpha

>  create mode 100644 tests/docker/dockerfiles/debian-cross-build.docker

^ for guest-tests I presume.

>  create mode 100644 tests/docker/dockerfiles/debian-sid.docker

^ cross base

I'd like to review the debian-sid.docker separately than the Alpha part.

>  create mode 100644 tests/tcg/alpha/Makefile.include
> 
> diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
> index 6a5aa9ec71..bcf44e80c4 100644
> --- a/tests/docker/Makefile.include
> +++ b/tests/docker/Makefile.include
> @@ -62,6 +62,7 @@ docker-image-debian-ppc64el-cross: docker-image-debian9
>  docker-image-debian-s390x-cross: docker-image-debian9
>  docker-image-debian-win32-cross: docker-image-debian8-mxe
>  docker-image-debian-win64-cross: docker-image-debian8-mxe
> +docker-image-debian-alpha-cross: docker-image-debian-sid
>  docker-image-travis: NOUSER=1
>  
>  # Expand all the pre-requistes for each docker image and test combination
> diff --git a/tests/docker/dockerfiles/debian-alpha-cross.docker b/tests/docker/dockerfiles/debian-alpha-cross.docker
> new file mode 100644
> index 0000000000..e446f7af3f
> --- /dev/null
> +++ b/tests/docker/dockerfiles/debian-alpha-cross.docker
> @@ -0,0 +1,12 @@
> +#
> +# Docker cross-compiler target
> +#
> +# This docker target builds on the debian sid base image which
> +# contains cross compilers for Debian "ports" targets.
> +#
> +FROM qemu:debian-sid
> +
> +RUN DEBIAN_FRONTEND=noninteractive eatmydata \
> +    apt-get install -y --no-install-recommends \
> +        gcc-alpha-linux-gnu \
> +        libc6.1-dev-alpha-cross
> diff --git a/tests/docker/dockerfiles/debian-cross-build.docker b/tests/docker/dockerfiles/debian-cross-build.docker
> new file mode 100644
> index 0000000000..c3611a7d3a
> --- /dev/null
> +++ b/tests/docker/dockerfiles/debian-cross-build.docker
> @@ -0,0 +1,36 @@
> +#
> +# Docker multiarch cross-compiler target
> +#
> +# This docker target is builds on Debian cross compiler targets to build distro
> +# with a selection of cross compilers for building test binaries.
> +#
> +# On its own you can't build much but the docker-foo-cross targets
> +# build on top of the base debian image.
> +#
> +FROM debian:stretch
> +
> +# Duplicate deb line as deb-src
> +RUN cat /etc/apt/sources.list | sed "s/^deb\ /deb-src /" >> /etc/apt/sources.list
> +
> +# Install common build utilities
> +RUN apt update
> +RUN DEBIAN_FRONTEND=noninteractive apt install -yy eatmydata
> +RUN DEBIAN_FRONTEND=noninteractive eatmydata \
> +    apt install -y --no-install-recommends \
> +        bison \
> +        build-essential \
> +        ca-certificates \
> +        flex \
> +        gettext \
> +        git \
> +        libgmp-dev \
> +        libmpfr-dev \
> +        libmpc-dev \
> +        pkg-config \
> +        psmisc \
> +        python \
> +        texinfo \
> +        wget \
> +        $(apt-get -s build-dep binutils | egrep ^Inst | cut -d\  -f2) \
> +        $(apt-get -s build-dep gcc | egrep ^Inst | cut -d\  -f2) \
> +        $(apt-get -s build-dep glibc | egrep ^Inst | cut -d\  -f2)
> diff --git a/tests/docker/dockerfiles/debian-sid.docker b/tests/docker/dockerfiles/debian-sid.docker
> new file mode 100644
> index 0000000000..adeb7134ca
> --- /dev/null
> +++ b/tests/docker/dockerfiles/debian-sid.docker
> @@ -0,0 +1,23 @@
> +#
> +# A number of our guests exist as ports only. We can either use the ports repo or get everything from SID
> +#
> +
> +FROM debian:sid-slim
> +
> +# Duplicate deb line as deb-src
> +RUN cat /etc/apt/sources.list | sed "s/^deb\ /deb-src /" >> /etc/apt/sources.list
> +
> +# Install common build utilities
> +RUN apt update
> +RUN DEBIAN_FRONTEND=noninteractive apt install -yy eatmydata
> +RUN DEBIAN_FRONTEND=noninteractive eatmydata \
> +    apt install -y --no-install-recommends \
> +        bison \
> +        build-essential \
> +        ca-certificates \
> +        flex \
> +        git \
> +        pkg-config \
> +        psmisc \
> +        python \
> +        texinfo
> diff --git a/tests/tcg/alpha/Makefile.include b/tests/tcg/alpha/Makefile.include
> new file mode 100644
> index 0000000000..c7dc48eadb
> --- /dev/null
> +++ b/tests/tcg/alpha/Makefile.include
> @@ -0,0 +1,2 @@
> +DOCKER_IMAGE=debian-alpha-cross
> +DOCKER_CROSS_COMPILER=alpha-linux-gnu-gcc
> 

Ignoring the Debian "Sid/unstable" problems (I'll develop this replying
to the cover), and using a snapshot:

-- >8 --
diff --git a/tests/docker/dockerfiles/debian-sid.docker
b/tests/docker/dockerfiles/debian-sid.docker
-# Duplicate deb line as deb-src
-RUN cat /etc/apt/sources.list | sed "s/^deb\ /deb-src /" >>
/etc/apt/sources.list
+# random 'working' snapshot
+RUN echo "deb
http://snapshot.debian.org/archive/debian/20180512T101008Z/ sid main" >
/etc/apt/sources.list && \
+    echo "deb-src
http://snapshot.debian.org/archive/debian/20180512T101008Z/ sid main" >>
/etc/apt/sources.list
--

For the Alpha part:
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
diff mbox series

Patch

diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
index 6a5aa9ec71..bcf44e80c4 100644
--- a/tests/docker/Makefile.include
+++ b/tests/docker/Makefile.include
@@ -62,6 +62,7 @@  docker-image-debian-ppc64el-cross: docker-image-debian9
 docker-image-debian-s390x-cross: docker-image-debian9
 docker-image-debian-win32-cross: docker-image-debian8-mxe
 docker-image-debian-win64-cross: docker-image-debian8-mxe
+docker-image-debian-alpha-cross: docker-image-debian-sid
 docker-image-travis: NOUSER=1
 
 # Expand all the pre-requistes for each docker image and test combination
diff --git a/tests/docker/dockerfiles/debian-alpha-cross.docker b/tests/docker/dockerfiles/debian-alpha-cross.docker
new file mode 100644
index 0000000000..e446f7af3f
--- /dev/null
+++ b/tests/docker/dockerfiles/debian-alpha-cross.docker
@@ -0,0 +1,12 @@ 
+#
+# Docker cross-compiler target
+#
+# This docker target builds on the debian sid base image which
+# contains cross compilers for Debian "ports" targets.
+#
+FROM qemu:debian-sid
+
+RUN DEBIAN_FRONTEND=noninteractive eatmydata \
+    apt-get install -y --no-install-recommends \
+        gcc-alpha-linux-gnu \
+        libc6.1-dev-alpha-cross
diff --git a/tests/docker/dockerfiles/debian-cross-build.docker b/tests/docker/dockerfiles/debian-cross-build.docker
new file mode 100644
index 0000000000..c3611a7d3a
--- /dev/null
+++ b/tests/docker/dockerfiles/debian-cross-build.docker
@@ -0,0 +1,36 @@ 
+#
+# Docker multiarch cross-compiler target
+#
+# This docker target is builds on Debian cross compiler targets to build distro
+# with a selection of cross compilers for building test binaries.
+#
+# On its own you can't build much but the docker-foo-cross targets
+# build on top of the base debian image.
+#
+FROM debian:stretch
+
+# Duplicate deb line as deb-src
+RUN cat /etc/apt/sources.list | sed "s/^deb\ /deb-src /" >> /etc/apt/sources.list
+
+# Install common build utilities
+RUN apt update
+RUN DEBIAN_FRONTEND=noninteractive apt install -yy eatmydata
+RUN DEBIAN_FRONTEND=noninteractive eatmydata \
+    apt install -y --no-install-recommends \
+        bison \
+        build-essential \
+        ca-certificates \
+        flex \
+        gettext \
+        git \
+        libgmp-dev \
+        libmpfr-dev \
+        libmpc-dev \
+        pkg-config \
+        psmisc \
+        python \
+        texinfo \
+        wget \
+        $(apt-get -s build-dep binutils | egrep ^Inst | cut -d\  -f2) \
+        $(apt-get -s build-dep gcc | egrep ^Inst | cut -d\  -f2) \
+        $(apt-get -s build-dep glibc | egrep ^Inst | cut -d\  -f2)
diff --git a/tests/docker/dockerfiles/debian-sid.docker b/tests/docker/dockerfiles/debian-sid.docker
new file mode 100644
index 0000000000..adeb7134ca
--- /dev/null
+++ b/tests/docker/dockerfiles/debian-sid.docker
@@ -0,0 +1,23 @@ 
+#
+# A number of our guests exist as ports only. We can either use the ports repo or get everything from SID
+#
+
+FROM debian:sid-slim
+
+# Duplicate deb line as deb-src
+RUN cat /etc/apt/sources.list | sed "s/^deb\ /deb-src /" >> /etc/apt/sources.list
+
+# Install common build utilities
+RUN apt update
+RUN DEBIAN_FRONTEND=noninteractive apt install -yy eatmydata
+RUN DEBIAN_FRONTEND=noninteractive eatmydata \
+    apt install -y --no-install-recommends \
+        bison \
+        build-essential \
+        ca-certificates \
+        flex \
+        git \
+        pkg-config \
+        psmisc \
+        python \
+        texinfo
diff --git a/tests/tcg/alpha/Makefile.include b/tests/tcg/alpha/Makefile.include
new file mode 100644
index 0000000000..c7dc48eadb
--- /dev/null
+++ b/tests/tcg/alpha/Makefile.include
@@ -0,0 +1,2 @@ 
+DOCKER_IMAGE=debian-alpha-cross
+DOCKER_CROSS_COMPILER=alpha-linux-gnu-gcc