gcc-pass1: Explain -i.orig

A frequently asked question is "why not using -i.orig instead of -i for
${some_random_sed_command_in_book}" but I really expect people to learn
from this example and do it on their own if they really need...
This commit is contained in:
Xi Ruoyao
2025-08-15 10:59:12 +08:00
parent 5d1c78af5d
commit 6026724d1a

View File

@@ -72,6 +72,23 @@ mv -v mpc-&mpc-version; mpc</userinput></screen>
;;
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>The GCC documentation recommends building GCC
in a dedicated build directory:</para>