diff options
author | B. Watson <yalhcru@gmail.com> | 2020-02-17 13:00:46 -0500 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2020-02-24 06:10:06 +0700 |
commit | ecdacbdc144adfe82d2ef681cb9844063e3b35d0 (patch) | |
tree | ec6803f395edd8a1c1ee92525b0e9b82baf05080 /development | |
parent | a6566830b66137a2e6c96e2ea8c6e4fc1dade360 (diff) | |
download | slackbuilds-ecdacbdc144adfe82d2ef681cb9844063e3b35d0.tar.gz |
development/afl: Fix clang support.
Signed-off-by: B. Watson <yalhcru@gmail.com>
Diffstat (limited to 'development')
-rw-r--r-- | development/afl/README | 8 | ||||
-rw-r--r-- | development/afl/afl.SlackBuild | 48 |
2 files changed, 41 insertions, 15 deletions
diff --git a/development/afl/README b/development/afl/README index 96fd8f3bbf..66692da46c 100644 --- a/development/afl/README +++ b/development/afl/README @@ -9,11 +9,11 @@ produced by the tool are also useful for seeding other, more labor- or resource-intensive testing regimes down the road. To use afl with binary-only code (no source available), a custom qemu -wrapper is used. This does NOT require a system-wide installation of -qemu, but it does require the source to qemu. To build qemu support, -download the qemu source from: +wrapper is used (afl-qemu-trace). This does NOT require a system-wide +installation of qemu, but it does require the source to qemu. To build +qemu support, download the qemu source from: -http://download.qemu-project.org/qemu-2.10.0.tar.xz +https://download.qemu-project.org/qemu-2.10.0.tar.xz Save the file in the same directory as the afl.SlackBuild script. diff --git a/development/afl/afl.SlackBuild b/development/afl/afl.SlackBuild index 4ee3be8797..e78269f6a3 100644 --- a/development/afl/afl.SlackBuild +++ b/development/afl/afl.SlackBuild @@ -6,11 +6,15 @@ # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. -# 20180709 bkw: updated for v2.49b. +# 20200217 bkw: BUILD=2. +# - fix afl-clang-fast +# - include README.llvm and optional README.qemu in doc dir +# - update README slightly +# 20180709 bkw: updated for v2.52b. PRGNAM=afl VERSION=${VERSION:-2.52b} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} TAG=${TAG:-_SBo} if [ -z "$ARCH" ]; then @@ -49,16 +53,15 @@ rm -rf $PRGNAM-$VERSION tar xvf $CWD/$PRGNAM-$VERSION.tgz cd $PRGNAM-$VERSION chown -R root:root . -find -L . \ - \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ - -o -perm 511 \) -exec chmod 755 {} \+ -o \ - \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ - -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+ +find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \ + \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+ # apply slack cflags, tell gcc to create stripped binaries -sed -i "/^CFLAGS/s|-O3.*|$SLKCFLAGS -Wl,-s|" Makefile +sed -i "/^CFLAGS/s|-O3.*|$SLKCFLAGS -Wl,-s|" Makefile llvm_mode/Makefile sed -i "/^CFLAGS/s|-O3|$SLKCFLAGS|" qemu_mode/build_qemu_support.sh +PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION + make \ DESTDIR=$PKG \ PREFIX=/usr \ @@ -69,10 +72,31 @@ make \ # llvm fast mode looks useful, include it. # comment this out if you're building on slack 14.1, its llvm is too old. -make -C llvm_mode +make -C llvm_mode \ + PREFIX=/usr \ + HELPER_PATH=/usr/lib$LIBDIRSUFFIX/$PRGNAM + +# no 'make install' support, manual install. install -s -m0755 -oroot -groot afl-clang-fast $PKG/usr/bin ln -s afl-clang-fast $PKG/usr/bin/afl-clang-fast++ +# 20200217 bkw: clang fast mode support libraries. Thanks to mity for +# a very detailed bug report. +CLANGLIB=$PKG/usr/lib$LIBDIRSUFFIX/$PRGNAM +install -s -m0755 -oroot -groot afl-llvm-pass.so $CLANGLIB +# no -s here, stripping this would be bad: +install -m0644 -oroot -groot afl-llvm-rt*.o $CLANGLIB + +# replace identical .o files with symlinks +baseobj=$CLANGLIB/afl-llvm-rt.o +for bits in 32 64; do + bitobj=$CLANGLIB/afl-llvm-rt-$bits.o + if [ -e $bitobj ] && cmp $bitobj $baseobj; then + rm -f $bitobj + ln -s afl-llvm-rt.o $bitobj + fi +done + WITHQEMU="without" # figure out the qemu source tarball name. N.B. update the README @@ -90,6 +114,7 @@ if [ -e "$CWD/$QEMU_SRC" ]; then cd qemu_mode sh build_qemu_support.sh + cp -a README.qemu $PKGDOC cd - install -s -m0755 -oroot -groot afl-qemu-trace $PKG/usr/bin @@ -102,8 +127,9 @@ fi # 'make install' already put the docs where they belong. # the experimental/ stuff is sample source code, include in docs. -cp -a experimental $PKG/usr/doc/$PRGNAM-$VERSION -cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild +# since llvm_mode has no 'make install', we install its doc here. +cp -a llvm_mode/README.llvm experimental $PKGDOC +cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild mkdir -p $PKG/install sed "s,@WITHQEMU@,$WITHQEMU," $CWD/slack-desc > $PKG/install/slack-desc |