From 91a4f1126998691b82b9e37ba1ed21ff49f1e807 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Mon, 4 Apr 2022 16:45:09 -0400 Subject: [PATCH] system/blake2: Strip binary, use SLKCFLAGS. Signed-off-by: B. Watson --- system/blake2/README | 4 ++++ system/blake2/blake2.SlackBuild | 18 +++++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/system/blake2/README b/system/blake2/README index 92db1e0cd4..389d3c60ba 100644 --- a/system/blake2/README +++ b/system/blake2/README @@ -3,3 +3,7 @@ the SHA-3 finalist BLAKE. BLAKE2 offers the highest security, yet is fast as MD5 on 64-bit platforms and requires less RAM. This script builds the b2sum binary. + +Note: if you get 'illegal instruction' errors from b2sum at runtime, +this is due to upstream's use of -march=native optimization. Rebuild +the package with FORCE_SLACK_CFLAGS=yes to avoid this. diff --git a/system/blake2/blake2.SlackBuild b/system/blake2/blake2.SlackBuild index 21ae9b39ca..a586a1ed2a 100644 --- a/system/blake2/blake2.SlackBuild +++ b/system/blake2/blake2.SlackBuild @@ -22,12 +22,16 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# 20220301 bkw: Modified by SlackBuilds.org, BUILD=2: +# - use SLKCFLAGS. +# - install binary stripped. + cd $(dirname $0) ; CWD=$(pwd) PRGNAM=blake2 VERSION=${VERSION:-20160619} SRCNAM=BLAKE2 -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} @@ -39,9 +43,6 @@ if [ -z "$ARCH" ]; then esac fi -# If the variable PRINT_PACKAGE_NAME is set, then this script will report what -# the name of the created package would be, and then exit. This information -# could be useful to other scripts. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" exit 0 @@ -51,6 +52,7 @@ TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} +# 20220404 bkw: nothing here uses LIBDIRSUFFIX. if [ "$ARCH" = "i586" ]; then SLKCFLAGS="-O2 -march=i586 -mtune=i686" LIBDIRSUFFIX="" @@ -76,15 +78,17 @@ cd $SRCNAM-$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 \ + -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 {} \; + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+ +[ "${FORCE_SLACK_CFLAGS:-no}" = "yes" ] && export CFLAGS="$SLKCFLAGS" cd b2sum make + mkdir -p $PKG/usr/bin -install -m 0755 b2sum $PKG/usr/bin/b2sum +install -s -m 0755 b2sum $PKG/usr/bin/b2sum cd .. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION