<commit_before>#!/bin/sh

set -e

GCC_VERSION=5.1.0
BINUTILS_VERSION=2.25
MPFR_VERSION=3.1.3
GMP_VERSION=6.0.0
MPC_VERSION=1.0.3
ICONV_VERSION=1.14
ISL_VERSION=0.14

TARGET=i686-elf
PREFIX=/opt/${TARGET}

ROOTDIR=${PWD}

CORES=$(nproc)
if [ -z "$CORES" ]
then
    CORES=1
fi

export PATH=${PREFIX}/bin:${PATH}

download()
{
        wget -N https://ftp.gnu.org/gnu/binutils/binutils-${BINUTILS_VERSION}.tar.bz2
        wget -N https://ftp.gnu.org/gnu/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2
        wget -N http://www.mpfr.org/mpfr-current/mpfr-${MPFR_VERSION}.tar.bz2
        wget -N https://gmplib.org/download/gmp/gmp-${GMP_VERSION}a.tar.bz2
        wget -N https://ftp.gnu.org/gnu/mpc/mpc-${MPC_VERSION}.tar.gz
        wget -N https://ftp.gnu.org/gnu/libiconv/libiconv-${ICONV_VERSION}.tar.gz
        wget -N http://isl.gforge.inria.fr/isl-${ISL_VERSION}.tar.bz2
}

extract()
{
    if [ ! -e binutils-${BINUTILS_VERSION} ]
    then
        tar xjf binutils-${BINUTILS_VERSION}.tar.bz2
    fi

    if [ ! -e gcc-${GCC_VERSION} ]
    then
        tar xjf gcc-${GCC_VERSION}.tar.bz2
    fi

    if [ ! -e mpfr-${MPFR_VERSION} ]
    then
        tar xjf mpfr-${MPFR_VERSION}.tar.bz2
    fi

    if [ ! -e gmp-${GMP_VERSION} ]
    then
        tar xjf gmp-${GMP_VERSION}a.tar.bz2
    fi

    if [ ! -e mpc-${MPC_VERSION} ]
    then
        tar xzf mpc-${MPC_VERSION}.tar.gz
    fi

    if [ ! -e libiconv-${ICONV_VERSION} ]
    then
        tar xzf libiconv-${ICONV_VERSION}.tar.gz
    fi

    if [ ! -e isl-${ISL_VERSION} ]
    then
        tar xjf isl-${ISL_VERSION}.tar.bz2
    fi

    ln -fs ${ROOTDIR}/mpfr-${MPFR_VERSION} gcc-${GCC_VERSION}/mpfr
    ln -fs ${ROOTDIR}/gmp-${GMP_VERSION} gcc-${GCC_VERSION}/gmp
    ln -fs ${ROOTDIR}/mpc-${MPC_VERSION} gcc-${GCC_VERSION}/mpc
    ln -fs ${ROOTDIR}/libiconv-${ICONV_VERSION} gcc-${GCC_VERSION}/libiconv
    ln -fs ${ROOTDIR}/isl-${MPC_VERSION} gcc-${GCC_VERSION}/isl
}

configure_binutils()
{
    echo "====================================="
    echo "Configuring binutils..."
    echo "====================================="

    rm -rf ${ROOTDIR}/binutils

    mkdir ${ROOTDIR}/binutils
    cd ${ROOTDIR}/binutils
    ${ROOTDIR}/binutils-${BINUTILS_VERSION}/configure --prefix=${PREFIX} --target=${TARGET} --enable-lto --enable-gold=default --enable-plugins --with-sysroot --disable-nls --disable-werror
}<commit_msg>Update gcc<commit_after>#!/bin/sh

set -e

GCC_VERSION=5.2.0
BINUTILS_VERSION=2.25
MPFR_VERSION=3.1.3
GMP_VERSION=6.0.0
MPC_VERSION=1.0.3
ICONV_VERSION=1.14
ISL_VERSION=0.15
CLOOG_VERSION=0.18.1

