]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
gcc: fix build on riscv64
authorArne Fitzenreiter <arne_f@ipfire.org>
Wed, 9 Aug 2023 17:58:04 +0000 (19:58 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 10 Aug 2023 06:35:11 +0000 (06:35 +0000)
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
lfs/gcc
src/patches/gcc/gcc-13.1.0-riscv_use_log2_from_cheader_without_namespace.patch [new file with mode: 0644]

diff --git a/lfs/gcc b/lfs/gcc
index 2468e6c85a42f2d207e13f71b0e5ca830edce2de..0e01fe66023de8426d8f292392443d438580f18d 100644 (file)
--- 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 (file)
index 0000000..3468179
--- /dev/null
@@ -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);