Skip to contentSkip to conversation

gcc-target: Disable multilibs on riscv32/riscv64 targets

PATCH New Khem Raj 1 participant 2 messages Apr 4, 2025

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/2 gcc-target: Disable multilibs on riscv32/riscv64 targets

It builds a default multilib set know-how into compiler even-though we do not have any multilib on target gcc. It alters the c++ standard header paths to multilib specific subdirs e.g.

ignoring nonexistent directory "/usr/lib/gcc/riscv32-yoe-linux/15.0.1/../../../../include/c++/15.0.1/riscv32-yoe-linux/rv32imafdc/ilp32d"

as a result it will not find the c++ headers because gcc-runtime has installed them in ( disabled multilib assumption)

"/usr/lib/gcc/riscv32-yoe-linux/15.0.1/../../../../include/c++/15.0.1/riscv32-yoe-linux/"

Therefore disable multilib during configure to match the runtime installation options.

Without this GCC on target is not able to compile simple C++ programs

e.g.

g++ -Wall -W -O2 -c -o arg_parser.o arg_parser.cc In file included from /usr/include/c++/15.0.1/cstring:47,

                 from arg_parser.cc:20:
/usr/include/c++/15.0.1/bits/version.h:51:10: fatal error: bits/c++config.h: No such file or directory
   51 | #include <bits/c++config.h>
      |          ^~~~~~~~~~~~~~~~~~
---
 meta/recipes-devtools/gcc/gcc-target.inc | 3 +++
 1 file changed, 3 insertions(+)
meta/recipes-devtools/gcc/gcc-target.inc +3 -0
index 6b47c10413a..6acf5a9604b 100644
@@ -1,4 +1,7 @@
 GCCMULTILIB = "--enable-multilib"
+GCCMULTILIB:riscv32 = "--disable-multilib"
+GCCMULTILIB:riscv64 = "--disable-multilib"
+
 require gcc-configure-common.inc
 
 EXTRA_OECONF_PATHS = "\
author
#1 lore raw

PATCH 2/2 oeqa: Update lzip version in buildzip testcase

---
 meta/lib/oeqa/runtime/cases/buildlzip.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/lib/oeqa/runtime/cases/buildlzip.py +1 -1
index 44f4f1be718..921a0bca616 100644
@@ -15,7 +15,7 @@ class BuildLzipTest(OERuntimeTestCase):
     @classmethod
     def setUpClass(cls):
         uri = 'http://downloads.yoctoproject.org/mirror/sources'
-        uri = '%s/lzip-1.19.tar.gz' % uri
+        uri = '%s/lzip-1.25.tar.gz' % uri
         cls.project = TargetBuildProject(cls.tc.target,
                                          uri,
                                          dl_dir = cls.tc.td['DL_DIR'])