summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2018-08-04 11:02:26 +0000
committer Eric Hameleers <alien@slackware.com>2018-08-04 11:02:26 +0000
commit9cde7a1de006492a1f680777db4798bcce4b33eb (patch)
tree6b2ebf62b11179b8ce91202f68ed541dd6ac88f1
parent42b45514157a60cbe0f520408d4ab37e85279647 (diff)
downloadmultilib-9cde7a1de006492a1f680777db4798bcce4b33eb.tar.gz
multilib-9cde7a1de006492a1f680777db4798bcce4b33eb.tar.xz
glibc-multilib: improved SlackBuild from Pat
-rwxr-xr-xsource/current/glibc/glibc-multilib.SlackBuild69
1 files changed, 52 insertions, 17 deletions
diff --git a/source/current/glibc/glibc-multilib.SlackBuild b/source/current/glibc/glibc-multilib.SlackBuild
index 0552a06..b8544c2 100755
--- a/source/current/glibc/glibc-multilib.SlackBuild
+++ b/source/current/glibc/glibc-multilib.SlackBuild
@@ -32,7 +32,7 @@ cd $(dirname $0) ; CWD=$(pwd)
PKGNAM=glibc
VERSION=${VERSION:-2.28}
CHECKOUT=${CHECKOUT:-""}
-BUILD=${BUILD:-1alien}
+BUILD=${BUILD:-2alien}
# I was considering disabling NSCD, but MoZes talked me out of it. :)
#DISABLE_NSCD=" --disable-nscd "
@@ -197,9 +197,11 @@ fi
# Create an incoming directory structure for glibc to be built into:
mkdir -p $PKG/lib${LIBDIRSUFFIX}
+mkdir -p $PKG/lib
mkdir -p $PKG/sbin
mkdir -p $PKG/usr/bin
mkdir -p $PKG/usr/lib${LIBDIRSUFFIX}
+mkdir -p $PKG/usr/lib
mkdir -p $PKG/usr/sbin
mkdir -p $PKG/usr/include
mkdir -p $PKG/usr/doc
@@ -293,6 +295,34 @@ cd build-glibc-$VERSION || exit 1
echo "BUILDING DAS NPTL GLIBC"
build_glibc
+# We've always had an sln symlink in /bin, so let's make sure it
+# remains there so as not to break any scripts that might need it:
+mkdir -p $PKG/bin
+( cd $PKG/bin ; ln -sf /sbin/sln sln )
+
+# This bit was mostly copped from Fedora Rawhide's .spec file. I'm not
+# entirely sure how important it is, since I'm not aware of anything
+# we ship trying to link libpthread as static. What it does is make sure
+# that anything linking libpthread static includes all of the functions
+# so that the resulting binary doesn't rely on parts of the library that
+# were not linked in. Optimizing actually working over binary size, so
+# to speak.
+( cd $PKG/usr/lib${LIBDIRSUFFIX}
+ gcc -r -nostdlib -o libpthread.o -Wl,--whole-archive ./libpthread.a
+ rm libpthread.a
+ ar rcs libpthread.a libpthread.o
+ rm libpthread.o
+)
+if [ "x$LIBDIRSUFFIX" = "x64" ]; then
+ # Same exercise for lib:
+ ( cd $PKG/usr/lib
+ gcc -r -nostdlib -o libpthread.o -Wl,--whole-archive ./libpthread.a
+ rm libpthread.a
+ ar rcs libpthread.a libpthread.o
+ rm libpthread.o
+ )
+fi
+
# The prevailing standard seems to be putting unstripped libraries in
# /usr/lib/debug/ and stripping the debugging symbols from all the other
# libraries.
@@ -468,9 +498,6 @@ if [ "x$LIBDIRSUFFIX" = "x64" ]; then
mkdir -p usr/lib
cp -a $PKG/usr/lib/gconv usr/lib
fi
-# Another manpage abandoned by GNU...
-#mkdir -p usr/man/man1
-#cp -a $PKG/usr/man/man1/ldd.1.gz usr/man/man1
mkdir -p usr/libexec
cp -a $PKG/usr/libexec/pt_chown usr/libexec
# Same usr.bin deal:
@@ -481,10 +508,20 @@ mv ldconfig sbin
mkdir install
cat $CWD/slack-desc.glibc-solibs > install/slack-desc
cat $CWD/doinst.sh-glibc-solibs > install/doinst.sh
+# Fix specific versioning for the symlink creation script. This part of the
+# script would only be used in the case where there is no ldconfig on the
+# running system that's used to install the package. That should never be the
+# case, but we'll leave the code in place anyway just in case.
+sed -i "s/@@VERSION@@/$VERSION/g" install/doinst.sh
+# Call the function to fix doinst.sh where $LIBDIRSUFFIX is needed:
fix_doinst
sed -i "s/@@VERSION@@/$VERSION/g" install/doinst.sh
-# Ditch links:
-find . -type l -exec rm {} \;
+# Only scrub the links in /lib{,64} that will be created by ldconfig:
+find lib${LIBDIRSUFFIX} -type l -exec rm {} \;
+if [ "x$LIBDIRSUFFIX" = "x64" ]; then
+ # Same exercise for lib:
+ find lib -type l -exec rm {} \;
+fi
# Build the package:
/sbin/makepkg -l y -c n $TMP/glibc-solibs-${VERSION}_multilib-$SLACKWARE_ARCH-$BUILD.txz
@@ -496,24 +533,22 @@ mkdir -p etc/profile.d
cp -a $CWD/profile.d/* etc/profile.d
chown -R root:root etc
chmod 755 etc/profile.d/*
-# Ditch links (these are in doinst.sh-glibc):
-find . -type l -exec rm {} \;
-# libm.so is *not* a linker script on all $ARCH.
-# If it's missing now, replace the symlink:
-if [ ! -r usr/lib${LIBDIRSUFFIX}/libm.so ]; then
- ( cd usr/lib${LIBDIRSUFFIX} ; ln -sf ../../lib${LIBDIRSUFFIX}/libm.so.6 libm.so )
-fi
+# Only scrub the links in /lib{,64} that will be created by ldconfig:
+find lib${LIBDIRSUFFIX} -type l -exec rm {} \;
if [ "x$LIBDIRSUFFIX" = "x64" ]; then
# Same exercise for lib:
- if [ ! -r usr/lib/libm.so ]; then
- ( cd usr/lib ; ln -sf ../../lib/libm.so.6 libm.so )
- fi
+ find lib -type l -exec rm {} \;
fi
mkdir install
cat $CWD/slack-desc.glibc > install/slack-desc
cat $CWD/doinst.sh-glibc > install/doinst.sh
-fix_doinst
+# Fix specific versioning for the symlink creation script. This part of the
+# script would only be used in the case where there is no ldconfig on the
+# running system that's used to install the package. That should never be the
+# case, but we'll leave the code in place anyway just in case.
sed -i "s/@@VERSION@@/$VERSION/g" install/doinst.sh
+# Call the function to fix doinst.sh where $LIBDIRSUFFIX is needed:
+fix_doinst
( cd lib${LIBDIRSUFFIX}
mkdir incoming
mv *so* incoming