From e5c36a3456ef665cccd7b1be11d64ab2ab737d40 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Fri, 21 Feb 2025 04:53:40 +0800 Subject: [PATCH] mips64el: gcc: Fix an issue causing runtime failures with Glibc >= 2.41 The issue causes some units "requiring executable stack," notably libgcc_s.so.1. Glibc does not allow dlopen()ing such an unit now. --- chapter05/gcc-pass1.xml | 8 ++++++++ chapter06/gcc-pass2.xml | 6 ++++++ chapter08/gcc.xml | 5 +++++ 3 files changed, 19 insertions(+) diff --git a/chapter05/gcc-pass1.xml b/chapter05/gcc-pass1.xml index cf305fdb0..affb97a1d 100644 --- a/chapter05/gcc-pass1.xml +++ b/chapter05/gcc-pass1.xml @@ -43,6 +43,14 @@ Installation of Cross GCC + + At first, fix an issue causing runtime failures with Glibc-2.41 or + newer: + + sed '/mips16.S/s|^//||' -i libgcc/config/mips/lib1funcs.S + 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 diff --git a/chapter06/gcc-pass2.xml b/chapter06/gcc-pass2.xml index 6ed318bee..f316c8208 100644 --- a/chapter06/gcc-pass2.xml +++ b/chapter06/gcc-pass2.xml @@ -47,6 +47,12 @@ patch -Np1 -i ../&gcc-upstream-fixes-patch; --> + + Again, fix the issue causing runtime failures with Glibc-2.41 or + newer: + + sed '/mips16.S/s|^//||' -i libgcc/config/mips/lib1funcs.S + 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: diff --git a/chapter08/gcc.xml b/chapter08/gcc.xml index d4476aab0..4d86fdf1d 100644 --- a/chapter08/gcc.xml +++ b/chapter08/gcc.xml @@ -41,6 +41,11 @@ Installation of GCC + Again, fix the issue causing runtime failures with Glibc-2.41 or + newer: + + sed '/mips16.S/s|^//||' -i libgcc/config/mips/lib1funcs.S + For building on 64-bit MIPS, change the default directory name for 64-bit libraries to lib: