| Newsgroups |
gmane.linux.lfs.book |
| Message-ID |
<[email protected]> |
This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch multilib
in repository lfs.
commit 9033e119b98c4b57ca72ef4aec74f5d3e0d26ece
Merge: 30e7d2fd3 6026724d1
Author: Thomas Trepl <[email protected]>
AuthorDate: Sat Aug 16 05:29:06 2025 +0200
Merge
chapter05/gcc-pass1.xml | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --cc chapter05/gcc-pass1.xml
index d5051f0bd,3a537e014..03eb4d86a
--- a/chapter05/gcc-pass1.xml
+++ b/chapter05/gcc-pass1.xml
@@@ -72,45 -72,23 +72,61 @@@ mv -v mpc-&mpc-version; mpc</userinput>
;;
esac</userinput></screen>
+ <note>
+ <para>
+ This example demonstrates the use of the
+ <parameter>-i.orig</parameter> switch. It makes the
+ <command>sed</command> copy the <filename>t-linux64</filename>
+ to <filename>t-linux64.orig</filename>, and then edit the
+ <filename>t-linux64</filename> inplace. So you may run
+ <command>diff -u gcc/config/i386/t-linux64{.orig,}</command>
+ to visualize the change done by the <command>sed</command> command
+ afterwards. We'll simply use <parameter>-i</parameter> (which just
+ edits the original file inplace without copying it) for all other
+ packages in the book, but you can change it to
+ <parameter>-i.orig</parameter> in any case you want to keep a copy
+ of the original file.
+ </para>
+ </note>
+
+ <para arch="ml_32,ml_x32,ml_all">Change the default directory name for
+ libraries:</para>
+
+<screen arch="ml_32,ml_x32,ml_all"><userinput remap="pre">sed -e '/m64=/s/lib64/lib/' \
+ -e '/m32=/s/m32=.*/m32=..\/lib32$(call if_multiarch,:i386-linux-gnu)/' \
+ -i.orig gcc/config/i386/t-linux64
+</userinput></screen>
+
+ <para arch="ml_32,ml_all">Make <literal>-mstackrealign</literal>
+ a default for 32bit objects:</para>
+
+<screen arch="ml_32,ml_all"><userinput remap="pre">sed '/STACK_REALIGN_DEFAULT/s/0/(!TARGET_64BIT \&\& TARGET_SSE)/' \
+ -i gcc/config/i386/i386.h</userinput></screen>
+
+ <note arch="ml_32,ml_all">
+ <para>Adding the <literal>-mstackrealign</literal> flag by default
+ helps to overcome issues with old binaries which cannot be
+ recompiled on the actual OS.</para>
+
+ <!-- Thanks to xry111 for explaining the technical background: -->
+
+ <para>Today the x86-32 SysV psABI (used by all Linux programs)
+ mandates a 16-byte alignment of the stack frame, so the routines
+ using SSE will save/load SSE vectors onto/from the stack using a
+ <literal>movaps</literal> instruction (which only works with
+ aligned addresses, but faster than its counterpart allowing
+ unaligned addresses, <literal>movups</literal>).</para>
+
+ <para>But some really old x86-32 Linux binaries (compiled about
+ 15 years ago), and all Windows x86-32 binaries which might be
+ run via <application>Wine</application> or <application>Steam</application>
+ only aligns the
+ stack frame to 4-byte. Thus, when it calls a SSE routine in LFS
+ built without <literal>-mstackrealign</literal>, the
+ <literal>movdqa</literal> instruction fails with a General
+ Protection Error and the Linux kernel terminates the process
+ with a SIGSEGV.</para>
- </note>
+
<para>The GCC documentation recommends building GCC
in a dedicated build directory:</para>
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
--
http://lists.linuxfromscratch.org/sympa/info/lfs-book
Unsubscribe: See the above information page