public inbox for development@lists.ipfire.org
 help / color / mirror / Atom feed
From: Arne Fitzenreiter <arne_f@ipfire.org>
To: development@lists.ipfire.org
Subject: [PATCH 2/4] gcc: fix build on riscv64
Date: Wed, 09 Aug 2023 19:58:04 +0200	[thread overview]
Message-ID: <20230809175806.2624-2-arne_f@ipfire.org> (raw)
In-Reply-To: <20230809175806.2624-1-arne_f@ipfire.org>

[-- Attachment #1: Type: text/plain, Size: 1953 bytes --]

Signed-off-by: Arne Fitzenreiter <arne_f(a)ipfire.org>
---
 lfs/gcc                                           |  2 ++
 ..._use_log2_from_cheader_without_namespace.patch | 15 +++++++++++++++
 2 files changed, 17 insertions(+)
 create mode 100644 src/patches/gcc/gcc-13.1.0-riscv_use_log2_from_cheader_without_namespace.patch

diff --git a/lfs/gcc b/lfs/gcc
index 2468e6c85..0e01fe660 100644
--- a/lfs/gcc
+++ b/lfs/gcc
@@ -212,6 +212,8 @@ $(subst %,%_BLAKE2,$(objects)) :
 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
 	@$(PREBUILD)
 	@rm -rf $(DIR_APP) $(DIR_SRC)/gcc-build && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
+	cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/gcc/gcc-13.1.0-riscv_use_log2_from_cheader_without_namespace.patch
+
 	@mkdir $(DIR_SRC)/gcc-build
 
 	cd $(DIR_APP) && sed -i 's/install_to_$$(INSTALL_DEST) //' libiberty/Makefile.in
diff --git a/src/patches/gcc/gcc-13.1.0-riscv_use_log2_from_cheader_without_namespace.patch b/src/patches/gcc/gcc-13.1.0-riscv_use_log2_from_cheader_without_namespace.patch
new file mode 100644
index 000000000..346817952
--- /dev/null
+++ b/src/patches/gcc/gcc-13.1.0-riscv_use_log2_from_cheader_without_namespace.patch
@@ -0,0 +1,15 @@
+diff -Naur gcc-13.1.0.org/gcc/config/riscv/genrvv-type-indexer.cc gcc-13.1.0/gcc/config/riscv/genrvv-type-indexer.cc
+--- gcc-13.1.0.org/gcc/config/riscv/genrvv-type-indexer.cc	2023-04-26 09:09:39.000000000 +0200
++++ gcc-13.1.0/gcc/config/riscv/genrvv-type-indexer.cc	2023-08-02 11:28:53.615913583 +0200
+@@ -115,9 +115,9 @@
+   if (sew == eew)
+     elmul_log2 = lmul_log2;
+   else if (sew > eew)
+-    elmul_log2 = lmul_log2 - std::log2 (sew / eew);
++    elmul_log2 = lmul_log2 - log2 (sew / eew);
+   else /* sew < eew */
+-    elmul_log2 = lmul_log2 + std::log2 (eew / sew);
++    elmul_log2 = lmul_log2 + log2 (eew / sew);
+ 
+   if (float_p)
+     return floattype (eew, elmul_log2);
-- 
2.39.2


  reply	other threads:[~2023-08-09 17:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-09 17:58 [PATCH 1/4] qemu_environ: set G_SLICE="always_malloc" for riscv64 Arne Fitzenreiter
2023-08-09 17:58 ` Arne Fitzenreiter [this message]
2023-08-09 17:58 ` [PATCH 3/4] kernel: update config " Arne Fitzenreiter
2023-08-09 17:58 ` [PATCH 4/4] riscv64: rootfile updates for gcc, util-linux and rust Arne Fitzenreiter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230809175806.2624-2-arne_f@ipfire.org \
    --to=arne_f@ipfire.org \
    --cc=development@lists.ipfire.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox