loongarch: gcc: Apply an upstream change to prevent the linker from generating illegal instructions

I've proposed a backport of the change to GCC 13.3 but no response yet.
But even if the proposal is rejected I'd still have no choice but
backporting downstream.  So just do it.
This commit is contained in:
Xi Ruoyao 2024-02-07 05:26:00 +08:00
parent 2a71a83b9a
commit 4ac095c78b
No known key found for this signature in database
GPG Key ID: ACAAD20E19E710E3
3 changed files with 26 additions and 0 deletions

View File

@ -43,6 +43,14 @@
<sect2 role="installation">
<title>Installation of Cross GCC</title>
<!-- https://gcc.gnu.org/r14-4674 -->
<para>At first, fix an issue producing illegal instructions in linked
executables and shared libraries with GCC &gcc-version; and
Binutils-2.42:</para>
<screen><userinput remap='pre'>sed -e '/ASM_OUTPUT_ALIGN_WITH_NOP/,+1d' \
-i gcc/config/loongarch/loongarch.h</userinput></screen>
<para>GCC requires the GMP, MPFR and MPC packages. As these packages may
not be included in your host distribution, they will be built with
GCC. Unpack each package into the GCC source directory and rename the

View File

@ -47,6 +47,15 @@
<screen><userinput remap="pre">patch -Np1 -i ../&gcc-upstream-fixes-patch;</userinput></screen>
-->
<!-- https://gcc.gnu.org/r14-4674 -->
<para>Again, fix an issue producing illegal instructions in linked
executables and shared libraries with GCC &gcc-version; and
Binutils-2.42:</para>
<screen><userinput remap='pre'>sed -e '/ASM_OUTPUT_ALIGN_WITH_NOP/,+1d' \
-i gcc/config/loongarch/loongarch.h</userinput></screen>
<para>As in the first build of GCC, the GMP, MPFR, and MPC packages are
required. Unpack the tarballs and move them into the required directories:</para>

View File

@ -54,6 +54,15 @@
<screen><userinput remap="pre">patch -Np1 -i ../&gcc-upstream-fixes-patch;</userinput></screen>
-->
<!-- https://gcc.gnu.org/r14-4674 -->
<para>Again, fix an issue producing illegal instructions in linked
executables and shared libraries with GCC &gcc-version; and
Binutils-2.42:</para>
<screen><userinput remap='pre'>sed -e '/ASM_OUTPUT_ALIGN_WITH_NOP/,+1d' \
-i gcc/config/loongarch/loongarch.h</userinput></screen>
<para>Set the default directory name for
64-bit libraries to <quote>lib</quote>:</para>