libstdc++ is needed in the IAA extension but it is not automatically discoverable in our build system. Recently, I needed to link another C++ library to WiredTiger in a POC and I was hit by this problem as the WiredTiger library needs to link with libstdc++.
I did the following change to fix this:
diff --git a/cmake/toolchains/mongodbtoolchain_v4_gcc.cmake b/cmake/toolchains/mongodbtoolchain_v4_gcc.cmake index 52374b4e2d..7b95b258dd 100644 --- a/cmake/toolchains/mongodbtoolchain_v4_gcc.cmake +++ b/cmake/toolchains/mongodbtoolchain_v4_gcc.cmake @@ -7,3 +7,4 @@ endif() set(CMAKE_C_COMPILER "${TOOLCHAIN_ROOT}/bin/gcc") set(CMAKE_CXX_COMPILER "${TOOLCHAIN_ROOT}/bin/g++") set(CMAKE_ASM_COMPILER "${TOOLCHAIN_ROOT}/bin/gcc") +set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${TOOLCHAIN_ROOT}/lib/gcc/aarch64-mongodb-linux/11.3.0")
We should add this to all our toolchain cmake files.