mirror of
https://github.com/golang/sys.git
synced 2026-02-08 11:46:04 +03:00
Add syscall wrappers, error constants and types for linux/riscv64 Switch docker image to Ubuntu 18.10 in order to get qemu supporting riscv64. Also set the uname release string for qemu to 4.15 (the first Linux kernel version with riscv64 support), because otherwise running the generating C program in mkerrors.sh on a host with an older kernel would fail with a "FATAL: kernel too old". Note that linux/riscv64 is currently only usable using gccgo. Updates golang/go#27532 Change-Id: Ic420f842342418443474cac72d38adff14d1b938 Reviewed-on: https://go-review.googlesource.com/133735 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
54 lines
2.1 KiB
Docker
54 lines
2.1 KiB
Docker
FROM ubuntu:18.10
|
|
|
|
# Dependencies to get the git sources and go binaries
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
ca-certificates \
|
|
curl \
|
|
git \
|
|
&& apt-get clean \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Get the git sources. If not cached, this takes O(5 minutes).
|
|
WORKDIR /git
|
|
RUN git config --global advice.detachedHead false
|
|
# Linux Kernel: Released 12 Aug 2018
|
|
RUN git clone --branch v4.18 --depth 1 https://kernel.googlesource.com/pub/scm/linux/kernel/git/torvalds/linux
|
|
# GNU C library: Released 01 Aug 2018 (we should try to get a secure way to clone this)
|
|
RUN git clone --branch glibc-2.28 --depth 1 git://sourceware.org/git/glibc.git
|
|
|
|
# Get Go
|
|
ENV GOLANG_VERSION 1.11
|
|
ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
|
|
ENV GOLANG_DOWNLOAD_SHA256 b3fcf280ff86558e0559e185b601c9eade0fd24c900b4c63cd14d1d38613e499
|
|
|
|
RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz \
|
|
&& echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - \
|
|
&& tar -C /usr/local -xzf golang.tar.gz \
|
|
&& rm golang.tar.gz
|
|
|
|
ENV PATH /usr/local/go/bin:$PATH
|
|
|
|
# Linux and Glibc build dependencies and emulator
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
bison gawk make python \
|
|
gcc gcc-multilib \
|
|
gettext texinfo \
|
|
qemu-user \
|
|
&& apt-get clean \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
# Cross compilers (install recommended packages to get cross libc-dev)
|
|
RUN apt-get update && apt-get install -y \
|
|
gcc-aarch64-linux-gnu gcc-arm-linux-gnueabi \
|
|
gcc-mips-linux-gnu gcc-mips64-linux-gnuabi64 \
|
|
gcc-mips64el-linux-gnuabi64 gcc-mipsel-linux-gnu \
|
|
gcc-powerpc64-linux-gnu gcc-powerpc64le-linux-gnu \
|
|
gcc-riscv64-linux-gnu \
|
|
gcc-s390x-linux-gnu gcc-sparc64-linux-gnu \
|
|
&& apt-get clean \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Let the scripts know they are in the docker environment
|
|
ENV GOLANG_SYS_BUILD docker
|
|
WORKDIR /build
|
|
ENTRYPOINT ["go", "run", "linux/mkall.go", "/git/linux", "/git/glibc"]
|