TARGET=i686-elf
PREFIX=/opt/${TARGET}

ROOTDIR=${PWD}

CORES=$(nproc)
if [ -z "$CORES" ]
then
    CORES=1
fi

export PATH=${PREFIX}/bin:${PATH}

download()
{
        wget -N https://ftp.gnu.org/gnu/binutils/binutils-${BINUTILS_VERSION}.tar.bz2
        wget -N https://ftp.gnu.org/gnu/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2
        wget -N http://www.mpfr.org/mpfr-current/mpfr-${MPFR_VERSION}.tar.bz2
        wget -N https://gmplib.org/download/gmp/gmp-${GMP_VERSION}a.tar.bz2
        wget -N https://ftp.gnu.org/gnu/mpc/mpc-${MPC_VERSION}.tar.gz
        wget -N https://ftp.gnu.org/gnu/libiconv/libiconv-${ICONV_VERSION}.tar.gz
        wget -N http://isl.gforge.inria.fr/isl-${ISL_VERSION}.tar.bz2
        wget ftp://gcc.gnu.org/pub/gcc/infrastructure/cloog-${CLOOG_VERSION}.tar.gz
}

extract()
{
    if [ ! -e binutils-${BINUTILS_VERSION} ]
    then
        tar xjf binutils-${BINUTILS_VERSION}.tar.bz2
    fi

    if [ ! -e gcc-${GCC_VERSION} ]
    then
        tar xjf gcc-${GCC_VERSION}.tar.bz2
    fi

    if [ ! -e mpfr-${MPFR_VERSION} ]
    then
        tar xjf mpfr-${MPFR_VERSION}.tar.bz2
    fi

    if [ ! -e gmp-${GMP_VERSION} ]
    then
        tar xjf gmp-${GMP_VERSION}a.tar.bz2
    fi

    if [ ! -e mpc-${MPC_VERSION} ]
    then
        tar xzf mpc-${MPC_VERSION}.tar.gz
    fi

    if [ ! -e libiconv-${ICONV_VERSION} ]
    then
        tar xzf libiconv-${ICONV_VERSION}.tar.gz
    fi

    if [ ! -e isl-${ISL_VERSION} ]
    then
        tar xjf isl-${ISL_VERSION}.tar.bz2
    fi

    if [ ! -e cloog-${CLOOG_VERSION} ]
    then
        tar xzf cloog-${CLOOG_VERSION}.tar.gz
    fi

    ln -fs ${ROOTDIR}/mpfr-${MPFR_VERSION} gcc-${GCC_VERSION}/mpfr
    ln -fs ${ROOTDIR}/gmp-${GMP_VERSION} gcc-${GCC_VERSION}/gmp
    ln -fs ${ROOTDIR}/mpc-${MPC_VERSION} gcc-${GCC_VERSION}/mpc
    ln -fs ${ROOTDIR}/libiconv-${ICONV_VERSION} gcc-${GCC_VERSION}/libiconv
    ln -fs ${ROOTDIR}/isl-${MPC_VERSION} gcc-${GCC_VERSION}/isl
    ln -fs ${ROOTDIR}/cloog-${CLOOG_VERSION} gcc-${GCC_VERSION}/cloog
}

configure_binutils()
{
    echo "====================================="
    echo "Configuring binutils..."
    echo "====================================="

    rm -rf ${ROOTDIR}/binutils

    mkdir ${ROOTDIR}/binutils
    cd ${ROOTDIR}/binutils
    ${ROOTDIR}/binutils-${BINUTILS_VERSION}/configure --prefix=${PREFIX} --target=${TARGET} --enable-lto --enable-gold=default --enable-plugins --with-sysroot --disable-nls --disable-werror
}
{'fraction_non_alphanumeric': 0.20063567739372268, 'fraction_numerical': 0.014700039729837107, 'mean_word_length': 2.7857142857142856, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 10, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2938385', 'n_tokens_mistral': 2162, 'n_tokens_neox': 2024, 'n_words': 302}