Skip to contentSkip to conversation

apt: Always use libstdc++ when using clang compiler

PATCH New Khem Raj 1 participant 1 message Sep 15, 2025

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH v2 1/1 apt: Always use libstdc++ when using clang compiler

apt is not portable across non libstdc++ systems yet there is work to get it there but its still in progress Default to use libstdc++ with clang

---
v2: Use libstdc++ instead of fixing the code to work with libc++ for now

 meta/recipes-devtools/apt/apt_3.0.3.bb | 4 ++++
 1 file changed, 4 insertions(+)
meta/recipes-devtools/apt/apt_3.0.3.bb +4 -0
index 03a6869393b..75d85dbbce3 100644
@@ -58,6 +58,10 @@ PACKAGECONFIG ??= ""
 # the system doesn't have merged /usr folders.
 PACKAGECONFIG[usrmerge] = "-DREQUIRE_MERGED_USR=ON,-DREQUIRE_MERGED_USR=OFF"
 
+# Needed until https://salsa.debian.org/apt-team/apt/-/merge_requests/511 is fixed
+CXXFLAGS:append:toolchain-clang = " -stdlib=libstdc++"
+LDFLAGS:append:toolchain-clang = " -stdlib=libstdc++"
+
 do_configure:prepend() {
 	echo "set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH )" >>  ${WORKDIR}/toolchain.cmake
 }