From 8b8b87bcb25d09789b223cd348a0aa1c642a2ffc Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Wed, 7 Feb 2024 05:07:58 +0800 Subject: [PATCH] loongarch: Binutils: Apply an upstream fix for LTO This issue is known to cause Mozilla packages fail to build. So fix it just like what we did for Binutils-2.38 on x86_64. --- chapter08/binutils.xml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/chapter08/binutils.xml b/chapter08/binutils.xml index 38762ade4..347cc59f3 100644 --- a/chapter08/binutils.xml +++ b/chapter08/binutils.xml @@ -41,6 +41,17 @@ Installation of Binutils + + First, fix an issue causing some packages fail to build with + Link Time Optimization (LTO). Note that some BLFS packages will be + built with LTO enabled by default even if you don't enable it + explicitly: + +for i in LO12 HI20 ADD; do + sed -e '/DESC64_HI12/a\ case BFD_RELOC_LARCH_TLS_LE_'${i}'_R:' \ + -i gas/config/tc-loongarch.c +done + The Binutils documentation recommends building Binutils in a dedicated build directory: