diff options
Diffstat (limited to 'source/l/gc')
-rwxr-xr-x | source/l/gc/gc.SlackBuild | 130 | ||||
-rw-r--r-- | source/l/gc/gc.test-stack-infinite-loop.diff | 67 | ||||
-rw-r--r-- | source/l/gc/slack-desc | 19 |
3 files changed, 216 insertions, 0 deletions
diff --git a/source/l/gc/gc.SlackBuild b/source/l/gc/gc.SlackBuild new file mode 100755 index 000000000..70c9595af --- /dev/null +++ b/source/l/gc/gc.SlackBuild @@ -0,0 +1,130 @@ +#!/bin/sh + +# Copyright 2013 Patrick J. Volkerding, Sebeka, MN, USA +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +PKGNAM=gc +VERSION=${VERSION:-$(echo $PKGNAM-*.tar.xz | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} +BUILD=${BUILD:-1} + +# Automatically determine the architecture we're building on: +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) export ARCH=i486 ;; + arm*) export ARCH=arm ;; + # Unless $ARCH is already set, use uname -m for all other archs: + *) export ARCH=$( uname -m ) ;; + esac +fi + +NUMJOBS=${NUMJOBS:-" -j7 "} + +CWD=$(pwd) +TMP=${TMP:-/tmp} +PKG=$TMP/package-$PKGNAM +rm -rf $PKG +mkdir -p $PKG/usr + +if [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "s390" ]; then + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +cd $TMP +rm -rf $PKGNAM-$VERSION $PKGNAM-$(echo $VERSION | cut -b 1-3) +tar xvf $CWD/$PKGNAM-$VERSION.tar.xz || exit 1 +cd $PKGNAM-$VERSION 2> /dev/null || cd $PKGNAM-$(echo $VERSION | cut -b 1-3) || exit 1 +chown -R root:root . +find . \ + \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ + -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ + -exec chmod 644 {} \; + +zcat $CWD/gc.test-stack-infinite-loop.diff.gz | patch -p1 --verbose || exit 1 + +CFLAGS="$SLKCFLAGS" \ +./configure \ + --prefix=/usr \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ + --infodir=/usr/info \ + --mandir=/usr/man \ + --disable-static \ + --disable-dependency-tracking \ + --disable-static \ + --enable-cplusplus \ + --enable-large-config \ + --enable-parallel-mark \ + --enable-threads=posix \ + --with-libatomic-ops=no \ + --build=$ARCH-slackware-linux + +# Does not like parallel make... +make $NUMJOBS || make || exit 1 +make install DESTDIR=$PKG || exit 1 + +find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null + +# Compress and link manpages, if any: +if [ -d $PKG/usr/man ]; then + ( cd $PKG/usr/man + for manpagedir in $(find . -type d -name "man*") ; do + ( cd $manpagedir + for eachpage in $( find . -type l -maxdepth 1) ; do + ln -s $( readlink $eachpage ).gz $eachpage.gz + rm $eachpage + done + gzip -9 *.? + ) + done + ) +fi + +# Compress info files, if any: +if [ -d $PKG/usr/info ]; then + ( cd $PKG/usr/info + rm -f dir + gzip -9 * + ) +fi + +mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION +cp -a \ + AUTHORS COPYING* FAQ GUILE-VERSION \ + HACKING INSTALL LICENSE NEWS README* THANKS \ + $PKG/usr/doc/$PKGNAM-$VERSION + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz + diff --git a/source/l/gc/gc.test-stack-infinite-loop.diff b/source/l/gc/gc.test-stack-infinite-loop.diff new file mode 100644 index 000000000..49a6046e8 --- /dev/null +++ b/source/l/gc/gc.test-stack-infinite-loop.diff @@ -0,0 +1,67 @@ +diff --git a/libatomic_ops/tests/test_atomic.c b/libatomic_ops/tests/test_atomic.c +index e354024..b8906e9 100644 +--- a/libatomic_ops/tests/test_atomic.c ++++ b/libatomic_ops/tests/test_atomic.c +@@ -77,7 +77,10 @@ void * acqrel_thr(void *id) + { + AO_t my_counter1; + if (me != 1) +- fprintf(stderr, "acqrel test: too many threads\n"); ++ { ++ fprintf(stderr, "acqrel test: too many threads\n"); ++ abort(); ++ } + my_counter1 = AO_load(&counter1); + AO_store(&counter1, my_counter1 + 1); + AO_store_release_write(&counter2, my_counter1 + 1); +diff --git a/libatomic_ops/tests/test_malloc.c b/libatomic_ops/tests/test_malloc.c +index a1f4179..a19ffd5 100644 +--- a/libatomic_ops/tests/test_malloc.c ++++ b/libatomic_ops/tests/test_malloc.c +@@ -151,6 +151,7 @@ void * run_one_test(void * arg) { + if (0 == p) { + # ifdef HAVE_MMAP + fprintf(stderr, "AO_malloc(%d) failed\n", LARGE_OBJ_SIZE); ++ abort(); + # else + fprintf(stderr, "AO_malloc(%d) failed: This is normal without mmap\n", + LARGE_OBJ_SIZE); +diff --git a/libatomic_ops/tests/test_stack.c b/libatomic_ops/tests/test_stack.c +index bf3180d..e654c35 100644 +--- a/libatomic_ops/tests/test_stack.c ++++ b/libatomic_ops/tests/test_stack.c +@@ -97,14 +97,23 @@ void check_list(int n) + p = (list_element *)AO_REAL_NEXT_PTR(p -> next)) + { + if (p -> data > n || p -> data <= 0) +- fprintf(stderr, "Found erroneous list element %d\n", p -> data); ++ { ++ fprintf(stderr, "Found erroneous list element %d\n", i); ++ abort(); ++ } + if (marks[p -> data] != 0) +- fprintf(stderr, "Found duplicate list element %d\n", p -> data); ++ { ++ fprintf(stderr, "Found duplicate list element %d\n", i); ++ abort(); ++ } + marks[p -> data] = 1; + } + for (i = 1; i <= n; ++i) + if (marks[i] != 1) +- fprintf(stderr, "Missing list element %d\n", i); ++ { ++ fprintf(stderr, "Missing list element %d\n", i); ++ abort(); ++ } + } + + volatile AO_t ops_performed = 0; +@@ -218,6 +227,7 @@ int main(int argc, char **argv) + int code; + if ((code = pthread_join(thread[i], 0)) != 0) { + fprintf(stderr, "Thread join failed %u\n", code); ++ abort(); + } + } + times[nthreads][exper_n] = (unsigned long)(get_msecs() - start_time); diff --git a/source/l/gc/slack-desc b/source/l/gc/slack-desc new file mode 100644 index 000000000..4e747f8fd --- /dev/null +++ b/source/l/gc/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. Line +# up the first '|' above the ':' following the base package name, and the '|' +# on the right side marks the last column you can put a character in. You must +# make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':'. + + |-----handy-ruler------------------------------------------------------| +gc: gc (garbage collector library) +gc: +gc: The Boehm-Demers-Weiser conservative garbage collector can be used as +gc: a garbage collecting replacement for C malloc or C++ new. +gc: +gc: Homepage: http://www.hpl.hp.com/personal/Hans_Boehm/gc/ +gc: +gc: +gc: +gc: +gc: |