Merge upstream changes

This commit is contained in:
Thomas Trepl (Moody) 2021-07-27 07:53:40 +02:00
commit 85cd74c2cb
4 changed files with 112 additions and 25 deletions

View File

@ -45,6 +45,24 @@
appropriate for the entry or if needed the entire day's listitem. appropriate for the entry or if needed the entire day's listitem.
--> -->
<listitem>
<para>2021-07-26</para>
<itemizedlist>
<listitem>
<para>[thomas] - Fix a programming error in shadow-4.9</para>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<para>2021-07-25</para>
<itemizedlist>
<listitem>
<para>[xry111] - (Hopefully) complete stripping workaround.</para>
</listitem>
</itemizedlist>
</listitem>
<listitem> <listitem>
<para>2021-07-25</para> <para>2021-07-25</para>
<itemizedlist> <itemizedlist>

View File

@ -121,6 +121,21 @@
and rerun that command to confirm nothing is still using the and rerun that command to confirm nothing is still using the
deleted libraries. deleted libraries.
</para></listitem> </para></listitem>
<listitem>
<para>If a binary or a shared library is overwrote, the processes
using the code or data in the binary or library may crash. The
correct way to update a binary or a shared library without causing
the process to crash is: remove it first, then install the new
version into position. The <command>install</command> command
provided by <application>Coreutils</application> has already
implemented this and most packages use it to install binaries and
libraries. So you won't be troubled by this issue most of the time.
However, the install process of some packages (notably Mozilla JS
in BLFS) just overwrites the file if it exists and causes crash, so
it's safer to save your work and close unneeded running processes
before updating a package.</para>
</listitem>
</itemizedlist> </itemizedlist>
</sect2> </sect2>

View File

@ -95,6 +95,10 @@ find man -name Makefile.in -exec sed -i 's/passwd\.5 / /' {} \;</userinput></s
<screen><userinput remap="pre">sed -i 's/1000/999/' etc/useradd</userinput></screen> <screen><userinput remap="pre">sed -i 's/1000/999/' etc/useradd</userinput></screen>
--> -->
<para>Fix a simple programming error by modifying a file with following command:</para>
<screen><userinput remap="pre">sed -e "224s/rounds = SHA_ROUNDS_DEFAULT/min_&amp;/" -i libmisc/salt.c</userinput></screen>
<para>Prepare Shadow for compilation:</para> <para>Prepare Shadow for compilation:</para>
<screen><userinput remap="configure">touch /usr/bin/passwd <screen><userinput remap="configure">touch /usr/bin/passwd

View File

