From 8a7b2e46194777191cc15cb9d6581f103e334665 Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Thu, 13 Jan 2022 11:32:34 +0500 Subject: [PATCH] Add vendored RISC-V cross-compiler --- .gitignore | 7 +++++-- vendor/cross/build/riscv64/binutils/.keep | 0 vendor/cross/build/riscv64/build.sh | 21 +++++++++++++++++++++ vendor/cross/build/riscv64/gcc/.keep | 0 4 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 vendor/cross/build/riscv64/binutils/.keep create mode 100755 vendor/cross/build/riscv64/build.sh create mode 100644 vendor/cross/build/riscv64/gcc/.keep diff --git a/.gitignore b/.gitignore index 7a80ba2..6c1cab7 100644 --- a/.gitignore +++ b/.gitignore @@ -67,12 +67,15 @@ /vendor/cross/build/i386/binutils/* !/vendor/cross/build/i386/binutils/.keep - /vendor/cross/build/i386/gcc/* !/vendor/cross/build/i386/gcc/.keep +/vendor/cross/build/riscv64/binutils/* +!/vendor/cross/build/riscv64/binutils/.keep +/vendor/cross/build/riscv64/gcc/* +!/vendor/cross/build/riscv64/gcc/.keep + /vendor/cross/build/x86_64/binutils/* !/vendor/cross/build/x86_64/binutils/.keep - /vendor/cross/build/x86_64/gcc/* !/vendor/cross/build/x86_64/gcc/.keep diff --git a/vendor/cross/build/riscv64/binutils/.keep b/vendor/cross/build/riscv64/binutils/.keep new file mode 100644 index 0000000..e69de29 diff --git a/vendor/cross/build/riscv64/build.sh b/vendor/cross/build/riscv64/build.sh new file mode 100755 index 0000000..3598fc1 --- /dev/null +++ b/vendor/cross/build/riscv64/build.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +set -e + +ARCH='riscv64' +TARGET="$ARCH-elf" +REPO="$(pwd)" +PREFIX="$REPO/vendor/cross" +PATH="$PREFIX/bin:$PATH" + +if [ -z "$J" ]; then J='1'; fi + +cd "$REPO/vendor/cross/build/$ARCH/binutils" +../../../../binutils-2.37/configure --target="$TARGET" --prefix="$PREFIX" --with-sysroot --disable-nls --disable-werror +make -j"$J" +make install + +cd "$REPO/vendor/cross/build/$ARCH/gcc" +../../../../gcc-11.2.0/configure --target="$TARGET" --prefix="$PREFIX" --disable-nls --enable-languages=c,c++ --without-headers +make -j"$J" all-gcc all-target-libgcc +make install-gcc install-target-libgcc diff --git a/vendor/cross/build/riscv64/gcc/.keep b/vendor/cross/build/riscv64/gcc/.keep new file mode 100644 index 0000000..e69de29