[openwrt/openwrt] toolchain: gcc: Backport patch to fix mips16 linking

LEDE Commits lede-commits at lists.infradead.org
Sat May 3 13:06:05 PDT 2025


hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/0744d77779967af196f100c13ecf1937e6eaca8b

commit 0744d77779967af196f100c13ecf1937e6eaca8b
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Sat May 3 00:38:31 2025 +0200

    toolchain: gcc: Backport patch to fix mips16 linking
    
    Backport patch from upstream GCC 14 branch which fixes linking with
    MIPS16 on the pistachio target.
    
    This fixes the following link problem:
    ```
    /builder/shared-workdir/build/staging_dir/toolchain-mipsel_24kc+24kf_gcc-14.2.0_musl/lib/gcc/mipsel-openwrt-linux-musl/14.2.0/../../../../mipsel-openwrt-linux-musl/bin/ld.bfd: ./liblua.so: undefined reference to `__mips16_ledf2'
    /builder/shared-workdir/build/staging_dir/toolchain-mipsel_24kc+24kf_gcc-14.2.0_musl/lib/gcc/mipsel-openwrt-linux-musl/14.2.0/../../../../mipsel-openwrt-linux-musl/bin/ld.bfd: ./liblua.so: undefined reference to `__mips16_call_stub_df_2'
    /builder/shared-workdir/build/staging_dir/toolchain-mipsel_24kc+24kf_gcc-14.2.0_musl/lib/gcc/mipsel-openwrt-linux-musl/14.2.0/../../../../mipsel-openwrt-linux-musl/bin/ld.bfd: ./liblua.so: undefined reference to `__mips16_muldf3'
    ```
    
    Link: https://github.com/openwrt/openwrt/pull/18688
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 ...de-missing-mips16.S-in-libgcc-lib1funcs.S.patch | 34 ++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/toolchain/gcc/patches-14.x/020-MIPS-Include-missing-mips16.S-in-libgcc-lib1funcs.S.patch b/toolchain/gcc/patches-14.x/020-MIPS-Include-missing-mips16.S-in-libgcc-lib1funcs.S.patch
new file mode 100644
index 0000000000..00a4bf8327
--- /dev/null
+++ b/toolchain/gcc/patches-14.x/020-MIPS-Include-missing-mips16.S-in-libgcc-lib1funcs.S.patch
@@ -0,0 +1,34 @@
+From 75892d97979f397a66730b97e8279941169e0316 Mon Sep 17 00:00:00 2001
+From: YunQiang Su <syq at gcc.gnu.org>
+Date: Fri, 23 Aug 2024 23:46:16 +0800
+Subject: MIPS: Include missing mips16.S in libgcc/lib1funcs.S
+
+mips16.S was missing since
+commit 29b74545531f6afbee9fc38c267524326dbfbedf
+Date:   Thu Jun 1 10:14:24 2023 +0800
+
+    MIPS: Add speculation_barrier support
+
+Without mips16.S included, some symbols will miss for mips16, and
+so some software will fail to build.
+
+libgcc/ChangeLog:
+
+	* config/mips/lib1funcs.S: Includes mips16.S.
+
+(cherry picked from commit 9522fc8bb7812f2ad50eb038e0938bfd958e730f)
+---
+ libgcc/config/mips/lib1funcs.S | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/libgcc/config/mips/lib1funcs.S
++++ b/libgcc/config/mips/lib1funcs.S
+@@ -19,7 +19,7 @@ a copy of the GCC Runtime Library Except
+ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+ <http://www.gnu.org/licenses/>.  */
+ 
+-//#include "mips16.S"
++#include "mips16.S"
+ 
+ #ifdef L_speculation_barrier
+ 




More information about the lede-commits mailing list