From cfcf8eea6e49762606b00d5ea8ba0498955273f9 Mon Sep 17 00:00:00 2001 From: Tim Dickson Date: Sun, 3 May 2020 00:12:06 +0700 Subject: development/dwz: Added (dwarf compressor). Signed-off-by: Willy Sudiarto Raharjo --- development/dwz/README | 15 +++++++ development/dwz/dwz.SlackBuild | 92 ++++++++++++++++++++++++++++++++++++++++++ development/dwz/dwz.info | 11 +++++ development/dwz/slack-desc | 19 +++++++++ 4 files changed, 137 insertions(+) create mode 100644 development/dwz/README create mode 100644 development/dwz/dwz.SlackBuild create mode 100644 development/dwz/dwz.info create mode 100644 development/dwz/slack-desc (limited to 'development') diff --git a/development/dwz/README b/development/dwz/README new file mode 100644 index 0000000000..7a677ec267 --- /dev/null +++ b/development/dwz/README @@ -0,0 +1,15 @@ +dwz is a dwarf compressor + +DWARF optimization and duplicate removal tool + +dwz is a program that attempts to optimize DWARF debugging +information contained in ELF shared libraries and ELF executables for +size, by replacing DWARF information representation with equivalent +smaller representation where possible and by reducing the amount of +duplication using techniques from DWARF standard appendix E - +creating DW_TAG_partial_unit compilation units (CUs) for duplicated +information and using DW_TAG_imported_unit to import it into each CU +that needs it. + +sourcecode licence is GPL2. see COPYING and COPYING.RUNTIME for more +details. diff --git a/development/dwz/dwz.SlackBuild b/development/dwz/dwz.SlackBuild new file mode 100644 index 0000000000..4f456a2533 --- /dev/null +++ b/development/dwz/dwz.SlackBuild @@ -0,0 +1,92 @@ +#!/bin/sh + +# Slackware build script for the dwz + +# Copyright 2020 Tim Dickson, dickson.tim@googlemail.com +# 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. + +#download from mirrors.kernel.org/sourceware/dwx/releases/ +PRGNAM=dwz +VERSION=${VERSION:-0.13} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM +tar xvf $CWD/$PRGNAM-$VERSION.tar.xz +cd $PRGNAM +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 {} \; + +# Fix man installation path (the original works due to a link in slackware from /usr/share/man +# to /usr/man , but we may as well install it in the right place) +sed -i 's_^mandir.*_mandir = /usr/man_g' Makefile +make +make install DESTDIR=$PKG + +find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + +find $PKG/usr/man -type f -exec gzip -9 {} \; +for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/development/dwz/dwz.info b/development/dwz/dwz.info new file mode 100644 index 0000000000..cc198bb00c --- /dev/null +++ b/development/dwz/dwz.info @@ -0,0 +1,11 @@ +PRGNAM="dwz" +VERSION="0.13" +HOMEPAGE="https://sourceware.org/git/?p=dwz.git;a=summary" +DOWNLOAD="http://mirrors.kernel.org/sourceware/dwz/releases/dwz-0.13.tar.xz" +MD5SUM="6cb10dc92d432a5b86bc3fe36e154698" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="Tim Dickson" +EMAIL="dickson.tim@googlemail.com" + diff --git a/development/dwz/slack-desc b/development/dwz/slack-desc new file mode 100644 index 0000000000..1120b63aeb --- /dev/null +++ b/development/dwz/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 ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +dwz: dwz (a dwarf compressor) +dwz: +dwz: DWARF optimization and duplicate removal tool +dwz: dwz is a program that attempts to optimize DWARF debugging +dwz: information contained in ELF shared libraries and ELF executables for +dwz: size, by replacing DWARF information representation with equivalent +dwz: smaller representation where possible and by reducing the amount of +dwz: duplication using techniques from DWARF standard appendix E - +dwz: creating DW_TAG_partial_unit compilation units (CUs) for duplicated +dwz: information and using DW_TAG_imported_unit to import it into each CU +dwz: that needs it. see https://sourceware.org/git/?p=dwz.git;a=summary -- cgit v1.2.3