From 7b3bd008069869de95f0ed5c6cd373e38ba842f6 Mon Sep 17 00:00:00 2001 From: Sam James Date: Tue, 26 May 2026 08:42:59 +0100 Subject: [PATCH] toolchain.eclass: bootstrap D with matching C, C++ compilers When building gcc 14 with trunk, I see: opts-common.cc:(.text+0x193): undefined reference to `std::__cxx11::basic_string, std::allocator >::_M_create_plus(unsigned long, unsigned long)' and in libstdc++.so.6.0.36, I have: 00000000002590e0 W std::__cxx11::basic_string, std::allocator >::_M_create_plus(unsigned long, unsigned long)@@GLIBCXX_3.4.36 create_plus is from r17-603-gacfdad706d8acc. Using gdc-14 to bootstrap D but opts-common.o is built by g++ from trunk, which means it uses libstdc++ trunk headers, then gdc-14 tries to use libstdc++.so from 14. We nede to use matching C, C++ compilers too, so do that, for bootstrapping D. Signed-off-by: Sam James --- eclass/toolchain.eclass | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass index c89e7d21ee4c8..1b3c781056a72 100644 --- a/eclass/toolchain.eclass +++ b/eclass/toolchain.eclass @@ -1154,6 +1154,8 @@ toolchain_setup_d() { die "Did not find any appropriate GDC compiler installed" fi + export CC=${bootstrap_gcc_bin_dir}/${CHOST}-gcc + export CXX=${bootstrap_gcc_bin_dir}/${CHOST}-g++ export GDC=${bootstrap_gcc_bin_dir}/${CHOST}-gdc }