From d89ca7e41a528430e28b3010daf3aa4ab77dcdb3 Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Wed, 12 Jan 2022 09:17:11 +0500 Subject: [PATCH] Build vendored cross-compiler --- .gitignore | 14 ++++++++++++- vendor/cross/{ => build/i386/binutils}/.keep | 0 vendor/cross/build/i386/build.sh | 21 ++++++++++++++++++++ vendor/cross/build/i386/gcc/.keep | 0 vendor/cross/build/x86_64/binutils/.keep | 0 vendor/cross/build/x86_64/build.sh | 21 ++++++++++++++++++++ vendor/cross/build/x86_64/gcc/.keep | 0 7 files changed, 55 insertions(+), 1 deletion(-) rename vendor/cross/{ => build/i386/binutils}/.keep (100%) create mode 100755 vendor/cross/build/i386/build.sh create mode 100644 vendor/cross/build/i386/gcc/.keep create mode 100644 vendor/cross/build/x86_64/binutils/.keep create mode 100755 vendor/cross/build/x86_64/build.sh create mode 100644 vendor/cross/build/x86_64/gcc/.keep diff --git a/.gitignore b/.gitignore index 8dae820..611844b 100644 --- a/.gitignore +++ b/.gitignore @@ -63,4 +63,16 @@ !/vendor/wget.txt /vendor/cross/* -!/vendor/cross/.keep +!/vendor/cross/build/ + +/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/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/.keep b/vendor/cross/build/i386/binutils/.keep similarity index 100% rename from vendor/cross/.keep rename to vendor/cross/build/i386/binutils/.keep diff --git a/vendor/cross/build/i386/build.sh b/vendor/cross/build/i386/build.sh new file mode 100755 index 0000000..c023c6c --- /dev/null +++ b/vendor/cross/build/i386/build.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +set -e + +ARCH='i386' +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/i386/gcc/.keep b/vendor/cross/build/i386/gcc/.keep new file mode 100644 index 0000000..e69de29 diff --git a/vendor/cross/build/x86_64/binutils/.keep b/vendor/cross/build/x86_64/binutils/.keep new file mode 100644 index 0000000..e69de29 diff --git a/vendor/cross/build/x86_64/build.sh b/vendor/cross/build/x86_64/build.sh new file mode 100755 index 0000000..2ad96ff --- /dev/null +++ b/vendor/cross/build/x86_64/build.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +set -e + +ARCH='x86_64' +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/x86_64/gcc/.keep b/vendor/cross/build/x86_64/gcc/.keep new file mode 100644 index 0000000..e69de29