From b14e017c740cdaf1d2bae354b2d218d637fd74cf Mon Sep 17 00:00:00 2001 From: Xin Wang Date: Tue, 17 Dec 2024 19:57:22 +0800 Subject: [PATCH] LoongArch: keep compatible with older gcc --- ...h-binutils-compatible-with-older-gcc.patch | 26 +++++++++++++++++++ binutils.spec | 6 ++++- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 LoongArch-binutils-compatible-with-older-gcc.patch diff --git a/LoongArch-binutils-compatible-with-older-gcc.patch b/LoongArch-binutils-compatible-with-older-gcc.patch new file mode 100644 index 0000000..bfca9eb --- /dev/null +++ b/LoongArch-binutils-compatible-with-older-gcc.patch @@ -0,0 +1,26 @@ +diff --git a/gas/config/tc-loongarch.c b/gas/config/tc-loongarch.c +index 7fa7fa0f..16f688d6 100644 +--- a/gas/config/tc-loongarch.c ++++ b/gas/config/tc-loongarch.c +@@ -599,8 +599,21 @@ s_loongarch_option (int x ATTRIBUTE_UNUSED) + demand_empty_rest_of_line (); + } + ++static void ++s_loongarch_align (int arg) ++{ ++ const char *t = input_line_pointer; ++ while (!is_end_of_line[(unsigned char) *t] && *t != ',') ++ ++t; ++ if (*t == ',') ++ s_align_ptwo (arg); ++ else ++ s_align_ptwo (0); ++} ++ + static const pseudo_typeS loongarch_pseudo_table[] = + { ++ { "align", s_loongarch_align, -4 }, + { "dword", cons, 8 }, + { "word", cons, 4 }, + { "half", cons, 2 }, diff --git a/binutils.spec b/binutils.spec index 1e8054c..e51e3b9 100644 --- a/binutils.spec +++ b/binutils.spec @@ -2,7 +2,7 @@ Summary: A GNU collection of binary utilities Name: binutils%{?_with_debug:-debug} Version: 2.41 -Release: 12 +Release: 13 License: GPL-3.0-or-later AND (GPL-3.0-or-later WITH Bison-exception-2.2) AND (LGPL-2.0-or-later WITH GCC-exception-2.0) AND BSD-3-Clause AND GFDL-1.3-or-later AND GPL-2.0-or-later AND LGPL-2.1-or-later AND LGPL-2.0-or-later URL: https://sourceware.org/binutils @@ -299,6 +299,7 @@ Patch3130: Include-ldlex.h-when-compile-eelfxxloongarch.c.patch Patch3131: Modify-test-because-of-readelf-not-update.patch Patch3132: remove-file-produced-by-bison.patch Patch3133: replace-space-with-tab.patch +Patch3134: LoongArch-binutils-compatible-with-older-gcc.patch # Part 5000 - @@ -1370,6 +1371,9 @@ exit 0 #---------------------------------------------------------------------------- %changelog +* Tue Dec 17 2024 wangxin - 2.41-13 +- LoongArch: keep compatible with older gcc + * Fri Nov 22 2024 swcompiler - 2.41-12 - Sw64 add sw64 ISA support -- Gitee