mirror of
https://github.com/rwinkhart/sys.git
synced 2026-08-30 05:46:45 -04:00
unix: add generate component files support for linux/loong64
Updates golang/go#46229 Change-Id: If0ee99997360608d7ba218880a1ef180ca6db551 Reviewed-on: https://go-review.googlesource.com/c/sys/+/399336 Reviewed-by: Matt Layher <mdlayher@gmail.com> Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Than McIntosh <thanm@google.com>
This commit is contained in:
@@ -20,6 +20,13 @@ RUN git clone --branch v5.17 --depth 1 https://kernel.googlesource.com/pub/scm/l
|
||||
# GNU C library: Released 03 Feb 2022
|
||||
RUN git clone --branch release/2.35/master --depth 1 https://sourceware.org/git/glibc.git
|
||||
|
||||
# Only for loong64, add kernel and glibc patch
|
||||
RUN git clone https://github.com/loongson/golang-infra.git /git/loong64-patches \
|
||||
&& git config --global user.name "golang" && git config --global user.email "golang@localhost" \
|
||||
&& cd /git/loong64-patches && git checkout linux-v5.17 && cd /git/linux && git am /git/loong64-patches/*.patch \
|
||||
&& cd /git/loong64-patches && git checkout glibc-v2.35 && cd /git/glibc && git am /git/loong64-patches/*.patch \
|
||||
&& curl -fsSL https://git.savannah.gnu.org/cgit/config.git/plain/config.sub -o /git/glibc/scripts/config.sub
|
||||
|
||||
# Get Go
|
||||
ENV GOLANG_VERSION 1.18
|
||||
ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
|
||||
@@ -51,6 +58,24 @@ RUN apt-get update && apt-get install -y \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Only for loong64, add patch and build golang
|
||||
RUN git clone https://go.googlesource.com/go --branch go1.18 /git/go \
|
||||
&& cd /git/loong64-patches && git checkout go-v1.18 && cd /git/go && git am /git/loong64-patches/*.patch \
|
||||
&& rm -rf /git/loong64-patches && cd /git/go/src && ./make.bash
|
||||
|
||||
ENV PATH /git/go/bin:$PATH
|
||||
|
||||
# Only for loong64, getting tools of qemu-user and gcc-cross-compiler
|
||||
RUN apt-get update && apt-get install wget xz-utils -y && mkdir /loong64 && cd /loong64 \
|
||||
&& wget -q https://github.com/loongson/build-tools/releases/download/2021.12.21/qemu-loongarch-2022-4-01.tar.gz \
|
||||
&& tar xf qemu-loongarch-2022-4-01.tar.gz && cp ./4-1/new-world/qemu-loongarch64 /usr/bin/ \
|
||||
&& rm -rf qemu-loongarch-2022-4-01.tar.gz 4-1 \
|
||||
&& wget -q https://github.com/loongson/build-tools/releases/download/2021.12.21/loongarch64-clfs-2022-03-03-cross-tools-gcc-glibc.tar.xz \
|
||||
&& tar xf loongarch64-clfs-2022-03-03-cross-tools-gcc-glibc.tar.xz && mv cross-tools.gcc_glibc /usr/local/cross-tools-loong64 \
|
||||
&& rm -rf loongarch64-clfs-2022-03-03-cross-tools-gcc-glibc.tar.xz \
|
||||
&& ln -s /usr/local/cross-tools-loong64/bin/loongarch64-unknown-linux-gnu-gcc /usr/bin/loongarch64-linux-gnu-gcc \
|
||||
&& rm -rf /loong64
|
||||
|
||||
# Let the scripts know they are in the docker environment
|
||||
ENV GOLANG_SYS_BUILD docker
|
||||
WORKDIR /build/unix
|
||||
|
||||
@@ -83,6 +83,12 @@ var targets = []target{
|
||||
GNUArch: "arm-linux-gnueabi",
|
||||
Bits: 32,
|
||||
},
|
||||
{
|
||||
GoArch: "loong64",
|
||||
LinuxArch: "loongarch",
|
||||
GNUArch: "loongarch64-linux-gnu",
|
||||
Bits: 64,
|
||||
},
|
||||
{
|
||||
GoArch: "mips",
|
||||
LinuxArch: "mips",
|
||||
|
||||
+3
-2
@@ -308,7 +308,7 @@ struct my_sockaddr_nfc_llcp {
|
||||
|
||||
#ifdef __ARM_EABI__
|
||||
typedef struct user_regs PtraceRegs;
|
||||
#elif defined(__aarch64__)
|
||||
#elif defined(__aarch64__) || defined(__loongarch64)
|
||||
typedef struct user_pt_regs PtraceRegs;
|
||||
#elif defined(__mips__) || defined(__powerpc__) || defined(__powerpc64__)
|
||||
typedef struct pt_regs PtraceRegs;
|
||||
@@ -339,7 +339,8 @@ struct my_epoll_event {
|
||||
// alignment requirements of EABI
|
||||
int32_t padFd;
|
||||
#elif defined(__powerpc__) || defined(__powerpc64__) || defined(__s390x__) || defined(__sparc__) \
|
||||
|| defined(__riscv) || (defined(__mips__) && _MIPS_SIM == _MIPS_SIM_ABI64)
|
||||
|| defined(__riscv) || (defined(__mips__) && _MIPS_SIM == _MIPS_SIM_ABI64) \
|
||||
|| defined(__loongarch64)
|
||||
int32_t _padFd;
|
||||
#endif
|
||||
int32_t fd;
|
||||
|
||||
Reference in New Issue
Block a user