Permalink
Cannot retrieve contributors at this time
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?
pkg-scripts/gcc-10.2.0-0.build.sh
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
executable file
73 lines (57 sloc)
1.83 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# Note: Depending on the value in /proc/sys/vm/overcommit_memory (0|2) | |
# results of make check differ, but neither one succeeds. | |
PKG=gcc | |
VERSION=10.2.0 | |
BUILD=0 | |
URL=https://ftp.gnu.org/gnu/gcc/gcc-${VERSION}/gcc-${VERSION}.tar.gz | |
PREFIX=/pkg/$PKG-$VERSION-$BUILD | |
if [ -n "$TESTING" ]; then PREFIX=/dev/shm/$PKG-$VERSION-$BUILD ; fi | |
set -xe | |
umask 022 | |
BUILD_TMPDIR=/dev/shm/$PKG-$VERSION-$BUILD.build.tmp | |
test -d $BUILD_TMPDIR && ( chmod -R u+rwx $BUILD_TMPDIR || true ; 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 | |
if [ -d $PREFIX/.compatlibs ]; then export LD_LIBRARY_PATH=$PREFIX/.compatlibs\${LD_LIBRARY_PATH:+:\$LD_LIBRARY_PATH} ; fi | |
EOF | |
. $PREFIX/profile | |
export MAKEFLAGS="-j $(nproc)" | |
BUILDDIR=$PREFIX/build | |
mkdir -p $BUILDDIR | |
cd $BUILDDIR | |
test -e gcc-${VERSION}.tar.gz || wget --no-verbose $URL | |
test -d gcc-$VERSION || tar xvf gcc-${VERSION}.tar.gz | |
cd gcc-$VERSION | |
mkdir -p objdir | |
cd objdir | |
# Note on languages: go and lto are not part of the mpi default install, | |
# here they are enabled just for testing/fun | |
$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++,go,lto \ | |
--disable-multilib \ | |
--with-system-zlib \ | |
--with-diagnostics-color=auto-if-env | |
make | |
# /dev/shm/gcc-8.4.0-0/build/gcc-8.4.0/objdir/check.log | |
make -k check |& 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 -dumpmachine)/$VERSION/liblto_plugin.so lib/bfd-plugins/ | |
# and dump these ... | |
rm -v lib64/*-gdb.py | |
exit |