Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 71 lines (56 sloc) 1.47 KB
#! /bin/bash
# Note: The test suite run address sanitizer tests. In the current mariux64 environment
# this requires
#
# sudo sysctl vm.overcommit_memory=0
PKG=gcc
VERSION=7.3.0
BUILD=0
URL=http://ftp.gnu.org/gnu/gcc/gcc-${VERSION}/gcc-${VERSION}.tar.gz
PREFIX=/pkg/$PKG-$VERSION-$BUILD
#PREFIX=/dev/shm/$PKG-$VERSION-$BUILD
set -xe
umask 022
BUILD_TMPDIR=/dev/shm/$PKG-$VERSION-$BUILD.build.tmp
test -d $BUILD_TMPDIR && rm -rf $BUILD_TMPDIR
mkdir -p $BUILD_TMPDIR/home
export TMPDIR=$BUILD_TMPDIR
export HOME=$BUILD_TMPDIR/home
exec </dev/null
mkdir -p $PREFIX
cat >$PREFIX/profile <<-EOF
PATH=$PREFIX/bin:\$PATH
EOF
. $PREFIX/profile
export MAKEFLAGS="-j $(nproc)"
BUILDDIR=$PREFIX/build
mkdir -p $BUILDDIR
cd $BUILDDIR
test -e gcc-${VERSION}.tar.gz || wget $URL
test -d gcc-$VERSION || tar xvf gcc-${VERSION}.tar.gz
cd gcc-$VERSION
mkdir -p objdir
cd objdir
$BUILDDIR/gcc-$VERSION/configure \
--prefix=$PREFIX \
--enable-shared \
--enable-threads=posix \
--enable-__cxa_atexit \
--enable-clocale=gnu \
--enable-languages=c,fortran,c++,objc,obj-c++ \
--disable-multilib \
--with-system-zlib
make
make -k check 2>&1 | tee check.log
make install
cd $PREFIX
mkdir -vp lib
ln -sfv ${PREFIX}/bin/cpp lib/
ln -sfv gcc bin/cc
install -v -dm755 lib/bfd-plugins
ln -sfv ../../libexec/gcc/$(gcc -dumpmaschine)/$VERSION/liblto_plugin.so lib/bfd-plugins/
mv -v lib64/* lib/
rmdir -v lib64
mkdir -p share/gdb/auto-load/lib
mv -v lib/*-gdb.py share/gdb/auto-load/lib
exit