From 903aa21b7eb609f6478d49a8c2f3f5a8bee45ec7 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Fri, 19 Jan 2018 15:37:49 -0500 Subject: system/statifier: Updated for version 1.7.4, new maintainer. Signed-off-by: B. Watson --- system/statifier/README | 41 ++++++++++++++++++++++++++++++++--- system/statifier/detect_vdso.diff | 24 ++++++++++++++++++++ system/statifier/slack-desc | 8 +++---- system/statifier/statifier.SlackBuild | 35 +++++++++++++++++++----------- system/statifier/statifier.info | 10 ++++----- 5 files changed, 93 insertions(+), 25 deletions(-) create mode 100644 system/statifier/detect_vdso.diff diff --git a/system/statifier/README b/system/statifier/README index c9c7e17210..d4c8a64be2 100644 --- a/system/statifier/README +++ b/system/statifier/README @@ -1,3 +1,38 @@ -Statifier combines a dynamically linked executable with its libraries into -one large file. The result can be easier to distribute and may make a -32-bits binary work on 64-bits. +statifier (convert dynamic executables to statically linked) + +Statifier combines a dynamically linked executable with its libraries +into one large file. The result can be easier to distribute and may +allow a 32-bit binary to run on a 64-bit-only system. + +Notes: + +1. To get statifier to work properly, VDSO support must be disabled in + the kernel. This must be done on the system statifier is being run on, + before it's run. The converted binaries themselves don't require this, + only statifier itself. If you forget to do this, statifier will appear + to run OK, but the converted binaries will segfault when run. + + For 32-bit systems only, this can be done without a reboot. + Execute this as root: + + echo "0" > /proc/sys/vm/vdso_enabled + + ...and to re-enable VDSO, replace the "0" with "1". + + For 64-bit systems, you must use kernel parameters, meaning a reboot is + required. At the lilo (elilo, grub, etc) prompt, enter: + + linux vdso=0 vdso32=0 + + ...or add 'append="vdso=0 vdso32=0"' to the kernel image section in + /etc/lilo.conf to make it permanent (not recommended). + + If you run statifier with VDSO enabled, it will remind you to disable it. + +2. Executables converted with statifier will show up as dynamic, in + 'file' output, but ldd will say 'not a dynamic executable'. + +3. Converting 32-bit executables on a 64-bit system requires multilib + and probably a 32-bit statifier package. The SlackBuild maintainer + hasn't tested multilib, and would be interested to know what kind of + results you get with it. diff --git a/system/statifier/detect_vdso.diff b/system/statifier/detect_vdso.diff new file mode 100644 index 0000000000..8ff51f75c5 --- /dev/null +++ b/system/statifier/detect_vdso.diff @@ -0,0 +1,24 @@ +diff -Naur statifier-1.7.4/src/statifier statifier-1.7.4.patched/src/statifier +--- statifier-1.7.4/src/statifier 2015-10-23 05:17:13.000000000 -0400 ++++ statifier-1.7.4.patched/src/statifier 2018-01-19 15:04:54.809053542 -0500 +@@ -7,4 +7,20 @@ + # modify it under the terms of the GNU General Public License. + # See LICENSE file in the doc directory. + ++# Modified by B. Watson for the SlackBuilds.org project: detects ++# whether VDSO has been disabled and prints a warning if not. ++if ldd /bin/ls | grep -q 'linux-\(gate\|vdso\)\.'; then ++ echo "VDSO is enabled. Converted binary will likely segfault when run." ++ if [ -e /proc/sys/vm/vdso_enabled ]; then ++ cat < /proc/sys/vm/vdso_enabled ++EOF ++ else ++ cat < -# revision date: 2010/03/13 -# Updated by Willy Sudiarto Raharjo +# Written by Niels Horn , revision date: 2010/03/13 +# Updated by Willy Sudiarto Raharjo +# Updated again and now maintained by B. Watson + +# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. + +# 20180118 bkw: +# - take over maintenance. +# - update for v1.7.4. +# - grammar nitpicks in README and slack-desc. +# - add useful info to README, like how to actually get this to work. +# - add patch to help the user remember to disable VDSO. PRGNAM=statifier -VERSION=${VERSION:-1.7.2} +VERSION=${VERSION:-1.7.4} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} @@ -31,7 +40,6 @@ elif [ "$ARCH" = "i686" ]; then elif [ "$ARCH" = "x86_64" ]; then LIBDIRSUFFIX="64" else - SLKCFLAGS="-O2" LIBDIRSUFFIX="" fi @@ -46,14 +54,17 @@ 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 \ + -exec chmod 755 {} \+ -o \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ - -exec chmod 644 {} \; + -exec chmod 644 {} \+ # We need to patch config.x86_64 because Slackware64 is not multi-lib and we # only have the 32-bits libraries patch -p1 < $CWD/64pure.patch +# If VDSO is enabled, print a warning and directions on how to disable it. +patch -p1 < $CWD/detect_vdso.diff + # "usr/lib/" is hardcoded in the Makefile... sed -i "s,usr/lib/,usr/lib${LIBDIRSUFFIX}/," src/Makefile # And in the startup script... @@ -68,15 +79,13 @@ make install DESTDIR=$PKG find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true -( cd $PKG/usr/man - find . -type f -exec gzip -9 {} \; - for i in $( find . -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done -) +gzip $PKG/usr/man/man1/$PRGNAM.1 mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -a \ - AUTHORS ChangeLog FAQ INSTALL LICENSE NEWS README RELEASE THANKS \ - TODO VERSION doc $PKG/usr/doc/$PRGNAM-$VERSION + AUTHORS ChangeLog FAQ INSTALL LICENSE NEWS \ + README RELEASE THANKS TODO VERSION doc \ + $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild mkdir -p $PKG/install diff --git a/system/statifier/statifier.info b/system/statifier/statifier.info index 7a5ed7c512..c167aefb6e 100644 --- a/system/statifier/statifier.info +++ b/system/statifier/statifier.info @@ -1,10 +1,10 @@ PRGNAM="statifier" -VERSION="1.7.2" +VERSION="1.7.4" HOMEPAGE="http://statifier.sourceforge.net/" -DOWNLOAD="http://downloads.sourceforge.net/statifier/statifier-1.7.2.tar.gz" -MD5SUM="20b80e6aebc7a36d4e0435790990f248" +DOWNLOAD="http://downloads.sourceforge.net/statifier/statifier-1.7.4.tar.gz" +MD5SUM="e6004f1436be1d525e973536d12b44de" DOWNLOAD_x86_64="UNSUPPORTED" MD5SUM_x86_64="" REQUIRES="" -MAINTAINER="Niels Horn" -EMAIL="niels.horn@gmail.com" +MAINTAINER="B. Watson" +EMAIL="yalhcru@gmail.com" -- cgit v1.2.3-65-gdbad