@ -23,18 +23,28 @@
<command>strip</command> commands, it is a good idea to make a <command>strip</command> commands, it is a good idea to make a
backup of the LFS system in its current state.</para> backup of the LFS system in its current state.</para>
<para>First place the debugging symbols for selected libraries <para>The debugging symbols for selected libraries are placed
in separate files. This debugging information is needed if running in separate files. These debugging information is needed if running
regression tests that use <ulink regression tests that use <ulink
url='&blfs-book;/general/valgrind.html'>valgrind</ulink> or <ulink url='&blfs-book;/general/valgrind.html'>valgrind</ulink> or <ulink
url='&blfs-book;/general/gdb.html'>gdb</ulink> later in BLFS. url='&blfs-book;/general/gdb.html'>gdb</ulink> later in BLFS.
</para> </para>
<para>And, <command>strip</command> will overwrite the binary or library
file. This may crash the processes using code or data from the file. If
the process running <command>strip</command> itself is affected, the
binary or library being stripped may be destroyed. This may make the
system completely unusable. To avoid it, we'll copy some libraries and
binaries into <filename class="directory">/tmp</filename>, strip them
there, and install them back with the <command>install</command> command.
Read the related entry in <xref linkend="pkgmgmt-upgrade-issues"/> for the
rationale to use the <command>install</command> command here.</para>
<!-- also of interest are libgfortan, libgo, libgomp, and libobjc from GCC --> <!-- also of interest are libgfortan, libgo, libgomp, and libobjc from GCC -->
<!--<screen><userinput>save_lib="ld-2.25.so libc-2.25.so libpthread-2.25.so libthread_db-1.0.so"--> <!--<screen><userinput>save_lib="ld-2.25.so libc-2.25.so libpthread-2.25.so libthread_db-1.0.so"-->
<screen><userinput>save_usrlib="ld-&glibc-version;.so libc-&glibc-version;.so libpthread-&glibc-version;.so libthread_db-&libthread_db-version;.so <screen><userinput>save_usrlib="ld-&glibc-version;.so libc-&glibc-version;.so libpthread-&glibc-version;.so libthread_db-&libthread_db-version;.so
libquadmath.so.&libquadmath-version; libstdc++.so.&libstdcpp-version; libz.so.&zlib-version; libquadmath.so.&libquadmath-version; libstdc++.so.&libstdcpp-version;
libitm.so.&libitm-version; libatomic.so.&libatomic-version;" <!-- libcilkrts.so.&libcilkrts-version;--> libitm.so.&libitm-version; libatomic.so.&libatomic-version;" <!-- libcilkrts.so.&libcilkrts-version;-->
cd /usr/lib cd /usr/lib
@ -67,32 +77,72 @@ for LIB in $save_usrlib; do
rm /tmp/$LIB rm /tmp/$LIB
done</userinput><userinput> done</userinput><userinput>
unset LIB save_usrlib</userinput></screen> online_usrbin="bash find strip"
online_usrlib="libbfd-&binutils-version;.so libdl-&glibc-version;.so
libhistory.so.&readline-version; libncursesw.so.&ncurses-version;
libm-&glibc-version;.so libreadline.so.&readline-version;
libz.so.&zlib-version;"
<!-- <para>Before performing the stripping, take special care to ensure that for BIN in $online_usrbin; do
none of the binaries that are about to be stripped are running:</para> cp /usr/bin/$BIN /tmp/$BIN
strip --strip-all /tmp/$BIN
install -vm755 /tmp/$BIN /usr/bin
rm /tmp/$BIN
done
<screen role="nodump"><userinput>exec /tools/bin/bash</userinput></screen> for LIB in $online_usrlib; do
cp /usr/lib/$LIB /tmp/$LIB
<para>Now the binaries and libraries can be safely stripped:</para> strip --strip-unneeded /tmp/$LIB
--> install -vm755 /tmp/$LIB /usr/lib
<para>Now the binaries and libraries can be stripped:</para> rm /tmp/$LIB
<screen><userinput>find /usr/lib -type f -name \*.a \ done</userinput><userinput arch="ml_32,ml_all">
-exec strip --strip-debug {} ';'</userinput> for LIB in $online_usrlib; do
<userinput arch="ml_32,ml_all">find /usr/lib32 -type f -name \*.a \ cp /usr/lib32/$LIB /tmp/$LIB
-exec strip --strip-debug {} ';'</userinput> strip --strip-unneeded /tmp/$LIB
<userinput arch="ml_x32,ml_all">find /usr/libx32 -type f -name \*.a \ install -vm755 /tmp/$LIB /usr/lib32
-exec strip --strip-debug {} ';'</userinput><userinput> rm /tmp/$LIB
done</userinput><userinput arch="ml_x32,ml_all">
for LIB in $online_usrlib; do
cp /usr/libx32/$LIB /tmp/$LIB
strip --strip-unneeded /tmp/$LIB
install -vm755 /tmp/$LIB /usr/libx32
rm /tmp/$LIB
done</userinput><userinput>
find /usr/lib -type f -name \*.so* ! -name \*dbg ! -name libz.so* \ find /usr/lib -type f -name \*.a \
-exec strip --strip-unneeded {} ';'</userinput> -exec strip --strip-debug {} ';'
<userinput arch="ml_32,ml_all">find /usr/lib32 -type f -name \*.so* ! -name \*dbg ! -name libz.so* \
-exec strip --strip-unneeded {} ';'</userinput>
<userinput arch="ml_x32,ml_all">find /usr/libx32 -type f -name \*.so* ! -name \*dbg ! -name libz.so* \
-exec strip --strip-unneeded {} ';'</userinput><userinput>
find /usr/{bin,sbin,libexec} -type f \ for i in $(find /usr/lib -type f -name \*.so* ! -name \*dbg); do
-exec strip --strip-all {} ';'</userinput></screen> case "$online_usrlib $save_usrlib" in
*$(basename $i)* ) ;;
* ) strip --strip-unneeded $i ;;
esac
done</userinput><userinput arch="ml_32,ml_all">
for i in $(find /usr/lib32 -type f -name \*.so* ! -name \*dbg); do
case "$online_usrlib $save_usrlib" in
*$(basename $i)* ) ;;
* ) strip --strip-unneeded $i ;;
esac
done</userinput><userinput arch="ml_x32,ml_all">
for i in $(find /usr/libx32 -type f -name \*.so* ! -name \*dbg); do
case "$online_usrlib $save_usrlib" in
*$(basename $i)* ) ;;
* ) strip --strip-unneeded $i ;;
esac
done</userinput><userinput>
for i in $(find /usr/bin -type f); do
case "$online_usrbin" in
*$(basename $i)* ) ;;
* ) strip --strip-all $i ;;
esac
done
find /usr/{sbin,libexec} -type f \
-exec strip --strip-all {} ';'
unset BIN LIB save_usrlib online_usrbin online_usrlib
</userinput></screen>
<para>A large number of files will be reported as having their file <para>A large number of files will be reported as having their file
format not recognized. These warnings can be safely ignored. These format not recognized. These warnings can be safely ignored. These