commit b7315b7fd407e65eeb6f59a3c481964773bb9b3e Author: Alex Kotov Date: Mon Jan 17 23:18:42 2022 +0500 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..50fa83b --- /dev/null +++ b/.gitignore @@ -0,0 +1,20 @@ +/src/* +!/src/.keep + +/root/* +!/root/.keep + +/build/i386/binutils/* +!/build/i386/binutils/.keep +/build/i386/gcc/* +!/build/i386/gcc/.keep + +/build/riscv64/binutils/* +!/build/riscv64/binutils/.keep +/build/riscv64/gcc/* +!/build/riscv64/gcc/.keep + +/build/x86_64/binutils/* +!/build/x86_64/binutils/.keep +/build/x86_64/gcc/* +!/build/x86_64/gcc/.keep diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..88ab6c0 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Alex Kotov + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/build/i386/binutils/.keep b/build/i386/binutils/.keep new file mode 100644 index 0000000..e69de29 diff --git a/build/i386/build.sh b/build/i386/build.sh new file mode 100755 index 0000000..ee8696c --- /dev/null +++ b/build/i386/build.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +set -e + +REPO="$(realpath "$(dirname "$(realpath "$0")")/../..")" + +ARCH='i386' +TARGET="$ARCH-elf" + +ROOT="$REPO/root" +PATH="$ROOT/bin:$PATH" + +if [ -z "$J" ]; then J='1'; fi + +cd "$REPO/build/$ARCH/binutils" +"$REPO/src/binutils-2.37/configure" --target="$TARGET" --prefix="$ROOT" --with-sysroot --disable-nls --disable-werror +make -j"$J" +make install + +cd "$REPO/build/$ARCH/gcc" +"$REPO/src/gcc-11.2.0/configure" --target="$TARGET" --prefix="$ROOT" --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/build/i386/gcc/.keep b/build/i386/gcc/.keep new file mode 100644 index 0000000..e69de29 diff --git a/build/riscv64/binutils/.keep b/build/riscv64/binutils/.keep new file mode 100644 index 0000000..e69de29 diff --git a/build/riscv64/build.sh b/build/riscv64/build.sh new file mode 100755 index 0000000..30ece17 --- /dev/null +++ b/build/riscv64/build.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +set -e + +REPO="$(realpath "$(dirname "$(realpath "$0")")/../..")" + +ARCH='riscv64' +TARGET="$ARCH-elf" + +ROOT="$REPO/root" +PATH="$ROOT/bin:$PATH" + +if [ -z "$J" ]; then J='1'; fi + +cd "$REPO/build/$ARCH/binutils" +"$REPO/src/binutils-2.37/configure" --target="$TARGET" --prefix="$ROOT" --with-sysroot --disable-nls --disable-werror +make -j"$J" +make install + +cd "$REPO/build/$ARCH/gcc" +"$REPO/src/gcc-11.2.0/configure" --target="$TARGET" --prefix="$ROOT" --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/build/riscv64/gcc/.keep b/build/riscv64/gcc/.keep new file mode 100644 index 0000000..e69de29 diff --git a/build/x86_64/binutils/.keep b/build/x86_64/binutils/.keep new file mode 100644 index 0000000..e69de29 diff --git a/build/x86_64/build.sh b/build/x86_64/build.sh new file mode 100755 index 0000000..b957442 --- /dev/null +++ b/build/x86_64/build.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +set -e + +REPO="$(realpath "$(dirname "$(realpath "$0")")/../..")" + +ARCH='x86_64' +TARGET="$ARCH-elf" + +ROOT="$REPO/root" +PATH="$ROOT/bin:$PATH" + +if [ -z "$J" ]; then J='1'; fi + +cd "$REPO/build/$ARCH/binutils" +"$REPO/binutils-2.37/configure" --target="$TARGET" --prefix="$ROOT" --with-sysroot --disable-nls --disable-werror +make -j"$J" +make install + +cd "$REPO/build/$ARCH/gcc" +"$REPO/gcc-11.2.0/configure" --target="$TARGET" --prefix="$ROOT" --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/build/x86_64/gcc/.keep b/build/x86_64/gcc/.keep new file mode 100644 index 0000000..e69de29 diff --git a/fetch.sh b/fetch.sh new file mode 100755 index 0000000..37f6fb5 --- /dev/null +++ b/fetch.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +set -e + +REPO="$(realpath "$(dirname "$(realpath "$0")")")" + +cd "$REPO" + +SRC="$REPO/src" + +wget -nc -i 'wget.txt' -P "$SRC" +sha256sum -c 'sha256sums.txt' + +tar -xf "$SRC/binutils-2.37.tar.xz" -C "$SRC" +tar -xf "$SRC/gcc-11.2.0.tar.xz" -C "$SRC" diff --git a/root/.keep b/root/.keep new file mode 100644 index 0000000..e69de29 diff --git a/sha256sums.txt b/sha256sums.txt new file mode 100644 index 0000000..50562af --- /dev/null +++ b/sha256sums.txt @@ -0,0 +1,2 @@ +820d9724f020a3e69cb337893a0b63c2db161dadcb0e06fc11dc29eb1e84a32c src/binutils-2.37.tar.xz +d08edc536b54c372a1010ff6619dd274c0f1603aa49212ba20f7aa2cda36fa8b src/gcc-11.2.0.tar.xz diff --git a/src/.keep b/src/.keep new file mode 100644 index 0000000..e69de29 diff --git a/wget.txt b/wget.txt new file mode 100644 index 0000000..11a9e59 --- /dev/null +++ b/wget.txt @@ -0,0 +1,2 @@ +https://ftp.gnu.org/gnu/binutils/binutils-2.37.tar.xz +https://ftp.gnu.org/gnu/gcc/gcc-11.2.0/gcc-11.2.0.tar.xz